Skip to content

Commit

Permalink
sci-libs/libgeodecomp: Fix boost detection
Browse files Browse the repository at this point in the history
When hpx is installed libgeodecomp tries to use the boost libraries detected by
hpx. That doesn't work, because the wrong variables are referenced and hpx uses
fewer boost libraries than libgeodecomp.

So remove that and use the system boost libraries in all cases.

Closes: https://bugs.gentoo.org/686294
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
  • Loading branch information
shifty91 committed Mar 14, 2020
1 parent eb13869 commit bad6820
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
92 changes: 92 additions & 0 deletions sci-libs/libgeodecomp/files/libgeodecomp-0.4.0-boost.patch
@@ -0,0 +1,92 @@
From f964fc68b745cc200a1df9e442a2dd8e908f0248 Mon Sep 17 00:00:00 2001
From: Kurt Kanzenbach <kurt@kmk-computers.de>
Date: Sun, 8 Mar 2020 10:53:53 +0100
Subject: [PATCH] cmake: Disable use of HPX boost libraries

First of all the wrong variables are referenced. Second HPX doesn't include
date_time which is needed by the tracing writer. So that does not work.

Use the system boost libraries.

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
src/CMakeLists.txt | 60 +++++++++++++++++-----------------------------
1 file changed, 22 insertions(+), 38 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2870446108d0..f1a15abb0161 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -2,47 +2,31 @@

find_package(HPX)

-if(NOT HPX_FOUND)
- if(NOT DEFINED BOOST_ROOT)
- # deduce Boost location from environment (e.g. on woody.rrze.uni-erlangen.de)
- set(BOOST_ENV_LIBDIR "$ENV{BOOST_LIBDIR}")
- if(BOOST_ENV_LIBDIR)
- set(Boost_NO_SYSTEM_PATHS true)
- set(BOOST_ROOT "$ENV{BOOST_LIBDIR}/../")
- set(Boost_LIBRARY_DIRS "$ENV{BOOST_LIBDIR}")
- set(Boost_INCLUDE_DIR "$ENV{BOOST_INCDIR}")
- endif()
+if(NOT DEFINED BOOST_ROOT)
+ # deduce Boost location from environment (e.g. on woody.rrze.uni-erlangen.de)
+ set(BOOST_ENV_LIBDIR "$ENV{BOOST_LIBDIR}")
+ if(BOOST_ENV_LIBDIR)
+ set(Boost_NO_SYSTEM_PATHS true)
+ set(BOOST_ROOT "$ENV{BOOST_LIBDIR}/../")
+ set(Boost_LIBRARY_DIRS "$ENV{BOOST_LIBDIR}")
+ set(Boost_INCLUDE_DIR "$ENV{BOOST_INCDIR}")
endif()
-
- # mandatory Boost libs go into the first line, optional ones into
- # their own call. This avoids leaving out any available lib during
- # link time. The reason for this ugly multi-stage discovery is the
- # following: since CMAKE 2.8.11 each call to find_package(Boost...)
- # will reset Boost_LIBRARIES.
- find_package(Boost REQUIRED COMPONENTS date_time filesystem system)
- set(ALL_BOOST_LIBS "${Boost_LIBRARIES}")
- find_package(Boost COMPONENTS serialization)
- set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
- find_package(Boost COMPONENTS thread)
- set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
- find_package(Boost COMPONENTS move)
- set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
-else()
- # If HPX was found, we use the Boost libraries found by HPX
- set(ALL_BOOST_LIBS
- ${HPX_BOOST_DATE_TIME_LIBRARY}
- ${HPX_BOOST_FILESYSTEM_LIBRARY}
- ${HPX_BOOST_SYSTEM_LIBRARY}
- ${HPX_BOOST_SERIALIZATION_LIBRARY}
- ${HPX_BOOST_THREAD_LIBRARY}
- )
- set(Boost_DATE_TIME_FOUND true)
- set(Boost_FILESYSTEM_FOUND true)
- set(Boost_SYSTEM_FOUND true)
- set(Boost_SERIALIZATION_FOUND true)
- set(Boost_THREAD_FOUND true)
endif()

+# mandatory Boost libs go into the first line, optional ones into
+# their own call. This avoids leaving out any available lib during
+# link time. The reason for this ugly multi-stage discovery is the
+# following: since CMAKE 2.8.11 each call to find_package(Boost...)
+# will reset Boost_LIBRARIES.
+find_package(Boost REQUIRED COMPONENTS date_time filesystem system)
+set(ALL_BOOST_LIBS "${Boost_LIBRARIES}")
+find_package(Boost COMPONENTS serialization)
+set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
+find_package(Boost COMPONENTS thread)
+set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
+find_package(Boost COMPONENTS move)
+set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
+
find_package(Boost COMPONENTS mpi)
set(Boost_MPI_LIBRARIES "${Boost_LIBRARIES}")

--
2.24.1

1 change: 1 addition & 0 deletions sci-libs/libgeodecomp/libgeodecomp-0.4.0-r1.ebuild
Expand Up @@ -37,6 +37,7 @@ PATCHES=(
"${FILESDIR}/${P}-scotch.patch"
"${FILESDIR}/${P}-libdir.patch"
"${FILESDIR}/${P}-lfa.patch"
"${FILESDIR}/${P}-boost.patch"
)

src_prepare() {
Expand Down

0 comments on commit bad6820

Please sign in to comment.