From 6096eb2db483cddd2211b9d8bc96298a38ac3169 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Feb 2015 18:00:03 +0100 Subject: Check if we need librt for clock_gettime in configure script --- build/linux/Makefile.in | 3 ++- build/linux/configure.ac | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 685e1e5..5b4c9fa 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -19,10 +19,11 @@ VPATH=../.. CPPFLAGS=@SAVED_CPPFLAGS@ CXXFLAGS=@SAVED_CXXFLAGS@ LDFLAGS=@SAVED_LDFLAGS@ +LIBS=@SAVED_LIBS@ CPPFLAGS+=-I../.. -I../../include -I../../lib/include/rapidxml CXXFLAGS+=-g -O3 -Wall -Wshadow -LIBS=-lpthread -lrt +LIBS+=-lpthread LDFLAGS+=-g ifeq ($(cuda),yes) diff --git a/build/linux/configure.ac b/build/linux/configure.ac index f99c4d3..cbf6016 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 @@ -47,6 +48,32 @@ dnl Use iostream to check if the C++ compiler works AC_CHECK_HEADER(iostream, , AC_MSG_ERROR([No working c++ compiler found])) +# clock_gettime + +AC_MSG_CHECKING([for clock_gettime]) +AC_TRY_LINK([ +#include +],[ +struct timespec t; clock_gettime(CLOCK_REALTIME, &t); +],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no) +AC_MSG_RESULT($astra_clock_gettime_ok) +if test x$astra_clock_gettime_ok = xno; then + AC_MSG_CHECKING([for clock_gettime in librt]) + LIBS="$LIBS -lrt" + AC_TRY_LINK([ + #include + ],[ + struct timespec t; clock_gettime(CLOCK_REALTIME, &t); + ],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no) + AC_MSG_RESULT($astra_clock_gettime_ok) + if test x$astra_clock_gettime_ok = xno; then + AC_MSG_ERROR([No clock_gettime found]) + else + SAVED_LIBS="$SAVED_LIBS -lrt" + fi +fi + + # boost-unit-test-framework AC_MSG_CHECKING([for boost-unit-test-framework]) @@ -179,6 +206,7 @@ AC_SUBST(HAVEMATLAB) AC_SUBST(SAVED_CPPFLAGS) AC_SUBST(SAVED_CXXFLAGS) AC_SUBST(SAVED_LDFLAGS) +AC_SUBST(SAVED_LIBS) AC_CONFIG_FILES([Makefile]) -- cgit v1.2.3 From 7dda95b08055350bd5525b0ff196769be82b4450 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 25 Feb 2015 10:42:18 +0100 Subject: Improve logging for nvcc hack --- build/linux/acinclude.m4 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'build/linux') diff --git a/build/linux/acinclude.m4 b/build/linux/acinclude.m4 index 4ff9e4b..713b5d3 100644 --- a/build/linux/acinclude.m4 +++ b/build/linux/acinclude.m4 @@ -60,8 +60,14 @@ AC_DEFUN([ASTRA_RUN_STOREOUTPUT],[{ test $ac_status = 0; }]) -dnl ASTRA_RUN(command) -AC_DEFUN([ASTRA_RUN],[ASTRA_RUN_STOREOUTPUT($1,/dev/null)]) +dnl ASTRA_RUN_LOGOUTPUT(command) +AC_DEFUN([ASTRA_RUN_LOGOUTPUT],[{ + AS_ECHO(["$as_me:${as_lineno-$LINENO}: $1"]) >&AS_MESSAGE_LOG_FD + ( $1 ) >&AS_MESSAGE_LOG_FD 2>&1 + ac_status=$? + AS_ECHO(["$as_me:${as_lineno-$LINENO}: \$? = $ac_status"]) >&AS_MESSAGE_LOG_FD + test $ac_status = 0; + }]) @@ -79,9 +85,9 @@ ASTRA_RUN_STOREOUTPUT([$NVCC -c -o conftest.o conftest.cu $$2],conftest.nvcc.out $1="no" # Check if hack for gcc 4.4 helps if grep -q __builtin_stdarg_start conftest.nvcc.out; then + AS_ECHO(["$as_me:${as_lineno-$LINENO}: Trying CUDA hack for gcc 4.4"]) >&AS_MESSAGE_LOG_FD NVCC_OPT="-Xcompiler -D__builtin_stdarg_start=__builtin_va_start" - - ASTRA_RUN([$NVCC -c -o conftest.o conftest.cu $$2 $NVCC_OPT]) && { + ASTRA_RUN_LOGOUTPUT([$NVCC -c -o conftest.o conftest.cu $$2 $NVCC_OPT]) && { $1="yes" $2="$$2 $NVCC_OPT" } @@ -94,6 +100,7 @@ fi rm -f conftest.cu conftest.o conftest.nvcc.out ]) + dnl ASTRA_FIND_NVCC_ARCHS(archs-to-try,cppflags-to-extend,output-list) dnl Architectures should be of the form 10,20,30,35, dnl and should be in order. The last accepted one will be used for PTX output. -- cgit v1.2.3 From 8df1ed4c66ac41d1c44fabdadd7be5b771098963 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 25 Feb 2015 10:42:48 +0100 Subject: Fix copy-paste error in boost-unit-test-framework check --- build/linux/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index cbf6016..a33b0bc 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -81,7 +81,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 -- cgit v1.2.3 From e8de27710cf8786fd2f09e22e209fa61eb72cb2c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 25 Feb 2015 10:43:43 +0100 Subject: Clean up configure check for nvcc --- build/linux/configure.ac | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index a33b0bc..bf033f4 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -92,48 +92,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? @@ -142,11 +135,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 -- cgit v1.2.3 From dd63c8a9b125ebab755a9c898d0064b5fb8decd7 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 25 Feb 2015 10:45:05 +0100 Subject: Output summary of results at end of configure --- build/linux/configure.ac | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index bf033f4..3521e68 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -174,7 +174,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]) @@ -201,6 +201,12 @@ AC_SUBST(SAVED_CXXFLAGS) AC_SUBST(SAVED_LDFLAGS) AC_SUBST(SAVED_LIBS) +echo +echo "Summary of ASTRA Toolbox build options:" +echo " CUDA : $HAVECUDA" +echo " Matlab : $HAVEMATLAB" +echo + AC_CONFIG_FILES([Makefile]) AC_OUTPUT -- cgit v1.2.3 From c2005e33b2152ca7cd306590ea22fe1c1bd68c29 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 25 Feb 2015 11:01:02 +0100 Subject: Also output prefix at end of configure --- build/linux/configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 3521e68..639264b 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -200,13 +200,13 @@ 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 - - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT +echo " prefix : $prefix" +echo -- cgit v1.2.3 From 8c02a01bc617e99e1c6b7627676402bb276bac80 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 25 Feb 2015 14:09:38 +0100 Subject: Remove CAsyncAlgorithm::timedJoin It is currently unused, and its current implementation is not very portable. --- build/linux/configure.ac | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index cbf6016..24f0124 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -48,32 +48,6 @@ dnl Use iostream to check if the C++ compiler works AC_CHECK_HEADER(iostream, , AC_MSG_ERROR([No working c++ compiler found])) -# clock_gettime - -AC_MSG_CHECKING([for clock_gettime]) -AC_TRY_LINK([ -#include -],[ -struct timespec t; clock_gettime(CLOCK_REALTIME, &t); -],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no) -AC_MSG_RESULT($astra_clock_gettime_ok) -if test x$astra_clock_gettime_ok = xno; then - AC_MSG_CHECKING([for clock_gettime in librt]) - LIBS="$LIBS -lrt" - AC_TRY_LINK([ - #include - ],[ - struct timespec t; clock_gettime(CLOCK_REALTIME, &t); - ],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no) - AC_MSG_RESULT($astra_clock_gettime_ok) - if test x$astra_clock_gettime_ok = xno; then - AC_MSG_ERROR([No clock_gettime found]) - else - SAVED_LIBS="$SAVED_LIBS -lrt" - fi -fi - - # boost-unit-test-framework AC_MSG_CHECKING([for boost-unit-test-framework]) -- cgit v1.2.3 From e64e295fc6394124fdb4bf2630c823744eac23ea Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Wed, 25 Feb 2015 08:11:53 +0100 Subject: Added libtool check for OSX --- build/linux/autogen.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'build/linux') diff --git a/build/linux/autogen.sh b/build/linux/autogen.sh index c856793..544fdeb 100755 --- a/build/linux/autogen.sh +++ b/build/linux/autogen.sh @@ -12,9 +12,12 @@ if test $? -ne 0; then exit 1 fi -libtoolize --install --force > /dev/null 2>&1 +case `uname` in Darwin*) LIBTOOLIZEBIN=glibtoolize ;; + *) LIBTOOLIZEBIN=libtoolize ;; esac + +$LIBTOOLIZEBIN --install --force > /dev/null 2>&1 if test $? -ne 0; then - libtoolize --force + $LIBTOOLIZEBIN --force if test $? -ne 0; then echo "Error running libtoolize" exit 1 -- cgit v1.2.3