[Trilinos-Users] Building with -fPIC flag

Bill Spotz wfspotz at sandia.gov
Fri Jul 29 12:27:50 MDT 2011


Chris,

Position independent code is associate with shared libraries.  I believe that if you configure with

    -D BUILD_SHARED_LIBS:BOOL=ON

then all of the libraries should be compiled properly for you.

-Bill

On Jul 29, 2011, at 11:14 AM, Christopher Parmer wrote:

> Hi All,
> 
> I'm linking my trilinos project with matlab and so I (er.. matlab mex files) need the libraries to be 'position independent' or compiled with the -fPIC flag. 
> 
> I tried rebuilding trilinos (via ccmake, make, make install) with -fPIC in CMAKE_CXX_FLAGS, (and later I added it to CMAKE_C_FLAGS, CMAKE_EXE_LINKER_FLAGS), but I get the same error with respect to the libaztecoo and a few other packages. However, my simple examples with Epetra CrsMatrices now work. 
> 
> Am I missing a flag somewhere? Or are some libraries not written to be 'position independent'?
> 
> Sorry if this is a simple question - I'm very new to linking and building large packages. 
> 
> Thanks,
> 
> Chris
> 
> -- 
> (802) 343-5897
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users

** Bill Spotz                                              **
** Sandia National Laboratories  Voice: (505)845-0170      **
** P.O. Box 5800                 Fax:   (505)284-0154      **
** Albuquerque, NM 87185-0370    Email: wfspotz at sandia.gov **




More information about the Trilinos-Users mailing list