-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
119 lines (97 loc) · 3.61 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
AC_INIT([libgerlumph], [0.1], [gvernard@astro.rug.nl])
AC_LANG(C++)
AC_CONFIG_AUX_DIR(aux-dist)
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_MACRO_DIRS([m4])
AC_PREFIX_DEFAULT($PWD)
AC_PROG_CXX
LT_INIT([disable-static])
##########################################################################
ac_new_CPPFLAGS="-Iinclude"
ac_new_LDFLAGS=""
ac_new_LIBS=""
AC_ARG_WITH([fftw3],
[AS_HELP_STRING([--with-fftw3=prefix],[give the path to the fftw3 library and header files.])],
[
ac_new_CPPFLAGS+=" -I${withval}/include"
ac_new_LDFLAGS+=" -L${withval}/lib -Wl,-rpath -Wl,${withval}/lib"
ac_new_LIBS+=" -lfftw3"
],
[
AC_CHECK_LIB(fftw3,main,[],[AC_MSG_ERROR("you need to have the fftw3 library installed.")])
AC_CHECK_HEADERS(fftw3.h,[],[AC_MSG_ERROR("you need to have the fftw3 header files installed.")])
])
AC_ARG_WITH([CCfits],
[AS_HELP_STRING([--with-CCfits=prefix],[give the path to the CCfits library and header files.])],
[
ac_new_CPPFLAGS+=" -I${withval}/include"
ac_new_LDFLAGS+=" -L${withval}/lib -Wl,-rpath -Wl,${withval}/lib"
ac_new_LIBS+=" -lCCfits"
],
[
AC_CHECK_LIB(CCfits,main,[],[AC_MSG_ERROR("you need to have the CCfits library installed.")],[-lcfitsio])
AC_CHECK_HEADERS(CCfits/CCfits.h,[],[AC_MSG_ERROR("you need to have the CCfits header files installed.")])
])
AC_ARG_WITH([cfitsio],
[AS_HELP_STRING([--with-cfitsio=prefix],[give the path to the cfitsio library and header files.])],
[
ac_new_CPPFLAGS+=" -I${withval}/include"
ac_new_LDFLAGS+=" -L${withval}/lib -Wl,-rpath -Wl,${withval}/lib"
ac_new_LIBS+=" -lcfitsio"
],
[
AC_CHECK_LIB(cfitsio,main,[],[AC_MSG_ERROR("you need to have the cfitsio library installed.")])
AC_CHECK_HEADERS(fitsio.h,[],[AC_MSG_ERROR("you need to have the cfitsio header files installed.")])
])
AC_ARG_WITH([png],
[AS_HELP_STRING([--with-png=prefix],[give the path to the png library and header files.])],
[
ac_new_CPPFLAGS+=" -I${withval}/include"
ac_new_LDFLAGS+=" -L${withval}/lib -Wl,-rpath -Wl,${withval}/lib"
ac_new_LIBS+=" -lpng"
],
[
AC_CHECK_LIB(png,main,[],[AC_MSG_ERROR("you need to have the png library installed.")])
AC_CHECK_HEADERS(png.h,[],[AC_MSG_ERROR("you need to have the png header files installed.")])
])
CPPFLAGS+="$ac_new_CPPFLAGS"
LDFLAGS+="$ac_new_LDFLAGS"
LIBS+="$ac_new_LIBS"
AC_SUBST([CPPFLAGS])
AC_SUBST([LDFLAGS])
AC_SUBST([LIBS])
##########################################################################
##########################################################################
AC_ARG_WITH([map-path],
[AS_HELP_STRING([--with-map-path=prefix],[give the path to the gerlumph maps])],
[MAP_PATHSET=1],
[MAP_PATHSET=0])
# if optional parameter used, extend path flags for compliler and linker
if test $MAP_PATHSET = 1 ; then
MAP_PATH="$with_map_path"
else
AC_MSG_ERROR([You need to provide the MAP_PATH to comile the gerlumph++ library!])
fi
AC_SUBST([MAP_PATH])
##########################################################################
##########################################################################
AC_ARG_ENABLE([gpu],
[AS_HELP_STRING([--enable-gpu],[replace convolutions on the CPU (fftw) by the GPU (cufft)])],
[
if test "$enable_gpu" = "no"; then
GPU_SET=0
else
GPU_SET=1
fi
],
[GPU_SET=0])
AM_CONDITIONAL([WITH_GPU], [test $GPU_SET = 1])
CUDA_CFLAGS="-std=c++11 --compiler-options '-fPIC' -Wno-deprecated-gpu-targets"
CUDA_LIBS="-lcudart -lcufft"
NVCC="nvcc"
AC_SUBST(CUDA_CFLAGS)
AC_SUBST(CUDA_LIBS)
AC_SUBST(NVCC)
##########################################################################
AC_CONFIG_FILES([Makefile])
AC_OUTPUT