yziquel
(Guillaume Yziquel)
September 14, 2023, 9:54pm
1
Hi.
I’ve got an issue that is reported in the following github issues:
opened 05:36PM - 14 Sep 23 UTC
type:Bug
### Description
I tried to build `itk-wasm` after having built `ITK`. It fail… s at the `cmake ..` step since it cannot find `ITKModuleExternal.cmake`. The issue has been reported here:
https://github.com/InsightSoftwareConsortium/itk-wasm/issues/933
### Steps to Reproduce
Build `ITK` on Ubuntu 22 with `cmake .. && make && sudo make install` and then build `itk-wasm` with `cmake ..`. Here are the revisions:
`ITK`: `aaa43159aa5510fd514c71823b6b9c86b1f01212``
`itk-wasm`: `b1289e36d0b2483c8687d9325fb16ed604be4b15`
### Expected behavior
The `itk-wasm` build would pass the `cmake ..`step.
### Actual behavior
It fails to find `ITKModuleExternal.cmake`. Log is here:
https://github.com/InsightSoftwareConsortium/itk-wasm/issues/933
### Reproducibility
Deterministic.
### Versions
Revision SHAs have been given above.
### Environment
Ubuntu 22 on an amd64.
opened 05:10PM - 14 Sep 23 UTC
I just built ITK from source with `cmake ..`and `make` followed by `sudo make in… stall`. I hoped to pull all ITK dependencies this way. It appears not:
```console
mini-me@virtucon ~/h/c/i/build (main)> cmake ..
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CTest.cmake:50 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
For compatibility with older versions of CMake, option is clearing the
normal variable 'BUILD_TESTING'.
Call Stack (most recent call first):
build/_deps/libcbor-src/CMakeLists.txt:4 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of size_t
-- Check size of size_t - done
-- LTO is enabled
-- Looking for ldexp
-- Looking for ldexp - found
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
CMake Error at CMakeLists.txt:126 (include):
include could not find requested file:
ITKModuleExternal
CMake Error at CMakeLists.txt:130 (itk_module_target_label):
Unknown CMake command "itk_module_target_label".
-- Configuring incomplete, errors occurred!
See also "/home/mini-me/home/cellar/itk-wasm/build/CMakeFiles/CMakeOutput.log".
```
This is likely a problem in ITK itself, but as it impacts itk-wasm, it seems not incorrect to open an issue here.
Roughly put: I am trying to build ITK and itk-wasm from source, living on the git repo head. The ITKModuleExternal.cmake file is supposed to come from ITK and to be consumed by itk-wasm. However, nothing I try with the usual cmake procedure manages to get this ITKModuleExternal.cmake file published. It hence is not consumed by itk-wasm.
What is the known, standard and/or documented way to get this done ? Or should I resort to manual or not-so-manual hacks ? Seems to me like a cmake configuration issue in ITK repo.
Please advise.
dzenanz
(Dženan Zukić)
September 15, 2023, 1:38pm
2
ITK itself builds fine, and is thoroughly tested. The issue most likely comes from itk-wasm’s build system, or the way you are invoking it. @matt.mccormick might know more.
Hi,
In summary, the file ITKModuleExternal.cmake ’s purpose to to enabling an ITK module that lives in a repository separate from ITK, to be built against an ITK build tree. It is intentionally not added to the install tree.