Opened 19 years ago

Closed 17 years ago

#4495 closed defect (fixed)

BUG: VTK can not link with built library

Reported by: johans@… Owned by: cssdev
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc:
Port:

Description

I am trying to build Vtk-4.2.6 on Tiger using a Portfile dated 2005/08/14

The build and install succeeds, sort of; there is a lot of warnings about "Prebinding not disabled". Linking with the new libraries (using -L/opt/local/lib/vtk) fails with undefined references to /opt/local/var/db/dports/build/file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdate_dports_graphics_vtk/work/VTK/bin/\ libvtkRendering.dylib etc.

otool -L /opt/local/lib/vtk/libvtkRendering.dylib and friends report they depend on the above path, so obviously something is wrong during building/linking.

Cmake is updated to 2.0.6_3

Any ideas?

Change History (12)

comment:1 Changed 18 years ago by cssdev@…

This is actually a known bug with VTK. The install_names are incorrect, and the only way to fix them is to manually process through them with otool: http://public.kitware.com/pipermail/vtkusers/2003-December/070902.html

The development versions of both CMake and VTK resolve this issue already, so it's just a matter of waiting for Kitware to cut new releases of both tools. The CMake 2.2 beta is available through the cmake- devel port, but I have not yet created a vtk-devel port since a distribution is not readily available. http://public.kitware.com/pipermail/cmake/2005-August/007080.html

comment:2 Changed 18 years ago by cssdev@…

(Could someone with sufficient privileges reassign this bug to me as port maintainer?)

Turning off CMAKE_SKIP_RPATH should force CMake to include the correct install_name within the libraries. I'm not yet sure if a newer version of VTK is required, but I'll check with the existing 4.2.6 port and the latest version of CMake.

comment:3 Changed 18 years ago by jmpp@…

Owner: changed from darwinports-bugs@… to cssdev@…

comment:4 Changed 18 years ago by cssdev@…

I filed a bug with Kitware about the need to specify an install_name during library compilation: http://public.kitware.com/Bug/bug.php?op=show&bugid=2513

This bug has been assigned, so perhaps a new version of CMake will eventually allow more easily resolving this bug at build-time without the need for post-install scripts.

comment:5 Changed 18 years ago by cssdev@…

Kitware added RPATH configuration to CMake's CVS on 2005-02-16, and I'm testing with the CVS builds. This issue should be fully resolved once the new version of CMake is released. If desired, I could update the cmake-devel port to build from CVS.

comment:6 Changed 18 years ago by cssdev@…

dependson: 7497
Status: newassigned

BUG #7497 provides a development version of CMake with install_name support. The vtk port will require patches to provide the appropriate arguments during the configure phase. I believe that non-development versions of CMake will simply ignore the extra options. Once cmake-devel is updated, I'll update this port to include the appropriate install_names.

comment:7 Changed 18 years ago by cssdev@…

dependson: 7571, 7574

The latest cmake-devel port builds VTK 4.2.6 with the correct ${prefix} install_name. You should build and install the cmake-devel port prior to building VTK if it's essential that your VTK libraries use install_names. The VTK Portfile depend on the cmake port, but installing the cmake-devel port prior to VTK will satisfy the dependency. BUG #7574 is an RFC for handling the dependency on the development version of cmake rather than the stable release. BUG #7571 includes the latest fixes to the cmake-devel port.

Note that the cmake-devel port is a development version of CMake, so there might be other issues with it. Once CMake 2.3 is released and the release cmake port is updated, then you will not need to rely on cmake-devel.

The alternative is to set the DYLD_FALLBACK_LIBRARY_PATH environment variable to include ${prefix}/lib. http://devworld.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/DynamicLibraryUsageGuidelines.html

comment:8 Changed 18 years ago by cssdev@…

dependson: 9036

comment:9 Changed 18 years ago by cssdev@…

It should be possible to resolve this bug now that newer version of CMake is available. The latest CMake port properly supports setting the install_name when building software.

comment:10 Changed 18 years ago by cssdev

Owner: changed from cssdev@… to css@…
Status: assignednew

Reassigning to new address

comment:11 Changed 18 years ago by cssdev

Status: newassigned

comment:12 Changed 17 years ago by cssdev

Resolution: fixed
Status: assignedclosed

Closing this bug since the current version of CMake properly allows the port to specify the install location.

Note: See TracTickets for help on using tickets.