I have a docker container used to build a conan package which requires a CustomUtils.cmake from a another conan package. The conan genrator I use is only the CMakeDeps generator (no CMakeToolchain generator).
The build works fine on a build agent. However, when I try run the docker locally and then execute the same commands (conan install . -pr:h hprofile -pr:b bprofile -if=build, conan build . -bf=build) the build fails because CustomUtils.cmake module is not found. The cmake output of the two builds look sliglty different: is different and a . Specifically cmake defaults to the poky toolchain file
-- Toolchain file defaulted to '/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake'
Also the following cmake output is also missing locally:
-- Conan: Target declared 'CustomUtils::CustomUtils'
-- Conan: Including build module from '/home/agent/work/.conan/data/CustomUtils/0.1/_/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/CustomTestUtils.cmake'
Failing build because CustomUtils.cmake cannot be found
----Running------
> cd '/work/build' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_SYSTEM_NAME="Linux" -DCONAN_CMAKE_FIND_ROOT_PATH="/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="clang" -DCONAN_COMPILER_VERSION="14" -DCONAN_LIBCXX="libc++" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="/work/build/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_PREFIX_PATH="/work/build" -DCMAKE_MODULE_PATH="/work/build" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE="NEVER" -DCMAKE_POSITION_INDEPENDENT_CODE="ON" -Wno-dev '/work'
-----------------
-- Toolchain file defaulted to '/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake'
-- The C compiler identification is Clang 14.0.3
-- The CXX compiler identification is Clang 14.0.3
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Conan version 1.53.0
cmake version 3.22.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
CMake Debug Log at CMakeLists.txt:8 (find_package):
find_package considered the following paths for CustomUtils.cmake
CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH].
/work/build
CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
[CMAKE_FIND_USE_CMAKE_PATH].
Env variable CustomUtils_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].
none
CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].
none
CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].
none
Paths specified by the find_package HINTS option.
none
Standard system environment variables
[CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].
/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr
/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux
/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/x86_64-pokysdk-linux
/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl
/usr/local
/usr
/
CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY].
none
CMake variables defined in the Platform file
[CMAKE_FIND_USE_CMAKE_SYSTEM_PATH].
/work/build/package
/usr/X11R6
/usr/pkg
/opt
CMake System Package Registry
[CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY].
none
Paths specified by the find_package PATHS option.
none
find_package considered the following locations for the Config module:
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/CustomUtilsConfig.cmake
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/customutils-config.cmake
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/CustomUtilsConfig.cmake
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/customutils-config.cmake
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/CustomUtilsConfig.cmake
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/customutils-config.cmake
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/CustomUtilsConfig.cmake
/opt/poky/4.0.5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/customutils-config.cmake
The file was not found.
Working build on build agent:
----Running------
15:10:18 > cd '/home/agent/work/build' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_SYSTEM_NAME="Linux" -DCONAN_CMAKE_FIND_ROOT_PATH="/opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="clang" -DCONAN_COMPILER_VERSION="14" -DCONAN_LIBCXX="libc++" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="/home/agent/work/build/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_PREFIX_PATH="/home/agent/work/build" -DCMAKE_MODULE_PATH="/home/agent/work/build" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE="NEVER" -DCMAKE_POSITION_INDEPENDENT_CODE="ON" -Wno-dev '/home/agent/work'
15:10:18 -----------------
15:10:18 -- The C compiler identification is Clang 14.0.3
15:10:18 -- The CXX compiler identification is Clang 14.0.3
15:10:18 -- Detecting C compiler ABI info
15:10:18 -- Detecting C compiler ABI info - done
15:10:18 -- Check for working C compiler: /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-clang - skipped
15:10:18 -- Detecting C compile features
15:10:18 -- Detecting C compile features - done
15:10:18 -- Detecting CXX compiler ABI info
15:10:18 -- Detecting CXX compiler ABI info - done
15:10:18 -- Check for working CXX compiler: /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-clang++ - skipped
15:10:18 -- Detecting CXX compile features
15:10:18 -- Detecting CXX compile features - done
15:10:18 Conan version 1.53.0
15:10:18 cmake version 3.22.3
15:10:18
15:10:18 CMake suite maintained and supported by Kitware (kitware.com/cmake).
15:10:18 -- Conan: Target declared 'CustomUtils::CustomUtils'
15:10:18 -- Conan: Including build module from '/home/agent/work/.conan/data/CustomUtils/0.1/_/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/CustomTestUtils.cmake'
15:10:18 CMake Debug Log at CMakeLists.txt:8 (find_package):
15:10:18 find_package considered the following paths for CustomUtils.cmake
15:10:18
15:10:18 /home/agent/work/build/FindCustomUtils.cmake
15:10:18 /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.22/Modules/FindCustomUtils.cmake
15:10:18
15:10:18 The file was not found.
15:10:18
15:10:18 <PackageName>_ROOT CMake variable [CMAKE_FIND_USE_PACKAGE_ROOT_PATH].
15:10:18
15:10:18 none
15:10:18
15:10:18 CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH].
15:10:18
15:10:18 /home/agent/work/build
15:10:18
15:10:18
15:10:18
15:10:18 CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
15:10:18 [CMAKE_FIND_USE_CMAKE_PATH].
15:10:18
15:10:18
15:10:18
15:10:18 Env variable CustomUtils_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].
15:10:18
15:10:18 none
15:10:18
15:10:18 CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].
15:10:18
15:10:18 none
15:10:18
15:10:18 CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
15:10:18 [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].
15:10:18
15:10:18 none
15:10:18
15:10:18 Paths specified by the find_package HINTS option.
15:10:18
15:10:18 none
15:10:18
15:10:18 Standard system environment variables
15:10:18 [CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].
15:10:18
15:10:18 /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr
15:10:18 /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux
15:10:18 /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/x86_64-pokysdk-linux
15:10:18 /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
15:10:18 /opt/poky/4.0.5/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl
15:10:18 /usr/local
15:10:18 /usr
15:10:18 /
15:10:18
15:10:18
15:10:18
15:10:18 CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY].
15:10:18
15:10:18 none
15:10:18
15:10:18 CMake variables defined in the Platform file
15:10:18 [CMAKE_FIND_USE_CMAKE_SYSTEM_PATH].
15:10:18
15:10:18 /home/agent/work/build/package
15:10:18 /usr/X11R6
15:10:18 /usr/pkg
15:10:18 /opt
15:10:18
15:10:18
15:10:18
15:10:18 CMake System Package Registry
15:10:18 [CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY].
15:10:18
15:10:18 none
15:10:18
15:10:18 Paths specified by the find_package PATHS option.
15:10:18
15:10:18 none
15:10:18
15:10:18 find_package considered the following locations for the Config module:
15:10:18
15:10:18 /home/agent/work/build/CustomUtilsConfig.cmake
15:10:18
15:10:18 The file was found at
15:10:18
15:10:18 /home/agent/work/build/CustomUtilsConfig.cmake
Any idea why the build succeeds on the agent but not locally even with the same docker image is used (both freshly pulled and up to date)?
Why is CMake defaulting to a toolchain file that doesn't seem to be specified anywhere. Are there any environment variables to configure this behaviour?
Related
I've "brew install xmake" on my mac, and having a .cpp file, I run xmake and it generates a xmake.lua in the directory. Then it reports:
error: cannot get program for cxx
I've installed clang (alias as g++). It works fine. I then:
$sudo ln -s /usr/bin/g++ /usr/local/bin/cxx
Well, running xmake again, but it still reports same error:
error: cannot get program for cxx
How to handle this? Thanks
----------------------I tried these, don't work:
$xmake f -p cross
$xmake
error: cannot get program for cxx
$export CC=clang LD=clang++ xmake
$xmake
error: cannot get program for cxx
----------------------See my diagnotics:
$xmake f -p cross -c
(In fact no output)
$xmake -r -v
configure
{
plat = cross
, arch = none
, ccache = true
, kind = static
, buildir = build
, host = macosx
, mode = release
, clean = true
}
checking for the g++ ... no
checking for the linker (ld: g++) ... no
checking for the gcc ... no
checking for the linker (ld: gcc) ... no
checking for the clang++ ... no
checking for the linker (ld: clang++) ... no
checking for the clang ... no
checking for the linker (ld: clang) ... no
error: cannot get program for ld
$which g++
/usr/bin/g++
$which clang
/usr/bin/clang
xmake will detect and use xcrun -sdk macosx clang on macOS. Do you have Xcode command line tools installed?
If not, you can switch to cross platform to compile it. for example
xmake f -p cross
xmake
It will use gcc/clang directly.
Or set --cc=clang or CC, LD envirnoment vars to modify compiler and linker.
xmake f -c --cc=clang --ld=clang++
xmake
Or
export CC=clang LD=clang++
xmake
It works now, please update to latest version.
I'm trying to install Caffe on my Ubuntu 16.04 with GPU support (CUDA 8.0, CuDNN, OpenCV 3.1).
When I run sudo make test when building Caffe, I get the following error:
.....................................
CXX src/caffe/test/test_net.cpp
NVCC src/caffe/test/test_im2col_kernel.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use
-Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use
-Wno-deprecated-gpu-targets to suppress warning).
CXX src/gtest/gtest-all.cpp
CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
.build_release/src/caffe/test/test_gradient_based_solver.o: In function `caffe::MakeTempDir(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
test_gradient_based_solver.cpp:(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x56): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_gradient_based_solver.cpp:(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8a): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_gradient_based_solver.cpp:
(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x124): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_gradient_based_solver.cpp:(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x15a): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
.build_release/src/caffe/test/test_hdf5_output_layer.o: In function `caffe::MakeTempFilename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)': test_hdf5_output_layer.cpp:
(.text._ZN5caffe16MakeTempFilenameEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe16MakeTempFilenameEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1d4): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' .build_release/src/caffe/test/test_db.o: In function `caffe::DBTest<caffe::TypeLevelDB>::SetUp()': test_db.cpp:
(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0x7f): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_db.cpp:(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0xaf): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
test_db.cpp:
(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0x163): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_db.cpp:
(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0x19d): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
.build_release/src/caffe/test/test_db.o: In function `caffe::DBTest<caffe::TypeLMDB>::SetUp()': test_db.cpp:(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0x7f): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_db.cpp:(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0xaf): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
test_db.cpp:
(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0x163): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_db.cpp:
(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0x19d): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)' .build_release/src/caffe/test/test_upgrade_proto.o: In function `caffe::NetUpgradeTest_TestUpgradeV1LayerType_Test::TestBody()': test_upgrade_proto.cpp:(.text+0x2a21): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_upgrade_proto.cpp:(.text+0x2a5b): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_upgrade_proto.cpp:(.text+0x2b04): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_upgrade_proto.cpp:(.text+0x2b43): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
.build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::CPUDevice<float>
>::TestBody()':
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x4d9): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x513): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x5c4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x603): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
.build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::CPUDevice<double>
>::TestBody()':
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x4c1): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x4fb): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x5a4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x5e3): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)' .build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::GPUDevice<float>
>::TestBody()':
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x4d9): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)' test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x513): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x5c4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x603): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)' .build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::GPUDevice<double>
>::TestBody()': test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x4c1): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x4fb): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x5a4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_layer_factory.cpp:
(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x5e3): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
Makefile:599: recipe for target '.build_release/test/test_all.testbin' failed
make: *** [.build_release/test/test_all.testbin] Error 1
After googling for quite a while, I've found out that it's probably the issue with OpenCV, however, I don't know how to resolve it.
I've built OpenCV 3.1 from source following this tutorial..
I use Anaconda2 with Python 2.7 and I've created the virtual environment using conda (which I called deep-learning), so when I run python command in my terminal and check the OpenCV version, I get the following output:
(deep-learning) ➜ caffe git:(master) ✗ python
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import cv2
>>> print cv2.__version__
3.1.0
Also, I can run the opencv_version file to verify the version:
(deep-learning) ➜ caffe git:(master) ✗ /usr/local/bin/opencv_version
3.1.0-dev
Here's my process of building Caffe (assuming I'm in Caffe root folder):
sudo make clean
mkdir build
cd build
sudo cmake ..
cd ..
sudo make all
sudo make test
All the commands run successfully except sudo make test, which gives the error stated above.
Here's the output of running sudo cmake ..:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- 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
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version 106200
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:5 (find_package)
CMakeLists.txt:43 (include)
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version 106200
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:5 (find_package)
CMakeLists.txt:43 (include)
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version 106200
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:5 (find_package)
CMakeLists.txt:43 (include)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.62.0
-- Found the following Boost libraries:
-- system
-- thread
-- filesystem
-- Found GFlags: /usr/local/include
-- Found gflags (include: /usr/local/include, library: /usr/local/lib/libgflags.a)
-- Found Glog: /usr/local/include
-- Found glog (include: /usr/local/include, library: /usr/local/lib/libglog.so)
-- Found Protobuf: /usr/local/lib/libprotobuf.so
-- Found PROTOBUF Compiler: /usr/local/bin/protoc
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.16")
-- Found LMDB: /usr/local/include
-- Found lmdb (include: /usr/local/include, library: /usr/local/lib/liblmdb.so)
-- Found LevelDB: /usr/include
-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)
-- Found Snappy: /usr/include
-- Found Snappy (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so)
-- CUDA detected: 8.0
-- Found cuDNN: ver. 5.1.5 found (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Added CUDA NVCC flags for: sm_30
-- OpenCV found (/usr/local/share/OpenCV)
-- Found Atlas: /usr/include
-- Found Atlas (include: /usr/include, library: /usr/lib/libatlas.so)
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.12", minimum required is "2.7")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.7")
-- Found NumPy: /usr/local/lib/python2.7/dist-packages/numpy/core/include (found suitable version "1.11.2", minimum required is "1.7.1")
-- NumPy ver. 1.11.2 found (include: /usr/local/lib/python2.7/dist-packages/numpy/core/include)
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version 106200
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:147 (find_package)
CMakeLists.txt:43 (include)
-- Boost version: 1.62.0
-- Found the following Boost libraries:
-- python
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Found Git: /usr/bin/git (found version "2.7.4")
--
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : 1.0.0-rc3
-- Git : rc3-303-g5a201dd-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
-- USE_OPENCV : ON
-- USE_LEVELDB : ON
-- USE_LMDB : ON
-- ALLOW_LMDB_NOLOCK : OFF
--
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.62)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 3.1.0)
-- lmdb : Yes (ver. 0.9.70)
-- LevelDB : Yes (ver. 1.18)
-- Snappy : Yes (ver. 1.1.3)
-- OpenCV : Yes (ver. 3.1.0)
-- CUDA : Yes (ver. 8.0)
--
-- NVIDIA CUDA:
-- Target GPU(s) : Auto
-- GPU arch(s) : sm_30
-- cuDNN : Yes (ver. 5.1.5)
--
-- Python:
-- Interpreter : /usr/bin/python2.7 (ver. 2.7.12)
-- Libraries : /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.12)
-- NumPy : /usr/local/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.2)
--
-- Documentaion:
-- Doxygen : No
-- config_file :
--
-- Install:
-- Install path : /home/denis/code/caffe/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/denis/code/caffe/build
In the section Integration with Caffe in this OpenCV 3.1 Installation Guide for Ubuntu 16.04, it is said that I have to include /usr/local/share/OpenCV/3rdparty/lib/ in my LIBRARY_DIRS variable in Makefile.config. However, I don't have 3rdparty/lib/ in my /usr/local/share/OpenCV folder.
(deep-learning) ➜ caffe git:(master) ✗ ls /usr/local/share/OpenCV
haarcascades lbpcascades OpenCVConfig.cmake OpenCVConfig-version.cmake OpenCVModules.cmake OpenCVModules-release.cmake
I've done all the changes to Makefile and Makefile.config that are stated in most Caffe installation guides.
In my Makefile.config I have this (here's the full file):
USE_CUDNN := 1
OPENCV_VERSION := 3
CUDA_DIR := /usr/local/cuda-8.0
WITH_PYTHON_LAYER := 1
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /usr/local/share/OpenCV/3rdparty/lib/
USE_PKG_CONFIG := 1
And here's some of the content from Makefile (full file):
LIBRARIES += glog gflags protobuf leveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs opencv_videoio
NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)
I'm not even sure what it can be and why the error is happening. One theory is that it is the conflict of OpenCV versions or something (I might have installed OpenCV 2 earlier, but I don't think I have it now, and cv.__version__ in python gives me 3.1.0). Other people say it is some linking problem, though I don't understand how to resolve such issues.
Could you please help me to resolve my issue and install Caffe normally?
PS: I've already spent so much time trying to install Caffe with OpenCV 3.1 that I think I'll be happy even with OpenCV 2 (if only it works), but I'm not sure I can completely remove OpenCV 3.1 from my system, 'cause there're lots of different files connected with OpenCV 3.1 in a bunch of different folders.
So, below are the steps I've taken to resolve my issue:
Remove all the files connected with OpenCV
Remove all the files connected with Boost
Remove all the files connected with Caffe
Install Boost using sudo apt-get install libboost-all-dev
Install OpenCV 3.1
Turn off the virtual environment
Exclude Anaconda2 from path and use the standard python distribution
Follow the official guide and continue to use the standard python
distribution
Basically, I just gave up on using Anaconda and it started to work fine.
I have a Linux jni project (Jgles2 on github) which I'm trying to compile on windows.
With msys2 I have used pacman to install the following packages
make, gcc, mingw-w64-x86_64-glfw, mingw-w64-x86_64-angleproject-git
I see lots of link error (none with glfw) like this
[exec] gcc -shared -o libJgles2.dll jni/util.o jni/gles2.o -L/mingw64/lib/ -lglfw3 -lgdi32 -lGLESv2
[exec] jni/gles2.o:gles2.c:(.text+0x25): undefined reference to `glBindFramebuffer'
[exec] jni/gles2.o:gles2.c:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `glBindFramebuffer'
... later ....
[exec] jni/gles2.o:gles2.c:(.text+0x2425): undefined reference to `glBindBuffer'
my makefile rule looks like this
CC=gcc
LIBS= -L/mingw64/lib/ -lglfw3 -lgdi32 -lGLESv2
libJgles2.dll: $(OBJ) jni/Jgles2_util.h jni/Jgles2_util.h jni/Jgles2_GLES2.h
$(CC) -shared -o $# $(OBJ) $(LIBS)
I want to use the LAPACK library in my fortran code. I am compiling using gfortran and want to call the dgesv function from the lapack library.
I downloaded lapack3.5.0 and built it using Cmake which also tests it. The build for lapack3.5.0 has created the following libraries: libblas.a, liblapack.a, libtmglib.a
I am using a make file to compile my code using gfortran.
How do I use these libraries with gfortran compiler, I get error of dgsev being undefined when I compile. I have added the path to these libraries to the system path.
I have no clue what to do to use external libraries in gfortran.
You have to use -L option of gfortran linker. Using this you will point the compiler to look for libraries in this path.
For example:
gfortran test.f -L/path/to/libs -llapack -lblas
If you have additional libraries you can setup like this
LLIBS = -L/path/to/libs -llapack -lblas
XLIBS = -L/usr/X11R6/lib64 -lX11 -lpthread
GLIBS = -L/usr/X11R6/lib64 -lGLU -lGL -lX11 -lXext -lpthread
OBJS = test.o
gfortran $(OBJS) $(LLIBS) $(XLIBS) $(GLIBS)
There is no need to add anything to system path.
I cannot seem to get this to work. I configured with the --with-gcc-toolchain= where after the equals I put the directory where gcc was (/usr/lib/gcc-snapshot/bin).
I also looked into the answers to " clang linker problem" but I do not see how I can get the accepted answer to find the correct location, and the symlink answer would have worked, except that all of the directories that it is searching exist (copying the lib folder from gcc-snapshot to one of the include locations does not seem to help).
As suggested in the other question, the output of clang++ test.cpp -v:
bob#bob:~/programming$ clang++ test.cpp -v
clang version 3.3 (trunk 171350)
Target: x86_64-unknown-linux-gnu
Thread model: posix
"/home/bob/programming/build/Release+Asserts/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name test.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -momit-leaf-frame-pointer -v -resource-dir /home/bob/programming/build/Release+Asserts/bin/../lib/clang/3.3 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/local/include -internal-isystem /home/bob/programming/build/Release+Asserts/bin/../lib/clang/3.3/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/bob/programming -ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops -o /tmp/test-PWiB4M.o -x c++ test.cpp
clang -cc1 version 3.3 based upon LLVM 3.3svn default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/home/bob/programming/build/Release+Asserts/bin/../lib/clang/3.3/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
test.cpp:1:10: fatal error: 'iostream' file not found
#include
^
1 error generated.
clang version 3.3 (trunk revision 171350)
EDIT: There are no .o files in the Release+Asserts folder for the build. Is this normal? If not, why is this the case, and how can I fix it (if I can point it as clang's stdlib, then that works as well).
Edit 2: It also fails to compile int main(){return 0;} as it can't find crtbegin.o. Full output is as follows:
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The results after -v are the same as the above, but with the ending error being different.
Config.log:
The full file can be found here, but the first (non-comment) line is: $ ../llvm/configure --with-gcc-toolchain=/usr/lib/gcc-snapshot/gcc
The issue that we've identified is that gcc was installed with --prefix=/usr/lib/gcc-snapshot configure argument. and llvm was configured with --with-gcc-toolchain=/usr/lib/gcc-snapshot/gcc argument. It should be the same as the gcc installation prefix, i.e. --with-gcc-toolchain=/usr/lib/gcc-snapshot.
The question's current first line says " I configured with the --with-gcc-toolchain= where after the equals I put the directory where gcc was (/usr/lib/gcc-snapshot/bin).", and the current last line says "first (non-comment) line is: $ ../llvm/configure --with-gcc-toolchain=/usr/lib/gcc-snapshot/gcc"
That's puzzling, you might have thought that you had put the flag --with-gcc-toolchain=/usr/lib/gcc-snapshot/bin but you had actually put --with-gcc-toolchain=/usr/lib/gcc-snapshot/gcc
Regardless, I think you should try the following.
remove or rename the build directory (the directory where you ran the configure command, i.e. the directory where you found the config.log file) I assume it's the /home/bob/programming/build directory.
now create /home/bob/programming/build directory again. it should be empty now.
cd /home/bob/programming/build
run the following configure command
../llvm/configure --with-gcc-toolchain=/usr/lib/gcc-snapshot
follow through with the rest of your build process.
The issue seems to be that you didn't specify the gcc-toolchain prefix correctly. It should be the same as the --prefix parameter you used while configuring the gcc.
Report back the results here.
Also see Clang 3.2 build broken after building gcc 4.7