← Back to team overview

dolfin team mailing list archive

Re: More build problems

 

On Wed, March 12, 2008 Anders Logg wrote:
> I'm experiencing some more build problems, this time on a 64-bit
> machine. It works on my 32-bit laptop but not on my 64-bit desktop.
>
> The problem is when linking against libcommon in SCOTCH. This was
> compiled with -fPIC. DOLFIN also seems to be compiled with -fPIC.
>
> Here's part of the error message:
>
> /usr/local/bin/mpicxx -o dolfin/libdolfin.so -shared [...]
> /x86_64-linux-gnu/4.1.3 -L/usr/lib -L/lib -L/usr/lib
> -L/usr/lib/gcc/x86_64-linux-gnu/3.4.6 -L/usr/lib -L/usr/lib
> -L/usr/local/lib -L/usr/lib/atlas -L/usr/lib -L/usr/lib -lxml2
> -lpetscts -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec
> -lpetsc -lHYPRE -lX11 -lumfpack -lamd -llapack -lblas -lmpi_f77 -lg2c
> -lm -lmpi_cxx -lstdc++ -lmpi -lopen-rte -lopen-pal -lnsl -lutil
> -lgcc_s -lpthread -ldl -lscotch -lscotcherrcom -lcommon -lblas
> -llapack -lumfpack -lamd -lgts -lgthread-2.0 -lrt -lgmodule-2.0 -ldl
> -lglib-2.0
> /usr/bin/ld: /usr/local/lib/libcommon.a(common_error.o):
> relocation R_X86_64_32 against `a local symbol' can not be used when
> making a shared object; recompile with -fPIC
> /usr/local/lib/libcommon.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> scons: *** [dolfin/libdolfin.so] Error 1
> scons: building terminated because of errors.

I got a similar error when i tried to build DOLFIN with SCOTCH on my
64-bits installation of Ubuntu in VMware:

/usr/bin/mpicxx -o dolfin/libdolfin.so -shared [...]
ux-gnu/4.1.3 -L/usr/lib -L/lib -L/usr/lib
-L/usr/lib/gcc/x86_64-linux-gnu/3.4.6 -L/usr/lib -L/usr/lib -L/usr/lib
-L/usr/lib/atlas -L/usr/lib -L/usr/lib -lxml2 -lpetscts -lpetscsnes
-lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lX11 -lumfpack -lamd
-lsuperlu -llapack-3 -lblas-3 -lg2c -lm -lmpich -lpthread -lrt -lgcc_s
-ldl -lscotch -lscotcherr -lblas -llapack -lumfpack -lamd -lgts
-lgthread-2.0 -lrt -lgmodule-2.0 -ldl -lglib-2.0
/usr/bin/ld: /usr/lib/libscotch.a(library_graph.o): relocation R_X86_64_32
against `a local symbol' can not be used when making a shared object;
recompile with -fPIC
/usr/lib/libscotch.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
scons: *** [dolfin/libdolfin.so] Error 1
scons: building terminated because of errors.

Adding -fPIC to both CFLAGS and LDFLAGS and building SCOTCH again fixed
the problem for me.

Johannes




Follow ups

References