-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfigure.ac
130 lines (107 loc) · 2.91 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
120
121
122
123
124
125
126
127
128
129
130
AC_PREREQ([2.65])
AC_INIT([neurongpu], [1.8.2], [])
# Config initialization
AC_CONFIG_SRCDIR([m4/ct_check_cuda.m4])
AC_CONFIG_SRCDIR([m4/pypath.m4])
#, [m4/ct_check_cuda_sdk.m4])
AC_CONFIG_AUX_DIR(m4)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIRS([m4])
AC_ENABLE_SHARED
AC_DISABLE_STATIC
LT_INIT
# automake initialization
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
# AC_CANONICAL_HOST is needed to access the 'host_os' variable
AC_CANONICAL_HOST
build_linux=no
build_windows=no
build_mac=no
# Detect the target system
case "${host_os}" in
linux*)
build_linux=yes
;;
cygwin*|mingw*)
build_windows=yes
;;
darwin*)
build_mac=yes
;;
*)
AC_MSG_ERROR(["OS $host_os is not supported"])
;;
esac
# Pass the conditionals to automake
AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"])
AM_CONDITIONAL([OSX], [test "$build_mac" = "yes"])
# Search nvcc compiler
AC_PATH_PROG(NVCC, nvcc, "no")
AS_IF([test "x$NVCC" = "xno"],[AC_MSG_ERROR([NVCC compiler not found!])])
# Make variable $NVCC available in Makefile.am
AC_SUBST(NVCC)
# check for OpenMP
AC_OPENMP
#check for Python
AM_PATH_PYTHON([2.4])
#adl_CHECK_PYTHON
#AC_MSG_ERROR([$PYTHONINC])
# Checks for libraries.
AC_CHECK_LIB([m], [pow])
#AC_CHECK_LIB([just_a_test], [pow], [], [AC_MSG_ERROR([pow was not found in libjust_a_test])])
# Checks for header files.
AC_CHECK_HEADERS([limits.h stdlib.h string.h])
# check for CUDA
#CT_CHECK_CUDA_API
# check for CUDA SDK
#CT_CHECK_CUDA_SDK
GPU_ARCH=sm_35
AC_ARG_WITH(gpu-arch, [AC_HELP_STRING([--with-gpu-arch=GPU architecture],
[Specify the GPU compute capability [default=sm_35]])],
[GPU_ARCH=$withval])
AC_SUBST(GPU_ARCH)
AC_MSG_NOTICE(GPU architecture: ${GPU_ARCH})
dnl Check for MPI
dnl This check will set the MPICC and MPICXX variables to the MPI compiler ones
dnl if the library is found, or to the regular compilers if not.
AC_ARG_WITH(mpi, [AC_HELP_STRING([--with-mpi],
[enable MPI support [default=yes]])],
[case "${withval}" in
yes|no) with_mpi=$withval;;
*)
AC_MSG_ERROR(bad value ${withval} for --with-mpi);;
esac],
[with_mpi=yes])
if test "x$with_mpi" = "xyes"; then
ACX_MPI([], [AC_MSG_ERROR(m4_normalize([
could not find MPI library. You should either install it,
or use the option --with-mpi=no
to build without MPI-related functions]))])
AC_DEFINE(HAVE_MPI)
MPICC="mpicc"
MPICXX="mpicxx"
MPI_CXXLIBS=`mpicxx --showme:link`
MPI_CXXFLAGS=`mpicxx --showme:compile`
AC_SUBST(MPI_CXXLIBS)
AC_SUBST(MPI_CXXFLAGS)
else
MPICC="$CC"
MPICXX="$CXX"
AC_SUBST(MPICC)
AC_SUBST(MPICXX)
fi
AM_CONDITIONAL([WE_HAVE_MPI],[test "x$with_mpi" = "xyes"])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Checks for library functions.
AC_CHECK_FUNCS([pow])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
_AC_SRCDIRS(["."])
export ac_top_srcdir
$ac_top_srcdir/patch.sh