Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Experimental "remote module" CMake Error: install includes target which requires tensorstore #66

Open
N-Dekker opened this issue Aug 16, 2024 · 2 comments
Assignees

Comments

@N-Dekker
Copy link
Collaborator

N-Dekker commented Aug 16, 2024

As an experiment, I tried to see if I could add a remote module to ITKIOOMEZarrNGFF, just by adding a file named "IOOMEZarrNGFF.remote.cmake" to ITK's source subdirectory "Modules\Remote", having:

itk_fetch_module(
  IOOMEZarrNGFF
  "ITK module for IO of images stored in Zarr-backed OME-NGFF file format."
  MODULE_COMPLIANCE_LEVEL 3
  GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKIOOMEZarrNGFF.git
  GIT_TAG 6bb50d206670b2906558ebb47f77ad0e7306a7f0
  )

At https://github.com/N-Dekker/ITK/tree/IOOMEZarrNGFF-remote

When I do a CMake Generate of my adjusted version of ITK, after having enabled the remote module, it says:

Configuring done (300.6s)
CMake Error: install(EXPORT "ITKTargets" ...) includes target "IOOMEZarrNGFF" which requires target "tensorstore_tensorstore" that is not in any export set.
CMake Error: install(EXPORT "ITKTargets" ...) includes target "IOOMEZarrNGFF" which requires target "tensorstore_all_drivers" that is not in any export set.
Generating done (85.7s)

How could these errors possibly be avoided?

I guess the issue is related to the target_link_libraries(IOOMEZarrNGFF PRIVATE tensorstore::tensorstore tensorstore::all_drivers) call in

target_link_libraries(IOOMEZarrNGFF PRIVATE tensorstore::tensorstore tensorstore::all_drivers)

Is there any workaround or possible fix?

@dzenanz
Copy link
Member

dzenanz commented Aug 16, 2024

tensorstore, this remote module's main dependency, is big and complicated, with a strange build system. Its CMake-based build system is auto-generated from Bazel, which is its source of truth. CMake being second-class citizen within tensorstore has many strange side-effects. It has been long since I dealt with this, so I don't have any immediate suggestions.

@N-Dekker
Copy link
Collaborator Author

For the record, I observed that a local ITKIOOMEZarrNGFF CMake configuration executes the "if(NOT ITK_SOURCE_DIR)" branch, while as remote module, the "else()" branch is executed, from

if(NOT ITK_SOURCE_DIR)
find_package(ITK 5.0 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
include(ITKModuleExternal)
else()
set(ITK_DIR ${CMAKE_BINARY_DIR})
itk_module_impl()
endif()

That does not explain why the remote module does not work, just a single baby step forward 😺

@thewtex thewtex self-assigned this Sep 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants