[aspect-devel] [deal.II] Re: deal.ii problem during aspect compile, static libs

Wolfgang Bangerth bangerth at math.tamu.edu
Thu Jul 10 10:47:02 PDT 2014


Thorsten,
did you make progress on installing everything?


> Trying to compile shared objects using your approach (or my earlier attempts,
> I think it was using the right compilers?), brings me back to errors like the
> one below with trilinos. It does appears that there's something funny with the
> local mpich2 install and how it calls the linker, but we haven't experienced
> these problems with other software, I think.
>
>
> Linking CXX shared library libteuchoscore.so
> /usr/bin/ld: /usr/usc/mpich2/1.5/lib/libmpich.a(allreduce.o): relocation
> R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared obj
> ect; recompile with -fPIC
> /usr/usc/mpich2/1.5/lib/libmpich.a: could not read symbols: Bad value
> collect2: error: ld returned 1 exit status

This happens when you try to link a shared library (here: libteuchoscore.so) 
and the command line contains not just regular object files that have been 
compiled with -fPIC (a flag you need when you want to work with shared 
libraries) but also object files that have been compiled without. In your 
case, I suspect that the command line contains the flag
   -lmpich
which may have been added by mpiCC internally. If there were both
   /usr/usc/mpich2/1.5/lib/libmpich.so
and
   /usr/usc/mpich2/1.5/lib/libmpich.a
then linking a shared library would imply taking the former but if the former 
does not exist, then this means that the linker will try to take apart the 
static archive (i.e., the libmpich.a file) into its individual object files 
and then link them into libteuchoscore.so -- which will produce the error 
message you see. Can you say which of these files you have?


I have seen clusters where the MPI installation (or, more generally, all 
compilers) only support static linking. I see why system administrators want 
to do this, but this is a design that is fundamentally broken and only 
supports applications like Citcom that are essentially self contained. All 
more modern pieces of software (including the PETSc branch of Citcom, or 
ASPECT for that matter) will depend on multiple external libraries for which 
installation of static version is exceedingly difficult. If this is what the 
system requires, I have found that the only option is to ask system 
administrators to help with installation of the dependencies.

Best
  Wolfgang

-- 
------------------------------------------------------------------------
Wolfgang Bangerth               email:            bangerth at math.tamu.edu
                                 www: http://www.math.tamu.edu/~bangerth/



More information about the Aspect-devel mailing list