Project

General

Profile

Bug #2611

issues with gpu_utils-test with GMX_BUILD_UNITTESTS=OFF and on OSX

Added by Szilárd Páll over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
build system
Target version:
-
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Two symptoms point to the same problem source:

$ cmake [...] -DGMX_BUILD_UNITTESTS=OFF
CMake Error at src/gromacs/gpu_utils/tests/CMakeLists.txt:93 (target_link_libraries):
  Cannot specify link libraries for target "gpu_utils-test" which is not
  built by this project.

-- Configuring incomplete, errors occurred!
See also "/home/pszilard/projects/gromacs/gromacs-18/build_notest/CMakeFiles/CMakeOutput.log".
See also "/home/pszilard/projects/gromacs/gromacs-18/build_notest/CMakeFiles/CMakeError.log".

$ cmake . -DBUILD_TESTING=OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pszilard/projects/gromacs/gromacs-18/build_notest

On OSX with XCode 9.2 + CUDA 9.2:

$ cmake [...] && make
[...]
[  2%] Built target tng_io_zlib
[100%] Built target libgromacs
[100%] Built target template
[100%] Linking CXX shared library ../../../../lib/libgpu_utilstest_cuda.dylib
Undefined symbols for architecture x86_64:
  "getDeviceInfo(gmx_gpu_info_t const&, int)", referenced from:
      gmx::doDeviceTransfers(gmx_gpu_info_t const&, gmx::ArrayRef<char const>, gmx::ArrayRef<char>) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "getCompatibleGpus(gmx_gpu_info_t const&)", referenced from:
      gmx::doDeviceTransfers(gmx_gpu_info_t const&, gmx::ArrayRef<char const>, gmx::ArrayRef<char>) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "gmx::formatString(char const*, ...)", referenced from:
      gmx::(anonymous namespace)::throwUponFailure(cudaError, char const*) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "gmx::GromacsException::setInfo(std::__1::type_index const&, std::__1::unique_ptr<gmx::internal::IExceptionInfo, std::__1::default_delete<gmx::internal::IExceptionInfo> >&&)", referenced from:
      gmx::(anonymous namespace)::throwUponFailure(cudaError, char const*) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "gmx::GromacsException::GromacsException(gmx::ExceptionInitializer const&)", referenced from:
      gmx::(anonymous namespace)::throwUponFailure(cudaError, char const*) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "gmx::internal::assertHandler(char const*, char const*, char const*, char const*, int)", referenced from:
      gmx::doDeviceTransfers(gmx_gpu_info_t const&, gmx::ArrayRef<char const>, gmx::ArrayRef<char>) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "gmx::internal::IExceptionInfo::~IExceptionInfo()", referenced from:
      gmx::(anonymous namespace)::throwUponFailure(cudaError, char const*) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
      gmx::ExceptionInfo<gmx::ExceptionInfoLocation_, gmx::ThrowLocation>::~ExceptionInfo() in gpu_utilstest_cuda_generated_devicetransfers.cu.o
      gmx::ExceptionInfo<gmx::ExceptionInfoLocation_, gmx::ThrowLocation>::~ExceptionInfo() in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "typeinfo for gmx::InternalError", referenced from:
      gmx::(anonymous namespace)::throwUponFailure(cudaError, char const*) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "typeinfo for gmx::internal::IExceptionInfo", referenced from:
      typeinfo for gmx::ExceptionInfo<gmx::ExceptionInfoLocation_, gmx::ThrowLocation> in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  "vtable for gmx::InternalError", referenced from:
      gmx::(anonymous namespace)::throwUponFailure(cudaError, char const*) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for gmx::GromacsException", referenced from:
      gmx::(anonymous namespace)::throwUponFailure(cudaError, char const*) in gpu_utilstest_cuda_generated_devicetransfers.cu.o
      gmx::InternalError::~InternalError() in gpu_utilstest_cuda_generated_devicetransfers.cu.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
c++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libgpu_utilstest_cuda.dylib] Error 1
make[1]: *** [src/gromacs/gpu_utils/tests/CMakeFiles/gpu_utilstest_cuda.dir/all] Error 2
make: *** [all] Error 2

The link line seems to be missing libgromacs.3.2.0.dylib, adding it manually fixes the issue.

Also available in: Atom PDF