Skip to content
Snippets Groups Projects
Commit 4584cbd3 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Enable LAPACK detection configuration

parent bfde602f
No related branches found
No related tags found
No related merge requests found
AUTOMAKE_OPTIONS=subdir-objects AUTOMAKE_OPTIONS=subdir-objects
LDADD=libnptm/libnptm.la -L/usr/lib64 $(HDF5_LDFLAGS) LDADD=libnptm/libnptm.la -L/usr/lib64 ${HDF5_LDFLAGS} ${LAPACK_LDFLAGS}
lib_LTLIBRARIES=libnptm/libnptm.la lib_LTLIBRARIES=libnptm/libnptm.la
libnptm_libnptm_la_SOURCES=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp ../src/libnptm/types.cpp libnptm_libnptm_la_SOURCES=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp ../src/libnptm/types.cpp
bin_PROGRAMS=cluster/edfb_clu cluster/clu cluster/np_cluster sphere/edfb_sph sphere/sph sphere/np_sphere trapping/frfme trapping/lffft trapping/np_trapping bin_PROGRAMS=cluster/edfb_clu cluster/clu cluster/np_cluster sphere/edfb_sph sphere/sph sphere/np_sphere trapping/frfme trapping/lffft trapping/np_trapping
......
# CAPABILITY TESTING MACROS # CAPABILITY TESTING MACROS
m4_define( m4_define(
[M4_HDF5_LIB], [M4_HDF5_LIB],
[cat > nptm_test_hdf5.cpp <<EOF [
cat > nptm_test_hdf5.cpp <<EOF
#include <hdf5.h> #include <hdf5.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {
hid_t file_id = 0; hid_t file_id = 0;
...@@ -14,9 +15,25 @@ EOF ...@@ -14,9 +15,25 @@ EOF
rm nptm_test_hdf5.cpp rm nptm_test_hdf5.cpp
if test "x$TEST_HDF5_LIB" = "x0"; then if test "x$TEST_HDF5_LIB" = "x0"; then
rm nptm_test_hdf5 rm nptm_test_hdf5
fi] fi
]
) )
m4_define(
[M4_DETECT_LAPACK],
[
LAPACK_ROOT=$MKLROOT
if test "x$LAPACK_ROOT" != "x"; then
export LAPACK_INCLUDE=$(MKLROOT)/include
export LAPACK_LIB=$(MKLROOT)/lib
export LAPACK_LIBRARY="-Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl"
else
export LAPACK_INCLUDE=/usr/include
export LAPACK_LIB=/lib/x86_64-linux-gnu
export LAPACK_LIBRARY="-llapacke64"
fi
]
)
# END CAPABILITY TESTING MACROS # END CAPABILITY TESTING MACROS
# autoconf setup initialization # autoconf setup initialization
...@@ -35,62 +52,71 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign]) ...@@ -35,62 +52,71 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_PROG_AR AM_PROG_AR
AC_ARG_ENABLE( AC_ARG_ENABLE(
[mpi], [mpi],
[AS_HELP_STRING([--enable-mpi], [use MPI if available (default is yes)])], [AS_HELP_STRING([--enable-mpi], [use MPI if available [default=yes]])],
[ [
if test "x$enableval" = "xno"; then if test "x$enableval" = "xno"; then
if test "x$F77" = "xmpif90"; then if test "x$F77" = "xmpif90"; then
gfortran --version > /dev/null gfortran --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export F77=gfortran AC_SUBST([F77], [gfortran])
fi fi
fi fi
if test "x$F77" = "xmpif90"; then if test "x$F77" = "xmpif90"; then
f77 --version > /dev/null f77 --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export F77=f77 #export F77=f77
AC_SUBST([F77], [f77])
fi fi
fi fi
if test "x$CXX" = "xmpicxx"; then if test "x$CXX" = "xmpicxx"; then
g++ --version > /dev/null g++ --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=g++ #export CXX=g++
AC_SUBST([CXX], [g++])
fi fi
fi fi
if test "x$CXX" = "xmpicxx"; then if test "x$CXX" = "xmpicxx"; then
clang --version > /dev/null clang --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=clang #export CXX=clang
AC_SUBST([CXX], [clang])
fi fi
fi fi
if test "x$F77" = "x"; then if test "x$F77" = "x"; then
gfortran --version > /dev/null gfortran --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export F77=gfortran #export F77=gfortran
AC_SUBST([F77], [gfortran])
fi fi
fi fi
if test "x$F77" = "x"; then if test "x$F77" = "x"; then
f77 --version > /dev/null f77 --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export F77=f77 #export F77=f77
AC_SUBST([F77], [f77])
fi fi
fi fi
if test "x$CXX" = "x"; then if test "x$CXX" = "x"; then
g++ --version > /dev/null g++ --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=g++ #export CXX=g++
AC_SUBST([CXX], [g++])
fi fi
fi fi
if test "x$CXX" = "x"; then if test "x$CXX" = "x"; then
clang --version > /dev/null clang --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=clang #export CXX=clang
AC_SUBST([CXX], [clang])
fi fi
fi fi
else else
mpicxx --version > /dev/null mpicxx --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=mpicxx #export CXX=mpicxx
export F77=mpif90 #export F77=mpif90
AC_SUBST([CXX], [mpicxx])
AC_SUBST([F77], [mpif90])
else else
AC_MSG_ERROR(["MPI was enabled, but no MPI compiler was found!"]) AC_MSG_ERROR(["MPI was enabled, but no MPI compiler was found!"])
fi fi
...@@ -100,28 +126,30 @@ AC_ARG_ENABLE( ...@@ -100,28 +126,30 @@ AC_ARG_ENABLE(
if test "x$CXX" = "x"; then if test "x$CXX" = "x"; then
mpicxx --version > /dev/null mpicxx --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=mpicxx #export CXX=mpicxx
export F77=mpif90 #export F77=mpif90
AC_SUBST([CXX], [mpicxx])
AC_SUBST([F77], [mpif90])
fi fi
fi fi
if test "x$CXX" = "x"; then if test "x$CXX" = "x"; then
g++ --version > /dev/null g++ --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=g++ #export CXX=g++
AC_SUBST([CXX], [g++])
fi fi
fi fi
if test "x$CXX" = "x"; then if test "x$CXX" = "x"; then
clang --version > /dev/null clang --version > /dev/null
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
export CXX=clang #export CXX=clang
AC_SUBST([CXX], [clang])
fi fi
fi fi
] ]
) )
AC_SUBST([CXX]) AC_PROG_CXX([$CXX])
AC_PROG_CXX(CXX) AC_PROG_F77([$F77])
AC_SUBST([F77])
AC_PROG_F77([$F77 mpif90 gfortran f77])
# Libtool initialization # Libtool initialization
LT_INIT LT_INIT
...@@ -129,17 +157,14 @@ LT_INIT ...@@ -129,17 +157,14 @@ LT_INIT
# Environment setup # Environment setup
AS_IF( AS_IF(
[test "x$HDF5_INCLUDE" = "x"], [test "x$HDF5_INCLUDE" = "x"],
[export HDF5_INCLUDE=/usr/include/hdf5/serial], [AC_SUBST([HDF5_INCLUDE], ["/usr/include/hdf5/serial"])],
[AC_MSG_NOTICE(["HDF5_INCLUDE=$HDF5_INCLUDE"])] [AC_MSG_NOTICE([HDF5_INCLUDE=$(HDF5_INCLUDE)])]
) )
AS_IF( AS_IF(
[test "x$HDF5_LIB" = "x"], [test "x$HDF5_LIB" = "x"],
[export HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial], [AC_SUBST([HDF5_LIB], ["/usr/lib/x86_64-linux-gnu/hdf5/serial"])],
[AC_MSG_NOTICE(["HDF5_LIB=$HDF5_LIB"])] [AC_MSG_NOTICE([HDF5_LIB=$(HDF5_LIB)])]
) )
FFLAGS="-std=legacy -O3"
CXXFLAGS="-O3 -ggdb -Wno-format-contains-nul -I $HDF5_INCLUDE"
SUBDIRS="cluster libnptm sphere testing trapping"
# Check for required headers # Check for required headers
AC_CHECK_HEADER( AC_CHECK_HEADER(
...@@ -152,12 +177,65 @@ AC_CHECK_HEADER( ...@@ -152,12 +177,65 @@ AC_CHECK_HEADER(
M4_HDF5_LIB M4_HDF5_LIB
AS_IF( AS_IF(
[test "x$TEST_HDF5_LIB" = "x0"], [test "x$TEST_HDF5_LIB" = "x0"],
[export HDF5_LDFLAGS="-L${HDF5_LIB} -lhdf5"], [AC_SUBST([HDF5_LDFLAGS], ["-L${HDF5_LIB} -lhdf5"])],
[AC_MSG_ERROR(["HDF5 library not found!"])] [AC_MSG_ERROR(["HDF5 library not found!"])]
) )
AC_SUBST([HDF5_LDFLAGS])
# Configure the optional features # Configure the optional features
M4_DETECT_LAPACK
AS_IF(
[test "x$LAPACK_LIBRARY" != "x"],
[AC_MSG_NOTICE([LAPACK detected])],
[AC_MSG_NOTICE([No LAPACK found])]
)
AC_ARG_ENABLE(
[openmp],
[AS_HELP_STRING([--enable-openmp], [enable OpneMP multi-threading [default=yes]])],
[
if test "x$enableval" != "xno"; then
AC_SUBST([OMPFLAGS], ["-fopenmp"])
fi
],
[
AC_SUBST([OMPFLAGS], ["-fopenmp"])
]
)
AC_ARG_WITH(
[lapack],
[AS_HELP_STRING([--with-lapack], [use LAPACK @<:@default=check@:>@])],
[
if test "x$withval" = "xno"; then
AC_SUBST([LAPACK_FLAGS], [""])
AC_SUBST([LAPACK_LDFLAGS], [""])
fi
],
[
if test "x$LAPACK_INCLUDE" != "x"; then
AC_SUBST([LAPACK_FLAGS], ["-DUSE_LAPACK -DLAPACK_ILP64 -DUSE_ILP64 -I${LAPACK_INCLUDE}"])
AC_SUBST([LAPACK_LDFLAGS], ["-L${LAPACK_LIB} ${LAPACK_LIBRARY}"])
fi
]
)
AC_ARG_WITH(
[magma],
[AS_HELP_STRING([--with-magma], [use MAGMA @<:@default=check@:>@])],
[],
[]
)
AC_ARG_ENABLE(
[ilp64],
[AS_HELP_STRING([--enable-ilp64], [use MAGMA @<:@default=check@:>@])],
[],
[]
)
FFLAGS="-std=legacy -O3"
CXXFLAGS="-O3 -ggdb -Wno-format-contains-nul -I$HDF5_INCLUDE $OMPFLAGS $LAPACK_FLAGS"
SUBDIRS="cluster libnptm sphere testing trapping"
# Send output to Makefiles # Send output to Makefiles
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment