Commit 6798c748 authored by jenkins's avatar jenkins

Fixing installation on OSX

parent 496b5893
......@@ -181,7 +181,7 @@ else
fi
./script/install_OPENBLAS.sh $i_dir $compiler_opt
LAPACK_installed=1
blas_options="--with-blas=-L/home/i-bird/OPENBLAS/lib/ -lopenblas"
blas_options="--with-blas=-L$i_dir/OPENBLAS/lib/ -lopenblas"
elif [ $conf_err -eq 205 ]; then
## First we install openblas, we ignore default lapack
## this SuiteSparse is programmed to use libopenblas
......@@ -192,7 +192,7 @@ else
fi
./script/install_OPENBLAS.sh $i_dir $compiler_opt
LAPACK_installed=1
blas_options="--with-blas=-L/home/i-bird/OPENBLAS/lib/ -lopenblas"
blas_options="--with-blas=-L$i_dir/OPENBLAS/lib/ -lopenblas"
## Then suite sparse
echo "SuiteSparse not found try to install"
......
......@@ -66,9 +66,28 @@ AC_ARG_WITH(suitesparse,
SUITESPARSE_INCLUDE="-I$with_suitesparse/include"
])
#
# Platform specific setup
#
#############################
AC_CANONICAL_HOST
# Check for which host we are on and setup a few things
# specifically based on the host
case $host_os in
darwin* )
RT_LIB=""
;;
linux*)
RT_LIB="-lrt"
;;
*)
RT_LIB="-lrt"
;;
esac
# First, check SUITESPARSE_LIBS environment variable
if test "x$SUITESPARSE_LIBS" != x; then
save_LIBS="$LIBS"; LIBS="$SUITESPARSE_LIBS -lumfpack -lm -lsuitesparseconfig -lrt"
save_LIBS="$LIBS"; LIBS="$SUITESPARSE_LIBS -lumfpack -lm -lsuitesparseconfig $RT_LIB"
AC_MSG_CHECKING([for umf_l_malloc])
AC_TRY_LINK_FUNC(umf_l_malloc, [ax_suitesparse_ok=yes
SUITESPARSE_LIB="$SUITESPARSE_LIBS -lamd -lbtf -lcamd -lccolamd -lcholmod -lcolamd -lcxsparse -lklu -ldl -lrbio -lspqr -lsuitesparseconfig -lumfpack"], [SUITRSPARSE_LIBS=""])
......
openfpm_numerics @ 62456127
Subproject commit 4ebf01b5555842abda2fc91a8dd364b32023f239
Subproject commit 624561273e0e2750890cb8c0b87b0d1119ffb956
#! /bin/bash
source script/discover_os
discover_os
# check if the directory $1/SUITESPARSE exist
if [ -d "$1/SUITESPARSE" ]; then
......@@ -18,14 +22,36 @@ cd SuiteSparse
# configuration
sed -i "/INSTALL_LIB\s=\s\/usr\/local\/lib/c\INSTALL_LIB = $1\/SUITESPARSE\/lib" SuiteSparse_config/SuiteSparse_config.mk
sed -i "/INSTALL_INCLUDE\s=\s\/usr\/local\/include/c\INSTALL_INCLUDE = $1\/SUITESPARSE\/include" SuiteSparse_config/SuiteSparse_config.mk
sed -i "/\sLAPACK\s=\s-llapack/c\LAPACK = " SuiteSparse_config/SuiteSparse_config.mk
sed -i "/\sBLAS\s=\s\-lopenblas/c\BLAS = -L$1/OPENBLAS/lib -lopenblas" SuiteSparse_config/SuiteSparse_config.mk
if [ x"$platform"==x"osx" ]; then
# installation for OSX
sed -i "" -e "s|INSTALL_LIB = \/usr\/local\/lib|INSTALL_LIB = "$1"\/SUITESPARSE\/lib|" SuiteSparse_config/SuiteSparse_config_Mac.mk
sed -i "" -e "s|INSTALL_INCLUDE = \/usr\/local\/include|INSTALL_INCLUDE = "$1"\/SUITESPARSE\/include|" SuiteSparse_config/SuiteSparse_config_Mac.mk
sed -i "" -e "s| LAPACK = -llapack|LAPACK = |" SuiteSparse_config/SuiteSparse_config_Mac.mk
sed -i "" -e "s| BLAS = -lopenblas|BLAS = -L"$1"/OPENBLAS/lib -lopenblas|" SuiteSparse_config/SuiteSparse_config_Mac.mk
### Overwrite SuiteSparse_config.mk
rm SuiteSparse_config/SuiteSparse_config.mk
mv SuiteSparse_config/SuiteSparse_config_Mac.mk SuiteSparse_config/SuiteSparse_config.mk
else
# Installation for linux
sed -i "/INSTALL_LIB\s=\s\/usr\/local\/lib/c\INSTALL_LIB = $1\/SUITESPARSE\/lib" SuiteSparse_config/SuiteSparse_config.mk
sed -i "/INSTALL_INCLUDE\s=\s\/usr\/local\/include/c\INSTALL_INCLUDE = $1\/SUITESPARSE\/include" SuiteSparse_config/SuiteSparse_config.mk
sed -i "/\sLAPACK\s=\s-llapack/c\LAPACK = " SuiteSparse_config/SuiteSparse_config.mk
sed -i "/\sBLAS\s=\s\-lopenblas/c\BLAS = -L$1/OPENBLAS/lib -lopenblas" SuiteSparse_config/SuiteSparse_config.mk
fi
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1/OPENBLAS/lib"
make
if [ $? != 0 ]; then
echo "Fail to compile SuiteSparse"
exit 1
fi
mkdir $1/SUITESPARSE
mkdir $1/SUITESPARSE/lib
mkdir $1/SUITESPARSE/include
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment