Open inferrna opened 8 years ago
cmake output
clblas$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-3.5 ../src/
-- Build dynamic Hawaii kernels.
-- Check OCL_OFFLINE_BUILD_HAWAII_KERNEL to build kernls at compile-time. This will eliminates clBuildProgram() overhead and better kernel performance with certain driver.
-- Build dynamic Bonaire kernels.
-- Check OCL_OFFLINE_BUILD_BONAIRE_KERNEL to build kernls at compile-time. This will eliminates clBuildProgram() overhead and better kernel performance with certain driver.
-- Build dynamic Tahiti kernels.
-- Check OCL_OFFLINE_BUILD_TAHITI_KERNEL to build kernls at compile-time. This will eliminates clBuildProgram() overhead and better kernel performance with certain driver.
-- You have confirmed OpenCL 1.2 is supported in your system
-- CORR_TEST_WITH_ACML set to ON
-- Target platform: 64-bit
-- Use default OpenCL Compiler
CMake Warning at CMakeLists.txt:218 (message):
Cannot find acml.h
CMake Warning at CMakeLists.txt:250 (message):
Cannot find libacml
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:492 ] _boost_TEST_VERSIONS = 1.44.0;1.44;1.47.0;1.47;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:494 ] Boost_USE_MULTITHREADED = ON
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:496 ] Boost_USE_STATIC_LIBS = ON
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:498 ] Boost_USE_STATIC_RUNTIME =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:500 ] Boost_ADDITIONAL_VERSIONS = 1.44.0;1.44;1.47.0;1.47
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:502 ] Boost_NO_SYSTEM_PATHS =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:554 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:556 ] BOOST_ROOT =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:558 ] BOOST_INCLUDEDIR =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:560 ] BOOST_LIBRARYDIR =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:562 ] _boost_TEST_VERSIONS = 1.44.0;1.44;1.47.0;1.47;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:655 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:679 ] version.hpp reveals boost 1.54.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:755 ] guessed _boost_COMPILER = -gcc49
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:765 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:808 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:810 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:859 ] _boost_LIBRARY_SEARCH_DIRS = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:947 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: boost_program_options-gcc49-mt-1_54;boost_program_options-gcc49-mt;boost_program_options-mt-1_54;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:983 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: boost_program_options-gcc49-mt-d-1_54;boost_program_options-gcc49-mt-d;boost_program_options-mt-d-1_54;boost_program_options-mt-d;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1034 ] Boost_FOUND = 1
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- program_options
-- Boost_PROGRAM_OPTIONS_LIBRARY: /usr/lib/x86_64-linux-gnu/libboost_program_options.a
-- OCL_VERSION = 1.2
-- loading of compiler flags requires OpenCL 2.0. will use default flags.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/inferno/.dev/clBLAS/clblas
Looks like you are missing ACML as reference BLAS.
You can uncheck "BUILD_TEST" from cmake (this will disable test) or supply path to ACML from cmake
Cmake reported about ACML:
CMake Warning at CMakeLists.txt:218 (message):
Cannot find acml.h
CMake Warning at CMakeLists.txt:250 (message):
Cannot find libacml
I believe cmake abilities is enough to uncheck BUILD_TEST in auto mode when libacml not found. Additionally it may even report it, like that:
CMake Warning at CMakeLists.txt:218 (message):
Cannot find acml.h
CMake Warning at CMakeLists.txt:250 (message):
Cannot find libacml - tests disabled.
I don't know if it is the right approach that if acml is missing BUILD_TEST should be disabled. I believe some people might actually want to build the test suite and install acml after the seeing warning message.
I just mean that any build error must be prevented on cmake stage if it can. If test build is checked but it required missing acml, cmake must fail or disable test, let compilation fails is bad idea.
Hi Inferrna, I am thinking of a situation where the user actually want to build the test suite. But for some reason did not set up the CPU BLAS library (ACML or other) correctly. Should we silently disable building the test suite or should we throw a error message at configure (cmake) and build time? Wouldn't it be a surprise to the user that the test is not built after all?
As of my opinion, best solution, if it possible, will be that:
Hi with PR #181 on my Ubuntu system I can find and build test with libblas.so fairly straightforward. Can you verify that it works for you?
Ubuntu 15.10, cmake stage seems ok
-- You have confirmed OpenCL 1.2 is supported in your system
-- CORR_TEST_WITH_ACML set to OFF. Try link with libblas.so
-- The Fortran compiler identification is GNU
-- The C compiler identification is GNU 5.2.1
-- The CXX compiler identification is GNU 5.2.1
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95 -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 -- yes
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Target platform: 64-bit
-- Using default OpenCL Compiler
-- Found NETLIB: /usr/lib/libblas.so
-- Found OPENCL: /usr/lib/libOpenCL.so
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:531 ] _boost_TEST_VERSIONS = 1.44.0;1.44;1.47.0;1.47;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:533 ] Boost_USE_MULTITHREADED = ON
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:535 ] Boost_USE_STATIC_LIBS = ON
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:537 ] Boost_USE_STATIC_RUNTIME =
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:539 ] Boost_ADDITIONAL_VERSIONS = 1.44.0;1.44;1.47.0;1.47
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:541 ] Boost_NO_SYSTEM_PATHS =
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:593 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:595 ] BOOST_ROOT =
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:597 ] BOOST_INCLUDEDIR =
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:599 ] BOOST_LIBRARYDIR =
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:601 ] _boost_TEST_VERSIONS = 1.44.0;1.44;1.47.0;1.47;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:670 ] Include debugging info:
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:672 ] _boost_INCLUDE_SEARCH_DIRS = PATHS;C:/boost/include;C:/boost;/sw/local/include
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:674 ] _boost_PATH_SUFFIXES = boost-1_44_0;boost_1_44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;boost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boost-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_46_1;boost_1_46_1;boost/boost-1_46_1;boost/boost_1_46_1;boost-1_46_0;boost_1_46_0;boost/boost-1_46_0;boost/boost_1_46_0;boost-1_46;boost_1_46;boost/boost-1_46;boost/boost_1_46;boost-1_45_0;boost_1_45_0;boost/boost-1_45_0;boost/boost_1_45_0;boost-1_45;boost_1_45;boost/boost-1_45;boost/boost_1_45;boost-1_44_0;boost_1_44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_43_0;boost_1_43_0;boost/boost-1_43_0;boost/boost_1_43_0;boost-1_43;boost_1_43;boost/boost-1_43;boost/boost_1_43;boost-1_42_0;boost_1_42_0;boost/boost-1_42_0;boost/boost_1_42_0;boost-1_42;boost_1_42;boost/boost-1_42;boost/boost_1_42;boost-1_41_0;boost_1_41_0;boost/boost-1_41_0;boost/boost_1_41_0;boost-1_41;boost_1_41;boost/boost-1_41;boost/boost_1_41;boost-1_40_0;boost_1_40_0;boost/boost-1_40_0;boost/boost_1_40_0;boost-1_40;boost_1_40;boost/boost-1_40;boost/boost_1_40;boost-1_39_0;boost_1_39_0;boost/boost-1_39_0;boost/boost_1_39_0;boost-1_39;boost_1_39;boost/boost-1_39;boost/boost_1_39;boost-1_38_0;boost_1_38_0;boost/boost-1_38_0;boost/boost_1_38_0;boost-1_38;boost_1_38;boost/boost-1_38;boost/boost_1_38;boost-1_37_0;boost_1_37_0;boost/boost-1_37_0;boost/boost_1_37_0;boost-1_37;boost_1_37;boost/boost-1_37;boost/boost_1_37;boost-1_36_1;boost_1_36_1;boost/boost-1_36_1;boost/boost_1_36_1;boost-1_36_0;boost_1_36_0;boost/boost-1_36_0;boost/boost_1_36_0;boost-1_36;boost_1_36;boost/boost-1_36;boost/boost_1_36;boost-1_35_1;boost_1_35_1;boost/boost-1_35_1;boost/boost_1_35_1;boost-1_35_0;boost_1_35_0;boost/boost-1_35_0;boost/boost_1_35_0;boost-1_35;boost_1_35;boost/boost-1_35;boost/boost_1_35;boost-1_34_1;boost_1_34_1;boost/boost-1_34_1;boost/boost_1_34_1;boost-1_34_0;boost_1_34_0;boost/boost-1_34_0;boost/boost_1_34_0;boost-1_34;boost_1_34;boost/boost-1_34;boost/boost_1_34;boost-1_33_1;boost_1_33_1;boost/boost-1_33_1;boost/boost_1_33_1;boost-1_33_0;boost_1_33_0;boost/boost-1_33_0;boost/boost_1_33_0;boost-1_33;boost_1_33;boost/boost-1_33;boost/boost_1_33
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:694 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:718 ] version.hpp reveals boost 1.58.0
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:803 ] guessed _boost_COMPILER = -gcc52
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:813 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:856 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:858 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:907 ] _boost_LIBRARY_SEARCH_DIRS = /usr/include/lib;/usr/include/../lib;/usr/include/../lib/x86_64-linux-gnu;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1018 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: boost_program_options-gcc52-mt-1_58;boost_program_options-gcc52-mt;boost_program_options-mt-1_58;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1054 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: boost_program_options-gcc52-mt-d-1_58;boost_program_options-gcc52-mt-d;boost_program_options-mt-d-1_58;boost_program_options-mt-d;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-3.2/Modules/FindBoost.cmake:1105 ] Boost_FOUND = 1
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- program_options
-- Boost_PROGRAM_OPTIONS_LIBRARY: /usr/lib/x86_64-linux-gnu/libboost_program_options.a
-- AutoGemm-PreCompile: no kernels to be pre-compiled.
-- OPENCL_VERSION = 1.2
-- clBLAS will NOT depend on /home/inferno/.dev/OpenCL/clBLAS/src/clblas/include/AutoGemmKernelBinaries/AutoGemmKernelBinariesPreCompiled.h
CMake Warning (dev) at tests/CMakeLists.txt:388 (get_target_property):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property should not be read from target "test-correctness".
Use the target name directly with add_custom_command, or use the generator
expression $<TARGET_FILE>, as appropriate.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/inferno/.dev/OpenCL/clBLAS/src/clblas
But make still fails
[100%] Building CXX object tests/CMakeFiles/test-correctness.dir/blas-wrapper.cpp.o
CMakeFiles/test-medium.dir/correctness/blas-lapack.c.o: In function `cdotu':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:658: undefined reference to `cdotusub_'
CMakeFiles/test-medium.dir/correctness/blas-lapack.c.o: In function `zdotu':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:673: undefined reference to `zdotusub_'
CMakeFiles/test-medium.dir/correctness/blas-lapack.c.o: In function `cdotc':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:688: undefined reference to `cdotcsub_'
CMakeFiles/test-medium.dir/correctness/blas-lapack.c.o: In function `zdotc':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:703: undefined reference to `zdotcsub_'
collect2: error: ld returned 1 exit status
tests/CMakeFiles/test-medium.dir/build.make:1515: recipe for target 'staging/test-medium' failed
make[2]: *** [staging/test-medium] Error 1
CMakeFiles/Makefile2:474: recipe for target 'tests/CMakeFiles/test-medium.dir/all' failed
make[1]: *** [tests/CMakeFiles/test-medium.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking Fortran executable ../staging/test-short
CMakeFiles/test-short.dir/correctness/blas-lapack.c.o: In function `cdotu':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:658: undefined reference to `cdotusub_'
CMakeFiles/test-short.dir/correctness/blas-lapack.c.o: In function `zdotu':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:673: undefined reference to `zdotusub_'
CMakeFiles/test-short.dir/correctness/blas-lapack.c.o: In function `cdotc':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:688: undefined reference to `cdotcsub_'
CMakeFiles/test-short.dir/correctness/blas-lapack.c.o: In function `zdotc':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:703: undefined reference to `zdotcsub_'
collect2: error: ld returned 1 exit status
tests/CMakeFiles/test-short.dir/build.make:1515: recipe for target 'staging/test-short' failed
make[2]: *** [staging/test-short] Error 1
CMakeFiles/Makefile2:510: recipe for target 'tests/CMakeFiles/test-short.dir/all' failed
make[1]: *** [tests/CMakeFiles/test-short.dir/all] Error 2
Linking Fortran executable ../staging/test-correctness
CMakeFiles/test-correctness.dir/correctness/blas-lapack.c.o: In function `cdotu':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:658: undefined reference to `cdotusub_'
CMakeFiles/test-correctness.dir/correctness/blas-lapack.c.o: In function `zdotu':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:673: undefined reference to `zdotusub_'
CMakeFiles/test-correctness.dir/correctness/blas-lapack.c.o: In function `cdotc':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:688: undefined reference to `cdotcsub_'
CMakeFiles/test-correctness.dir/correctness/blas-lapack.c.o: In function `zdotc':
/home/inferno/.dev/OpenCL/clBLAS/src/tests/correctness/blas-lapack.c:703: undefined reference to `zdotcsub_'
collect2: error: ld returned 1 exit status
tests/CMakeFiles/test-correctness.dir/build.make:1515: recipe for target 'staging/test-correctness' failed
make[2]: *** [staging/test-correctness] Error 1
CMakeFiles/Makefile2:402: recipe for target 'tests/CMakeFiles/test-correctness.dir/all' failed
make[1]: *** [tests/CMakeFiles/test-correctness.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2
Possibly it just because used /usr/lib/libblas.so isn't netlib but openblas:
inferno@inferno-X550LA:~/.dev/OpenCL/clBLAS/src/clblas$ ls -la /usr/lib/libblas.so
lrwxrwxrwx 1 root root 28 Jul 27 17:23 /usr/lib/libblas.so -> /etc/alternatives/libblas.so
inferno@inferno-X550LA:~/.dev/OpenCL/clBLAS/src/clblas$ ls -al /etc/alternatives/libblas.so
lrwxrwxrwx 1 root root 33 Sep 30 14:26 /etc/alternatives/libblas.so -> /usr/lib/openblas-base/libblas.so
Correct path to netlib blas in ubuntu 15.10 (and may be others) is /usr/lib/libblas/libblas.so.3
I tried to locate correct libblas.so path in /usr/lib/pkgconfig/blas-netlib.pc but it also points to /usr/lib/libblas.so. I also reported bug about it https://bugs.launchpad.net/ubuntu/+source/blas/+bug/1515081
On my Ubuntu system it picked up libblas.so under /usr/lib/libblas/ and worked fine. Does it work for you if linking with /usr/lib/libblas/libblas.so?
With /usr/lib/libblas/libblas.so provided directly in cmake it builds fine. The problem will appear when someone like me install openblas. It would be nice to add into cmake first search Netlib_BLAS_LIBRARY:FILEPATH in /usr/lib/libblas/libblas.so and only after use /usr/lib/libblas.so (I use openblas by 2 reasons: according some tests it faster and I can compile it with modern gcc with a lot optimisations)
Thanks. That makes sense. I don't know if there is a way to differentiate openblas from netlib blas since they are both libblas.so. Or is it easier for our testing suite to support cblas interface.
I don't know if there is a way to differentiate openblas from netlib blas
How about using the standard FindBLAS
and FindLAPACK
and specify the vendor you like via BLA_VENDOR
?
Hi. I have the same issue. Can we make the title of this thread a bit more specific though please ;-) eg undefined reference to "cdotusub_"
. Then it will be easy to find :-)
Here are the locations of these libraries in openblas by the way:
$ dpkg -L libopenblas-base | grep so
/usr/lib/libopenblas.so.0
/usr/lib/openblas-base/libblas.so.3
$ dpkg -L libopenblas-dev | grep so
/usr/lib/libopenblas.so
/usr/lib/openblas-base/libblas.so
Hmmm, why not simply link to /etc/alternatives/libblas.so
? Seems like that should always point to what the user wants?
But... I kind of hate the global 'variables' like /etc/alternatives
actually. I think what I'd like is:
BLAS_LIBRARY=NOT-FOUND
(note: edited to retype clblas
as blas
throughout the entire post :-P)
@hughperkins
why not simply link to /etc/alternatives/libblas.so
It unacceptable because it also may point to openblas ( or any other BLAS, see https://wiki.debian.org/DebianScience/LinearAlgebraLibraries ). We need to add some logic into cmake files for searching really netlib-blas. I'd prefer this way:
A simpler solution would be to just run update-alternatives
to point to NetLib's BLAS / LAPACK prior to building the test suite and reverting back to OpenBLAS afterwards.
I think I tracked down this issue, and why it is acting inconsistently across platforms. Here's an example of the build failure I keep getting: https://gist.github.com/anadon/055791063f8e89d439cf
And according to this (https://stackoverflow.com/questions/10112185/shared-library-in-fortran-minimal-example-does-not-work) the issue is related to slightly incorrect build arguments.
I'm looking into how this can be rectified, but someone with more cmake experience should be able to go into this and fix it in a few minutes rather than a few days.
I think that it's the missing '-l' argument to blas in place of the inclusion of the library via a file path inclusion.
So for the "undefined reference to `cdotusub_' issue. Pay attention your netlib blas version.
in lapack-3.6: "cdotusub" is defined in " lapack-3.6.0/CBLAS/src/cdotusub.f" but in lapack-3.5 there is no such file and such definition.
I have 3.6.0 installed. That's not the issue.
I think "/usr/lib64/libblas.so" should be "-lblas" but can't safely change and test the CMakeFile.txt to test that.
If none of them works. Just replace cdotusub with cdotu. One is exactly the other's wrapper. but cdotu should be the standard interface.
I commented out the offending lines and it seems to build fine now. Might the function signatures vary from what it's expecting?