[vtkusers] Multiple installation
LL
ll at maths.uq.edu.au
Tue Jun 5 16:55:51 EDT 2001
Dear VTK-users
Here is a useful hack for those experimenting with multiple versions of
VTK (as in different ABIs or cross-platform libraries). It relies on the
fact that in $(VTK_SRC)/system.make, VTK_LIB_EXT is different from
SHLIB_SUFFIX. Thus if you define (say)
VTK_VERSION = 3.2
VTK_LIB_EXT = ${VTK_VERSION}.so
then modify the other linked libraries in the various makes to use this
(e.g. -lVTKGraphics${VTK_VERSION} ) you can trick the make process to
generate different versions.
For example, Kit.make
libVTK$(ME)Python$(VTK_LIB_EXT): libVTK$(ME)$(VTK_LIB_EXT) \
python/${ME}Init.o ${PYTHON_O_ADD} ${PYTHON_WRAP}
rm -f libVTK$(ME)Python$(VTK_LIB_EXT)
$(CXX) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} \
-o libVTK$(ME)Python$(VTK_LIB_EXT) python/${ME}Init.o \
${PYTHON_O_ADD} ${PYTHON_WRAP} -L. ${XLDFLAGS} \
${PYTHON_LIBS} ${XLIBS} -lXext -lXt ${X_PRE_LIBS} -lX11 \
${X_EXTRA_LIBS} ${DL_LIBS} ${THREAD_LIBS}
then in places like install_python, you can add
@echo "Switching to version {VTK_VERSION}"
(cd $(LIB_INSTALL_DIR); \
rm -rf libVTK${ME}Python${SHLIB_SUFFIX};
ln -s libVTK${ME}Python${VTK_LIB_EXT}
libVTK${ME}Python${SHLIB_SUFFIX})
Caveats -
1) this does not modify the *.make.in so some of the changes (e.g. to
system.make) will be lost when you do a ./configure
2) I have not tested with with non-shared libraries and other variations
of config options, it may affect some other static options
3) there are some spots which need a bit of hand-massaging as they
redefine the linked libraries rather than taking their cues from
system.make. It should work as normal when you set VTK_VERSION to NULL
Where this is useful, if you are using different python installations
(which complains about C API mismatch) or trying some experimental
modifications without destroying a working test-case.
LL
More information about the vtkusers
mailing list