[CMake] VTK-5-2-0 macport build error

Darren Weber darren.weber.lists at gmail.com
Thu Sep 18 14:17:47 EDT 2008


I'm in the process of adapting a macport called vtk5 so it will work
with VTK-5-2-0, but I have a problem with finding a library.  I'm
running a build on the cvs checkout with tag VTK-5-2-0; I'm trying to
build against macport libraries (on OSX 10.5.5).  The build is
configured and builds successfully, but the link fails with "ld:
library not found for -lhistory" (see below).  How can I get more
information about this link error so I can identify the library
dependency and correct it?

export prefix="/opt/local"
export LDFLAGS="-L${prefix}/lib"
export CPPFLAGS="-I${prefix}/include"

cmake \
	-DBUILD_EXAMPLES:BOOL=OFF \
   	-DBUILD_SHARED_LIBS:BOOL=OFF \
   	-DBUILD_TESTING:BOOL=OFF \
   	-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
	-DCMAKE_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib \
	-DCMAKE_INCLUDE_PATH:PATH=${prefix}/include \
	-DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
	-DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib \
	-DCMAKE_LIBRARY_PATH:PATH=${prefix}/lib \
	-DVTK_INSTALL_PREFIX:PATH=${prefix} \
	-DVTK_DATA_ROOT:PATH=${prefix}/share/VTKData \
	-DVTK_USE_CARBON:BOOL=OFF \
	-DVTK_USE_COCOA:BOOL=ON \
	-DVTK_USE_INFOVIS:BOOL=ON \
	-DVTK_USE_PARALLEL:BOOL=OFF \
	-DVTK_USE_RENDERING:BOOL=ON \
	-DVTK_USE_VIEWS:BOOL=ON \
	-DVTK_USE_X:BOOL=OFF \
	-DVTK_WRAP_JAVA:BOOL=OFF \
	-DVTK_WRAP_PYTHON:BOOL=OFF \
	-DVTK_WRAP_TCL:BOOL=ON \
	-DVTK_TCL_LIBRARY_DIR:FILEPATH=${prefix}/lib/tcl8.5 \
	-DVTK_REQUIRED_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib \
	../VTK

<snip>

[ 99%] Building CXX object Views/CMakeFiles/vtkViewsTCL.dir/vtkViewsTCLInit.o
Linking CXX static library ../bin/libvtkViewsTCL.a
[ 99%] Built target vtkViewsTCL
Scanning dependencies of target vtk
[100%] Building CXX object Wrapping/Tcl/CMakeFiles/vtk.dir/vtkTkAppInit.o
Linking CXX executable ../../bin/vtk
ld: library not found for -lhistory
collect2: ld returned 1 exit status
make[2]: *** [bin/vtk] Error 1
make[1]: *** [Wrapping/Tcl/CMakeFiles/vtk.dir/all] Error 2
make: *** [all] Error 2


I can 'locate' the following (among others):

/opt/local/lib/libhistory.5.0.dylib
/opt/local/lib/libhistory.5.1.dylib
/opt/local/lib/libhistory.5.2.dylib
/opt/local/lib/libhistory.5.dylib
/opt/local/lib/libhistory.a
/opt/local/lib/libhistory.dylib

/opt/local/lib/tcl8.5/history.tcl
/usr/local/lib/tcl8.4/history.tcl

/System/Library/Tcl/tklib0.4/history
/System/Library/Tcl/tklib0.4/history/history.tcl
/System/Library/Tcl/tklib0.4/history/pkgIndex.tcl


Among the active macports, I have:

tk @8.5.4_0 (active)
tcl @8.5.4_0+memdebug+threads (active)
tcllib @1.10_0 (active)


More information about the CMake mailing list