simeks / deform

Efficient dense deformable image registration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake error: Target "stk" links to target "GTest::GTest" but the target was not found.

tatz-murakami opened this issue · comments

python setup.py install --use-cuda --use-ispc --debug returns the following error.

running install
running bdist_egg
running egg_info
writing pydeform.egg-info/PKG-INFO
writing dependency_links to pydeform.egg-info/dependency_links.txt
writing requirements to pydeform.egg-info/requires.txt
writing top-level names to pydeform.egg-info/top_level.txt
reading manifest file 'pydeform.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'pydeform.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
['-DDF_BUILD_PYTHON_WRAPPER=ON',
 '-DDF_BUILD_EXECUTABLE=OFF',
 '-DDF_BUILD_TESTS=OFF',
 '-DDF_BUILD_WITH_DEBUG_INFO=ON',
 '-DCMAKE_BUILD_TYPE=Debug',
 '-DDF_USE_CUDA=ON',
 '-DDF_USE_ISPC=ON',
 '-DDF_ITK_BRIDGE=OFF',
 '-DPYTHON_EXECUTABLE=/home/tmurakami/app/miniconda3/envs/deform2/bin/python',
 '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/tmurakami/app/deform_gpu/build/lib.linux-x86_64-3.8']
/home/tmurakami/app/deform_gpu/src/deform_lib/version.h.in
src/deform_lib/version.h
-- Found OpenMP_C: -fopenmp=libomp (found version "5.0") 
-- Found OpenMP_CXX: -fopenmp=libomp (found version "5.0") 
-- Found OpenMP_C: -fopenmp=libomp (found version "5.0") 
-- Found OpenMP_CXX: -fopenmp=libomp (found version "5.0") 
CMake Warning (dev) at third_party/stk/third_party/nifticlib-2.0.0/CMakeLists.txt:100:
  Syntax Warning in cmake code at column 38

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at third_party/stk/third_party/nifticlib-2.0.0/CMakeLists.txt:100:
  Syntax Warning in cmake code at column 39

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at third_party/stk/third_party/NrrdIO-1.11.0/CMakeLists.txt:26 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- pybind11 v2.4.2
CMake Deprecation Warning at third_party/yaml-cpp/CMakeLists.txt:6 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at third_party/yaml-cpp/CMakeLists.txt:9 (cmake_policy):
  The OLD behavior for policy CMP0012 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at third_party/yaml-cpp/CMakeLists.txt:13 (cmake_policy):
  The OLD behavior for policy CMP0015 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Configuring done
CMake Warning (dev) at src/deform_lib/CMakeLists.txt:116 (add_library):
  Policy CMP0115 is not set: Source file extensions must be explicit.  Run
  "cmake --help-policy CMP0115" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  File:

    /home/tmurakami/app/deform_gpu/src/deform_lib/version.h.in
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at third_party/stk/src/stk/CMakeLists.txt:65 (add_library):
  Target "stk" links to target "GTest::GTest" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?


CMake Error at third_party/stk/src/stk/CMakeLists.txt:65 (add_library):
  Target "stk" links to target "GTest::Main" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?


CMake Error at third_party/stk/third_party/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Target "_stk" links to target "GTest::GTest" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?
Call Stack (most recent call first):
  third_party/stk/src/python_wrapper/CMakeLists.txt:1 (pybind11_add_module)


CMake Error at third_party/stk/third_party/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Target "_stk" links to target "GTest::Main" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?
Call Stack (most recent call first):
  third_party/stk/src/python_wrapper/CMakeLists.txt:1 (pybind11_add_module)


CMake Error at src/deform_lib/CMakeLists.txt:116 (add_library):
  Target "deform_lib" links to target "GTest::GTest" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at src/deform_lib/CMakeLists.txt:116 (add_library):
  Target "deform_lib" links to target "GTest::Main" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at third_party/stk/third_party/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Target "_pydeform" links to target "GTest::GTest" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  src/python_wrapper/CMakeLists.txt:1 (pybind11_add_module)


CMake Error at third_party/stk/third_party/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Target "_pydeform" links to target "GTest::Main" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  src/python_wrapper/CMakeLists.txt:1 (pybind11_add_module)


CMake Warning (dev) in third_party/stk/src/stk/CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "stk".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in src/deform_lib/CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "deform_lib".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Odd, this software doesn't use GTest but it seems yaml-cpp does. I didn't manage to reproduce your error but you could try to add the flag -DYAML_CPP_BUILD_TESTS=0 to avoid building the yaml tests.

Rebuilt from scratch, now able to install.
I found this happens when --use-itk is included. -DYAML_CPP_BUILD_TESTS=0 did not help.
Ubuntu 20.04.3
ISPC 1.16.1
CMake 3.21.3
GCC 9.3.0