conda-forge / vtk-feedstock

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

vtk8.2.0 (linux): link-path to librt not replaced #86

Closed looooo closed 1 year ago

looooo commented 5 years ago

This issue comes up here: https://github.com/conda-forge/smesh-feedstock/pull/24

Error message:

ninja: error: '/home/conda/feedstock_root/build_artifacts/vtk_1557516595194/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/librt.so', needed by 'libSMDS.so.8.3.0.3', missing and no known rule to make it
looooo commented 5 years ago

Vtk package 8.2.0 201 worked. The problem is in the cmake files of build 202:

vtk/lib/cmake/vtk-8.2/VTKTargets-release.cmake:
 1143  set_property(TARGET vtkxdmf2 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
 1144  set_target_properties(vtkxdmf2 PROPERTIES
 1145:   IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "/opt/anaconda1anaconda2anaconda3/lib/libxml2.so;/opt/anaconda1anaconda2anaconda3/lib/libhdf5.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/librt.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libpthread.so;/opt/anaconda1anaconda2anaconda3/lib/libz.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libdl.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libm.so;/opt/anaconda1anaconda2anaconda3/lib/libhdf5_hl.so"
 1146    IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libvtkxdmf2-8.2.so.1"
 1147    IMPORTED_SONAME_RELEASE "libvtkxdmf2-8.2.so.1"

vtk/lib/cmake/vtk-8.2/Modules/vtkhdf5.cmake:
    1  set(vtkhdf5_LOADED 1)
    2  set(vtkhdf5_DEPENDS "vtkzlib")
    3: set(vtkhdf5_LIBRARIES "/opt/anaconda1anaconda2anaconda3/lib/libhdf5.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/librt.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libpthread.so;/opt/anaconda1anaconda2anaconda3/lib/libz.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libdl.so;/home/conda/feedstock_root/build_artifacts/vtk_1557516585734/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libm.so;/opt/anaconda1anaconda2anaconda3/lib/libhdf5_hl.so")
    4  set(vtkhdf5_INCLUDE_DIRS "${VTK_INSTALL_PREFIX}/include/vtk-8.2;/opt/anaconda1anaconda2anaconda3/include")
looooo commented 5 years ago

is it somehow possible to pin a build-number in meta.yaml or ci_support files?

jakirkham commented 5 years ago

Were you able to narrow down what caused it?

looooo commented 5 years ago

No, I am using sed to remove these paths: https://github.com/conda-forge/freecad-feedstock/pull/26/commits/36be9f416a446500c37cbd5821aee3b3dc8395e3#diff-44a73bcc045c193c3bd45da87994b03bR8

looooo commented 5 years ago

Was there a change of the compiler activation or conda-build? Do we have to add -lpthread -lrt manually? maybe @mingwandroid

looooo commented 5 years ago

Should we remove the wrong paths in this feedstock?

looooo commented 5 years ago

before replacing paths:

set(vtkhdf5_LIBRARIES "/opt/conda/conda-bld/vtk_1563271914799/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/libhdf5.so;/opt/conda/conda-bld/vtk_1563271914799/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/librt.so;/opt/conda/conda-bld/vtk_1563271914799/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libpthread.so;/opt/conda/conda-bld/vtk_1563271914799/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/libz.so;/opt/conda/conda-bld/vtk_1563271914799/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libdl.so;/opt/conda/conda-bld/vtk_1563271914799/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/libm.so;/opt/conda/conda-bld/vtk_1563271914799/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/libhdf5_hl.so")

So everything in host-env is replaced correctly but libraries in build-env are not replaced (I guess these should be ignored).

luzpaz commented 5 years ago

any progress on this ?

looooo commented 5 years ago

I read about removing find_package(rt) maybe helps. Not sure this is used for vtk.

looooo commented 4 years ago

Another option to avoid packages depending on vtk to link against rt and other libraries in sysroot is to make the linking private. See here for example: https://github.com/conda-forge/occt-feedstock/blob/master/recipe/fix-private-linking.patch

grlee77 commented 3 years ago

I am seeing this same type of error in the build for VTK itself in the CI logs from #148. For example, with Python 3.7 on linux:

2020-10-14T03:58:59.3981406Z ninja: error: '/home/conda/feedstock_root/build_artifacts/vtk_1602647608856/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/librt.so', needed by 'lib/libvtkIOMINC-9.0.so.9.0.1', missing and no known rule to make it

has there been any consensus elsewhere on how to best address this?

looooo commented 3 years ago

Would be nice if someone from @conda-forge/core who knows about the internals can give a statement on this. I think this is a fundamental issue of different/overlapping dependency handling (conda/cmake). So it would be nice to know if this is an issue with the cmake-configs or if this is conda-specific and how to solve it properly if possible.

mbargull commented 3 years ago

That path to librt.so is pulled in via libnetcdf, see https://github.com/conda-forge/libnetcdf-feedstock/pull/109#issuecomment-713804007. We can restart gh-148 once libnetcdf is rebuilt.

rockandsalt commented 3 years ago

any update on this? I am also getting this error.

Edit : actually nevermind, I upgraded to vtk 9.0. Instead I get

imported target vtk::opengl includes non-existent path

"/home/conda/feedstock_root/build_artifacts/vtk_1603657374168/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include" 
Tobias-Fischer commented 1 year ago

This was fixed with https://github.com/conda-forge/vtk-feedstock/commit/8fcd00327e3e312b4c62c56b5b1f71d41784acf3