[CMake] Link to exe but not shared
John Biddiscombe
biddisco at cscs.ch
Thu Feb 15 07:25:48 EST 2007
I have a problem with MPI on a new cluster...
To link all *.so shared libraries I need to set my MPI extra libraries to
MPI_EXTRA_LIBRARY
/opt/hpmpi/lib/linux_amd64/libmpio.so;/opt/hpmpi/lib/linux_amd64/libmpi.so;
but when linking executables, I need to add
/opt/hpmpi/lib/linux_amd64/libmpiCC.a
the problem being that there is no dynamic build of libmpiCC and if I
include this in the link line for the shared libs, I get a ton of errors
about fPIC incimpatibility etc.
As it turns out, the lib is only required at the final link to an
Executable.
Option 1) Add another MPI_EXE_LIBRARY to cmake and then modify all the
cmakelists files in paraview etc to use the usual MPI_LIBRARIES on
shared, and MPI_LIBRARIES+MPI_EXE_LIBRARY on exes
Option 2). Is there some way of specifying a library, but only for
inclusion with exes but not shared libs (or vice versa).
thanks
JB
--
John Biddiscombe, email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
More information about the CMake
mailing list