From d6db3a52e5c84de70453f17fd9a7a3479987978a Mon Sep 17 00:00:00 2001 From: lib Date: Mon, 3 Jul 2023 14:02:41 -0500 Subject: [PATCH] Compile with static libraries with -fPIC for static linkage with Python .so --- cmake-exodus | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake-exodus b/cmake-exodus index 09f9ff6..cec8cac 100755 --- a/cmake-exodus +++ b/cmake-exodus @@ -73,8 +73,8 @@ then CXX=g++ CC=gcc FC=gfortran - CFLAGS="-Wall -Wunused -pedantic -std=c11" - CXXFLAGS="-Wall -Wunused -pedantic" + CFLAGS="-Wall -Wunused -pedantic -std=c11 -fPIC" + CXXFLAGS="-Wall -Wunused -pedantic -fPIC" fi if [ "$COMPILER" == "gnubrew" ] @@ -83,8 +83,8 @@ then CXX=g++-${VER} CC=gcc-${VER} FC=gfortran-${VER} - CFLAGS="-Wall -Wunused -pedantic -std=c11" - CXXFLAGS="-Wall -Wunused -pedantic" + CFLAGS="-Wall -Wunused -pedantic -std=c11 -fPIC" + CXXFLAGS="-Wall -Wunused -pedantic -fPIC" fi if [ "$COMPILER" == "gnumacport" ] @@ -93,8 +93,8 @@ then CXX=g++-mp-${VER} CC=gcc-mp-${VER} FC=gfortran-mp-${VER} - CFLAGS="-Wall -Wunused -pedantic -std=c11" - CXXFLAGS="-Wall -Wunused -pedantic" + CFLAGS="-Wall -Wunused -pedantic -std=c11 -fPIC" + CXXFLAGS="-Wall -Wunused -pedantic -fPIC" fi if [ "$COMPILER" == "clangmacport" ] @@ -128,8 +128,8 @@ then CXX=icpc CC=icc FC=ifort - CFLAGS="-Wall -Wunused" - CXXFLAGS="-Wall -Wunused" + CFLAGS="-Wall -Wunused -fPIC" + CXXFLAGS="-Wall -Wunused -fPIC" fi # When building: "scan-build make -j8"