-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BLD: Update and simplify configure and make.
- Loading branch information
1 parent
bbafbc5
commit 4e3d84d
Showing
3 changed files
with
106 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
PYW_SRC="./src/py$HEADER_PREFIX" | ||
LIB_INCLUDE_DIR="../include" | ||
LIB_BUILD_DIR="../build" | ||
|
||
EXT=".so" | ||
|
||
LIBS=("libgfortran.5" "libquadmath.0" "libgcc_s.1.1") | ||
LIBSWINDOWS=("libwinpthread") | ||
|
||
ROOTLINUX=/usr/lib/ | ||
ROOTDARWIN=/usr/local/opt/gcc/lib/gcc/current | ||
ROOTWINDOWS=/C/msys64/mingw64/bin | ||
ROOT=$ROOTLINUX | ||
|
||
export PYW_SRC | ||
echo "PYW_SRC=" $PYW_SRC | ||
|
||
export LIB_INCLUDE_DIR | ||
echo "LIB_INCLUDE_DIR=" $LIB_INCLUDE_DIR | ||
|
||
export LIB_BUILD_DIR | ||
echo "LIB_BUILD_DIR=" $LIB_BUILD_DIR | ||
|
||
|
||
if [ "$PLATFORM" = "darwin" ]; then | ||
ROOT=$ROOTDARWIN | ||
EXT=".dylib" | ||
fi | ||
|
||
if [ "$PLATFORM" = "windows" ]; then | ||
ROOT=$ROOTWINDOWS | ||
EXT=".dll" | ||
LIBS+=$LIBSWINDOWS | ||
fi | ||
|
||
if ! [ -z $1 ]; then | ||
ROOT=$1 | ||
fi | ||
|
||
# LIBRARY | ||
echo "$LIBNAME folder: $LIB_BUILD_DIR" | ||
fpath=$LIB_BUILD_DIR/$LIBNAME$EXT | ||
if [ -f $fpath ]; then | ||
echo -n " $fpath exists." | ||
cp $fpath $PYW_SRC | ||
echo " Copied." | ||
if [ "$PLATFORM" = "windows" ]; then | ||
cp $fpath.a $PYW_SRC | ||
fi | ||
else | ||
echo " $fpath does not exist." | ||
fi | ||
|
||
|
||
# C HEADERS | ||
echo "Include folder: $LIB_INCLUDE_DIR" | ||
for header in "$LIB_INCLUDE_DIR"/*; do | ||
echo -n " $header." | ||
cp $LIB_INCLUDE_DIR/$header $PYW_SRC | ||
echo " Copied." | ||
done | ||
|
||
|
||
# GFORTRAN LIBRARIES | ||
echo "Gfortran libraries: $ROOT" | ||
for lib in ${LIBS[@]}; do | ||
fpath=$ROOT/$lib$EXT | ||
if [ -f "$fpath" ]; then | ||
echo -n " $fpath exists." | ||
cp "$fpath" $PYW_SRC | ||
if [ "$PLATFORM" = "darwin" ]; then | ||
install_name_tool -change "$fpath" "@loader_path/$lib$EXT" $PYW_SRC/$LIBNAME$EXT | ||
echo " Copied. Changed rpath in $LIBNAME$EXT." | ||
else | ||
echo " Copied." | ||
fi | ||
else | ||
echo " $fpath does not exist." | ||
fi | ||
done | ||
|
||
|
||
if [ "$PLATFORM" = "darwin" ]; then | ||
echo "Check rpaths:" | ||
otool -L $PYW_SRC/$LIBNAME$EXT | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters