forked from LSSTDESC/NaMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
100 lines (82 loc) · 3.71 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.
AC_PREREQ([2.4])
AC_INIT([namaster], [0.0], [github.com/damonge/NaMaster])
AM_INIT_AUTOMAKE([-Wall subdir-objects foreign serial-tests])
AM_PROG_AR
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_CONFIG_SRCDIR([src/nmt_master.c])
AC_CONFIG_HEADERS([config.h])
# Avoid problem with git timestamps
AM_MAINTAINER_MODE
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_INSTALL
AM_PROG_CC_C_O
AM_MAINTAINER_MODE
AC_OPENMP
# Deal with openmp versus pthreads for fftw3
AC_ARG_ENABLE([fftw_pthreads],
AS_HELP_STRING([--enable-fftw-pthreads], [Enable using pthreads instead of OpenMP with FFTW]))
AS_IF(
[test "x$enable_fftw_pthreads" = "xyes"], [AC_SUBST([fftw_thread_type], "-lfftw3_threads -lpthread")],
[test "x$enable_fftw_pthreads" != "xyes"], [AC_SUBST([fftw_thread_type], "-lfftw3_omp")])
# Which libsharp version are we using?
AC_ARG_ENABLE([libsharp_healpix],
AS_HELP_STRING([--enable-libsharp_healpix], [Enable Healpix new fft]))
AC_ARG_ENABLE([libsharp_gitlab],
AS_HELP_STRING([--enable-libsharp_gitlab], [Enable libsharp's new fft]))
# Set libsharp libraries needed
AS_IF(
[test "x$enable_libsharp_healpix" = "xyes"], [AC_SUBST([libsharp_libs], "-lsharp -lpocketfft -lc_utils ")],
[test "x$enable_libsharp_gitlab" = "xyes"], [AC_SUBST([libsharp_libs], "-lsharp ")],
[AC_SUBST([libsharp_libs], "-lsharp -lfftpack -lc_utils")])
# Set necessary define flags
AS_IF(
[test "x$enable_libsharp_gitlab" = "xyes"], [AC_DEFINE([LIBSHARP_GITLAB],[1],[libsharp gitlab version])],
[test "x$enable_libsharp_healpix" = "xyes"], [AC_DEFINE([LIBSHARP_HEALPIX],[1],[libsharp healpix version])],
[AC_DEFINE([LIBSHARP_GITHUB],[1],[libsharp github version])])
# Checks for libraries.
AC_SEARCH_LIBS([pow],[m],[],AC_MSG_ERROR(Couldn't find libm. Required.))
AC_SEARCH_LIBS([cblas_dgemm],[gslcblas],[],AC_MSG_ERROR(Couldn't find libgslcblas.))
AC_SEARCH_LIBS([gsl_spline2d_eval_e],[gsl],[],AC_MSG_ERROR(Couldn't find libgsl. GSL V2+ required.))
AC_SEARCH_LIBS([ffopen],[cfitsio],[],AC_MSG_ERROR(Couldn't find cfitsio))
if test "x$enable_libsharp_gitlab" = "xyes"; then :
AC_SEARCH_LIBS([sharp_make_triangular_alm_info],[sharp],[],AC_MSG_ERROR(Couldn't find libsharp gitlab),[])
elif test "x$enable_libsharp_healpix" = "xyes"; then :
AC_SEARCH_LIBS([sharp_make_triangular_alm_info],[sharp],[],AC_MSG_ERROR(Couldn't find libsharp healpix),[-lpocketfft -lc_utils])
else
AC_SEARCH_LIBS([sharp_make_triangular_alm_info],[sharp],[],AC_MSG_ERROR(Couldn't find libsharp),[-lfftpack -lc_utils])
fi
AC_SEARCH_LIBS([ring2nest],[chealpix],[],AC_MSG_ERROR(Couldn't find libchealpix))
AC_SEARCH_LIBS([fftw_execute],[fftw3],[],AC_MSG_ERROR(Couldn't find libfftw3))
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h math.h stdarg.h unistd.h time.h omp.h complex.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_FUNC_MALLOC
# Checks for library functions.
AC_CHECK_FUNCS([pow sqrt])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo \
"
-------------------------------------------------------
${PACKAGE_NAME} Version ${PACKAGE_VERSION}
Configuration settings:
- Prefix: '${prefix}'
- Compiler: '${CC} ${CFLAGS} ${CPPFLAGS}'
Now type 'make @<:@<target>@:>@', where the optional
target may be:
all : to build everything (currently libnmt)
this is the default target
check : runs the library's unit tests
install : to put everything in the installation
directories ('include', 'lib' and
'bin' from prefix). Root privileges may
be necessary for this.
clean : to remove garbage
------------------------------------------------------
"