conda-forge / vtk-feedstock

A conda-smithy repository for vtk.
BSD 3-Clause "New" or "Revised" License
13 stars 64 forks source link

vtk9: wrong config-paths in cmake-setup #157

Closed looooo closed 3 years ago

looooo commented 3 years ago

There are some wrong config paths in the cmake config files:

linux:

CMake Error in src/Mod/Fem/App/CMakeLists.txt:
  Imported target "VTK::opengl" includes non-existent path

    "/home/conda/feedstock_root/build_artifacts/vtk_1603657375561/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

osx:

CMake Error in src/Mod/Fem/App/CMakeLists.txt:
  Imported target "VTK::opengl" includes non-existent path

    "/Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.
looooo commented 3 years ago

is it possible to add some commands to remove these lines? I tried the following for linux which works for me: sed -i '380,384d' ${PREFIX}/lib/cmake/vtk-9.0/VTK-targets.cmake

Doing the same for osx results in: sed: -i may not be used with stdin

Maybe someoe of the core team can have a look at this issue, as this is a problem not only for this feedstock but a general issue with conda-build. Maybe there is a better way to avoid such paths. @conda-forge/core

chrisburr commented 3 years ago

Doing the same for osx results in: sed: -i may not be used with stdin

Add sed to the build dependencies to get GNU sed instead of BSD sed (which requires a suffix to -i like -i.bak).

looooo commented 3 years ago

thanks, yes I came to the same conclusion. Should we add this workaround to the vtk-recipe to avoid doing this on all the vt-dependent recipes?

isuruf commented 3 years ago

Try building with new conda-build. Might be fixed there.

wolfv commented 3 years ago

Is there handling for files taken from the $BUILD_PREFIX? We hit the same issue with the ROS packages here and there, and for linking we generally opted to patch CMake to not use the absolute path (just the library name). Not sure what to do about include paths, though. Maybe just not add them to the generated cmake because they should be found from the sys include directories anyways?

looooo commented 3 years ago

@isuruf which version should have the fix included? I would like to try.

Tobias-Fischer commented 3 years ago

Ping @conda-forge/vtk - I'm running into this problem in https://github.com/conda-forge/pcl-feedstock/pull/31

isuruf commented 3 years ago

@Tobias-Fischer, try adding https://github.com/conda/conda-build/blob/1071bfe070c39dbfa5c12ded1942fd7e5326c7e0/tests/test-recipes/variants/31_variant_subkeys/conda_build_config.yaml#L11-L15 to recipe/conda_build_config.yaml here