[Dune-devel] SOCIS 2014: build system issue

Markus Blatt markus at dr-blatt.de
Wed Jul 9 14:49:44 CEST 2014


Hi,


On Wed, Jul 09, 2014 at 11:59:58AM +0000, Agnese, Marco wrote:
> I have a small issue when I compile my projects using thread. More precisely my codes compile correct but the thread library is not linked. 
> 


The precise error message would be helpful here. You are probably
missing -lpthread in the LDFLAGS.

> I have compiled the module both with the option -std=C++1 and -pthread. A workaround to fix this linking issue is to append the the flag 
> 
> -Wl,--no-as-needed 
> 
> at the end of the linking command.
> 
> I think that the build system should produce a Makefile which links correctly the -pthread library without using this workaround. I do not know how to modify it therefore I need your help.
> 
> This workaround it is not necessary when compiling a plain c++ code. Indeed it is sufficient g++ -std=C++11 -pthread -o test test.cc. I don't understand why it is necessary this additional flag with DUNE.
> 

You should use the build system to query for pthread support
http://www.gnu.org/software/autoconf-archive/ax_pthread.html and use
the corresponding flags for the compilation. I guess more details
(e.g. how to require this test to be run in a dune module) can found in
the build system howto.

Markus
-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20140709/61d75402/attachment.sig>


More information about the Dune-devel mailing list