Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

[OS X - GPU Build] Undefined symbols for architecture x86_64 #1298

Open
ghost opened this issue Oct 5, 2017 · 3 comments
Open

[OS X - GPU Build] Undefined symbols for architecture x86_64 #1298

ghost opened this issue Oct 5, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 5, 2017

cmake build summary

-- ******** Summary ********
-- General:
--   Git version           : v0.8.1-427-g4659f85c-dirty
--   System                : Darwin
--   C++ compiler          : /Library/Developer/CommandLineTools/usr/bin/c++
--   C++ compiler version  : 8.0.0.8000042
--   Protobuf compiler     : /Users/dat/frameworks/miniconda3/envs/ai-2/bin/protoc
--   CXX flags             :  -std=c++11 -O2 -fPIC -Wno-narrowing
--   Build type            : Release
--   Compile definitions   :
--
--   BUILD_BINARY          : ON
--   BUILD_PYTHON          : ON
--     Python version      : 2.7.13
--     Python library      : /Users/dat/frameworks/miniconda3/envs/ai-2/lib/libpython2.7.dylib
--   BUILD_SHARED_LIBS     : ON
--   BUILD_TEST            : ON
--   USE_ATEN              : OFF
--   USE_EIGEN_FOR_BLAS    :
--   USE_CUDA              : ON
--     CUDA version        : 8.0
--     CuDNN version       : 6.0.21
--   USE_FFMPEG            : OFF
--   USE_GFLAGS            : ON
--   USE_GLOG              : ON
--   USE_GLOO              : OFF
--   USE_LEVELDB           : ON
--     LevelDB version     : 1.20
--     Snappy version      : ..
--   USE_LITE_PROTO        : OFF
--   USE_LMDB              : ON
--     LMDB version        : 0.9.21
--   USE_METAL             : OFF
--   USE_MKL               :
--   USE_MOBILE_OPENGL     : OFF
--   USE_MPI               : OFF
--   USE_NCCL              : OFF
--   USE_NERVANA_GPU       : OFF
--   USE_NNPACK            : ON
--   USE_OBSERVERS         : OFF
--   USE_OPENCV            : off
--   USE_OPENMP            : OFF
--   USE_REDIS             : OFF
--   USE_ROCKSDB           : ON
--   USE_THREADS           : ON
--   USE_ZMQ               : OFF

I got this error when trying to make

[ 77%] Linking CXX executable binaries/operator_gpu_test
Undefined symbols for architecture x86_64:
  "testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)", referenced from:
      __GLOBAL__sub_I_operator_gpu_test.cc in operator_gpu_test.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [caffe2/binaries/operator_gpu_test] Error 1
make[1]: *** [caffe2/CMakeFiles/operator_gpu_test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 77%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_mkl.cc.o
[ 77%] Linking CXX executable binaries/elementwise_op_gpu_test
Undefined symbols for architecture x86_64:
  "testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)", referenced from:
      __GLOBAL__sub_I_elementwise_op_gpu_test.cc in elementwise_op_gpu_test.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [caffe2/binaries/elementwise_op_gpu_test] Error 1
make[1]: *** [caffe2/CMakeFiles/elementwise_op_gpu_test.dir/all] Error 2
[ 78%] Linking CXX executable binaries/math_gpu_test
Undefined symbols for architecture x86_64:
  "testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)", referenced from:
      __GLOBAL__sub_I_math_gpu_test.cc in math_gpu_test.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [caffe2/binaries/math_gpu_test] Error 1
make[1]: *** [caffe2/CMakeFiles/math_gpu_test.dir/all] Error 2
[ 78%] Linking CXX shared module python/caffe2_pybind11_state.so
[ 78%] Built target caffe2_pybind11_state
make: *** [all] Error 2
@Yangqing
Copy link
Contributor

Yangqing commented Oct 5, 2017

This seems like a linking conflict between the system gtest and the third party gtest file that is included by the C2 library. Could you check if you have gtest installed system wide?

@ghost
Copy link
Author

ghost commented Oct 5, 2017

Thanks! I managed to solve that problem after removing the system wide gtest. Now I got this error when trying to sudo make install

-- Installing: /usr/local/bin/convert_caffe_image_db
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/convert_caffe_image_db (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/convert_db
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/convert_db (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/db_throughput
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/db_throughput (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/make_cifar_db
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/make_cifar_db (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/make_mnist_db
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/make_mnist_db (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/predictor_verifier
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/predictor_verifier (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/print_registered_core_operators
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/print_registered_core_operators (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/run_plan
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/run_plan (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/speed_benchmark
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/speed_benchmark (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/split_db
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/split_db (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/inspect_gpus
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/inspect_gpus (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/print_core_object_sizes
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/print_core_object_sizes (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib
-- Installing: /usr/local/bin/tutorial_blob
error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /usr/local/bin/tutorial_blob (for architecture x86_64) option "-add_rpath /usr/local/cuda/lib" would duplicate path, file already has LC_RPATH for: /usr/local/cuda/lib

Would you like help me on this as well?

@pietern
Copy link
Contributor

pietern commented Dec 12, 2017

@taurandat Did you happen to figure this out? I'm curious what could have been the issue.

@dzhulgakov I recall you did some work on RPATH on macOS; does this look related?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants