getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to build?


From: edgar
Subject: Re: How to build?
Date: Thu, 15 Apr 2021 02:51:25 +0000
User-agent: Roundcube Webmail

On 2021-04-13 20:03, edgar wrote:
Hello.

I would like to know if somebody can help me, please. I got to the
part of compiling, but running the tests throws an error which I
haven't been able to figure out. Let me know the information that you
need. Below is the last part of what `make check' tells me. Thanks.

     CXXLD    dynamic_tas
    /usr/bin/ld: /usr/lib64/libsmumps.so: undefined reference to
`mumps_sol_get_npiv_liell_ipos_'
 ... removed content ...

After some days, I think I'm getting closer. The Makefile for tests uses libtool, and I was able to link with mpicxx alone with the addition of -shared. The expanded command from the Makefile for the dynamic_tas target is:

/bin/sh ../libtool --tag=CXX --mode=link /usr/bin/mpicxx -fPIC -fopenmp -O3 -march=amdfam10 -mtune=generic -O2 -D_FORTIFY_SOURCE=2 -O3 -std=c++14 -L/usr/lib -L/usr/lib/openmpi -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0 -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o dynamic_tas dynamic_tas.o ../src/libgetfem.la -lm -lsmumps -ldmumps -lcmumps -lzmumps -lqhull -llapack -lmpi_cxx -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,-rpath -Wl,/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0 -lmpi -lpthread -lmetis -lsuperlu -lesmumps -lptscotch -lptscotcherr -lscotch -lscotcherr -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lblas -lmetis

(I added some libraries by means of the LIBS environment variable [1]). By replacing that with this:

/usr/bin/mpicxx -shared -fPIC -fopenmp -O3 -march=amdfam10 -mtune=generic -O2 -D_FORTIFY_SOURCE=2 -O3 -std=c++14 -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z -Wl,relro -Wl,-z -Wl,now -o dynamic_tas dynamic_tas.o -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,-rpath -Wl,/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0 -L/usr/lib -L/usr/lib/openmpi -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0 -Wl,--enable-new-dtags -lmpi_cxx ../src/.libs/libgetfem.so -lm -lqhull -llapack -lmpi_cxx -lmpi -lpthread -lsuperlu -lesmumps -lptscotch -lptscotcherr -lscotch -lscotcherr -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lblas -lmetis

, dynamic_tas was successfully created. I will now try and see if I can apply the same logic to other targets (of the tests/Makefile)

Aaaaand that's the penguin!

References:
[1] https://lists.nongnu.org/archive/html/getfem-users/2017-01/msg00011.html

Acknowledgements
[2] Linking: undefined reference to: https://riptutorial.com/c/example/12342/undefined-reference-errors-when-linking [3] Use ldd to check for statically linked libraries: https://github.com/JuliaSmoothOptimizers/MUMPS.jl/issues/34#issuecomment-466133965
[4] Use shared libraries: https://stackoverflow.com/a/24492288



reply via email to

[Prev in Thread] Current Thread [Next in Thread]