Skip to content

Commit

Permalink
Fix OSX configuration (broken LAPACK)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Feb 9, 2016
1 parent cf5d61e commit 0a4684b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -101,7 +101,7 @@ lis-clean:

.PRECIOUS: Makefile

Makefile: Makefile.in config.status common/m4/*.m4
Makefile: Makefile.in config.status common/m4/*.m4 m4/*.m4
./config.status

config.status: configure
Expand Down
12 changes: 10 additions & 2 deletions m4/lapack.m4
Expand Up @@ -14,6 +14,14 @@ AC_DEFUN([OMC_AC_LAPACK], [
AC_LANG_PUSH([C])
AC_MSG_CHECKING([LAPACK/BLAS flags])
OLDLIBS="$LIBS"
LAPACK_LINKER_FLAGS=""
for flag in -Wl,--no-undefined; do
LIBS="$LAPACK_LINKER_FLAGS $flag"
AC_TRY_LINK([], [return 0;], [LAPACK_LINKER_FLAGS="$LIBS"],[])
done
LIBS=""
if test "$LD_LAPACK" = "auto"; then
LD_LAPACK=""
if test "$1" = "static" || test "$2" = "static"; then
Expand All @@ -26,7 +34,7 @@ AC_DEFUN([OMC_AC_LAPACK], [
for flags in "-lopenblas" "`$PKGCONFIG lapack`" "`$PKGCONFIG lapack blas`" "-llapack -lblas" "-llapack -lblas -lm -latlas"; do
for extra in "" "-lgfortran" "-lgfortran -lquadmath"; do
THESELIBS="$LD_LAPACK_STATIC_HEAD $flags $extra $LD_LAPACK_STATIC_TAIL"
LIBS="-shared $THESELIBS -Wl,--no-undefined"
LIBS="-shared $THESELIBS $LAPACK_LINKER_FLAGS"
AC_LINK_IFELSE([AC_LANG_CALL([], [dgesv_])],[
AC_LINK_IFELSE([AC_LANG_CALL([], [dswap_])],[LD_LAPACK="$THESELIBS"],[])
],[])
Expand All @@ -41,7 +49,7 @@ AC_DEFUN([OMC_AC_LAPACK], [
for extra_dynamic in "-lm" "-lpthread" "-lm -lpthread"; do
THESELIBS="$LD_LAPACK_STATIC_HEAD $flags $LD_LAPACK_STATIC_TAIL $extra_dynamic"
LIBS="-shared $THESELIBS -Wl,--no-undefined"
LIBS="-shared $THESELIBS $LAPACK_LINKER_FLAGS"
AC_LINK_IFELSE([AC_LANG_CALL([], [dgesv_])],[
AC_LINK_IFELSE([AC_LANG_CALL([], [dswap_])],[LD_LAPACK="$THESELIBS"],[])
],[])
Expand Down

0 comments on commit 0a4684b

Please sign in to comment.