Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ITKModuleExternal cmake include missing #933

Open
gl-yziquel opened this issue Sep 14, 2023 · 9 comments
Open

ITKModuleExternal cmake include missing #933

gl-yziquel opened this issue Sep 14, 2023 · 9 comments

Comments

@gl-yziquel
Copy link

I just built ITK from source with cmake ..and make followed by sudo make install. I hoped to pull all ITK dependencies this way. It appears not:

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.

@dzenanz
Copy link
Member

dzenanz commented Sep 15, 2023

You might need to point to ITK's build directory, not install directory.

@gl-yziquel
Copy link
Author

Hmmmh... isn't it just the point ? Having these cmake files available out of tree ?

Any pointers as to where the way to perform this build is documented ?

@dzenanz
Copy link
Member

dzenanz commented Sep 15, 2023

Have you looked at the tutorial?

@dzenanz
Copy link
Member

dzenanz commented Sep 15, 2023

The user of itk-wasm might not need to build it in the usual C++ sense. Rather use it via npm packages and docker images.

@gl-yziquel
Copy link
Author

Tutorial ? that link -> 404.

I've seen stuff using docker. What I don't like about docker is that it hides the build process, and that it's too heavy to get that working on my laptop with everything else on it going on. I'm looking for a straight build process.

If I don't find documentation about a straight build process, I'll hunt down what goes under the hood with docker, and I hope not to find a pre-built image, but a genuine build process.

(I'm kind of getting fed up of getting docker images thrown at my face all the time, to be honest. I'm starting to miss autotools...)

@dzenanz
Copy link
Member

dzenanz commented Sep 15, 2023

What about this link: https://wasm.itk.org/docs/

For the build process, you could take a look at the CI, and the versions used there. The real build code is here: https://github.com/InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction

@gl-yziquel
Copy link
Author

That other link is still a 404.

I'll have a look at ITKRemoteModuleBuildTestPackageAction.

@thewtex
Copy link
Member

thewtex commented Sep 18, 2023

The correct links to the itk-wasm docs are:

https://wasm.itk.org/

and the development tutorial is:

https://wasm.itk.org/en/latest/cxx/tutorial/index.html

To build the C++ ITK IO modules and C++ command line interfaces, the steps are:

  1. Build ITK.
  2. Build the ITKMeshToPolyData module by building the project against the ITK build tree.
  3. Build the itk-wasm source tree against the ITK build tree. This will add a WebAssemblyInterface ITK module to the ITK build..

And then you can build pure native binary C++ executables or use the itk-wasm IO methods by building against that ITK build tree.

This is useful, but if you want to do more, i.e. generate WebAssembly or generate WebAssembly bindings, Docker and Node.js are required. They help make the build environment setup straightforward, reproducible, and low-resource. The build process is documented in the development tutorial.

@gl-yziquel
Copy link
Author

Thank you. This is a start. (I want full control over my builds, including wasm generation; we'll see how far that goes and how much time i manage to devote to that).

Will try out your instructions at some point in time. Thank you.

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

No branches or pull requests

3 participants