[Dune-devel] SOCIS 2014: build system issue

Agnese, Marco m.agnese13 at imperial.ac.uk
Thu Jul 10 15:17:48 CEST 2014


The system is Ubuntu-Server 14.04, gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1).
The workaround works; you need to compile like this

g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../../..  -I../../.. -I/usr/local_machine/openmpi-1.6.5/include -pthread -DMPIPP_H -DENABLE_MPI=1   -O3 -Wall -DNDEBUG -funroll-loops -finline-functions -pthread -fomit-frame-pointer -ffast-math -mfpmath=sse -msse3 -MT threadstest-threadstest.o -MD -MP -MF .deps/threadstest-threadstest.Tpo -c -o threadstest-threadstest.o `test -f 'threadstest.cc' || echo './'`threadstest.cc
> mv -f .deps/threadstest-threadstest.Tpo .deps/threadstest-threadstest.Po
> /bin/bash ../../../libtool  --tag=CXX   --mode=link g++ -std=c++11  -O3 -Wall -DNDEBUG -funroll-loops -finline-functions -pthread -fomit-frame-pointer -ffast-math -mfpmath=sse -msse3    -o threadstest threadstest-threadstest.o -pthread -L/usr/local_machine/openmpi-1.6.5/lib -lmpi -ldl -lm -Wl,--export-dynamic -lrt -lnsl -lutil -lm -ldl ../../../lib/libdunecommon.la  -lm -Wl,--no-as-needed
libtool: link: g++ -std=c++11 -O3 -Wall -DNDEBUG -funroll-loops -finline-functions -pthread -fomit-frame-pointer -ffast-math -mfpmath=sse -msse3 -o threadstest threadstest-threadstest.o -pthread -Wl,--export-dynamic  -L/usr/local_machine/openmpi-1.6.5/lib /usr/local_machine/openmpi-1.6.5/lib/libmpi.so -lrt -lnsl -lutil -ldl ../../../lib/.libs/libdunecommon.a -llapack -lblas -lgfortran -lquadmath -lm -pthread -Wl,-rpath -Wl,/usr/local_machine/openmpi-1.6.5/lib -Wl,-rpath -Wl,/usr/local_machine/openmpi-1.6.5/lib

If I compile a project without dune, it works perfectly (also the linking). Therefore I suppose that there is some wrong flags in the makefile produced by dune.

Cheers,
Marco.
________________________________________
From: Jö Fahlke [jorrit at jorrit.de]
Sent: Thursday, July 10, 2014 9:49 AM
To: Agnese, Marco
Cc: dune-devel at dune-project.org
Subject: Re: [Dune-devel] SOCIS 2014: build system issue

Am Wed,  9. Jul 2014, 23:51:20 +0000 schrieb Agnese, Marco:
> Hi,
> I am using autotools and the -pthread flag is presents also at the linking phase.
>
> The precise error message is
>
> terminate called after throwing an instance of 'std::system_error'
>   what():  Enable multithreading to use std::thread: Operation not permitted
> Aborted (core dumped)

Note to other people reading this: it is indeed possible that this is an issue
with a missing threading lib.  On one system that I worked with, libstdc++
contained stubs for the threading functions, which would be replaced when a
threading library was loaded.

> Looking the dynamic dependencies, the libthread one is missing.
>
> The full compile command is
>
> g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../../..  -I../../.. -I/usr/local_machine/openmpi-1.6.5/include -pthread -DMPIPP_H -DENABLE_MPI=1   -O3 -Wall -DNDEBUG -funroll-loops -finline-functions -pthread -fomit-frame-pointer -ffast-math -mfpmath=sse -msse3 -MT threadstest-threadstest.o -MD -MP -MF .deps/threadstest-threadstest.Tpo -c -o threadstest-threadstest.o `test -f 'threadstest.cc' || echo './'`threadstest.cc
> mv -f .deps/threadstest-threadstest.Tpo .deps/threadstest-threadstest.Po
> /bin/bash ../../../libtool  --tag=CXX   --mode=link g++ -std=c++11  -O3 -Wall -DNDEBUG -funroll-loops -finline-functions -pthread -fomit-frame-pointer -ffast-math -mfpmath=sse -msse3    -o threadstest threadstest-threadstest.o -pthread -L/usr/local_machine/openmpi-1.6.5/lib -lmpi -ldl -lm -Wl,--export-dynamic -lrt -lnsl -lutil -lm -ldl ../../../lib/libdunecommon.la  -lm
> libtool: link: g++ -std=c++11 -O3 -Wall -DNDEBUG -funroll-loops -finline-functions -pthread -fomit-frame-pointer -ffast-math -mfpmath=sse -msse3 -o threadstest threadstest-threadstest.o -pthread -Wl,--export-dynamic  -L/usr/local_machine/openmpi-1.6.5/lib /usr/local_machine/openmpi-1.6.5/lib/libmpi.so -lrt -lnsl -lutil -ldl ../../../lib/.libs/libdunecommon.a -llapack -lblas -lgfortran -lquadmath -lm -pthread -Wl,-rpath -Wl,/usr/local_machine/openmpi-1.6.5/lib -Wl,-rpath -Wl,/usr/local_machine/openmpi-1.6.5/lib

Hmm, that does not match my experience with the matter.  What kind of system
is this?  OSX, per chance?

> Is it possible to merge this macro of EXADUNE in dune-common to have the possibility to link the thread library properly just adding the  $(STD_THREAD_LDFLAGS) automake-rule?

That is my plan.  However, I currently have a more pressing matter (PDESoft)
at hand, so it probably won't happen before 2014-07-21.  And it won't help you
anyway, since all the macro does is add -pthread.  Apparently there is
something more required in your case which we'll have to figure out.

Do I understand correctly that you have a way to work around that until then?

Regards,
Jö.

--
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

If God had intended Man to Smoke, He would have set him on Fire.
-- fortune



More information about the Dune-devel mailing list