-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installing linking to clBlas #23
Comments
I had the same issue yesterday. Still unsolved. |
If you look at cmake/Dependenceis.cmake (lines 78-101, https://github.com/amd/OpenCL-caffe/blob/c46909b9543f52b3aea316093a1c72062d6777f9/cmake/Dependencies.cmake) it looks like clBLAS is not supported as a value for property BLAS. I do not understand why, as few lines before there is a piece of code for including clBLAS. Maybe clBLAS and other versions of the library do not really cover the same scope of functions, or ATLAS or LAPACK cannot work with clBLAS. lines 64-101
|
Hi @Aeium @mpekalski , |
@gujunli
as it does. But unless @Aeium gives us his full list of variables provided to cmake or attach CMakeCache.txt we will not know. If you look at **Makefile.config.example* (https://github.com/amd/OpenCL-caffe/blob/c46909b9543f52b3aea316093a1c72062d6777f9/Makefile.config.example) lines 29-31 it clearly says you cannot provide clBLAS as a value for BLAS
Another issue, I do not understand, is why LAPACK does not support clBLAS but does ACML, see FindLAPACK.cmake (https://github.com/amd/OpenCL-caffe/blob/c46909b9543f52b3aea316093a1c72062d6777f9/cmake/Modules/FindLAPACK.cmake) |
Well, I'm past the issue. When I was getting that error I don't think I had Atlas or some BLAS other than clBLAS installed. Ultimately what happened was I rm -rf'd the wrong directory and decided it would be best to just start over on Ubuntu 14.04 instead of 12.04. I just made sure to get Atlas this time. |
Not a fan of Unity I take it :-P |
Ok, well OpenCL-caffe actually built 100%, but then it had a segmentation fault on the runtest. I decided to try again with clBLAS' precompiled binaries, but now i'm having trouble linking to them again. I have been trying to edit the file in cmake under modules to ensure the cmake script gets the correct files, but I'm running into an issue where the cmake script seems blind to most of my environment variables. Turns out the sudo shell has a different set of environment variables, so that nixes my CLBLASROOT variable I was using in the cmake script, because "sudo cmake .." would not have that variable in the new root shell it makes to execute in, or something like that. It seems like the implication of this is that using sudo cmake and cmake are actually more different than I thought, and I need a different strategy other than exporting environment variables if I want to link things to this program if I need to use sudo cmake, which I think I do. Anyway, that's my progress report so far. Maybe I would be a fan of unity if I had more experience with Linux, which clearly would help out here anyway. |
Thanks for the update. It seems like you are having some inconsistent setting in your env variables. Clblas compiling can be with errors as well. Sometimes start all over with a clean environment can help. If still errors, post it here and also clblas github issues. Sent from my iPhone
|
I'm trying to build OpenCL-caffe and I'm running into a problem linking clBLAS:
[ 59%] Linking CXX executable caffe
../lib/libcaffe.so: undefined reference to `cblas_sgemv'
...
I've found some people online having a similar issue with regular Caffe, but this is a bit different because I want to use clBLAS for this version and not some other BLAS correct?
Is there something I need to put in the configuration for it to find the clBLAS?
I exported the folder where I compiled clBLAS as CLBLAS_ROOT. Is there something else I need to do for it to build?
Some outputs that might be useful:
-- Build files have been written to: /home/nathan/OpenCL-caffe/build
nathan@amdRig:
/OpenCL-caffe/build$ make clean/OpenCL-caffe/build$ sudo cmake ..nathan@amdRig:
-- Boost version: 1.46.1
-- Found the following Boost libraries:
-- system
-- thread
-- Found gflags (include: /usr/local/include, library: /usr/local/lib/libgflags.a)
-- Found glog (include: /usr/local/include, library: /usr/local/lib/libglog.so)
-- Found PROTOBUF Compiler: /usr/bin/protoc
-- Found lmdb (include: /usr/local/include, library: /usr/local/lib/liblmdb.so)
-- Found LevelDB (include: /usr/local/include, library: /usr/local/lib/libleveldb.so)
-- Found Snappy (include: /usr/include, library: /usr/lib/libsnappy.so)
-- Found OpenCL (include: /opt/AMDAPP/include, library: /usr/lib/libOpenCL.so)
-- Found clBLAS (include: /usr/local/include, library: /usr/local/lib64/libclBLAS.so)
-- OpenCV found (/usr/share/OpenCV)
-- NumPy ver. 1.7.1 found (include: /usr/local/lib/python2.7/dist-packages/numpy/core/include)
-- Boost version: 1.46.1
-- Found the following Boost libraries:
-- python
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : (Caffe doesn't declare its version in headers)
-- Git : aaa1c2c-dirty
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : ON
-- BUILD_matlab : OFF
-- BUILD_docs : ON
-- CPU_ONLY : OFF
-- Dependencies:
-- BLAS : Yes (clBLAS)
-- Boost : Yes (ver. 1.46)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 2.4.1)
-- lmdb : Yes (ver. 0.9.70)
-- Snappy : Yes (ver. 1.0.4)
-- LevelDB : Yes (ver. 1.9)
-- OpenCV : Yes (ver. 2.3.1)
-- OpenCL : Yes
-- clBLAS : Yes
-- Python:
-- Interpreter : /usr/bin/python2.7 (ver. 2.7.3)
-- Libraries : /usr/lib/libpython2.7.so (ver 2.7.3)
-- NumPy : /usr/local/lib/python2.7/dist-packages/numpy/core/include (ver 1.7.1)
-- Documentaion:
-- Doxygen : /usr/bin/doxygen (1.7.6.1)
-- config_file : /home/nathan/OpenCL-caffe/.Doxyfile
-- Install:
-- Install path : //home/nathan/OpenCL-caffe/build/install
-- Configuring done
CMake Warning at src/caffe/CMakeLists.txt:20 (add_library):
Cannot generate a safe linker search path for target caffe because files in
some directories may conflict with libraries in implicit directories:
Some of these libraries may not be found correctly.
CMake Warning at src/caffe/CMakeLists.txt:20 (add_library):
Cannot generate a safe runtime search path for target caffe because files
in some directories may conflict with libraries in implicit directories:
....
....
[ 53%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/insert_splits.cpp.o
[ 55%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/upgrade_proto.cpp.o
[ 55%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/ocl_wrapper.cpp.o
[ 56%] Building CXX object src/caffe/CMakeFiles/caffe.dir/internal_thread.cpp.o
[ 56%] Linking CXX shared library ../../lib/libcaffe.so
[ 58%] Built target caffe
Scanning dependencies of target caffe.bin
[ 59%] Building CXX object tools/CMakeFiles/caffe.bin.dir/caffe.cpp.o
[ 59%] Linking CXX executable caffe
../lib/libcaffe.so: undefined reference to
cblas_sgemv' ../lib/libcaffe.so: undefined reference to
cblas_dgemm'../lib/libcaffe.so: undefined reference to
cblas_sscal' ../lib/libcaffe.so: undefined reference to
cblas_dgemv'../lib/libcaffe.so: undefined reference to
cblas_saxpy' ../lib/libcaffe.so: undefined reference to
cblas_ddot'../lib/libcaffe.so: undefined reference to
cblas_dasum' ../lib/libcaffe.so: undefined reference to
cblas_sgemm'../lib/libcaffe.so: undefined reference to
cblas_dscal' ../lib/libcaffe.so: undefined reference to
cblas_scopy'../lib/libcaffe.so: undefined reference to
cblas_sasum' ../lib/libcaffe.so: undefined reference to
cblas_daxpy'../lib/libcaffe.so: undefined reference to
cblas_dcopy' ../lib/libcaffe.so: undefined reference to
cblas_sdot'collect2: ld returned 1 exit status
The text was updated successfully, but these errors were encountered: