[Paraview] static linking with python

burlen burlen.loring at gmail.com
Sat Mar 5 14:25:24 EST 2011


On 03/04/2011 05:53 AM, Brad King wrote:
> On 03/03/2011 04:08 PM, Burlen Loring wrote:
>>   On 03/03/2011 05:39 AM, Brad King wrote:
>>> On 03/02/2011 06:31 PM, Burlen Loring wrote:
>>>> Can anyone help figure out where these comes from and how to turn them off?
>>> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:LINK_SEARCH_END_STATIC
>> Thanks for the reply, I have been playing with this unsuccessfully. It
>> doesn't have the desired effect so I think I'm doing something wrong.
>    "Make uses these options to set the link type for libraries whose full
>     paths are not known or (in some cases) are in implicit link directories
>     for the platform. By default the linker search type is left at -Bdynamic
>     by the end of the library list."
>
> IOW any library of the form "-lfoo" is assumed to be -Bdynamic.  Libraries
> in implicit link directories like "/usr/lib/libbar.a" will get turned into
> "-Bstatic -lbar" but then a later "-lfoo" will become "-Bdynamic -lfoo"
> since "-lfoo" is assumed to be dynamic.  This is all because CMake assumes
> dynamic linking is preferred.

OK but why would LINK_SEARCH_END_STATIC result in "-Wl,-Bstatic 
-Wl,-Bdynamic" being used ? Shouldn't it be just "-Bstatic" ?

Why is CMake's default to make a substitution like "-lfoo" with 
"-Bdynamic -lfoo" ? It seems like this choice is unnecessarily 
complicating things. It's also often redundant (as long as you don't 
want to mix static and dynamic linking) because without this ld defaults 
to using shared libraries. These substitutions override what's set in 
CMAKE_EXE_LINKER_FLAGS making that pretty much useless. It would be 
useful to be able to turn off these substitutions, then the "-static" in 
CMAKE_EXE_LINKER_FLAGS would work.

I wondering if the LINK_SEARCH_*_STATIC issues are sidetracking us, 
because there's one instance of -Bdynamic appearing in the middle of the 
link line (below), and it's not affected by LINK_SEARCH_*_STATIC. I have 
no idea where it's coming from but it's presence is related to enabling 
python support because otherwise pv links statically fine. By the way 
this is a statically linked build of python.

> Now you can set a "LINK_SEARCH_START_STATIC" property to switch the dynamic
> linking assumption to static linking.  In combination with "-static" that
> should produce a link line with no -Bdynamic options that links statically.
>
> This new feature should be available in the nightly builds by tomorrow:
Thank you Brad! I tried the new feature and I still have a -Bdynamic 
appearing in the middle of the link line at "../../bin/libhdf5.a 
-Wl,-Bdynamic -lm ../../bin/libvtkPVCommandOptions.a", full link line 
from the LINK_SEARCH_START_STATIC build follows.

cat ./Servers/Executables/CMakeFiles/pvserver.dir/link.txt
/opt/cray/xt-asyncpe/4.0/bin/CC    -Wno-deprecated -fPIC -Bstatic 
-static -O3 -DNDEBUG  -fPIC -Bstatic -static 
CMakeFiles/pvserver.dir/pvserver.cxx.o  -o ../../bin/pvserver -rdynamic 
-L/opt/fftw/3.2.2.1/lib -L/opt/cray/pmi/1.0-1.0000.8256.50.1.ss/lib64 
-L/opt/cray/mpt/5.0.0/xt/seastar/mpich2-gnu/lib 
-L/opt/cray/mpt/5.0.0/xt/seastar/sma/lib64 
-L/opt/xt-libsci/10.4.5/gnu/lib/44 -L/opt/xt-libsci/10.4.5/gnu/lib 
-L/opt/xt-pe/2.2.48B/lib -L/opt/xt-pe/default/lib 
-L/opt/xt-pe/2.2.48B/lib/snos64 -L/opt/xt-pe/default/lib/snos64 
-L/opt/gcc/4.4.4/snos/lib/gcc/x86_64-suse-linux/4.4.4 
-L/opt/gcc/4.4.4/snos/lib64 -L/lib64 -L/opt/gcc/4.4.4/snos/lib 
../../bin/libvtkPVServerCommon.a ../../bin/libvtkPVFilters.a 
../../bin/libvtkPVServerManager.a ../../bin/libvtkPVPythonInterpretor.a 
../../bin/libvtkPVFiltersCS.a ../../bin/libvtkPVFiltersPython.a 
../../bin/libvtkPVServerManagerPython.a 
../../bin/libvtkPVFiltersPythonD.a 
../../bin/libvtkPVServerManagerPythonD.a ../../bin/libvtkPVFilters.a 
../../bin/libvtkPVServerManager.a ../../bin/libvtkPVPythonInterpretor.a 
../../bin/libvtkPVFiltersCS.a ../../bin/libvtkPVFiltersPython.a 
../../bin/libvtkPVServerManagerPython.a 
../../bin/libvtkPVFiltersPythonD.a 
../../bin/libvtkPVServerManagerPythonD.a ../../bin/libicet_mpi.a 
../../bin/libicet_strategies.a ../../bin/libicet.a 
../../bin/libvtkXdmfCS.a ../../bin/libvtkXdmf.a ../../bin/libXdmf.a 
/lustre/scratch/proj/sw/pythoncnl/lib/libpython2.5.a 
../../bin/libvtkCommonPython.a ../../bin/libvtkFilteringPython.a 
../../bin/libvtkImagingPython.a ../../bin/libvtkGraphicsPython.a 
../../bin/libvtkGenericFilteringPython.a 
../../bin/libvtkGenericFilteringPythonD.a ../../bin/libvtkIOPython.a 
../../bin/libvtkRenderingPython.a 
../../bin/libvtkVolumeRenderingPython.a 
../../bin/libvtkVolumeRenderingPythonD.a ../../bin/libvtkHybridPython.a 
../../bin/libvtkWidgetsPython.a ../../bin/libvtkParallelPython.a 
../../bin/libvtkInfovisPython.a ../../bin/libvtkGeovisPython.a 
../../bin/libvtkGeovisPythonD.a ../../bin/libvtkGeovis.a 
../../bin/libvtkproj4.a ../../bin/libvtkViewsPython.a 
../../bin/libvtkChartsPython.a ../../bin/libvtkChartsPythonD.a 
../../bin/libvtkViewsPythonD.a ../../bin/libvtkInfovisPythonD.a 
../../bin/libvtkCharts.a ../../bin/libvtkViews.a 
../../bin/libvtkPVServerCommonPython.a -lz -lexpat 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/numarray/_capi.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/linalg/lapack_lite.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/core/scalarmath.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/core/_sort.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/core/multiarray.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/core/umath.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/lib/_compiled_base.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/fft/fftpack_lite.a 
/lustre/scratch/proj/sw/pythoncnl/lib/python2.5/site-packages/numpy/random/mtrand.a 
-Wl,-Bstatic -lutil ../../bin/libvtkVolumeRenderingCS.a 
../../bin/libvtkVolumeRendering.a ../../bin/libvtkWidgetsCS.a 
../../bin/libvtkWidgetsPythonD.a ../../bin/libvtkHybridPythonD.a 
../../bin/libvtkParallelPythonD.a ../../bin/libvtkRenderingPythonD.a 
../../bin/libvtkImagingPythonD.a ../../bin/libvtkGraphicsPythonD.a 
../../bin/libvtkPVServerCommonPythonD.a 
../../bin/libvtkPVServerCommonCS.a ../../bin/libvtkPVServerCommon.a 
../../bin/libvtkInfovisCS.a ../../bin/libvtkInfovis.a 
../../bin/libvtkWidgets.a ../../bin/libvtklibxml2.a 
../../bin/libvtkalglib.a ../../bin/libKWCommon.a ../../bin/libhdf5.a 
-Wl,-Bdynamic -lm ../../bin/libvtkPVCommandOptions.a 
../../bin/libvtkHybridCS.a ../../bin/libvtkHybrid.a 
../../bin/libvtkParallelCS.a ../../bin/libvtkParallel.a 
../../bin/libvtkexoIIc.a ../../bin/libVPIC.a ../../bin/libCosmo.a 
/opt/cray/mpt/5.0.0/xt/seastar/mpich2-gnu/lib/libmpich.a 
../../bin/libvtkRenderingCS.a ../../bin/libvtkRendering.a 
/sw/xt/osmesa/7.5.1/cnl2.2_gnu4.4.4/lib64/libOSMesa.a 
../../bin/libvtkftgl.a ../../bin/libvtkfreetype.a 
../../bin/libvtkGenericFilteringCS.a ../../bin/libvtkGenericFiltering.a 
../../bin/libvtkGraphicsCS.a ../../bin/libvtkGraphics.a 
../../bin/libvtkverdict.a ../../bin/libvtkImagingCS.a 
../../bin/libvtkImaging.a ../../bin/libvtkIOCS.a 
../../bin/libvtkFilteringCS.a ../../bin/libvtkCommonCS.a 
../../bin/libvtkClientServer.a ../../bin/libvtkIOPythonD.a 
../../bin/libvtkIO.a ../../bin/libvtkDICOMParser.a 
../../bin/libvtkNetCDF_cxx.a ../../bin/libvtkNetCDF.a 
../../bin/libvtkmetaio.a ../../bin/libvtksqlite.a ../../bin/libvtkpng.a 
../../bin/libvtktiff.a ../../bin/libvtkzlib.a ../../bin/libvtkjpeg.a 
../../bin/libvtkexpat.a ../../bin/libvtkFilteringPythonD.a 
../../bin/libvtkFiltering.a ../../bin/libvtkCommonPythonD.a 
../../bin/libvtkCommon.a ../../bin/libvtksys.a -ldl -lm -lpthread 
-lmpich -lrt -lsma -lportals -lpmi -lm -lc -lc_p -lfftw3 -lfftw3f






More information about the ParaView mailing list