2015-05-22 09:33:15 +01:00
|
|
|
AC_PREREQ([2.63])
|
2017-05-08 18:20:04 +01:00
|
|
|
AC_INIT([Grid], [0.7.0], [https://github.com/paboyle/Grid], [Grid])
|
2016-09-23 11:05:36 +01:00
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_TARGET
|
2017-05-08 18:20:04 +01:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects 1.13])
|
2017-05-05 19:54:38 +01:00
|
|
|
AM_EXTRA_RECURSIVE_TARGETS([tests bench])
|
2015-03-04 04:13:07 +00:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2018-08-28 15:00:40 +01:00
|
|
|
AC_CONFIG_SRCDIR([Grid/Grid.h])
|
2021-02-17 13:24:15 +00:00
|
|
|
AC_CONFIG_HEADERS([Grid/Config.h],[[$SED_INPLACE -e 's|PACKAGE_|GRID_|' -e 's|[[:space:]]PACKAGE[[:space:]]| GRID_PACKAGE |' -e 's|[[:space:]]VERSION[[:space:]]| GRID_PACKAGE_VERSION |' Grid/Config.h]],
|
|
|
|
[if test x"$host_os" == x"${host_os#darwin}" ; then]
|
|
|
|
[SED_INPLACE="sed -i"]
|
|
|
|
[else]
|
|
|
|
[SED_INPLACE="sed -i .bak"]
|
|
|
|
[fi])
|
2015-05-18 09:15:14 +01:00
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2016-11-10 18:44:36 +00:00
|
|
|
################ Get git info
|
|
|
|
#AC_REVISION([m4_esyscmd_s([./scripts/configure.commit])])
|
|
|
|
|
2017-07-26 12:08:51 +01:00
|
|
|
################ Set flags
|
|
|
|
# do not move!
|
2018-03-04 15:51:47 +00:00
|
|
|
AC_ARG_ENABLE([debug],[AC_HELP_STRING([--enable-debug=yes|no], [enable debug compilation ])],
|
|
|
|
[ac_DEBUG=${enable_debug}], [ac_DEBUG=no])
|
|
|
|
case ${ac_DEBUG} in
|
|
|
|
yes)
|
2018-03-08 13:01:24 +00:00
|
|
|
CXXFLAGS="-g $CXXFLAGS "
|
2018-03-04 15:51:47 +00:00
|
|
|
;;
|
|
|
|
no)
|
2018-03-08 13:01:24 +00:00
|
|
|
CXXFLAGS="-O3 $CXXFLAGS "
|
2018-03-04 15:51:47 +00:00
|
|
|
;;
|
|
|
|
*)
|
2018-03-08 13:01:24 +00:00
|
|
|
CXXFLAGS="-O3 $CXXFLAGS "
|
2018-03-04 15:51:47 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2017-07-26 12:08:51 +01:00
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### Checks for programs
|
2015-03-04 04:13:07 +00:00
|
|
|
AC_PROG_CXX
|
2016-09-16 15:25:49 +01:00
|
|
|
AC_PROG_RANLIB
|
2016-08-24 15:05:00 +01:00
|
|
|
|
2016-10-31 16:31:27 +00:00
|
|
|
############### Get compiler informations
|
|
|
|
AC_LANG([C++])
|
|
|
|
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
|
|
|
|
AX_COMPILER_VENDOR
|
|
|
|
AC_DEFINE_UNQUOTED([CXX_COMP_VENDOR],["$ax_cv_cxx_compiler_vendor"],
|
|
|
|
[vendor of C++ compiler that will compile the code])
|
|
|
|
AX_GXX_VERSION
|
|
|
|
AC_DEFINE_UNQUOTED([GXX_VERSION],["$GXX_VERSION"],
|
|
|
|
[version of g++ that will compile the code])
|
2016-08-24 15:05:00 +01:00
|
|
|
|
2017-05-06 15:20:25 +01:00
|
|
|
|
2016-10-31 16:31:27 +00:00
|
|
|
############### Checks for typedefs, structures, and compiler characteristics
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT64_T
|
2016-08-24 15:05:00 +01:00
|
|
|
|
2017-05-05 12:47:17 +01:00
|
|
|
############### OpenMP
|
2016-10-31 16:31:27 +00:00
|
|
|
AC_OPENMP
|
|
|
|
ac_openmp=no
|
2020-09-23 09:13:50 +01:00
|
|
|
if test "${ac_cv_prog_cxx_openmp}X" != "noX"; then
|
|
|
|
ac_openmp=yes
|
|
|
|
AM_CXXFLAGS="$OPENMP_CXXFLAGS $AM_CXXFLAGS"
|
|
|
|
AM_LDFLAGS="$OPENMP_CXXFLAGS $AM_LDFLAGS"
|
|
|
|
fi
|
2018-01-27 00:05:11 +00:00
|
|
|
|
2016-08-24 15:05:00 +01:00
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### Checks for header files
|
2015-03-04 04:13:07 +00:00
|
|
|
AC_CHECK_HEADERS(stdint.h)
|
2015-05-15 11:52:11 +01:00
|
|
|
AC_CHECK_HEADERS(mm_malloc.h)
|
2015-03-04 04:13:07 +00:00
|
|
|
AC_CHECK_HEADERS(malloc/malloc.h)
|
|
|
|
AC_CHECK_HEADERS(malloc.h)
|
2015-04-23 07:51:15 +01:00
|
|
|
AC_CHECK_HEADERS(endian.h)
|
2015-11-06 10:31:05 +00:00
|
|
|
AC_CHECK_HEADERS(execinfo.h)
|
2015-05-01 10:57:33 +01:00
|
|
|
AC_CHECK_DECLS([ntohll],[], [], [[#include <arpa/inet.h>]])
|
|
|
|
AC_CHECK_DECLS([be64toh],[], [], [[#include <arpa/inet.h>]])
|
2015-03-04 04:13:07 +00:00
|
|
|
|
2017-07-27 11:15:09 +01:00
|
|
|
############## Standard libraries
|
|
|
|
AC_CHECK_LIB([m],[cos])
|
|
|
|
AC_CHECK_LIB([stdc++],[abort])
|
|
|
|
|
2016-10-31 16:31:27 +00:00
|
|
|
############### GMP and MPFR
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_ARG_WITH([gmp],
|
|
|
|
[AS_HELP_STRING([--with-gmp=prefix],
|
|
|
|
[try this for a non-standard install prefix of the GMP library])],
|
2016-08-03 11:39:20 +01:00
|
|
|
[AM_CXXFLAGS="-I$with_gmp/include $AM_CXXFLAGS"]
|
2016-10-05 14:57:20 +01:00
|
|
|
[AM_LDFLAGS="-L$with_gmp/lib $AM_LDFLAGS"])
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_ARG_WITH([mpfr],
|
|
|
|
[AS_HELP_STRING([--with-mpfr=prefix],
|
|
|
|
[try this for a non-standard install prefix of the MPFR library])],
|
2016-08-03 11:39:20 +01:00
|
|
|
[AM_CXXFLAGS="-I$with_mpfr/include $AM_CXXFLAGS"]
|
|
|
|
[AM_LDFLAGS="-L$with_mpfr/lib $AM_LDFLAGS"])
|
2016-08-24 15:05:00 +01:00
|
|
|
|
2017-05-05 12:47:17 +01:00
|
|
|
############### FFTW3
|
|
|
|
AC_ARG_WITH([fftw],
|
2016-10-31 16:31:27 +00:00
|
|
|
[AS_HELP_STRING([--with-fftw=prefix],
|
|
|
|
[try this for a non-standard install prefix of the FFTW3 library])],
|
|
|
|
[AM_CXXFLAGS="-I$with_fftw/include $AM_CXXFLAGS"]
|
|
|
|
[AM_LDFLAGS="-L$with_fftw/lib $AM_LDFLAGS"])
|
|
|
|
|
2017-02-21 11:58:50 +00:00
|
|
|
############### LIME
|
|
|
|
AC_ARG_WITH([lime],
|
|
|
|
[AS_HELP_STRING([--with-lime=prefix],
|
|
|
|
[try this for a non-standard install prefix of the LIME library])],
|
|
|
|
[AM_CXXFLAGS="-I$with_lime/include $AM_CXXFLAGS"]
|
|
|
|
[AM_LDFLAGS="-L$with_lime/lib $AM_LDFLAGS"])
|
|
|
|
|
2018-08-10 16:36:11 +01:00
|
|
|
############### OpenSSL
|
|
|
|
AC_ARG_WITH([openssl],
|
|
|
|
[AS_HELP_STRING([--with-openssl=prefix],
|
|
|
|
[try this for a non-standard install prefix of the OpenSSL library])],
|
|
|
|
[AM_CXXFLAGS="-I$with_openssl/include $AM_CXXFLAGS"]
|
|
|
|
[AM_LDFLAGS="-L$with_openssl/lib $AM_LDFLAGS"])
|
|
|
|
|
2017-05-05 12:47:17 +01:00
|
|
|
############### lapack
|
2016-08-02 17:26:54 +01:00
|
|
|
AC_ARG_ENABLE([lapack],
|
2017-05-05 12:47:17 +01:00
|
|
|
[AC_HELP_STRING([--enable-lapack=yes|no|prefix], [enable LAPACK])],
|
2016-10-31 16:31:27 +00:00
|
|
|
[ac_LAPACK=${enable_lapack}], [ac_LAPACK=no])
|
2016-08-22 16:21:01 +01:00
|
|
|
|
2016-08-02 17:26:54 +01:00
|
|
|
case ${ac_LAPACK} in
|
|
|
|
no)
|
|
|
|
;;
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([USE_LAPACK],[1],[use LAPACK]);;
|
|
|
|
*)
|
2016-08-03 11:39:20 +01:00
|
|
|
AM_CXXFLAGS="-I$ac_LAPACK/include $AM_CXXFLAGS"
|
|
|
|
AM_LDFLAGS="-L$ac_LAPACK/lib $AM_LDFLAGS"
|
2016-10-31 16:31:27 +00:00
|
|
|
AC_DEFINE([USE_LAPACK],[1],[use LAPACK]);;
|
2016-08-02 17:26:54 +01:00
|
|
|
esac
|
2016-07-30 17:53:18 +01:00
|
|
|
|
2020-12-03 11:47:11 +00:00
|
|
|
############### fermions
|
|
|
|
AC_ARG_ENABLE([fermion-reps],
|
2021-02-22 14:17:07 +00:00
|
|
|
[AC_HELP_STRING([--enable-fermion-reps=yes|no], [enable extra fermion representation support])],
|
2020-12-03 11:47:11 +00:00
|
|
|
[ac_FERMION_REPS=${enable_fermion_reps}], [ac_FERMION_REPS=yes])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(BUILD_FERMION_REPS, [ test "${ac_FERMION_REPS}X" == "yesX" ])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([gparity],
|
|
|
|
[AC_HELP_STRING([--enable-gparity=yes|no], [enable G-parity support])],
|
|
|
|
[ac_GPARITY=${enable_gparity}], [ac_GPARITY=yes])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(BUILD_GPARITY, [ test "${ac_GPARITY}X" == "yesX" ])
|
2021-03-03 19:21:43 +00:00
|
|
|
|
|
|
|
AC_ARG_ENABLE([zmobius],
|
|
|
|
[AC_HELP_STRING([--enable-zmobius=yes|no], [enable Zmobius support])],
|
|
|
|
[ac_ZMOBIUS=${enable_zmobius}], [ac_ZMOBIUS=yes])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(BUILD_ZMOBIUS, [ test "${ac_ZMOBIUS}X" == "yesX" ])
|
|
|
|
|
|
|
|
|
2020-12-03 11:47:11 +00:00
|
|
|
case ${ac_FERMION_REPS} in
|
|
|
|
yes) AC_DEFINE([ENABLE_FERMION_REPS],[1],[non QCD fermion reps]);;
|
|
|
|
esac
|
|
|
|
case ${ac_GPARITY} in
|
|
|
|
yes) AC_DEFINE([ENABLE_GPARITY],[1],[fermion actions with GPARITY BCs]);;
|
|
|
|
esac
|
2021-03-03 19:21:43 +00:00
|
|
|
case ${ac_ZMOBIUS} in
|
|
|
|
yes) AC_DEFINE([ENABLE_ZMOBIUS],[1],[Zmobius fermion actions]);;
|
|
|
|
esac
|
2020-10-07 18:07:00 +01:00
|
|
|
############### Nc
|
|
|
|
AC_ARG_ENABLE([Nc],
|
|
|
|
[AC_HELP_STRING([--enable-Nc=2|3|4], [enable number of colours])],
|
|
|
|
[ac_Nc=${enable_Nc}], [ac_Nc=3])
|
|
|
|
|
|
|
|
case ${ac_Nc} in
|
|
|
|
2)
|
2020-10-08 16:31:24 +01:00
|
|
|
AC_DEFINE([Config_Nc],[2],[Gauge group Nc]);;
|
2020-10-07 18:07:00 +01:00
|
|
|
3)
|
2020-10-08 16:31:24 +01:00
|
|
|
AC_DEFINE([Config_Nc],[3],[Gauge group Nc]);;
|
2020-10-07 18:07:00 +01:00
|
|
|
4)
|
|
|
|
AC_DEFINE([Config_Nc],[4],[Gauge group Nc]);;
|
|
|
|
5)
|
|
|
|
AC_DEFINE([Config_Nc],[5],[Gauge group Nc]);;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR(["Unsupport gauge group choice Nc = ${ac_Nc}"]);;
|
|
|
|
esac
|
|
|
|
|
2017-04-13 11:55:24 +01:00
|
|
|
############### FP16 conversions
|
2017-04-20 15:30:52 +01:00
|
|
|
AC_ARG_ENABLE([sfw-fp16],
|
2017-05-05 12:47:17 +01:00
|
|
|
[AC_HELP_STRING([--enable-sfw-fp16=yes|no], [enable software fp16 comms])],
|
2017-04-20 15:30:52 +01:00
|
|
|
[ac_SFW_FP16=${enable_sfw_fp16}], [ac_SFW_FP16=yes])
|
|
|
|
case ${ac_SFW_FP16} in
|
2017-04-13 11:55:24 +01:00
|
|
|
yes)
|
2017-04-20 15:30:52 +01:00
|
|
|
AC_DEFINE([SFW_FP16],[1],[software conversion to fp16]);;
|
|
|
|
no);;
|
2017-04-13 11:55:24 +01:00
|
|
|
*)
|
2017-04-20 15:30:52 +01:00
|
|
|
AC_MSG_ERROR(["SFW FP16 option not supported ${ac_SFW_FP16}"]);;
|
2017-04-13 11:55:24 +01:00
|
|
|
esac
|
|
|
|
|
2020-11-13 03:11:03 +00:00
|
|
|
############### Default to accelerator cshift, but revert to host if UCX is buggy or other reasons
|
|
|
|
AC_ARG_ENABLE([accelerator-cshift],
|
|
|
|
[AC_HELP_STRING([--enable-accelerator-cshift=yes|no], [run cshift on the device])],
|
|
|
|
[ac_ACC_CSHIFT=${enable_accelerator_cshift}], [ac_ACC_CSHIFT=yes])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([ucx-buggy],
|
|
|
|
[AC_HELP_STRING([--enable-ucx-buggy=yes|no], [enable workaround for UCX device buffer bugs])],
|
|
|
|
[ac_UCXBUGGY=${enable_ucx_buggy}], [ac_UCXBUGGY=no])
|
|
|
|
|
|
|
|
case ${ac_UCXBUGGY} in
|
2019-10-31 15:46:09 +00:00
|
|
|
yes)
|
2020-11-13 03:11:03 +00:00
|
|
|
ac_ACC_CSHIFT=no;;
|
|
|
|
*);;
|
2019-10-31 15:46:09 +00:00
|
|
|
esac
|
|
|
|
|
2020-11-13 03:11:03 +00:00
|
|
|
case ${ac_ACC_CSHIFT} in
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([ACCELERATOR_CSHIFT],[1],[ UCX device buffer bugs are not present]);;
|
|
|
|
*);;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2020-05-17 21:34:25 +01:00
|
|
|
############### SYCL/CUDA/HIP/none
|
2020-05-10 10:28:09 +01:00
|
|
|
AC_ARG_ENABLE([accelerator],
|
|
|
|
[AC_HELP_STRING([--enable-accelerator=cuda|sycl|hip|none], [enable none,cuda,sycl,hip acceleration])],
|
|
|
|
[ac_ACCELERATOR=${enable_accelerator}], [ac_ACCELERATOR=none])
|
|
|
|
case ${ac_ACCELERATOR} in
|
|
|
|
cuda)
|
|
|
|
echo CUDA acceleration
|
2020-09-04 01:29:26 +01:00
|
|
|
LIBS="${LIBS} -lcuda"
|
2020-05-10 10:28:09 +01:00
|
|
|
AC_DEFINE([GRID_CUDA],[1],[Use CUDA offload]);;
|
|
|
|
sycl)
|
|
|
|
echo SYCL acceleration
|
2020-05-05 19:13:27 +01:00
|
|
|
AC_DEFINE([GRID_SYCL],[1],[Use SYCL offload]);;
|
2020-05-10 10:28:09 +01:00
|
|
|
hip)
|
|
|
|
echo HIP acceleration
|
|
|
|
AC_DEFINE([GRID_HIP],[1],[Use HIP offload]);;
|
|
|
|
none)
|
2020-11-13 03:11:03 +00:00
|
|
|
echo NO acceleration ;;
|
|
|
|
no)
|
|
|
|
echo NO acceleration ;;
|
2020-05-05 19:13:27 +01:00
|
|
|
*)
|
2020-05-10 10:28:09 +01:00
|
|
|
AC_MSG_ERROR(["Acceleration not suppoorted ${ac_ACCELERATOR}"]);;
|
2020-05-05 19:13:27 +01:00
|
|
|
esac
|
|
|
|
|
2020-05-17 21:34:25 +01:00
|
|
|
############### UNIFIED MEMORY
|
|
|
|
AC_ARG_ENABLE([unified],
|
|
|
|
[AC_HELP_STRING([--enable-unified=yes|no], [enable unified address space for accelerator loops])],
|
|
|
|
[ac_UNIFIED=${enable_unified}], [ac_UNIFIED=yes])
|
|
|
|
case ${ac_UNIFIED} in
|
|
|
|
yes)
|
|
|
|
echo Unified memory for accelerator loops
|
|
|
|
AC_DEFINE([GRID_UVM],[1],[Use unified address space]);;
|
|
|
|
no)
|
|
|
|
echo Manual memory copy for accelerator loops;;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR(["Unified virtual memory option not suppoorted ${ac_UNIFIED}"]);;
|
|
|
|
esac
|
|
|
|
|
2018-11-19 17:21:53 +00:00
|
|
|
############### Intel libraries
|
2016-10-31 16:31:27 +00:00
|
|
|
AC_ARG_ENABLE([mkl],
|
|
|
|
[AC_HELP_STRING([--enable-mkl=yes|no|prefix], [enable Intel MKL for LAPACK & FFTW])],
|
|
|
|
[ac_MKL=${enable_mkl}], [ac_MKL=no])
|
2018-11-19 17:21:53 +00:00
|
|
|
AC_ARG_ENABLE([ipp],
|
|
|
|
[AC_HELP_STRING([--enable-ipp=yes|no|prefix], [enable Intel IPP for fast CRC32C])],
|
2020-03-27 17:23:29 +00:00
|
|
|
[ac_IPP=${enable_ipp}], [ac_IPP=no])
|
2016-10-31 16:31:27 +00:00
|
|
|
|
|
|
|
case ${ac_MKL} in
|
|
|
|
no)
|
|
|
|
;;
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([USE_MKL], [1], [Define to 1 if you use the Intel MKL]);;
|
|
|
|
*)
|
|
|
|
AM_CXXFLAGS="-I$ac_MKL/include $AM_CXXFLAGS"
|
|
|
|
AM_LDFLAGS="-L$ac_MKL/lib $AM_LDFLAGS"
|
|
|
|
AC_DEFINE([USE_MKL], [1], [Define to 1 if you use the Intel MKL]);;
|
2016-08-02 17:26:54 +01:00
|
|
|
esac
|
2016-07-30 17:53:18 +01:00
|
|
|
|
2018-11-19 17:21:53 +00:00
|
|
|
case ${ac_IPP} in
|
|
|
|
no)
|
|
|
|
;;
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([USE_IPP], [1], [Define to 1 if you use the Intel IPP]);;
|
|
|
|
*)
|
|
|
|
AM_CXXFLAGS="-I$ac_IPP/include $AM_CXXFLAGS"
|
|
|
|
AM_LDFLAGS="-L$ac_IPP/lib $AM_LDFLAGS"
|
|
|
|
AC_DEFINE([USE_IPP], [1], [Define to 1 if you use the Intel IPP]);;
|
|
|
|
esac
|
|
|
|
|
2017-01-18 00:21:18 +00:00
|
|
|
############### HDF5
|
|
|
|
AC_ARG_WITH([hdf5],
|
|
|
|
[AS_HELP_STRING([--with-hdf5=prefix],
|
|
|
|
[try this for a non-standard install prefix of the HDF5 library])],
|
|
|
|
[AM_CXXFLAGS="-I$with_hdf5/include $AM_CXXFLAGS"]
|
|
|
|
[AM_LDFLAGS="-L$with_hdf5/lib $AM_LDFLAGS"])
|
|
|
|
|
2016-10-12 11:45:22 +01:00
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### Checks for library functions
|
2016-08-03 11:39:20 +01:00
|
|
|
CXXFLAGS_CPY=$CXXFLAGS
|
|
|
|
LDFLAGS_CPY=$LDFLAGS
|
|
|
|
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
|
|
|
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
2016-10-31 16:31:27 +00:00
|
|
|
|
2015-03-04 04:13:07 +00:00
|
|
|
AC_CHECK_FUNCS([gettimeofday])
|
2016-08-03 15:06:45 +01:00
|
|
|
|
2016-10-31 16:31:27 +00:00
|
|
|
if test "${ac_MKL}x" != "nox"; then
|
|
|
|
AC_SEARCH_LIBS([mkl_set_interface_layer], [mkl_rt], [],
|
2018-11-19 17:21:53 +00:00
|
|
|
[AC_MSG_ERROR("Intel MKL enabled but library not found")])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "${ac_IPP}x" != "nox"; then
|
2020-04-23 10:27:03 +01:00
|
|
|
AC_SEARCH_LIBS([ippsCRC32C_8u], [ippdc],
|
2018-11-19 17:21:53 +00:00
|
|
|
[LIBS="${LIBS} -lippdc -lippvm -lipps -lippcore"],
|
|
|
|
[AC_MSG_ERROR("Intel IPP enabled but library not found")])
|
2016-08-02 17:26:54 +01:00
|
|
|
fi
|
2016-10-31 16:31:27 +00:00
|
|
|
|
|
|
|
AC_SEARCH_LIBS([__gmpf_init], [gmp],
|
2017-05-05 12:47:17 +01:00
|
|
|
[AC_SEARCH_LIBS([mpfr_init], [mpfr],
|
|
|
|
[AC_DEFINE([HAVE_LIBMPFR], [1],
|
2016-10-31 16:31:27 +00:00
|
|
|
[Define to 1 if you have the `MPFR' library])]
|
|
|
|
[have_mpfr=true], [AC_MSG_ERROR([MPFR library not found])])]
|
|
|
|
[AC_DEFINE([HAVE_LIBGMP], [1], [Define to 1 if you have the `GMP' library])]
|
|
|
|
[have_gmp=true])
|
|
|
|
|
|
|
|
if test "${ac_LAPACK}x" != "nox"; then
|
|
|
|
AC_SEARCH_LIBS([LAPACKE_sbdsdc], [lapack], [],
|
|
|
|
[AC_MSG_ERROR("LAPACK enabled but library not found")])
|
2017-05-05 12:47:17 +01:00
|
|
|
fi
|
2016-10-31 16:31:27 +00:00
|
|
|
|
|
|
|
AC_SEARCH_LIBS([fftw_execute], [fftw3],
|
|
|
|
[AC_SEARCH_LIBS([fftwf_execute], [fftw3f], [],
|
|
|
|
[AC_MSG_ERROR("single precision FFTW library not found")])]
|
|
|
|
[AC_DEFINE([HAVE_FFTW], [1], [Define to 1 if you have the `FFTW' library])]
|
|
|
|
[have_fftw=true])
|
|
|
|
|
2017-02-21 11:58:50 +00:00
|
|
|
AC_SEARCH_LIBS([limeCreateReader], [lime],
|
|
|
|
[AC_DEFINE([HAVE_LIME], [1], [Define to 1 if you have the `LIME' library])]
|
|
|
|
[have_lime=true],
|
2020-05-04 18:24:48 +01:00
|
|
|
[AC_MSG_WARN(LIME library was not found in your system.)])
|
2018-08-10 16:36:11 +01:00
|
|
|
|
|
|
|
AC_SEARCH_LIBS([SHA256_Init], [crypto],
|
|
|
|
[AC_DEFINE([HAVE_CRYPTO], [1], [Define to 1 if you have the `OpenSSL' library])]
|
|
|
|
[have_crypto=true],
|
|
|
|
[AC_MSG_ERROR(OpenSSL library was not found in your system.)])
|
|
|
|
AC_CHECK_HEADER([openssl/sha.h], [], [AC_MSG_ERROR(OpenSSL library found but without headers.)], [AC_INCLUDES_DEFAULT([])])
|
2017-02-21 11:58:50 +00:00
|
|
|
|
2017-06-13 12:00:23 +01:00
|
|
|
AC_SEARCH_LIBS([crc32], [z],
|
|
|
|
[AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have the `LIBZ' library])]
|
2017-07-11 14:15:08 +01:00
|
|
|
[have_zlib=true] [LIBS="${LIBS} -lz"],
|
2017-06-13 12:00:23 +01:00
|
|
|
[AC_MSG_ERROR(zlib library was not found in your system.)])
|
2017-02-21 11:58:50 +00:00
|
|
|
|
2017-07-11 14:15:08 +01:00
|
|
|
|
2017-01-18 00:21:18 +00:00
|
|
|
AC_SEARCH_LIBS([H5Fopen], [hdf5_cpp],
|
|
|
|
[AC_DEFINE([HAVE_HDF5], [1], [Define to 1 if you have the `HDF5' library])]
|
|
|
|
[have_hdf5=true]
|
|
|
|
[LIBS="${LIBS} -lhdf5"], [], [-lhdf5])
|
|
|
|
AM_CONDITIONAL(BUILD_HDF5, [ test "${have_hdf5}X" == "trueX" ])
|
|
|
|
|
2016-08-03 11:39:20 +01:00
|
|
|
CXXFLAGS=$CXXFLAGS_CPY
|
|
|
|
LDFLAGS=$LDFLAGS_CPY
|
2015-03-04 04:13:07 +00:00
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### SIMD instruction selection
|
2016-11-19 00:32:39 +00:00
|
|
|
AC_ARG_ENABLE([simd],[AC_HELP_STRING([--enable-simd=code],
|
|
|
|
[select SIMD target (cf. README.md)])], [ac_SIMD=${enable_simd}], [ac_SIMD=GEN])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([gen-simd-width],
|
|
|
|
[AS_HELP_STRING([--enable-gen-simd-width=size],
|
2019-11-21 20:02:10 +00:00
|
|
|
[size (in bytes) of the generic SIMD vectors (default: 64)])],
|
2016-11-19 00:32:39 +00:00
|
|
|
[ac_gen_simd_width=$enable_gen_simd_width],
|
2019-10-31 15:46:09 +00:00
|
|
|
[ac_gen_simd_width=64])
|
2016-07-30 17:53:18 +01:00
|
|
|
|
2018-04-12 17:32:57 +01:00
|
|
|
AC_ARG_ENABLE([gen-scalar],
|
|
|
|
[AS_HELP_STRING([--enable-gen-scalar=yes|no],
|
|
|
|
[enable generic scalar implementation])],
|
|
|
|
[ac_gen_scalar=$enable_gen_scalar],
|
|
|
|
[ac_gen_scalar=no])
|
|
|
|
|
|
|
|
case ${ac_gen_scalar} in
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([GENERIC_SCALAR],[1],[Use scalar data parallel loops])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2018-01-24 13:18:19 +00:00
|
|
|
##################### Compiler dependent choices
|
2020-04-29 15:37:11 +01:00
|
|
|
|
|
|
|
#Strip any optional compiler arguments from nvcc call (eg -ccbin) for compiler comparison
|
|
|
|
CXXBASE=${CXX}
|
|
|
|
CXXTEST=${CXX}
|
|
|
|
if echo "${CXX}" | grep -q "nvcc"; then
|
|
|
|
CXXTEST="nvcc"
|
2020-07-07 19:26:47 +01:00
|
|
|
fi
|
2020-04-29 15:37:11 +01:00
|
|
|
|
2020-07-07 19:26:47 +01:00
|
|
|
case ${CXXTEST} in
|
2020-04-23 10:27:03 +01:00
|
|
|
nvcc)
|
2018-06-13 19:55:30 +01:00
|
|
|
# CXX="nvcc -keep -v -x cu "
|
|
|
|
# CXXLD="nvcc -v -link"
|
2020-04-29 15:37:11 +01:00
|
|
|
CXX="${CXXBASE} -x cu "
|
|
|
|
CXXLD="${CXXBASE} -link"
|
2020-01-06 16:47:48 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -Xcompiler -fno-strict-aliasing --expt-extended-lambda --expt-relaxed-constexpr"
|
2019-08-07 12:11:18 +01:00
|
|
|
if test $ac_openmp = yes; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -Xcompiler -fopenmp"
|
2021-06-17 12:05:13 +01:00
|
|
|
LDFLAGS="$LDFLAGS -Xcompiler -fopenmp"
|
2019-08-07 12:11:18 +01:00
|
|
|
fi
|
2018-01-24 13:18:19 +00:00
|
|
|
;;
|
2020-05-10 10:28:09 +01:00
|
|
|
hipcc)
|
2020-09-16 00:33:09 +01:00
|
|
|
# CXXFLAGS="$CXXFLAGS -Xcompiler -fno-strict-aliasing --expt-extended-lambda --expt-relaxed-constexpr"
|
|
|
|
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
|
2020-05-10 10:28:09 +01:00
|
|
|
CXXLD=${CXX}
|
|
|
|
if test $ac_openmp = yes; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -Xcompiler -fopenmp"
|
|
|
|
fi
|
|
|
|
;;
|
2020-09-29 14:50:10 +01:00
|
|
|
dpcpp)
|
|
|
|
LDFLAGS="$LDFLAGS"
|
|
|
|
CXXFLAGS="$CXXFLAGS"
|
|
|
|
CXXLD=${CXX}
|
|
|
|
;;
|
2018-01-24 13:18:19 +00:00
|
|
|
*)
|
|
|
|
CXXLD=${CXX}
|
2020-04-24 09:10:47 +01:00
|
|
|
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
|
2018-01-24 13:18:19 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
case ${ax_cv_cxx_compiler_vendor} in
|
|
|
|
clang|gnu)
|
|
|
|
case ${ac_SIMD} in
|
2018-06-13 19:55:30 +01:00
|
|
|
GPU)
|
|
|
|
AC_DEFINE([GPU_VEC],[1],[GPU vectorised 512bit])
|
2018-07-23 11:09:05 +01:00
|
|
|
AC_DEFINE_UNQUOTED([GEN_SIMD_WIDTH],[$ac_gen_simd_width],
|
|
|
|
[generic SIMD vector width (in bytes)])
|
|
|
|
SIMD_GEN_WIDTH_MSG=" (width= $ac_gen_simd_width)"
|
2018-06-13 19:55:30 +01:00
|
|
|
SIMD_FLAGS='';;
|
2016-07-30 17:53:18 +01:00
|
|
|
SSE4)
|
|
|
|
AC_DEFINE([SSE4],[1],[SSE4 intrinsics])
|
2017-04-20 15:30:52 +01:00
|
|
|
case ${ac_SFW_FP16} in
|
|
|
|
yes)
|
|
|
|
SIMD_FLAGS='-msse4.2';;
|
|
|
|
no)
|
|
|
|
SIMD_FLAGS='-msse4.2 -mf16c';;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR(["SFW_FP16 must be either yes or no value ${ac_SFW_FP16} "]);;
|
|
|
|
esac;;
|
2016-07-30 17:53:18 +01:00
|
|
|
AVX)
|
|
|
|
AC_DEFINE([AVX1],[1],[AVX intrinsics])
|
2017-04-12 19:32:37 +01:00
|
|
|
SIMD_FLAGS='-mavx -mf16c';;
|
2016-07-30 17:53:18 +01:00
|
|
|
AVXFMA4)
|
|
|
|
AC_DEFINE([AVXFMA4],[1],[AVX intrinsics with FMA4])
|
2017-04-12 19:32:37 +01:00
|
|
|
SIMD_FLAGS='-mavx -mfma4 -mf16c';;
|
2016-10-10 14:43:37 +01:00
|
|
|
AVXFMA)
|
|
|
|
AC_DEFINE([AVXFMA],[1],[AVX intrinsics with FMA3])
|
2017-04-12 19:32:37 +01:00
|
|
|
SIMD_FLAGS='-mavx -mfma -mf16c';;
|
2016-07-30 17:53:18 +01:00
|
|
|
AVX2)
|
|
|
|
AC_DEFINE([AVX2],[1],[AVX2 intrinsics])
|
2017-04-12 19:32:37 +01:00
|
|
|
SIMD_FLAGS='-mavx2 -mfma -mf16c';;
|
2016-10-31 16:31:27 +00:00
|
|
|
AVX512)
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_DEFINE([AVX512],[1],[AVX512 intrinsics])
|
2021-03-11 11:58:49 +00:00
|
|
|
SIMD_FLAGS='-mavx512f -mavx512cd';;
|
2018-01-28 16:02:46 +00:00
|
|
|
SKL)
|
|
|
|
AC_DEFINE([AVX512],[1],[AVX512 intrinsics for SkyLake Xeon])
|
|
|
|
SIMD_FLAGS='-march=skylake-avx512';;
|
2016-10-31 16:31:27 +00:00
|
|
|
KNC)
|
2016-08-23 14:41:44 +01:00
|
|
|
AC_DEFINE([IMCI],[1],[IMCI intrinsics for Knights Corner])
|
2016-07-30 17:53:18 +01:00
|
|
|
SIMD_FLAGS='';;
|
2016-10-31 16:31:27 +00:00
|
|
|
KNL)
|
|
|
|
AC_DEFINE([AVX512],[1],[AVX512 intrinsics])
|
2017-06-30 10:15:59 +01:00
|
|
|
AC_DEFINE([KNL],[1],[Knights landing processor])
|
2016-10-31 16:31:27 +00:00
|
|
|
SIMD_FLAGS='-march=knl';;
|
2016-07-30 17:53:18 +01:00
|
|
|
GEN)
|
2016-11-19 00:32:39 +00:00
|
|
|
AC_DEFINE([GEN],[1],[generic vector code])
|
|
|
|
AC_DEFINE_UNQUOTED([GEN_SIMD_WIDTH],[$ac_gen_simd_width],
|
|
|
|
[generic SIMD vector width (in bytes)])
|
|
|
|
SIMD_GEN_WIDTH_MSG=" (width= $ac_gen_simd_width)"
|
2016-07-30 17:53:18 +01:00
|
|
|
SIMD_FLAGS='';;
|
2020-07-08 11:43:51 +01:00
|
|
|
A64FX)
|
|
|
|
case ${ax_cv_cxx_compiler_vendor} in
|
|
|
|
gnu)
|
|
|
|
AC_DEFINE([A64FX],[1],[A64FX / 512-bit SVE VLS])
|
|
|
|
SIMD_FLAGS='-march=armv8.2-a+sve -msve-vector-bits=512 -fno-gcse -DDSLASHINTRIN';;
|
|
|
|
clang)
|
|
|
|
AC_DEFINE([A64FX],[1],[A64FX / 512-bit SVE VLA])
|
|
|
|
SIMD_FLAGS='-mcpu=a64fx -DARMCLANGCOMPAT -DDSLASHINTRIN';;
|
|
|
|
esac;;
|
2017-06-13 12:26:59 +01:00
|
|
|
NEONv8)
|
|
|
|
AC_DEFINE([NEONV8],[1],[ARMv8 NEON])
|
2017-06-29 11:30:29 +01:00
|
|
|
SIMD_FLAGS='-march=armv8-a';;
|
2016-08-23 14:41:44 +01:00
|
|
|
QPX|BGQ)
|
|
|
|
AC_DEFINE([QPX],[1],[QPX intrinsics for BG/Q])
|
|
|
|
SIMD_FLAGS='';;
|
2016-07-30 17:53:18 +01:00
|
|
|
*)
|
2016-08-04 16:19:59 +01:00
|
|
|
AC_MSG_ERROR(["SIMD option ${ac_SIMD} not supported by the GCC/Clang compiler"]);;
|
2016-07-30 17:53:18 +01:00
|
|
|
esac;;
|
|
|
|
intel)
|
|
|
|
case ${ac_SIMD} in
|
2019-07-16 11:59:56 +01:00
|
|
|
GPU)
|
2018-06-13 19:55:30 +01:00
|
|
|
AC_DEFINE([GPU_VEC],[1],[GPU vectorised ])
|
|
|
|
SIMD_FLAGS='';;
|
2016-07-30 17:53:18 +01:00
|
|
|
SSE4)
|
|
|
|
AC_DEFINE([SSE4],[1],[SSE4 intrinsics])
|
|
|
|
SIMD_FLAGS='-msse4.2 -xsse4.2';;
|
|
|
|
AVX)
|
|
|
|
AC_DEFINE([AVX1],[1],[AVX intrinsics])
|
|
|
|
SIMD_FLAGS='-mavx -xavx';;
|
2016-10-10 14:43:37 +01:00
|
|
|
AVXFMA)
|
2016-11-21 16:47:18 +00:00
|
|
|
AC_DEFINE([AVXFMA],[1],[AVX intrinsics with FMA3])
|
|
|
|
SIMD_FLAGS='-mavx -fma';;
|
2016-07-30 17:53:18 +01:00
|
|
|
AVX2)
|
|
|
|
AC_DEFINE([AVX2],[1],[AVX2 intrinsics])
|
|
|
|
SIMD_FLAGS='-march=core-avx2 -xcore-avx2';;
|
|
|
|
AVX512)
|
|
|
|
AC_DEFINE([AVX512],[1],[AVX512 intrinsics])
|
2021-03-11 11:58:49 +00:00
|
|
|
SIMD_FLAGS='-xcommon-avx512';;
|
2021-03-11 12:08:40 +00:00
|
|
|
SKL)
|
|
|
|
AC_DEFINE([AVX512],[1],[AVX512 intrinsics])
|
|
|
|
SIMD_FLAGS='-xcore-avx512';;
|
2016-10-31 16:31:27 +00:00
|
|
|
KNC)
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_DEFINE([IMCI],[1],[IMCI Intrinsics for Knights Corner])
|
|
|
|
SIMD_FLAGS='';;
|
2016-10-31 16:31:27 +00:00
|
|
|
KNL)
|
|
|
|
AC_DEFINE([AVX512],[1],[AVX512 intrinsics for Knights Landing])
|
2017-06-30 10:15:59 +01:00
|
|
|
AC_DEFINE([KNL],[1],[Knights landing processor])
|
2016-10-31 16:31:27 +00:00
|
|
|
SIMD_FLAGS='-xmic-avx512';;
|
2016-07-30 17:53:18 +01:00
|
|
|
GEN)
|
2016-11-19 00:32:39 +00:00
|
|
|
AC_DEFINE([GEN],[1],[generic vector code])
|
2016-11-19 12:45:12 +00:00
|
|
|
AC_DEFINE_UNQUOTED([GEN_SIMD_WIDTH],[$ac_gen_simd_width],
|
|
|
|
[generic SIMD vector width (in bytes)])
|
2016-11-19 00:32:39 +00:00
|
|
|
SIMD_GEN_WIDTH_MSG=" (width= $ac_gen_simd_width)"
|
2016-07-30 17:53:18 +01:00
|
|
|
SIMD_FLAGS='';;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR(["SIMD option ${ac_SIMD} not supported by the Intel compiler"]);;
|
|
|
|
esac;;
|
|
|
|
*)
|
|
|
|
AC_MSG_WARN([Compiler unknown, using generic vector code])
|
|
|
|
AC_DEFINE([GENERIC_VEC],[1],[generic vector code]);;
|
2015-03-04 04:13:07 +00:00
|
|
|
esac
|
2016-07-30 17:53:18 +01:00
|
|
|
AM_CXXFLAGS="$SIMD_FLAGS $AM_CXXFLAGS"
|
|
|
|
AM_CFLAGS="$SIMD_FLAGS $AM_CFLAGS"
|
2015-03-04 04:13:07 +00:00
|
|
|
|
2020-11-13 03:11:03 +00:00
|
|
|
###### PRECISION ALWAYS DOUBLE
|
2020-10-07 18:07:00 +01:00
|
|
|
AC_DEFINE([GRID_DEFAULT_PRECISION_DOUBLE],[1],[GRID_DEFAULT_PRECISION is DOUBLE] )
|
|
|
|
|
2020-11-20 15:48:28 +00:00
|
|
|
#########################################################
|
|
|
|
###################### GRID ALLOCATOR ALIGNMENT ##
|
|
|
|
#########################################################
|
|
|
|
AC_ARG_ENABLE([alloc-align],[AC_HELP_STRING([--enable-alloc-align=2MB|4k],
|
|
|
|
[Alignment in bytes of GRID Allocator ])],[ac_ALLOC_ALIGN=${enable_alloc_align}],[ac_ALLOC_ALIGN=2MB])
|
|
|
|
case ${ac_ALLOC_ALIGN} in
|
|
|
|
4k)
|
|
|
|
AC_DEFINE([GRID_ALLOC_ALIGN],[(4096)],[GRID_ALLOC_ALIGN]);;
|
|
|
|
2MB)
|
|
|
|
AC_DEFINE([GRID_ALLOC_ALIGN],[(2*1024*1024)],[GRID_ALLOC_ALIGN]);;
|
|
|
|
*);;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([alloc-cache],[AC_HELP_STRING([--enable-alloc-cache ],
|
|
|
|
[Cache a pool of recent "frees" to reuse])],[ac_ALLOC_CACHE=${enable_alloc_cache}],[ac_ALLOC_CACHE=yes])
|
|
|
|
case ${ac_ALLOC_CACHE} in
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([ALLOCATION_CACHE],[1],[ALLOCATION_CACHE]);;
|
|
|
|
*);;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2020-11-13 03:11:03 +00:00
|
|
|
#########################################################
|
|
|
|
###################### set GPU device to rank in node ##
|
|
|
|
#########################################################
|
|
|
|
AC_ARG_ENABLE([setdevice],[AC_HELP_STRING([--enable-setdevice | --disable-setdevice],
|
|
|
|
[Set GPU to rank in node with cudaSetDevice or similar])],[ac_SETDEVICE=${enable_SETDEVICE}],[ac_SETDEVICE=no])
|
|
|
|
case ${ac_SETDEVICE} in
|
|
|
|
yes);;
|
2020-11-18 03:06:53 +00:00
|
|
|
no)
|
2020-11-13 03:11:03 +00:00
|
|
|
AC_DEFINE([GRID_DEFAULT_GPU],[1],[GRID_DEFAULT_GPU] )
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
#########################################################
|
|
|
|
###################### Shared memory intranode #########
|
|
|
|
#########################################################
|
|
|
|
AC_ARG_ENABLE([shm],[AC_HELP_STRING([--enable-shm=shmopen|shmget|hugetlbfs|shmnone|nvlink|no],
|
|
|
|
[Select SHM allocation technique])],[ac_SHM=${enable_shm}],[ac_SHM=no])
|
2017-09-05 12:51:02 +01:00
|
|
|
|
|
|
|
case ${ac_SHM} in
|
|
|
|
|
|
|
|
shmopen)
|
|
|
|
AC_DEFINE([GRID_MPI3_SHMOPEN],[1],[GRID_MPI3_SHMOPEN] )
|
2020-06-11 16:50:43 +01:00
|
|
|
CXXFLAGS_CPY=$CXXFLAGS
|
|
|
|
LDFLAGS_CPY=$LDFLAGS
|
|
|
|
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
|
|
|
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
2020-09-04 01:29:26 +01:00
|
|
|
AC_SEARCH_LIBS([shm_unlink], [rt], [],[AC_MSG_ERROR("no library found for shm_unlink")])
|
2020-06-11 16:50:43 +01:00
|
|
|
CXXFLAGS=$CXXFLAGS_CPY
|
|
|
|
LDFLAGS=$LDFLAGS_CPY
|
2017-09-05 12:51:02 +01:00
|
|
|
;;
|
|
|
|
|
2018-04-30 21:50:00 +01:00
|
|
|
shmget)
|
|
|
|
AC_DEFINE([GRID_MPI3_SHMGET],[1],[GRID_MPI3_SHMGET] )
|
|
|
|
;;
|
|
|
|
|
2020-11-13 03:11:03 +00:00
|
|
|
shmnone | no)
|
2018-03-16 21:37:03 +00:00
|
|
|
AC_DEFINE([GRID_MPI3_SHM_NONE],[1],[GRID_MPI3_SHM_NONE] )
|
2020-11-16 23:07:15 +00:00
|
|
|
;;
|
2020-11-13 03:11:03 +00:00
|
|
|
|
|
|
|
nvlink)
|
|
|
|
AC_DEFINE([GRID_MPI3_SHM_NVLINK],[1],[GRID_MPI3_SHM_NVLINK] )
|
2018-03-16 21:37:03 +00:00
|
|
|
;;
|
|
|
|
|
2017-09-05 12:51:02 +01:00
|
|
|
hugetlbfs)
|
|
|
|
AC_DEFINE([GRID_MPI3_SHMMMAP],[1],[GRID_MPI3_SHMMMAP] )
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR([${ac_SHM} unsupported --enable-shm option]);
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
###################### Shared base path for SHMMMAP
|
|
|
|
AC_ARG_ENABLE([shmpath],[AC_HELP_STRING([--enable-shmpath=path],
|
|
|
|
[Select SHM mmap base path for hugetlbfs])],
|
|
|
|
[ac_SHMPATH=${enable_shmpath}],
|
2018-05-02 14:07:41 +01:00
|
|
|
[ac_SHMPATH=/var/lib/hugetlbfs/global/pagesize-2MB/])
|
2017-09-05 12:51:02 +01:00
|
|
|
AC_DEFINE_UNQUOTED([GRID_SHM_PATH],["$ac_SHMPATH"],[Path to a hugetlbfs filesystem for MMAPing])
|
|
|
|
|
2020-11-17 01:15:50 +00:00
|
|
|
############### force MPI in SMP
|
|
|
|
AC_ARG_ENABLE([shm-force-mpi],[AC_HELP_STRING([--enable-shm-force-mpi],
|
|
|
|
[Force MPI within shared memory])],[ac_SHM_FORCE_MPI=${enable_shm_force_mpi}],[ac_SHM_FORCE_MPI=no])
|
|
|
|
case ${ac_SHM_FORCE_MPI} in
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([GRID_SHM_FORCE_MPI],[1],[GRID_SHM_FORCE_MPI] )
|
|
|
|
;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
2020-11-13 03:11:03 +00:00
|
|
|
|
|
|
|
############### communication type selection
|
|
|
|
AC_ARG_ENABLE([comms-threads],[AC_HELP_STRING([--enable-comms-threads | --disable-comms-threads],
|
|
|
|
[Use multiple threads in MPI calls])],[ac_COMMS_THREADS=${enable_comms_threads}],[ac_COMMS_THREADS=yes])
|
|
|
|
|
|
|
|
case ${ac_COMMS_THREADS} in
|
|
|
|
yes)
|
|
|
|
AC_DEFINE([GRID_COMMS_THREADING],[1],[GRID_COMMS_NONE] )
|
|
|
|
;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### communication type selection
|
2018-01-08 11:26:48 +00:00
|
|
|
AC_ARG_ENABLE([comms],[AC_HELP_STRING([--enable-comms=none|mpi|mpi-auto],
|
2016-10-31 16:31:27 +00:00
|
|
|
[Select communications])],[ac_COMMS=${enable_comms}],[ac_COMMS=none])
|
2015-03-29 21:44:22 +01:00
|
|
|
|
2020-11-13 03:11:03 +00:00
|
|
|
|
2015-03-29 21:44:22 +01:00
|
|
|
case ${ac_COMMS} in
|
|
|
|
none)
|
2016-10-31 16:31:27 +00:00
|
|
|
AC_DEFINE([GRID_COMMS_NONE],[1],[GRID_COMMS_NONE] )
|
2016-11-03 13:48:07 +00:00
|
|
|
comms_type='none'
|
2015-03-29 21:44:22 +01:00
|
|
|
;;
|
2018-01-08 11:26:48 +00:00
|
|
|
mpi*)
|
2016-10-31 16:31:27 +00:00
|
|
|
AC_DEFINE([GRID_COMMS_MPI3],[1],[GRID_COMMS_MPI3] )
|
2016-11-03 13:48:07 +00:00
|
|
|
comms_type='mpi3'
|
2016-10-20 16:56:40 +01:00
|
|
|
;;
|
2015-03-29 21:44:22 +01:00
|
|
|
*)
|
2017-05-05 12:47:17 +01:00
|
|
|
AC_MSG_ERROR([${ac_COMMS} unsupported --enable-comms option]);
|
2015-03-29 21:44:22 +01:00
|
|
|
;;
|
|
|
|
esac
|
2016-10-31 16:31:27 +00:00
|
|
|
case ${ac_COMMS} in
|
|
|
|
*-auto)
|
|
|
|
LX_FIND_MPI
|
2019-07-11 03:16:17 +01:00
|
|
|
echo MPI_CXXFLAGS $MPI_CXXFLAGS
|
|
|
|
echo MPI_CXXLDFLAGS $MPI_CXXLDFLAGS
|
|
|
|
echo MPI_CFLAGS $MPI_CFLAGS
|
2016-10-31 16:31:27 +00:00
|
|
|
AM_CXXFLAGS="$MPI_CXXFLAGS $AM_CXXFLAGS"
|
|
|
|
AM_CFLAGS="$MPI_CFLAGS $AM_CFLAGS"
|
|
|
|
AM_LDFLAGS="`echo $MPI_CXXLDFLAGS | sed -E 's/-l@<:@^ @:>@+//g'` $AM_LDFLAGS"
|
|
|
|
LIBS="`echo $MPI_CXXLDFLAGS | sed -E 's/-L@<:@^ @:>@+//g'` $LIBS";;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-11-03 13:48:07 +00:00
|
|
|
AM_CONDITIONAL(BUILD_COMMS_MPI3, [ test "${comms_type}X" == "mpi3X" ] )
|
|
|
|
AM_CONDITIONAL(BUILD_COMMS_NONE, [ test "${comms_type}X" == "noneX" ])
|
2015-04-03 04:52:53 +01:00
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### RNG selection
|
2017-01-25 12:47:22 +00:00
|
|
|
AC_ARG_ENABLE([rng],[AC_HELP_STRING([--enable-rng=ranlux48|mt19937|sitmo],\
|
2016-10-31 16:31:27 +00:00
|
|
|
[Select Random Number Generator to be used])],\
|
2017-04-01 16:26:05 +01:00
|
|
|
[ac_RNG=${enable_rng}],[ac_RNG=sitmo])
|
2016-07-30 17:53:18 +01:00
|
|
|
|
2015-12-19 18:32:25 +00:00
|
|
|
case ${ac_RNG} in
|
|
|
|
ranlux48)
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_DEFINE([RNG_RANLUX],[1],[RNG_RANLUX] )
|
2015-12-19 18:32:25 +00:00
|
|
|
;;
|
|
|
|
mt19937)
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_DEFINE([RNG_MT19937],[1],[RNG_MT19937] )
|
2015-12-19 18:32:25 +00:00
|
|
|
;;
|
2017-01-25 12:47:22 +00:00
|
|
|
sitmo)
|
|
|
|
AC_DEFINE([RNG_SITMO],[1],[RNG_SITMO] )
|
|
|
|
;;
|
2015-12-19 18:32:25 +00:00
|
|
|
*)
|
2017-05-05 12:47:17 +01:00
|
|
|
AC_MSG_ERROR([${ac_RNG} unsupported --enable-rng option]);
|
2015-12-19 18:32:25 +00:00
|
|
|
;;
|
|
|
|
esac
|
2016-06-03 11:24:26 +01:00
|
|
|
|
2016-10-31 16:31:27 +00:00
|
|
|
############### Timer option
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_ARG_ENABLE([timers],[AC_HELP_STRING([--enable-timers],\
|
2016-10-31 16:31:27 +00:00
|
|
|
[Enable system dependent high res timers])],\
|
|
|
|
[ac_TIMERS=${enable_timers}],[ac_TIMERS=yes])
|
|
|
|
|
2016-06-03 11:24:26 +01:00
|
|
|
case ${ac_TIMERS} in
|
|
|
|
yes)
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_DEFINE([TIMERS_ON],[1],[TIMERS_ON] )
|
2016-06-03 11:24:26 +01:00
|
|
|
;;
|
|
|
|
no)
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_DEFINE([TIMERS_OFF],[1],[TIMERS_OFF] )
|
2016-06-03 11:24:26 +01:00
|
|
|
;;
|
|
|
|
*)
|
2017-05-05 12:47:17 +01:00
|
|
|
AC_MSG_ERROR([${ac_TIMERS} unsupported --enable-timers option]);
|
2016-06-03 11:24:26 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### Chroma regression test
|
2016-10-31 16:31:27 +00:00
|
|
|
AC_ARG_ENABLE([chroma],[AC_HELP_STRING([--enable-chroma],
|
|
|
|
[Expect chroma compiled under c++11 ])],ac_CHROMA=yes,ac_CHROMA=no)
|
|
|
|
|
2015-12-10 22:55:00 +00:00
|
|
|
case ${ac_CHROMA} in
|
2016-07-30 17:53:18 +01:00
|
|
|
yes|no)
|
2015-12-10 22:55:00 +00:00
|
|
|
;;
|
|
|
|
*)
|
2017-05-05 12:47:17 +01:00
|
|
|
AC_MSG_ERROR([${ac_CHROMA} unsupported --enable-chroma option]);
|
2015-12-10 22:55:00 +00:00
|
|
|
;;
|
|
|
|
esac
|
2016-10-31 16:31:27 +00:00
|
|
|
|
2015-12-10 22:55:00 +00:00
|
|
|
AM_CONDITIONAL(BUILD_CHROMA_REGRESSION,[ test "X${ac_CHROMA}X" == "XyesX" ])
|
2015-03-29 21:44:22 +01:00
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### Doxygen
|
2016-08-05 15:29:18 +01:00
|
|
|
DX_DOXYGEN_FEATURE([OFF])
|
|
|
|
DX_DOT_FEATURE([OFF])
|
|
|
|
DX_HTML_FEATURE([ON])
|
|
|
|
DX_CHM_FEATURE([OFF])
|
|
|
|
DX_CHI_FEATURE([OFF])
|
|
|
|
DX_MAN_FEATURE([OFF])
|
|
|
|
DX_RTF_FEATURE([OFF])
|
|
|
|
DX_XML_FEATURE([OFF])
|
|
|
|
DX_PDF_FEATURE([OFF])
|
|
|
|
DX_PS_FEATURE([OFF])
|
|
|
|
DX_INIT_DOXYGEN([$PACKAGE_NAME], [doxygen.cfg])
|
2015-05-27 02:34:56 +01:00
|
|
|
|
2016-07-30 17:53:18 +01:00
|
|
|
############### Ouput
|
|
|
|
cwd=`pwd -P`; cd ${srcdir}; abs_srcdir=`pwd -P`; cd ${cwd}
|
2018-11-07 13:32:46 +00:00
|
|
|
GRID_CXX="$CXX"
|
2020-04-23 15:25:53 +01:00
|
|
|
GRID_CXXLD="$CXXLD"
|
2017-05-02 19:13:13 +01:00
|
|
|
GRID_CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
|
|
|
GRID_LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
|
|
|
GRID_LIBS=$LIBS
|
2017-05-02 19:41:01 +01:00
|
|
|
GRID_SHORT_SHA=`git rev-parse --short HEAD`
|
2017-05-02 19:13:13 +01:00
|
|
|
GRID_SHA=`git rev-parse HEAD`
|
|
|
|
GRID_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
2018-08-28 15:00:40 +01:00
|
|
|
AM_CXXFLAGS="-I${abs_srcdir} $AM_CXXFLAGS"
|
|
|
|
AM_CFLAGS="-I${abs_srcdir} $AM_CFLAGS"
|
|
|
|
AM_LDFLAGS="-L${cwd}/Grid $AM_LDFLAGS"
|
2018-01-24 13:18:19 +00:00
|
|
|
AC_SUBST([CXXLD])
|
2016-07-30 17:53:18 +01:00
|
|
|
AC_SUBST([AM_CFLAGS])
|
|
|
|
AC_SUBST([AM_CXXFLAGS])
|
|
|
|
AC_SUBST([AM_LDFLAGS])
|
2018-11-07 13:32:46 +00:00
|
|
|
AC_SUBST([GRID_CXX])
|
2020-04-23 15:25:53 +01:00
|
|
|
AC_SUBST([GRID_CXXLD])
|
2017-05-02 19:13:13 +01:00
|
|
|
AC_SUBST([GRID_CXXFLAGS])
|
|
|
|
AC_SUBST([GRID_LDFLAGS])
|
|
|
|
AC_SUBST([GRID_LIBS])
|
|
|
|
AC_SUBST([GRID_SHA])
|
|
|
|
AC_SUBST([GRID_BRANCH])
|
2015-05-18 09:15:14 +01:00
|
|
|
|
2016-11-10 18:44:36 +00:00
|
|
|
git_commit=`cd $srcdir && ./scripts/configure.commit`
|
|
|
|
|
2016-10-31 16:31:27 +00:00
|
|
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2015-05-18 09:15:14 +01:00
|
|
|
Summary of configuration for $PACKAGE v$VERSION
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2016-11-10 18:44:36 +00:00
|
|
|
----- GIT VERSION -------------------------------------
|
|
|
|
$git_commit
|
2016-08-03 11:39:20 +01:00
|
|
|
----- PLATFORM ----------------------------------------
|
2016-10-31 16:31:27 +00:00
|
|
|
architecture (build) : $build_cpu
|
|
|
|
os (build) : $build_os
|
|
|
|
architecture (target) : $target_cpu
|
|
|
|
os (target) : $target_os
|
|
|
|
compiler vendor : ${ax_cv_cxx_compiler_vendor}
|
|
|
|
compiler version : ${ax_cv_gxx_version}
|
2016-08-03 11:39:20 +01:00
|
|
|
----- BUILD OPTIONS -----------------------------------
|
2020-10-07 18:07:00 +01:00
|
|
|
Nc : ${ac_Nc}
|
2016-11-19 00:32:39 +00:00
|
|
|
SIMD : ${ac_SIMD}${SIMD_GEN_WIDTH_MSG}
|
2017-05-05 12:47:17 +01:00
|
|
|
Threading : ${ac_openmp}
|
2020-05-10 10:28:09 +01:00
|
|
|
Acceleration : ${ac_ACCELERATOR}
|
2020-05-17 21:34:25 +01:00
|
|
|
Unified virtual memory : ${ac_UNIFIED}
|
2016-11-03 13:48:07 +00:00
|
|
|
Communications type : ${comms_type}
|
2017-09-05 12:51:02 +01:00
|
|
|
Shared memory allocator : ${ac_SHM}
|
|
|
|
Shared memory mmap path : ${ac_SHMPATH}
|
2016-10-31 16:31:27 +00:00
|
|
|
Default precision : ${ac_PRECISION}
|
2017-04-20 15:30:52 +01:00
|
|
|
Software FP16 conversion : ${ac_SFW_FP16}
|
2017-05-05 12:47:17 +01:00
|
|
|
RNG choice : ${ac_RNG}
|
2016-10-31 16:31:27 +00:00
|
|
|
GMP : `if test "x$have_gmp" = xtrue; then echo yes; else echo no; fi`
|
|
|
|
LAPACK : ${ac_LAPACK}
|
|
|
|
FFTW : `if test "x$have_fftw" = xtrue; then echo yes; else echo no; fi`
|
2016-11-10 18:13:07 +00:00
|
|
|
LIME (ILDG support) : `if test "x$have_lime" = xtrue; then echo yes; else echo no; fi`
|
2017-01-18 00:21:18 +00:00
|
|
|
HDF5 : `if test "x$have_hdf5" = xtrue; then echo yes; else echo no; fi`
|
2016-11-19 12:11:13 +00:00
|
|
|
build DOXYGEN documentation : `if test "$DX_FLAG_doc" = '1'; then echo yes; else echo no; fi`
|
2016-08-03 11:39:20 +01:00
|
|
|
----- BUILD FLAGS -------------------------------------
|
2016-10-31 16:31:27 +00:00
|
|
|
CXXFLAGS:
|
2016-09-27 11:54:37 +01:00
|
|
|
`echo ${AM_CXXFLAGS} ${CXXFLAGS} | tr ' ' '\n' | sed 's/^-/ -/g'`
|
2016-10-31 16:31:27 +00:00
|
|
|
LDFLAGS:
|
2016-09-27 11:54:37 +01:00
|
|
|
`echo ${AM_LDFLAGS} ${LDFLAGS} | tr ' ' '\n' | sed 's/^-/ -/g'`
|
2016-10-31 16:31:27 +00:00
|
|
|
LIBS:
|
2016-09-27 11:54:37 +01:00
|
|
|
`echo ${LIBS} | tr ' ' '\n' | sed 's/^-/ -/g'`
|
2016-11-10 18:13:07 +00:00
|
|
|
-------------------------------------------------------" > grid.configure.summary
|
2017-05-02 19:40:47 +01:00
|
|
|
|
2017-05-05 12:47:17 +01:00
|
|
|
GRID_SUMMARY="`cat grid.configure.summary`"
|
2017-05-02 19:40:47 +01:00
|
|
|
AM_SUBST_NOTMAKE([GRID_SUMMARY])
|
|
|
|
AC_SUBST([GRID_SUMMARY])
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([grid-config], [chmod +x grid-config])
|
|
|
|
AC_CONFIG_FILES(Makefile)
|
2018-08-28 15:00:40 +01:00
|
|
|
AC_CONFIG_FILES(Grid/Makefile)
|
2019-02-24 15:22:17 +00:00
|
|
|
AC_CONFIG_FILES(HMC/Makefile)
|
2017-05-02 19:40:47 +01:00
|
|
|
AC_CONFIG_FILES(tests/Makefile)
|
|
|
|
AC_CONFIG_FILES(tests/IO/Makefile)
|
|
|
|
AC_CONFIG_FILES(tests/core/Makefile)
|
|
|
|
AC_CONFIG_FILES(tests/debug/Makefile)
|
|
|
|
AC_CONFIG_FILES(tests/forces/Makefile)
|
|
|
|
AC_CONFIG_FILES(tests/hmc/Makefile)
|
|
|
|
AC_CONFIG_FILES(tests/solver/Makefile)
|
2017-10-11 10:12:07 +01:00
|
|
|
AC_CONFIG_FILES(tests/lanczos/Makefile)
|
2017-05-05 13:59:10 +01:00
|
|
|
AC_CONFIG_FILES(tests/smearing/Makefile)
|
2017-05-02 19:40:47 +01:00
|
|
|
AC_CONFIG_FILES(tests/qdpxx/Makefile)
|
|
|
|
AC_CONFIG_FILES(tests/testu01/Makefile)
|
2021-10-12 09:06:15 +01:00
|
|
|
AC_CONFIG_FILES(tests/Sp2n/Makefile)
|
2017-05-02 19:40:47 +01:00
|
|
|
AC_CONFIG_FILES(benchmarks/Makefile)
|
2021-08-22 14:17:12 +01:00
|
|
|
AC_CONFIG_FILES(examples/Makefile)
|
2017-05-02 19:40:47 +01:00
|
|
|
AC_OUTPUT
|
|
|
|
|
2016-10-31 16:31:27 +00:00
|
|
|
echo ""
|
2016-10-24 11:02:14 +01:00
|
|
|
cat grid.configure.summary
|
2016-10-31 16:31:27 +00:00
|
|
|
echo ""
|