Building OpenBlas with msys2 - c++

I have a windows 7-64bit computer and I am trying to build OpenBlas library through Msys2.
There seems to be some problem with the gcc as after installing minGW and unziped OpenBlas folder, I open msys2 and I navigate to the folder where OpenBlas is located. I type the command make and I get this error:
make: gcc: Command not found
make: *** [getarch] Error 127

See our PKGBUILD for openblas:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-openblas/PKGBUILD#L33

Related

Building TBB on Windows using MingW & Cmake

Hey I'm trying to build TBB on my Windows computer using MinGW & CMake. (gcc,,g++, ..)
I have already tried using the premade binaries but I keep getting undefined reference issues.
My cmake for the project I'm trying to import it in looks as following:
find_package(TBB REQUIRED tbb)
target_link_libraries(projectName PRIVATE ${TBB_IMPORTED_TARGETS})
I use the source code of https://github.com/oneapi-src/oneTBB/releases/tag/v2021.3.0 (latest)
and I make a build dir and cd into it and execute:
cmake .. -G "MinGW Makefiles"
followed by:
cmake --build .
also tried:
mingw32-make
Both result into
[ 1%] Building CXX object src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.obj
In file included from c:\users\refactor\downloads\onetbb-2021.3.0\onetbb-2021.3.0\include\oneapi\tbb\detail\_utils.h:26,
from C:\Users\Refactor\Downloads\oneTBB-2021.3.0\oneTBB-2021.3.0\src\tbb\address_waiter.cpp:17:
c:\users\refactor\downloads\onetbb-2021.3.0\onetbb-2021.3.0\include\oneapi\tbb\detail\_machine.h:67: error: ignoring '#pragma intrinsic ' [-Werror=unknown-pragmas]
67 | #pragma intrinsic(_mm_mfence)
|
compilation terminated due to -Wfatal-errors.
cc1plus.exe: all warnings being treated as errors
mingw32-make[2]: *** [src\tbb\CMakeFiles\tbb.dir\build.make:76: src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:454: src/tbb/CMakeFiles/tbb.dir/all] Error 2
mingw32-make: *** [makefile:165: all] Error 2```
As mentioned in the comments there are issues building with MinGW with the latest versions of TBB.
The last version of TBB I was able to build was 2020.0 using this command (replace intel64 with ia32 for 32-bit):
mingw32-make compiler=gcc arch=intel64 runtime=mingw tbb tbbmalloc CPLUS="g++ -static-libstdc++ -static-libgcc"

Install g++ from source in Fedora 26

I am trying to install a c++ compiler on a IBM Power7 with Fedora 26.
In /usr/bin it is installed gcc [(GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)] but it has not the c++ compiler (I tried gcc -lstdc++ but the result is: `
/usr/bin/ld: cannot find -lstdc++
I do not have sudo rights so I have to install everything from source.
I was able to install:
Zlib
Perl
Curl
Git
GNU M4
GMP
MPFR
MPC
EXPAT
APR and APR-UTIL
ISL
but when I try to install locally gcc, after a successfull configure, when I try make I got this error:
configure: error: in `/home/aantonietti/gcc/host-powerpc64-unknown-linux-gnu/gcc':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[2]: *** [Makefile:4333: configure-stage1-gcc] Error 1
make[2]: Leaving directory '/home/aantonietti/gcc'
make[1]: *** [Makefile:23745: stage1-bubble] Error 2
make[1]: Leaving directory '/home/aantonietti/gcc'
make: *** [Makefile:945: all] Error 2
I also tried to install clang++ but it needs tons of other dependecies.
Do you have any hint on how to install just the gcc-c++ compiler?
Why don't you run dnf install gcc-c++? It will install the C++ system compiler bring in linking support for libstdc++ as well.

cmake finds path to opencv library but make does not find opencv function Rodrigues

I am building a project from github. This project uses OpenCV. cmake is used for building the project. The output of cmake is as follows:
OpenCV information:
OpenCV_INCLUDE_DIRS: /usr/local/anaconda3/envs/test-caffe/include/opencv;/usr/local/anaconda3/envs/test-caffe/include
OpenCV_LIBRARIES: opencv_xphoto;opencv_xobjdetect;opencv_ximgproc;opencv_xfeatures2d;opencv_tracking;opencv_text;opencv_surface_matching;opencv_structured_light;opencv_stereo;opencv_saliency;opencv_rgbd;opencv_reg;opencv_plot;opencv_optflow;opencv_line_descriptor;opencv_hdf;opencv_fuzzy;opencv_face;opencv_dpm;opencv_dnn;opencv_datasets;opencv_ccalib;opencv_bioinspired;opencv_bgsegm;opencv_aruco;opencv_videostab;opencv_videoio;opencv_video;opencv_superres;opencv_stitching;opencv_shape;opencv_photo;opencv_objdetect;opencv_ml;opencv_imgproc;opencv_imgcodecs;opencv_highgui;opencv_flann;opencv_features2d;opencv_core;opencv_calib3d
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- filesystem
-- system
Boost information:
Boost_INCLUDE_DIRS: /usr/include
Boost_LIBRARIES: /usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_system.so
Boost_LIBRARY_DIRS: /usr/lib/x86_64-linux-gnu
OPENMP FOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /home/iimtech5/3DMM/3dmm_cnn-master/build
As you can see, cmake has found opencv directories. But here's the error thrown by make command:
/home/iimtech5/3DMM/3dmm_cnn-master/modules/PoseExpr/src/BaselFaceEstimator.cpp:207:2: error: ‘Rodrigues’ is not a member of ‘cv’
cv::Rodrigues(rMatP, rVec);
^
make[2]: *** [modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/BaselFaceEstimator.cpp.o] Error 1
make[1]: *** [modules/PoseExpr/CMakeFiles/PoseExprLib.dir/all] Error 2
make: *** [all] Error 2
Can anyone suggest me why could this error be coming? I have tried all the means to know the implication of this error but failed.
Thanks in advance.
Make sure you have installed openCV on your linux:
OpenCV_INCLUDE_DIRS: /usr/local/anaconda3/envs/test-caffe/include/opencv;/usr/local/anaconda3/envs/test-caffe/include
This above path is for opencv in python
Install opencv using : sudo apt-get install libopencv-dev

libcudart.so.7.5: cannot open shared object file:No such file or directory

I was trying to compile darknet(YOLO) with Cuda and Opencv. I compiled them and there is no error but there is warning like this :
/usr/bin/ld: warning: libcudart.so.7.5, needed by /usr/local/lib/libopencv_core.so, not found (try using -rpath or -rpath-link)
When I try with the example from https://pjreddie.com/darknet/yolo/, an error come out.
./darknet: error while loading shared libraries: libcudart.so.7.5: cannot open shared object file: No such file or directory
I don't know how to solve this.
Below is my system
OS = Ubuntu 16.04 LTS
CUDA = 8.0
OPENCV = 2.4
Typing nvcc -V on terminal result with this
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Sun_Sep__4_22:14:01_CDT_2016
Cuda compilation tools, release 8.0, V8.0.44
I installed opencv using this command like shown from http://milq.github.io/install-opencv-ubuntu-debian/
sudo apt-get install libopencv-dev python-opencv
I did use option two from the page but during make process, it return the following error
modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/build.make:2982: recipe for target 'modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o' failed
make[2]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o] Error 1
CMakeFiles/Makefile2:16054: recipe for target 'modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all' failed
make[1]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 59%] Linking CXX shared library ../../lib/libopencv_photo.so
[ 59%] Built target opencv_photo
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
I already put the path for cuda inside .bashrc and reload it but the same error appears.
Below is the path for cuda inside my .bashrc
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
export PATH=${CUDA_HOME}/bin:${PATH}
Thank you for your help.
Your error message indicates that version 7.5 of the CUDA runtime is needed by OpenCV (i.e. it was compiled against that version of CUDA.
Your installed version of CUDA is 8.0. Adding it's library path will not help finding a suitable version for OpenCV.
Build OpenCV against CUDA 8.0, or install CUDA 7.5 and add the library directory to LD_LIBRARY_PATH.
Technically you could also try a mixed build (i.e. just adding the CUDA 7.5 library directory to LD_LIBRARY_PATH, preferably after the CUDA 8.0 path). However carrying two versions of the CUDA runtime will likely lead to problems (I've never tried), and I'd recommend against it.
This is the solution for others who got same problem as me. I use the suggestion from daveselinger here https://github.com/opencv/opencv/issues/6677
git clone the repository and git checkout 3.1.0 with cuda 8 (refer to the link). After that just cmake and make
It worked for me.
$ cd /usr/local/cuda/lib64
$ $ln -s libcudart.so libcudart.so.7.5
There is no difference between libcudart.so.7.5 and libcudart.so.8.0.

Mingw32-Make & cmake 3.0

Well i am trying to compile opencv on my own for eclipsecdt4. I am following a tutorial for codeblocks over here
http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/
I did the cmake thing with eclipse cdt4-mingw32makefile config(tried with just mingw32 makefile too) but the makefile isnt generating. When i do mingw32-make in the build directory it says
F:\ocv\build>mingw32-make
mingw32-make: *** No targets specified and no makefile found. Stop.
Here is a screenshot of the build directory
I had excatly the same problem....I solved it today...I forgot to press Generate in Cmake.....