Skip to content

Commit 9582bca

Browse files
committed
patch cmake issue in scotch
1 parent 4306ec2 commit 9582bca

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ cd ../../
648648
# Scotch (includes METIS compatibility library)
649649
git clone -b $SCOTCH_VERSION --depth 1 https://gitlab.inria.fr/scotch/scotch.git
650650
cd scotch
651+
git apply --ignore-space-change --ignore-whitespace --verbose ../scotch.diff
651652
mkdir build
652653
cd build
653654
cmake -GNinja .. \

scotch.diff

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2+
index 6c84b7b..07f7677 100644
3+
--- a/src/CMakeLists.txt
4+
+++ b/src/CMakeLists.txt
5+
@@ -129,7 +129,8 @@ endif()
6+
7+
# Detect and remove GCC _FORTIFY_SOURCE
8+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
9+
- execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -E -Og -dM -x c ${dev_null} OUTPUT_VARIABLE gcc_macros)
10+
+ separate_arguments(C_FLAGS_LIST UNIX_COMMAND "${CMAKE_C_FLAGS}")
11+
+ execute_process(COMMAND ${CMAKE_C_COMPILER} ${C_FLAGS_LIST} -E -Og -dM -x c ${dev_null} OUTPUT_VARIABLE gcc_macros)
12+
string(FIND ${gcc_macros} "_FORTIFY_SOURCE" fortify)
13+
if(fortify GREATER -1)
14+
message(WARNING "GCC _FORTIFY_SOURCE is known to cause problem with Scotch and has been disabled")

0 commit comments

Comments
 (0)