I am trying to compile Caffe with OpenBLAS in Ubuntu 16.04. I had downloaded and compile OpenBLAS with make NO_AFFINITY=1 USE_OPENMP=1
OpenBLAS compilation is fine and all its tests are also run
OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)
OS ... Linux
Architecture ... x86_64
BINARY ... 64bit
C compiler ... GCC (command line : gcc)
Fortran compiler ... GFORTRAN (command line : gfortran)
Library Name ... libopenblas_sandybridgep-r0.2.20.dev.a (Multi threaded; Max num-threads is 4)
Use OpenMP in the multithreading. Because of ignoring OPENBLAS_NUM_THREADS and GOTO_NUM_THREADS flags,
you should use OMP_NUM_THREADS environment variable to control the number of threads.
However linking with OpenBLAS libs in Caffe install is giving the following error
Linking CXX executable upgrade_net_proto_binary
/opt/OpenBLAS/lib/libopenblas.so: undefined reference to `GOMP_parallel#GOMP_4.0'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/upgrade_net_proto_binary.dir/build.make:129: recipe for target 'tools/upgrade_net_proto_binary' failed
make[2]: * [tools/upgrade_net_proto_binary] Error 1
CMakeFiles/Makefile2:403: recipe for target 'tools/CMakeFiles/upgrade_net_proto_binary.dir/all' failed
make[1]: * [tools/CMakeFiles/upgrade_net_proto_binary.dir/all] Error 2
Most likely the reason is that you're linking to the compiled OpenBLAS instead of installing it and linking to the installation. After you run make, you should run make install PREFIX=/path/to/install/OpenBLAS, and then you should link to the installed version.
Related
I tried to install the Ipopt package on my Mac (macOS Catalina, 10.15.0) following this installation guide:
https://coin-or.github.io/Ipopt/INSTALL.html
I installed ASL as the linear solver and made it to the point 3. makewithout any further issues. However, when I run make test, I receive the following error message:
cd test; /Applications/Xcode.app/Contents/Developer/usr/bin/make test
CXX hs071_main.o
CXX hs071_nlp.o
CXXLD hs071_cpp
CC hs071_c.o
CCLD hs071_c
ln -s ../examples/hs071_f/hs071_f.f hs071_f.f
F77 hs071_f.o
F77LD hs071_f
ld: library not found for -lmkl_core
collect2: error: ld returned 1 exit status
make[1]: *** [hs071_f] Error 1
make: *** [unitTest] Error 2
Does anyone know how to fix this issue? It seems like it can't find the mkl library...
Yes, you have to install the Intel MKL library https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html since it is not part of Mac OS.
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.
So I have an AWS instance (the free tier one) running with Ubuntu 16.04. There I have installed nacl_sdk (which is working and has allowed me to access their sample sites with success) and naclports which I used to port opencv with which I had trouble with at first due to errors with zlib but got it working after I added i386 architecture and did sudo apt-get update on the system and installed necessary i386 programs.
Note I have depot_tools installed as well.
Now I am trying to install the eigen3 library for pnacl as well but I am getting an error and I am not sure how to understand it nor how exactly it gets built to fix it.
The command that I ported opencv with was
$ NACL_ARCH=pnacl make opencv
And I tried these two commands for building eigen3 with the same results (shown below)
$ NACL_ARCH=pnacl make eigen3
$ bin/webports install eigen3
This is the very end of terminal output (the entire message is very long):
######################################################################
Building eigen3
######################################################################
chdir /home/ubuntu/Work/ExternCode/naclports/src/out/build/eigen3/build_pnacl
make -j1 basicstuff cholesky determinant geo_transformations inverse
Scanning dependencies of target basicstuff
Building CXX object test/CMakeFiles/basicstuff.dir/basicstuff.cpp.o
Linking CXX executable basicstuff
Built target basicstuff
Scanning dependencies of target cholesky
[100%] Building CXX object test/CMakeFiles/cholesky.dir/cholesky.cpp.o
clang: error: unable to execute command: Killed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.7.0 (https://chromium.googlesource.com/a/native_client/pnacl-clang.git cf0dc7f6e6123dfa9b8834b56743315300b34e6c) (https://chromium.googlesource.com/a/native_client/pnacl-llvm.git baa63524b6b493ec2a6aa2c5193d9f25c0c33191)
Target: le32-unknown-nacl
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
test/CMakeFiles/cholesky.dir/build.make:62: recipe for target 'test/CMakeFiles/cholesky.dir/cholesky.cpp.o' failed
make[3]: *** [test/CMakeFiles/cholesky.dir/cholesky.cpp.o] Error 254
CMakeFiles/Makefile2:14386: recipe for target 'test/CMakeFiles/cholesky.dir/all' failed
make[2]: *** [test/CMakeFiles/cholesky.dir/all] Error 2
CMakeFiles/Makefile2:14393: recipe for target 'test/CMakeFiles/cholesky.dir/rule' failed
make[1]: *** [test/CMakeFiles/cholesky.dir/rule] Error 2
Makefile:5128: recipe for target 'cholesky' failed
make: *** [cholesky] Error 2
webports: Build failed: 'eigen3' [pnacl/release]
clang: error: unable to execute command: Killed
It looks like your AWS instance killed clang, so perhaps it ran out of memory. The free tier gives 1 MiB of RAM and that might not be enough for what you're trying to do.
Try compile. Get error. What his need?
[ 62%] Linking CXX shared library ....\bin\libopencv_superres310d.dll
Info: resolving vtable for cv::ParallelLoopBody by linking to __imp___ZTVN2cv16P
arallelLoopBodyE (auto-import)
Info: resolving vtable for cv::VideoCapture by linking to __imp___ZTVN2cv12Video
CaptureE (auto-import)
Creating library file: ....\lib\libopencv_superres310d.dll.a
c:/qt/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.e
xe: warning: auto-importing has been activated without --enable-auto-import spec
ified on the command line.
This should work unless it involves constant data structures referencing symbols
from auto-imported DLLs.
Cannot export _ZN2cv3Mat3ptrIN12_GLOBAL__N_18_Point4fEEEPT_i: symbol not found
collect2: ld returned 1 exit status
mingw32-make[2]: * [bin/libopencv_superres310d.dll] Error 1
mingw32-make[1]: * [modules/superres/CMakeFiles/opencv_superres.dir/all] Error
2
mingw32-make: *** [all] Error 2
the first problem is your function with computer when you use opencv3. 1, opencv3. 1 Newest operating systems are supported: Windows 10 and OSX 10.11 (Visual Studio 2015 and XCode 7.1.1), the function can't use old computer try with old version opencv
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