-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
88 lines (69 loc) · 2.34 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([slater_stoch],[1.0.0],[https://github.com/scemama/slater_stoch/issues],[],[])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build])
AM_INIT_AUTOMAKE([subdir-objects color-tests parallel-tests silent-rules 1.11])
AM_SILENT_RULES(yes)
AC_LANG(Fortran)
AC_OPENMP()
FCFLAGS="$FCFLAGS $OPENMP_FCFLAGS"
AM_PROG_CC_C_O
# Checks for programs.
#AC_PROG_F77
AX_PROG_FC_MPI
F77=$FC
AS_CASE(["$FC"],
[ifort*], [FCFLAGS="$FCFLAGS -mkl=parallel"],
[mpiifort*], [FCFLAGS="$FCFLAGS -mkl=parallel"],
[
# Checks for libraries.
## BLAS
AC_LANG_PUSH(C)
AX_BLAS([], [AC_MSG_ERROR([BLAS was not found.])])
AC_LANG_POP()
LIBS="$LIBS $BLAS_LIBS"
])
AS_CASE(["$FC"],
[gfortran*], [FCFLAGS="$FCFLAGS -std=legacy"],
[])
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_LANG_PUSH(C)
AC_CHECK_FUNC([vderfcinv],[ AC_DEFINE([HAVE_VDERFINVC],[1],[vdErfInvc found]) ])
AC_ARG_ENABLE([mmap],
[AS_HELP_STRING([--enable-mmap],
[Enable support for mmap])],
[enable_mmap=$enableval],
[enable_mmap=no])
AM_CONDITIONAL([HAVE_MMAP], [test "$enable_mmap" = "yes"])
AS_IF([test "$enable_mmap" = "yes"], [AC_DEFINE([HAVE_MMAP], [1], [Use mmap in SVD cleaning])])
AC_ARG_WITH([trexio],
[AS_HELP_STRING([--without-trexio],
[disable support for TREXIO])],
[with_trexio=$withval],
[with_trexio=yes])
AS_CASE([$with_trexio],
[no], [],
[yes],
[AC_CHECK_LIB([trexio], [trexio_open], [],
[PKG_CHECK_MODULES([TREXIO], [trexio]) ])
CFLAGS="$CFLAGS $TREXIO_CFLAGS"
LIBS="$LIBS $TREXIO_LIBS"
AC_DEFINE([HAVE_TREXIO], [1], [Define if TREXIO support is available])
ARGS="${ARGS} trexio"],
[AS_IF([test ! -d "$withval"],
[AC_MSG_ERROR([--with-trexio=$withval: argument is not a directory])])
TREXIO_LIBS="-L$with_trexio/lib -ltrexio"
TREXIO_CFLAGS="-I$with_trexio/include"
CFLAGS="$CFLAGS $TREXIO_CFLAGS"
LIBS="$LIBS $TREXIO_LIBS"
AC_DEFINE([HAVE_TREXIO], [1], [Define if TREXIO support is available])
ARGS="${ARGS} trexio"
])
AC_LANG_POP
AC_CONFIG_FILES([Makefile])
AC_OUTPUT