Dear Wenguo,

It looks like you’re linking deal.II, built as a shared library, against 
LAPACK, built as a static library. As the error message suggests, you’ll need 
to build LAPACK with the -fPIC flag in order to do this. As suggested here 
(https://stackoverflow.com/questions/18828730/lapack-linking-error-recompile-with-fpic
 
<https://stackoverflow.com/questions/18828730/lapack-linking-error-recompile-with-fpic>)
 you should make the following changes to make.inc when building LAPACK:

FORTRAN  = gfortran -m64 -fPIC
OPTS     = -O2 -m64 -fPIC
DRVOPTS  = $(OPTS)
NOOPT    = -O0 -m64 -fPIC
LOADER   = gfortran -m64 -fPIC

I hope that this helps you resolve your issue.
Best,
Jean-Paul

> On 23 Mar 2019, at 08:26, Zhu wenguo <[email protected]> wrote:
> 
> 
> Hello everyone,
> 
> I am installing deal ii -9.0.1 using recommended commands. and something went 
> wrong, the error message is as follow:
> has someone ever met this problem?
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> [ 81%] Building CXX object source/CMakeFiles/deal_II.dir/dummy.cc.o
> [ 81%] Linking CXX shared library ../lib/libdeal_II.so
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(spotrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'spotrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(sgetrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'sgetrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(dpotrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'dpotrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(dgetrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'dgetrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(zpotrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'zpotrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(sladiv.o): requires 
> dynamic R_X86_64_PC32 reloc against 'sladiv2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(dladiv.o): requires 
> dynamic R_X86_64_PC32 reloc against 'dladiv2_' which may overflow at runtime; 
> recompile with -fPIC
> collect2: error: ld returned 1 exit status
> source/CMakeFiles/deal_II.dir/build.make:751: recipe for target 
> 'lib/libdeal_II.so.9.0.1' failed
> make[2]: *** [lib/libdeal_II.so.9.0.1] Error 1
> CMakeFiles/Makefile2:871: recipe for target 
> 'source/CMakeFiles/deal_II.dir/all' failed
> make[1]: *** [source/CMakeFiles/deal_II.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs....
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(spotrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'spotrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(sgetrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'sgetrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(dpotrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'dpotrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(dgetrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'dgetrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(zpotrf2.o): requires 
> dynamic R_X86_64_PC32 reloc against 'zpotrf2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(sladiv.o): requires 
> dynamic R_X86_64_PC32 reloc against 'sladiv2_' which may overflow at runtime; 
> recompile with -fPIC
> /usr/bin/ld.gold: error: /usr/local/lib/liblapack.a(dladiv.o): requires 
> dynamic R_X86_64_PC32 reloc against 'dladiv2_' which may overflow at runtime; 
> recompile with -fPIC
> collect2: error: ld returned 1 exit status
> source/CMakeFiles/deal_II.g.dir/build.make:751: recipe for target 
> 'lib/libdeal_II.g.so.9.0.1' failed
> make[2]: *** [lib/libdeal_II.g.so.9.0.1] Error 1
> CMakeFiles/Makefile2:929: recipe for target 
> 'source/CMakeFiles/deal_II.g.dir/all' failed
> make[1]: *** [source/CMakeFiles/deal_II.g.dir/all] Error 2
> Makefile:129: recipe for target 'all' failed
> make: *** [all] Error 2
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> thank you!
> Wenguo.
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <https://groups.google.com/d/forum/dealii?hl=en>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to