diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-02-26 11:51:50 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-02-26 11:51:50 +0100 |
commit | d2407fea1ed7c3c718a4c115d8c632664c2378dd (patch) | |
tree | 9f0d21c77d64da4e9be1f4b0ba99f54edc691ad5 /build/linux/configure.ac | |
parent | 3cae1d138c53a3fd042de3d2c9d9a07cf0650e0f (diff) | |
parent | 0ca00f4c671d6d583ae77838d3e0d4fcd411f077 (diff) | |
download | astra-d2407fea1ed7c3c718a4c115d8c632664c2378dd.tar.gz astra-d2407fea1ed7c3c718a4c115d8c632664c2378dd.tar.bz2 astra-d2407fea1ed7c3c718a4c115d8c632664c2378dd.tar.xz astra-d2407fea1ed7c3c718a4c115d8c632664c2378dd.zip |
Merge branch 'master' into python-interface
Diffstat (limited to 'build/linux/configure.ac')
-rw-r--r-- | build/linux/configure.ac | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 7ad03c3..f4cc82e 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -31,6 +31,7 @@ LT_INIT([disable-static]) SAVED_CPPFLAGS="$CPPFLAGS" SAVED_CXXFLAGS="$CXXFLAGS" SAVED_LDFLAGS="$LDFLAGS" +SAVED_LIBS="$LIBS" AC_CANONICAL_BUILD AC_CANONICAL_HOST @@ -54,7 +55,7 @@ AC_MSG_CHECKING([for boost-unit-test-framework]) ASTRA_CHECK_BOOST_UNIT_TEST_FRAMEWORK(-lboost_unit_test_framework-mt, BOOSTUTF=yes_mt, BOOSTUTF=no) if test x$BOOSTUTF = xno; then ASTRA_CHECK_BOOST_UNIT_TEST_FRAMEWORK(-lboost_unit_test_framework, BOOSTUTF=yes, BOOSTUTF=no) - if test x$BOOSTTHREAD = xno; then + if test x$BOOSTUTF = xno; then AC_MSG_RESULT(no) AC_MSG_ERROR([No boost-unit-test-framework library found]) else @@ -65,48 +66,41 @@ else AC_MSG_RESULT([yes, libboost_unit_test_framework-mt]) LIBS_BOOSTUTF="-lboost_unit_test_framework-mt" fi -# TODO: do something with the result # nvcc, cuda AC_ARG_WITH(cuda, [[ --with-cuda=path path of CUDA SDK (optional)]],,) -NVCC_PATH=$PATH -if test x"$with_cuda" != x; then - NVCC_PATH="$with_cuda/bin:$NVCC_PATH" +if test x"$with_cuda" != xno; then + NVCC_PATH=$PATH + if test x"$with_cuda" != x -a x"$with_cuda" != xyes; then + NVCC_PATH="$with_cuda/bin:$NVCC_PATH" + fi + AC_PATH_PROG([NVCC], [nvcc], [no], [$NVCC_PATH]) +else + NVCC=no fi -AC_PATH_PROG([NVCC], [nvcc], [no], [$NVCC_PATH]) -# TODO: do something with the result HAVECUDA=no if test x"$NVCC" != xno; then HAVECUDA=yes BACKUP_CUDA_LDFLAGS="$LDFLAGS" - if test x"$with_cuda" != x; then - LDFLAGS_CUDA="-L$with_cuda/lib" + if test x"$with_cuda" != x -a x"$with_cuda" != xyes; then + case $host_cpu in + x86_64) + LDFLAGS_CUDA="-L$with_cuda/lib64" + ;; + *) + LDFLAGS_CUDA="-L$with_cuda/lib" + ;; + esac CPPFLAGS_CUDA="-I$with_cuda/include" LDFLAGS="$LDFLAGS $LDFLAGS_CUDA" fi AC_CHECK_LIB(cudart,cudaMalloc, ,HAVECUDA=no) AC_CHECK_LIB(cufft,cufftPlan1d, ,HAVECUDA=no) - if test x"$HAVECUDA" = xno; then - # try lib64 instead of lib - - HAVECUDA=yes - LDFLAGS="$BACKUP_CUDA_LDFLAGS" - - # prevent cached values from being used - unset ac_cv_lib_cudart_cudaMalloc - unset ac_cv_lib_cufft_cufftPlan1d - - LDFLAGS_CUDA="-L$with_cuda/lib64" - LDFLAGS="$LDFLAGS $LDFLAGS_CUDA" - AC_CHECK_LIB(cudart,cudaMalloc, ,HAVECUDA=no) - AC_CHECK_LIB(cufft,cufftPlan1d, ,HAVECUDA=no) - fi - LDFLAGS="$BACKUP_CUDA_LDFLAGS" unset BACKUP_CUDA_LDFLAGS # TODO: check for cuda headers? @@ -115,11 +109,11 @@ if test x"$NVCC" != xno; then fi NVCCFLAGS="" -AC_MSG_CHECKING([if nvcc works]) if test x"$HAVECUDA" = xyes; then + AC_MSG_CHECKING([if nvcc works]) ASTRA_CHECK_NVCC(HAVECUDA,NVCCFLAGS) + AC_MSG_RESULT($HAVECUDA) fi -AC_MSG_RESULT($HAVECUDA) AC_ARG_WITH(cuda_compute, [[ --with-cuda-compute=archs comma separated list of CUDA compute models (optional)]],,) if test x"$HAVECUDA" = xyes; then @@ -154,7 +148,7 @@ if test x"$with_matlab" != x; then AC_SUBST(MEX) MATLAB_ROOT="$with_matlab" AC_SUBST(MATLAB_ROOT) - + # TODO: maybe catch mex warnings ASTRA_CHECK_MEX_SUFFIX([mexa64 mexglx mexmaci64 mexmaci],[MEXSUFFIX]) if test x$MEXSUFFIX = x; then AC_MSG_FAILURE([Unable to determine matlab mex suffix]) @@ -196,7 +190,14 @@ AC_SUBST(HAVEPYTHON) AC_SUBST(SAVED_CPPFLAGS) AC_SUBST(SAVED_CXXFLAGS) AC_SUBST(SAVED_LDFLAGS) - - +AC_SUBST(SAVED_LIBS) AC_CONFIG_FILES([Makefile]) AC_OUTPUT + +echo +echo "Summary of ASTRA Toolbox build options:" +echo " CUDA : $HAVECUDA" +echo " Matlab : $HAVEMATLAB" +echo +echo " prefix : $prefix" +echo |