[Dune] (no subject)
Markus Blatt
markus at dr-blatt.de
Tue Apr 28 19:00:14 CEST 2015
From: Markus Blatt <markus at dr-blatt.de>
To: Aleksejs Fomins <aleksejs.fomins at lspr.ch>
Cc: Dune <dune at dune-project.org>
Bcc:
Subject: Re: [Dune] Problem with linking Boost
Reply-To: Markus Blatt <markus at dr-blatt.de>
In-Reply-To: <553FAA74.6000004 at lspr.ch>
Hi Aleksej
On Tue, Apr 28, 2015 at 05:42:44PM +0200, Aleksejs Fomins wrote:
> Linking CXX executable hades3ddgfd
> CMakeFiles/hades3ddgfd.dir/hades3ddgfd.cc.o: In function `__static_initialization_and_destruction_0(int, int)':
> hades3ddgfd.cc:(.text+0x8454): undefined reference to `boost::system::generic_category()'
> ----------------------------------------------------------------------------------------------------------------
>
> Note:
> * Boost is found by the dunecontrol.
> * add_dune_boost_flags(hades3ddgfd) is done for this file in the CMake file
> * Finding Boost is performed in the lowest-level CMake file
>
> find_package(Boost)
> if(Boost_FOUND)
> include_directories(${Boost_INCLUDE_DIRS})
> else(Boost_FOUND)
>
> * -lboost_system is specified in the opts file.
-lboost_system needs to have the library in its search path. This
might not be the case here.
If you need libraries the correct CMake way of doing it is to
explicitly list the library as component to find_package.
find_package(Boost COMPONENTS system)
Hopefully it ends up int BOOST_LIBRARIES and is then added with
add_boost_flags automatically. If not, yell!
BTW: You will get a comprehensive help page for any
find_package(<package>) with "cmake --help-module Find<Package>.
Just try cmake --help-module FindBoost!
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
More information about the Dune
mailing list