-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
100 lines (78 loc) · 2.49 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
89
90
91
92
93
94
95
96
97
98
99
100
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#Initialize Autoconf.
#Specify package's name, version number and bug-report email address.
AC_INIT([mcf], [1.0], [xin.bian@aer.mw.tum.de])
#Require a minimum Autoconf version.
AC_PREREQ(2.60)
#A safety check.
#src/mcf.F90 should be a distributed source file.
AC_CONFIG_SRCDIR([src/mcf.F90])
#Declear config.h as output header.
AC_CONFIG_HEADERS([config.h])
#Initialize Automake.
#Turn on all Automake warnings and report them as errors.
#This is a foreign package.
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
ACX_MPI(,
[AC_MSG_ERROR([cannot find working mpif90, please set MPIFC variable])])
# compile and link with mpif90
#CC="$MPIFC"
FC="$MPIFC"
LIBS="$MPILIBS $LIBS"
# HACK: should be changed to more aproprite linking of c++ and fortran code
AC_PROG_CXX
AC_LANG_PUSH(C++)
AC_CHECK_LIB(stdc++,main,,AC_MSG_ERROR(Cannot find lib stdc++))
AC_CHECK_LIB(gcc_s,main,,AC_MSG_WARN(Cannot find lib gcc_s))
AC_LANG_POP
# for dependencies tracking
AC_CHECK_PROG(MAKEDEPF90, [makedepf90], [makedepf90], [not found], [$PATH])
AC_ARG_VAR(MAKEDEPF90, [F90 dependency tracking])
# ppm library
#ac_ext=f90
AC_FC_SRCEXT(F90)
AC_LANG_PUSH(Fortran)
AC_LANG(Fortran)
# Checks for libraries.
# double precision fftw library
AC_CHECK_LIB(fftw3,
dfftw_execute_dft_c2r,
[],
[AC_MSG_ERROR([cannot link against fftw library, please set LDFLAGS])])
# single precision fftw library
AC_CHECK_LIB(fftw3f,
sfftw_execute_dft_c2r,
[],
[AC_MSG_ERROR([cannot link against fftw library, please set LDFLAGS])])
# vizing library
AC_CHECK_LIB(vizing,
vizing_coloring,
,
[AC_MSG_ERROR([Cannot find lib vizing, please set LDFLAGS])])
# metis library
AC_CHECK_LIB(metis,
METIS_WPartGraphRecursive,
[],
[AC_MSG_ERROR([Cannot find lib metis, please set LDFLAGS])])
# test ppm library
LIBS="-lppm $LIBS"
AC_LINK_IFELSE([
PROGRAM main
USE ppm_module_write
INTEGER :: i
CALL ppm_write(1, 'test', 'test', i)
END PROGRAM main
],
[AC_MSG_RESULT([can compile with ppm])],
[AC_MSG_ERROR([cannot link against ppm library, please set LDFLAGS and FCFLAGS])])
# test lapack and blas
#AC_LANG_POP
#AC_PROG_FC
#AC_PROG_CC
#AX_LAPACK(,[AC_MSG_ERROR([cannot link against lapack])])
#LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FCLIBS"
#Declare Makefile and src/Makefile as output files
AC_CONFIG_FILES([Makefile src/Makefile])
#Actually output all declared files.
AC_OUTPUT