######################################################################## # # -*- Autoconf -*- # configure.in # by y.tosa # June 17, 2004 # # Process this file with autoconf to produce a configure script. # # CVS Revision Info: # $Author: nicks $ # $Date: 2012/01/09 21:42:00 $ # $Revision: 1.558 $ # ######################################################################## AC_PREREQ(2.57) AC_INIT(Freesurfer, dev5, freesurfer@nmr.mgh.harvard.edu) # if $FREESURFER_HOME is defined, then use that as default install dir: if test ! "x${FREESURFER_HOME}" = "x"; then ac_default_prefix=${FREESURFER_HOME} else # else use this as default install dir: ac_default_prefix=/usr/local/freesurfer/${PACKAGE_VERSION} fi AC_PREFIX_DEFAULT($ac_default_prefix) AC_CONFIG_AUX_DIR([config]) # create special dir for intermediate files AC_MSG_NOTICE(Setting System...) # set target, build, host etc. AC_CANONICAL_SYSTEM ######################################################################## # To use the Intel C/C++ compiler, assuming it is installed here: # /opt/intel/cce/10.0.023 # do this prior to configuring: # source /opt/intel/cce/10.0.023/bin/iccvars.csh # setenv CC icc # setenv CXX icpc # setenv LD icpc # setenv LDFLAGS "-L/opt/intel/cce/10.0.023/lib" # # Note: until all the warnings produced by icc are fixed in the source, # it is necessary to remove -Werror from CFLAGS (see WERROR in this file) ######################################################################## ################################################################ # AMD Open64 Compiler # Note: libmv.so* should be renamed to force usage of libmv.a, # otherwise binaries wont run on systems w/o compiler installed. ################################################################ ac_open64_includes="NO" ac_open64_libraries="NO" ac_open64_binaries="NO" LIBS_OPEN64="" AC_MSG_CHECKING(AMD Open64 compiler directories) AC_ARG_WITH(open64-dir, [ --with-open64-dir=DIR where the root of Open64 is installed.], [ ac_open64_binaries="$withval/bin" CC="${ac_open64_binaries}/opencc" CFLAGS="-Wno-uninitialized -OPT:Olimit=0" CXX="${ac_open64_binaries}/openCC" CXXFLAGS="-Wno-uninitialized -OPT:Olimit=0" LD="${ac_open64_binaries}/openCC" F77="${ac_open64_binaries}/openf90" FFLAGS="-extend_source" ]) AC_ARG_WITH(open64-include, [ --with-open64-include=DIR root of Open64 include directory.], [ ac_open64_includes="$withval" ]) AC_ARG_WITH(open64-libraries, [ --with-open64-libraries=DIR root of Open64 lib directory.], [ ac_open64_libraries="$withval" LDFLAGS="-L${ac_open64_libraries}" LIBS_OPEN64="-lm ${ac_open64_libraries}/libmv.a ${ac_open64_libraries}/libopen64rt.a " ]) if test ! "$ac_open64_binaries" = "NO"; then AC_MSG_RESULT(Open64 bin directory is ${ac_open64_binaries}) else AC_MSG_RESULT(Open64 directory is not supplied) fi AC_SUBST(LIBS_OPEN64)AM_CONDITIONAL(HAVE_OPEN64_COMPILER, ! test "x$ac_open64_binaries" = "xNO") ##################################################################### # perform our own vendor string customizations... ##################################################################### if test -e /etc/redhat-release ; then # Centos6 cat /etc/redhat-release | grep CentOS | grep 6 >& /dev/null if test "$?" = "0"; then build_vendor="centos6" host_vendor="centos6" if test "x$host" = "xi686-redhat-linux-gnu"; then host="Linux-centos6" fi if test "x$host" = "xx86_64-redhat-linux-gnu"; then host="Linux-centos6_x86_64" fi fi # Centos5 cat /etc/redhat-release | grep CentOS | grep 5 >& /dev/null if test "$?" = "0"; then build_vendor="centos5" host_vendor="centos5" if test "x$host" = "xi686-redhat-linux-gnu"; then host="Linux-centos5" fi if test "x$host" = "xx86_64-redhat-linux-gnu"; then host="Linux-centos5_x86_64" fi fi # Centos4 cat /etc/redhat-release | grep CentOS | grep 4 >& /dev/null if test "$?" = "0"; then build_vendor="centos4" host_vendor="centos4" if test "x$host" = "xi686-redhat-linux-gnu"; then host="Linux-centos4" fi if test "x$host" = "xx86_64-redhat-linux-gnu"; then host="Linux-centos4_x86_64" fi fi # RedHat9 cat /etc/redhat-release | grep "Red Hat Linux" | grep 9 >& /dev/null if test "$?" = "0"; then build_vendor="rh9" host_vendor="rh9" if test "x$host" = "xi686-pc-linux-gnu"; then host="Linux-rh9" fi fi fi if test -e /etc/debian_version ; then # Debian3 cat /etc/debian_version | grep 3 >& /dev/null if test "$?" = "0"; then build_vendor="debian3" host_vendor="debian3" if test "x$host" = "xi686-unknown-linux-gnu"; then host="Linux-debian3" fi if test "x$host" = "xx86_64-unknown-linux-gnu"; then host="Linux-debian3_x86_64" fi fi fi if test -d /etc/susehelp.d ; then # SuSE build_vendor="suse" host_vendor="suse" if test "x$host" = "xia64-unknown-linux-gnu"; then host="Linux-suse-ia64" fi fi AC_SUBST(build_vendor) AC_SUBST(host_vendor) AC_SUBST(host) AM_INIT_AUTOMAKE(tar-ustar) AC_CONFIG_SRCDIR([config.h.in]) AM_CONFIG_HEADER([config.h]) ##################################################################### # if CFLAGS and CXXFLAGS are not already set, then set to empty, # otherwise, AC_PROG_CPP and AC_PROG_CXX will automatically append # "-g -O2", flags over which we'd rather have explicit control per OS ##################################################################### if test "x$CFLAGS" = "x"; then CFLAGS="" AC_SUBST(CFLAGS) fi if test "x$CXXFLAGS" = "x"; then CXXFLAGS="" AC_SUBST(CXXFLAGS) fi ############################################################### # Checks for programs. ############################################################### AC_PROG_CXX AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_LIBTOOL_CXX AC_PROG_F77 if test "x$F77" = "x"; then AC_MSG_ERROR([FATAL: A Fortran 77 compiler is required!]) fi # hack: when building with gcc 4.4.*, AC_PROC_LIBTOOL creates # a libtool which when run gives CDPATH errors. the workaround # is to use the libtool on the system. if test "${CC}" = "gcc"; then gcc --version | head -n 1 | awk '{print $2 $3}' | grep "(GCC)4.4." >& /dev/null if test "$?" = "0"; then AC_MSG_NOTICE(Copying /usr/bin/libtool overtop the PROG_LIBTOOL) cp /usr/bin/libtool . fi fi ################################################################ # Checks for header files. ################################################################ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([\ arpa/inet.h \ fcntl.h \ float.h \ limits.h \ locale.h \ malloc.h \ memory.h \ netdb.h \ netinet/in.h \ stddef.h \ stdlib.h \ string.h \ strings.h \ sys/file.h \ sys/ioctl.h \ sys/param.h \ sys/socket.h \ sys/time.h \ sys/timeb.h \ unistd.h \ values.h \ wctype.h]) # the following is needed on Mac OS Darwin AC_CHECK_HEADERS(sys/types.h stdint.h) ################################################################ # Checks for typedefs, structures, and compiler characteristics. ################################################################ AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_CHECK_TYPES([ptrdiff_t]) ################################################################ # Checks for library functions. # autoscan says freesurfer uses these: ################################################################ AC_FUNC_CLOSEDIR_VOID AC_FUNC_ERROR_AT_LINE AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MMAP AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_STRTOD AC_FUNC_VPRINTF AC_C_VOLATILE AC_FUNC_FORK #AC_FUNC_MALLOC (can redefine malloc as rpl_malloc) AC_FUNC_MEMCMP #AC_FUNC_REALLOC AC_HEADER_STDBOOL AC_TYPE_PID_T # autoscan says freesurfer uses these functions: AC_CHECK_FUNCS([\ bzero \ calloc \ dup2 \ floor \ ftime \ getdelim \ getenv \ getcwd \ getpagesize \ gettimeofday \ isascii \ memmove \ memset \ mkdir \ munmap \ pow \ putenv \ rint \ select \ setenv \ sqrt \ strcasecmp \ strchr \ strcspn \ strdup \ strerror \ strncasecmp \ strrchr \ strspn \ strstr \ strtol \ uname]) # many linux systems dont have libg2c.so, the shared lib supporting g77, # so build using the static lib if available, so that distro is more # widely compatible. the talairach_avi/Makefile.am file uses LIB_G2C_A LIB_G2C_A="" if test -e /usr/local/lib/libg2c.a ; then LIB_G2C_A="/usr/local/lib/libg2c.a" fi if test -e /usr/lib/libg2c.a ; then LIB_G2C_A="/usr/lib/libg2c.a" fi if test -e /usr/lib64/libg2c.a ; then LIB_G2C_A="/usr/lib64/libg2c.a" fi if test "$host" = "powerpc64-suse-linux"; then if test -e /usr/lib/libg2c.a ; then LIB_G2C_A="/usr/lib/libg2c.a" fi fi AC_SUBST(LIB_G2C_A) # as the law of unintended consequences would have it, when linking # against -lblas and -llapack, it uses the shared versions (.so) which # expect that shared libg2c exists, which it may not if we are forcing the # use of a static libg2c.a, so find the static libblas and liblapack. # the fem_elastic build dir uses LIB_BLAS_A and LIB_LAPACK_A LIB_BLAS_A="" if test -e /usr/local/lib/libblas.a ; then LIB_BLAS_A="/usr/local/lib/libblas.a" fi if test -e /usr/lib/libblas.a ; then LIB_BLAS_A="/usr/lib/libblas.a" fi if test -e /usr/lib64/libblas.a ; then LIB_BLAS_A="/usr/lib64/libblas.a" fi if test "$host" = "powerpc64-suse-linux"; then if test -e /usr/lib/libblas.a ; then LIB_BLAS_A="/usr/lib/libblas.a" fi fi AC_SUBST(LIB_BLAS_A) LIB_LAPACK_A="" if test -e /usr/local/lib/liblapack.a ; then LIB_LAPACK_A="/usr/local/lib/liblapack.a" fi if test -e /usr/lib/liblapack.a ; then LIB_LAPACK_A="/usr/lib/liblapack.a" fi if test -e /usr/lib64/liblapack.a ; then LIB_LAPACK_A="/usr/lib64/liblapack.a" fi if test "$host" = "powerpc64-suse-linux"; then if test -e /usr/lib/liblapack.a ; then LIB_LAPACK_A="/usr/lib/liblapack.a" fi fi AC_SUBST(LIB_LAPACK_A) ################################################################ # Most of our scripts use /bin/tcsh, so make sure it exists ################################################################ AC_CHECK_FILE(/bin/tcsh,[], [AC_MSG_ERROR([FATAL: /bin/tcsh is required!])]) # links with g++ rather than gcc (and check for Intel and AMD Compilers) CCLD=g++ if test "x$CC" = "xicc"; then CCLD=icpc fi if test "x$CC" = "x${ac_open64_binaries}/opencc"; then CCLD=${ac_open64_binaries}/openCC fi AC_SUBST(CCLD) # two programs used for compress/decompress files # cannot make AC_MSG_ERROR work inside the AC_CHECK_PROG so # that I took it out. AC_CHECK_PROG([HAS_ZCAT],[zcat],[1],[]) if test ! "$HAS_ZCAT" = "1"; then AC_MSG_ERROR([FATAL: zcat is required in handling mgz etc. \ Put it in the path.]) fi AC_CHECK_PROG([HAS_GZIP],[gzip],[1],[]) if test ! "$HAS_GZIP" = "1"; then AC_MSG_ERROR([FATAL: gzip is required in creating mgz etc. \ Put it in the path.]) fi # # latex is optionally used to regenerate some fsfast docs AC_CHECK_PROG(LATEX, latex, latex) AM_CONDITIONAL(HAVE_LATEX, ! test -z "$LATEX") # # xxd is optionally used to convert .xml to a .h, for .c data incorporation AC_CHECK_PROG(XXD, xxd, xxd) AM_CONDITIONAL(HAVE_XXD, ! test -z "$XXD") # # xmllint is optionally used to check the help.xml files for correctness AC_CHECK_PROG(XMLLINT, xmllint, xmllint) AM_CONDITIONAL(HAVE_XMLLINT, ! test -z "$XMLLINT") ################################################################ # set platform related variable defaults for (Teem) NrrdIO # in utils ################################################################ TEEM_DIO=0 TEEM_32BIT=1 TEEM_ENDIAN=4321 TEEM_QNANHIBIT=1 AC_SUBST(TEEM_DIO) AC_SUBST(TEEM_QNANHIBIT) ################################################################ # define OS ################################################################ AC_C_BIGENDIAN_CROSS echo "byte order is " $BYTEORDER AC_SUBST(BYTEORDER) TEEM_ENDIAN=$BYTEORDER # Support for files >2GB (Large File Support) LFS_CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" # -Wno-unknown-pragmas suppresses warnings about unknown gcc pragmas, # like pragma indent NUPRAG="-Wno-unknown-pragmas" # Freesurfer should compile with -Wall (which enables all warnings) # and -Werror (which escalates warnings to errors, thus stopping the # build), but here we allow a bypass: WALL="-Wall" WERROR="-Werror" AC_ARG_ENABLE(Wall, [ --disable-Wall do not add -Wall to compiler flags], [ WALL="" ], [ WALL="-Wall" ]) AC_ARG_ENABLE(Werror, [ --disable-Werror do not add -Werror to compiler flags], [ WERROR="" ], [ WERROR="-Werror" ]) # the Intel C/C++ compiler complains about *a lot* of stuff, so # escalating warnings to errors (which stops the build) is not an # possible right now if test "x$CC" = "xicc"; then WERROR="" fi # to strip unused code when using Linux gcc: #DEADCODE_STRIP="-ffunction-sections -Wl,--gc-sections" # does not work in scuba2! so leave empty: DEADCODE_STRIP="" # and on the Mac: DEADCODE_STRIP_MAC="-dead_strip" ac_have_sse_mathfun=no FCLIBS="" AC_MSG_NOTICE(Setting OS from target...) case "${target}" in i*86-*-linux-gnu*) OS=Linux OS_CPPFLAGS="$DEADCODE_STRIP" OS_LDFLAGS="$DEADCODE_STRIP" DYNAMIC_LIB_EXT=".so" SHARED_CFLAGS="-fPIC " SHARED_LDFLAGS="-shared " CPPFLAGS="-g -O3 -msse2 -mfpmath=sse $WALL $WERROR $LFS_CFLAGS" FFLAGS="-g -O3 -msse2 -mfpmath=sse" ac_have_sse_mathfun=yes ;; x86_64-*) OS=Linux OS_CPPFLAGS="$DEADCODE_STRIP" OS_LDFLAGS="$DEADCODE_STRIP" LDFLAGS="-L/usr/lib64 -L/usr/X11R6/lib64 $LDFLAGS" DYNAMIC_LIB_EXT=".so" SHARED_CFLAGS="-fPIC" SHARED_LDFLAGS="-shared" CPPFLAGS="-g -O3 -msse2 -mfpmath=sse $WALL $WERROR" FFLAGS="-g -O3 -msse2 -mfpmath=sse" ac_have_sse_mathfun=yes TEEM_32BIT=0 ;; ia64-*) OS=Linux OS_CPPFLAGS= OS_LDFLAGS= DYNAMIC_LIB_EXT=".so" SHARED_CFLAGS="-fPIC" SHARED_LDFLAGS="-shared" CPPFLAGS="-g -O2 $WALL $WERROR $LFS_CFLAGS" TEEM_32BIT=0 ;; *-apple-darwin*) # Mac OS X OS=Darwin OS_CPPFLAGS= OS_LDFLAGS="$DEADCODE_STRIP_MAC" DYNAMIC_LIB_EXT=".dylib" SHARED_CFLAGS="-fno-common" SHARED_LDFLAGS="-dynamiclib" CPPFLAGS="-gfull -O3 $WALL $WERROR $LFS_CFLAGS" FCLIBS="-L/usr/lib -lgcc" ;; i*86-*-solaris*) OS=SunOS OS_CPPFLAGS= OS_LDFLAGS= DYNAMIC_LIB_EXT=".so" SHARED_CFLAGS="-fPIC " SHARED_LDFLAGS="-shared " CPPFLAGS="-g -O2 $WALL $WERROR $NUPRAG" ;; i*86-pc-cygwin) OS=Windows_NT OS_CPPFLAGS= OS_LDFLAGS= DYNAMIC_LIB_EXT= SHARED_CFLAGS= SHARED_LDFLAGS= CPPFLAGS="-g -O2 $WALL $WERROR $NUPRAG" ;; powerpc64-*-linux-gnu*) OS=Linux OS_CPPFLAGS="$DEADCODE_STRIP" OS_LDFLAGS="$DEADCODE_STRIP" DYNAMIC_LIB_EXT=".so" SHARED_CFLAGS="-fPIC " SHARED_LDFLAGS="-shared " CPPFLAGS="-g -O2 $WALL $WERROR $LFS_CFLAGS" ;; powerpc64-suse-linux) OS=Linux OS_CPPFLAGS="$DEADCODE_STRIP" OS_LDFLAGS="$DEADCODE_STRIP" DYNAMIC_LIB_EXT=".so" SHARED_CFLAGS="-fPIC " SHARED_LDFLAGS="-shared " CPPFLAGS="-g -O2 $WALL $WERROR $LFS_CFLAGS" ;; esac AC_SUBST(OS) AC_SUBST(OS_CPPFLAGS) AC_SUBST(OS_LDFLAGS) AC_SUBST(DYNAMIC_LIB_EXT) AC_SUBST(TEEM_32BIT) AC_SUBST(TEEM_ENDIAN) # export AC_SUBST(SHARED_CFLAGS) AC_SUBST(SHARED_LDFLAGS) AC_SUBST(FCLIBS) AC_MSG_NOTICE(OS is $OS) AM_CONDITIONAL(HAVE_MAC_OSX, test "x$OS" = "xDarwin" ) ################################################################ # gfortran ################################################################ # Centos 5 needs libgfortran when linking fem_elastic/surf2vol LIB_GFORTRAN="" # but the Mac doesnt need libgfortran! furthermore, its not installed # by default, so dont use it on the Mac! # NOTE! OS was just defined, so dont move this section if test ! "$OS" = "Darwin"; then AC_CHECK_LIB([gfortran], [_gfortran_compare_string],\ [LIB_GFORTRAN="-lgfortran"],[]) fi AC_SUBST(LIB_GFORTRAN) AM_CONDITIONAL(HAVE_GFORTRAN, test ! "x$LIB_GFORTRAN" = "x" ) # note: gcc 4.4 might give 'undefined reference to _gfortran_ errors, and so # the following may be necessary to get around this, as root: # cd /usr/lib64 # rm libgfortran.so; # ln -s libgfortran.so.1.0.0 libgfortran.so ################################################################ # SSE matrix and math functions (affine.h, sse_mathfun.h) ################################################################ #ac_have_sse_mathfun is initialized in OS target section above AC_ARG_ENABLE(sse_mathfun, [ --disable-sse_mathfun disable SSE math function support], [ ac_have_sse_mathfun=no AC_MSG_NOTICE(Disabling usage of SSE math functions) ]) # note that if compiling with x86, ac_have_sse_mathfun is set to 'yes' # (see OS target stuff), so --disable-sse_mathfun is used to disable for testing if test "x$ac_have_sse_mathfun" = "xyes"; then CPPFLAGS="$CPPFLAGS -DUSE_SSE_MATHFUN" fi AM_CONDITIONAL(USE_SSE_MATHFUN, test "x$ac_have_sse_mathfun" = "xyes") ############################################################## # OpenMP ############################################################## ac_have_openmp=no AC_ARG_ENABLE(openmp, [ --enable-openmp enable OpenMP multi-core support], [ ac_have_openmp=yes AC_MSG_NOTICE(Using OpenMP) if test "${CC}" = "icc"; then CPPFLAGS="-D_OPENMP -openmp $CPPFLAGS" else CPPFLAGS="-D_OPENMP -fopenmp $CPPFLAGS" fi ]) AM_CONDITIONAL(HAVE_OPENMP, test "x$ac_have_openmp" = "xyes") ############################################################## # OpenCV ############################################################## AC_ARG_WITH([opencv], [ --with-opencv=PATH prefix where opencv is installed]) use_opencv="no" OPENCV_DIR="no" if test -n "$with_opencv"; then OPENCV_DIR="$with_opencv" else if test -e /usr/pubsw/packages/opencv/current ; then OPENCV_DIR="/usr/pubsw/packages/opencv/current" fi fi if( test ! "x$OPENCV_DIR" = "xno" ) then use_opencv="yes" LIB_OPENCV="" OPENCV_CXXFLAGS="-I$OPENCV_DIR/include" OPENCV_LIBS="-L$OPENCV_DIR/lib -lm -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml" fi AC_SUBST(OPENCV_CXXFLAGS) AC_SUBST(OPENCV_LIBS) AC_SUBST(OPENCV_DIR) # if --without-opencv was specified, disable opencv build AM_CONDITIONAL(BUILDOPENCV, test x$use_opencv = xyes) ############################################################## # OPENCL enabling - added by Dan Ginsburg ############################################################## AC_ARG_WITH([opencl], [ --with-opencl=PATH prefix where opencl is installed]) use_opencl="no" OPENCL_LIB_EXT="lib" # Use /lib by default case "${target}" in x86_64-*) OPENCL_LIB_EXT="lib64" ;; esac OPENCL_INCDIR="" if test "$OS" = "Darwin"; then # On Mac OS X 10.6, OpenCL is provided by Apple so look for these # directories by default OPENCL_CFLAGS="-I/System/Library/Frameworks/OpenCL.framework/Headers" OPENCL_LIBS="-framework OpenCL" OPENCL_INCDIR="/System/Library/Frameworks/OpenCL.framework/Headers" elif test -n "$with_opencl" then # For Linux, the OpenCL implementation directory should be specified # using --with-opencl. Currently, the ATI Stream SDK v2.0 and # NVIDIA GPU SDK provides an OpenCL implementation. You must # also have the appropriate driver installed to get GPU support. # The ATI Stream SDK provides generic CPU support across both AMD # and Intel CPUs. OPENCL_CFLAGS="-I$with_opencl/include" OPENCL_LIBS="-L$with_opencl/$(OPENCL_LIB_EXT) -lOpenCL" OPENCL_INCDIR="$with_opencl/include/CL" fi AC_SUBST(OPENCL_CFLAGS) AC_SUBST(OPENCL_LIBS) AC_CHECK_FILE($OPENCL_INCDIR/cl.h, use_opencl="yes", use_opencl="no") AM_CONDITIONAL(BUILDOPENCL, test x$use_opencl = xyes) if( test ! "x$use_opencl" = "xno" ) then AC_DEFINE([FS_OPENCL],[1],[Defined if OPENCL should be used]) fi ############################################################# # Nvidia CUDA enabling ############################################################# AC_ARG_WITH([cuda], [ --with-cuda=PATH prefix where cuda is installed [default=auto]]) if test -n "$with_cuda"; then CUDA_DIR="$with_cuda" else if test -e /usr/pubsw/packages/CUDA/current ; then CUDA_DIR="/usr/pubsw/packages/CUDA/current" else if test -e /usr/local/cuda ; then CUDA_DIR="/usr/local/cuda" fi fi fi if( test ! "x$CUDA_DIR" = "xno" ) then LIB_CUDA="" AC_CHECK_LIB([cuda -L$CUDA_DIR/lib], [cuInit],[LIB_CUDA="-lcuda"],[]) AC_SUBST(LIB_CUDA) CUDA_CFLAGS="-I$CUDA_DIR/include" CUDA_LIBS="-L$CUDA_DIR/lib $LIB_CUDA -lcudart" if test -e /usr/lib64 ; then CUDA_LIBS="-L$CUDA_DIR/lib64 $LIB_CUDA -lcudart" fi NVCC="$CUDA_DIR/bin/nvcc" fi AC_SUBST(CUDA_CFLAGS) AC_SUBST(CUDA_LIBS) AC_SUBST(CUDA_DIR) AC_SUBST(NVCC) # if --without-cuda was specified, disable cuda build if test "x$with_cuda" = "xno"; then AM_CONDITIONAL(BUILDCUDA, false) NVCC=no AC_SUBST(NVCC) else # else enable if nvcc is found and libcuda is found AC_PATH_PROG([NVCC],[nvcc],[no],[$PATH:$with_cuda/bin]) AM_CONDITIONAL(BUILDCUDA, (test ! "x$NVCC" = "xno") && (test ! "x$LIB_CUDA" = "x")) fi AC_ARG_ENABLE([emu], [ --enable-emu enable device emulation for CUDA], [case "${enableval}" in yes) EMULATION=true;; no) EMULATION=false;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-emu]);; esac], [EMULATION=false] ) # default is to support tesla-class, this enables building for fermi-class ac_have_fermi_gpu=no AC_ARG_ENABLE(fermi-gpu, [ --enable-fermi-gpu enable NVidia Fermi GPU support], [ ac_have_fermi_gpu=yes AC_MSG_NOTICE(Building for Fermi-class GPU) ]) AM_CONDITIONAL(HAVE_FERMI_GPU, test "x$ac_have_fermi_gpu" = "xyes") # setup nvcc flags (default is for tesla-class, --enable-fermi-gpu overrides) NVIDIA_ARCH="sm_11" if test x$ac_have_fermi_gpu = xyes then NVIDIA_ARCH="sm_20" fi if test x$DEBUG = xtrue then NVCCFLAGS="-g -arch $NVIDIA_ARCH --ptxas-options=-v" else NVCCFLAGS="-arch $NVIDIA_ARCH --ptxas-options=-v -g" fi if test x$EMULATION = xtrue then NVCCFLAGS+=" -deviceemu" fi # Ubuntu hack: NVCCFLAGS+=" --compiler-bindir=/usr/bin/gcc-4.3" AC_SUBST(NVCCFLAGS) # warn the user about missing functionality if( test x$NVCC = xno ) then AC_MSG_NOTICE(Nvidia CUDA nvcc compiler not found or --without-cuda used.) AC_MSG_NOTICE(CUDA support will not be built.) AC_MSG_NOTICE(If you have CUDA and need CUDA support,) AC_MSG_NOTICE(check the path to CUDA and specify --with-cuda=/path/to/cuda) fi ############################################################## # cpu optimization ############################################################## CPUFLAGS="" if test "${CC}" = "gcc"; then AC_MSG_NOTICE(Setting CPU optimization...) CPUTYPE="NO" #### #### cpu type: we support #### pentium3, pentium4, #### athlon-xp, opteron, athlon64, athlon-fx #### AC_ARG_WITH(cpu, [ --with-cpu=CPUTYPE where CPUTYPE is pentium4, athlon-xp, G4, G5...], [CPUTYPE=$withval],[]) # --with-cpu not used automatically figure out if test "$CPUTYPE" = "NO"; then case "$OS" in Darwin) maccpu=`machine` case "$maccpu" in ppc750) CPUTYPE=G3 ;; ppc7450) CPUTYPE=G4 ;; ppc970) CPUTYPE=G5 ;; i486) CPUTYPE=intel-mac ;; *) CPUTYPE="NO" echo "unknown mac cpu $maccpu" ;; esac ;; Linux) case "${target}" in i*86-*-linux-gnu*) CPUCAPS=`${srcdir}/x86cpucaps/cpucaps -m | sed 's/ //g'` case "$CPUCAPS" in PentiumIII*) CPUTYPE=pentium3 ;; Pentium4) CPUTYPE=pentium4 ;; PentiumM*) CPUTYPE=pentium4 ;; AMDAthlonXP*) CPUTYPE=athlonxp ;; esac ;; x86_64-*) CPUCAPS=`${srcdir}/x86cpucaps/cpucaps -m | sed 's/ //g'` CPUTYPE=x86_64 case "$CPUCAPS" in AMDAthlon64) CPUTYPE=athlon64 ;; AMDOpteron*) CPUTYPE=opteron ;; esac ;; powerpc64-*) CPUTYPE=powerpc64 ;; ia64-*) CPUTYPE=itanium ;; esac ;; esac fi AC_MSG_NOTICE(CPUTYPE is $CPUTYPE) AC_MSG_CHECKING(CPU optimization...) AC_SUBST(CPUCAPS) AC_SUBST(CPUTYPE) # now set the flags case "$CPUTYPE" in pentium3) # CPUFLAGS="-march=pentium3" CPUFLAGS="" ;; pentium4) # CPUFLAGS="-march=pentium4" CPUFLAGS="" ;; athlonxp) # CPUFLAGS="-march=pentium3" CPUFLAGS="" ;; opteron) # CPUFLAGS="-march=x86-64" CPUFLAGS="-m64" ;; itanium) CPUFLAGS="-mtune=itanium2" ;; athlon64) # CPUFLAGS="-march=x86-64" CPUFLAGS="-m64" ;; athlon-fx) # CPUFLAGS="-march=x86-64" CPUFLAGS="-m64" ;; x86_64) CPUFLAGS="-m64" ;; G4) CPUFLAGS="-mtune=G4 -mcpu=G4 -faltivec" ;; G5) # maintain G4 backwards compatibility CPUFLAGS="-mtune=G4 -mcpu=G4 -faltivec" ;; power4) CPUFLAGS="-mtune=power4 -mcpu=power4" ;; power5) CPUFLAGS="-mtune=power5 -mcpu=power5" ;; powerpc64) CPUFLAGS="-mpowerpc64 -m32" ;; intel-mac) CPUFLAGS="-fast" ;; *) echo "cpu optimization not set" ;; esac found=$CPUFLAGS # set the value AC_MSG_RESULT($found) ##### # if gcc fi # if using the Intel compiler, enable additional interprocedural # optimizations for single file compilation, and generate SSE3, SSE2, # and SSE instructions, and enable auto-parallelization. if test "x$CC" = "xicc"; then AC_MSG_NOTICE(Setting Intel Compiler optimizations...) CPUFLAGS="-ip -axP -parallel -O3 -fast -msse3 -xO -unroll-aggressive $CPUFLAGS" fi # if using the AMD Open64 compiler, flags for the fastest optimization dont work. # -Ofast equals -O3, -IPA, -OPT:Ofast, -fno-math-errno, and -ffast-math # Note! Dont use -ffast-math Results from mri_ca_normalize differ too much # from the reference. -IPA gives all kinds of compile errors. if test "x$CC" = "x${ac_open64_binaries}/opencc"; then AC_MSG_NOTICE(Setting AMD Open64 Compiler optimizations...) CPUFLAGS="-march=anyx86 -m64 $CPUFLAGS" #CPUFLAGS="-Ofast $CPUFLAGS" #LDFLAGS="-ipa $LDFLAGS" #CPPFLAGS=`echo $CPPFLAGS | sed /-O2//` fi ############################################################### # verify that CPUFLAGS work ############################################################### ac_save_CFLAGS=$CFLAGS CFLAGS="$CPUFLAGS $CFLAGS" echo "$as_me:$LINENO: checking whether $CC accepts $CPUFLAGS" >&5 echo $ECHO_N "checking whether $CC accepts $CPUFLAGS... $ECHO_C" >&6 if test "${ac_cv_prog_cc_cpuflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_cpuflags=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_cpuflags=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_cpuflags" >&5 echo "${ECHO_T}$ac_cv_prog_cc_cpuflags" >&6 if test $ac_cv_prog_cc_cpuflags = no; then AC_MSG_NOTICE([$CC on this PC cannot accept $CPUFLAGS. $CC may be too old?]) CPUFLAGS="" fi # write the flag file echo "CPUFLAGS=$CPUFLAGS" > cpuflags.mak CFLAGS=$ac_save_CFLAGS # append these CPUFLAGS to our existing CPPFLAGS CPPFLAGS="$CPPFLAGS $CPUFLAGS" ############################################################## # This macro figures out how to build C programs using # POSIX threads. ############################################################## if test ! "$OS" = "SunOS"; then ACX_PTHREAD fi ############################################################## # get the path for X includes and X libraries ############################################################## AC_PATH_X if test "x$x_includes" = "xNONE"; then # Mac sets it to NONE, but this is really "" x_includes= fi if test "x$x_includes" = "x"; then x_includes=/usr/X11R6/include fi AC_MSG_NOTICE([x_includes set to $x_includes \ If not correct specify using --x-includes=]) # the path to the X libs is not always defined, so find it... if test "x$x_libraries" = "xNONE"; then # Mac sets empty to NONE, we want "" x_libraries= fi if test "x$x_libraries" = "x"; then # most common location if test -d "/usr/X11R6/lib" ; then x_libraries=/usr/X11R6/lib fi # replace with lib64 if that exists if test -d "/usr/lib64" ; then x_libraries=/usr/lib64 fi if test -d "/usr/X11R6/lib64" ; then x_libraries=/usr/X11R6/lib64 fi fi AC_MSG_NOTICE([x_libraries set to $x_libraries \ If not correct specify using --x-libraries=]) # find two necessary X libs if test ! "x$x_libraries" = "x"; then AC_CHECK_LIB([X11 -L$x_libraries],[XOpenDisplay], [X_LIBS="$X_LIBS -L$x_libraries -lX11"],[]) AC_CHECK_LIB([Xmu -L$x_libraries],[XmuClientWindow], [X_LIBS="$X_LIBS -L$x_libraries -lXmu"],[]) fi AC_SUBST(X_LIBS) AC_MSG_NOTICE([Checking for directory specification of 3rd-party libraries...]) ############################################################## # allow user to specify root of multi-package directory, # such as one containing all freesurfer dependencies. ############################################################## ac_pkgs_includes="NO" ac_pkgs_libraries="NO" pkgs_includes="" pkgs_libraries="" AC_ARG_WITH(pkgs-dir, [ --with-pkgs-dir=DIR where the root of multiple pkgs are installed.], [ ac_pkgs_includes="$withval"/include ac_pkgs_libraries="$withval"/lib ]) # modify CPPFLAGS and LDFLAGS if test ! "$ac_pkgs_includes" = "NO"; then AC_MSG_RESULT([Packages directory is $withval]) pkgs_includes=-I$ac_pkgs_includes CPPFLAGS="$CPPFLAGS $pkgs_includes" fi if test ! "$ac_pkgs_libraries" = "NO"; then pkgs_libraries=-L$ac_pkgs_libraries LDFLAGS="$LDFLAGS $pkgs_libraries" fi AC_SUBST(pkgs_includes) AC_SUBST(pkgs_libraries) ############################################################# # MNI ############################################################# ac_mni_includes=NO ac_mni_libraries=NO MNI_CFLAGS="" MNI_LIBS="" MNI_DIR="" AC_MSG_CHECKING(MNI directory) AC_ARG_WITH(mni-dir, [ --with-mni-dir=DIR where the root of MNI is installed.], [ ac_mni_includes="$withval"/include ac_mni_libraries="$withval"/lib MNI_DIR="$withval" ]) if test "x$MNI_DIR" = "x"; then # if an MNI root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/mni/current" ; then withval=/usr/pubsw/packages/mni/current MNI_DIR="$withval" ac_mni_includes="$withval"/include ac_mni_libraries="$withval"/lib fi fi if test ! "$ac_mni_includes" = "NO"; then AC_MSG_RESULT(MNI directory is $withval) MNI_CFLAGS=-I$ac_mni_includes else AC_MSG_RESULT(MNI directory is not supplied) fi if test ! "$ac_mni_libraries" = "NO"; then MNI_LIBS=-L$ac_mni_libraries fi # these are the libs used by freesurfer: MINC2=NO if test -e "$ac_mni_libraries/libminc2.a" ; then # newer build of the MNI tools LIBS_MNI="-lnetcdf -lhdf5 -lvolume_io2 -lminc2" MINC2=YES else LIBS_MNI="-lnetcdf -lvolume_io -lminc" fi AC_SUBST(MNI_CFLAGS) AC_SUBST(MNI_LIBS) AC_SUBST(MNI_DIR) AC_SUBST(LIBS_MNI) ################################################################ # NIfTI ################################################################ ac_nifti_includes="NO" ac_nifti_libraries="NO" ac_nifti_bindir="NO" ac_nifti_dir="NO" NIFTI_CFLAGS="" NIFTI_LIBS="" NIFTI_LIB="" NIFTI_DIR="" LIBS_NIFTI="" AC_MSG_CHECKING(NIfTI directory) AC_ARG_WITH(nifti-dir, [ --with-nifti-dir=DIR where the root of NIfTI is installed.], [ ac_nifti_includes="$withval"/include ac_nifti_libraries="$withval"/lib ac_nifti_bindir="$withval"/bin ac_nifti_dir="$withval" ]) AC_ARG_WITH(nifti-include, [ --with-nifti-include=DIR root of NIfTI include directory.], [ ac_nifti_includes="$withval" ]) AC_ARG_WITH(nifti-libraries, [ --with-nifti-libraries=DIR root of NIfTI lib directory.], [ ac_nifti_libraries="$withval" ]) if test ! "$ac_nifti_includes" = "NO"; then AC_MSG_RESULT(NIfTI directory is $withval) NIFTI_CFLAGS=-I$ac_nifti_includes NIFTI_DIR=$ac_nifti_dir else AC_MSG_RESULT(NIfTI directory is not supplied) fi if test ! "$ac_nifti_libraries" = "NO"; then NIFTI_LIB=$ac_nifti_libraries NIFTI_LIBS=-L$ac_nifti_libraries fi AC_SUBST(NIFTI_CFLAGS) AC_SUBST(NIFTI_LIBS) AC_SUBST(NIFTI_LIB) AC_SUBST(NIFTI_DIR) AM_CONDITIONAL(HAVE_NIFTI_LIBS, ! test "x$ac_nifti_dir" = "xNO") ################################################################ # VXL ################################################################ ac_vxl_includes="NO" ac_vxl_libraries="NO" VXL_CFLAGS="" VXL_LIBS="" VXL_LIB="" AC_MSG_CHECKING(VXL directory) AC_ARG_WITH(vxl-dir, [ --with-vxl-dir=DIR where the root of VXL is installed.], [ # v1.7.0 has new vxl dir, earlier versions do not! if test -d "$withval/include/vxl"; then vxl_i="$withval/include/vxl" else vxl_i="$withval/include" fi ac_vxl_includes="$vxl_i/core $vxl_i/vcl $vxl_i/v3p/netlib $vxl_i/v3p/netlib/opt" ac_vxl_libraries="$withval"/lib VXL_DIR="$withval" AC_SUBST(VXL_DIR) ]) if test "x$VXL_DIR" = "x"; then # if a VXL root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/vxl/current" ; then withval=/usr/pubsw/packages/vxl/current VXL_DIR="$withval" if test -d "$withval/include/vxl"; then vxl_i="$withval/include/vxl" else vxl_i="$withval/include" fi ac_vxl_includes="$vxl_i/core $vxl_i/vcl $vxl_i/v3p/netlib $vxl_i/v3p/netlib/opt" ac_vxl_libraries="$withval"/lib fi fi AC_ARG_WITH(vxl-include, [ --with-vxl-include=DIR root of VXL include directory.], [ if test -d "$withval/include/vxl"; then vxl_i="$withval/include/vxl" else vxl_i="$withval/include" fi ac_vxl_includes="$vxl_i/core $vxl_i/vcl $vxl_i/v3p/netlib $vxl_i/v3p/netlib/opt" ]) AC_ARG_WITH(vxl-libraries, [ --with-vxl-libraries=DIR root of VXL lib directory.], [ ac_vxl_libraries="$withval" ]) if test ! "$ac_vxl_includes" = "NO"; then AC_MSG_RESULT(VXL directory is $withval) for item in $ac_vxl_includes; do VXL_CFLAGS="${VXL_CFLAGS} -I${item}" done else AC_MSG_RESULT(VXL directory is not supplied) fi if test ! "$ac_vxl_libraries" = "NO"; then VXL_LIBS=-L$ac_vxl_libraries VXL_LIB=$ac_vxl_libraries fi # these are the VXL libs used by freesurfer: LIBS_VXL="-lvnl_algo -lvnl -lvcl -lnetlib -lv3p_netlib" AC_SUBST(VXL_CFLAGS) AC_SUBST(VXL_LIBS) AC_SUBST(VXL_LIB) AC_SUBST(LIBS_VXL) ################################################################ # FLTK ################################################################ ac_fltk_includes="NO" ac_fltk_libraries="NO" ac_fltk_bindir="NO" ac_fltk_dir="NO" FLTK_CXXFLAGS="" FLTK_LDFLAGS="" FLTK_LIBS="" FLTK_LIB="" FLTK_DIR="" AC_MSG_CHECKING(FLTK directory) AC_ARG_WITH(fltk-dir, [ --with-fltk-dir=DIR where the root of FLTK is installed.], [ fltk_i="$withval"/include ac_fltk_includes="$fltk_i" ac_fltk_libraries="$withval"/lib ac_fltk_bindir="$withval"/bin ac_fltk_dir="$withval" FLTK_DIR="$withval" AC_SUBST(FLTK_DIR) ]) if test "x$FLTK_DIR" = "x"; then # if a FLTK root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/fltk/current" ; then withval=/usr/pubsw/packages/fltk/current FLTK_DIR="$withval" ac_fltk_dir="$withval" fltk_i="$withval"/include ac_fltk_includes="$fltk_i" ac_fltk_libraries="$withval"/lib fi fi AC_ARG_WITH(fltk-include, [ --with-fltk-include=DIR root of FLTK include directory.], [ ac_fltk_includes="$withval" ]) AC_ARG_WITH(fltk-libraries, [ --with-fltk-libraries=DIR root of FLTK lib directory.], [ ac_fltk_libraries="$withval" ]) # if --enable-gems was specified: #AC_ARG_ENABLE(gems, # [ --enable-gems Enable GEMS building.], # ) if test ! "$ac_fltk_includes" = "NO"; then AC_MSG_RESULT(FLTK directory is $withval) #for item in $ac_fltk_includes; do # FLTK_CFLAGS="${FLTK_CFLAGS} -I${item}" FLTK_CXXFLAGS=`"$withval"/bin/fltk-config --cxxflags --use-gl --use-glut --use-forms --use-images` FLTK_LDFLAGS=`"$withval"/bin/fltk-config --ldstaticflags --use-gl --use-glut --use-forms --use-images` FLTK_DIR=$ac_fltk_dir else AC_MSG_RESULT(FLTK directory is not supplied) fi if test ! "$ac_fltk_libraries" = "NO"; then FLTK_LIB=$ac_fltk_libraries FLTK_LIBS=-L$ac_fltk_libraries fi AC_SUBST(FLTK_CXXFLAGS) AC_SUBST(FLTK_LDFLAGS) AC_SUBST(FLTK_LIBS) AC_SUBST(FLTK_LIB) AC_SUBST(FLTK_DIR) #AM_CONDITIONAL(ENABLE_GEMS, [test "x$enable_gems" = "xyes"]) AM_CONDITIONAL(HAVE_FLTK_LIBS, ! test "x$ac_fltk_dir" = "xNO") ################################################################ # PETSc ################################################################ ac_petsc_includes="NO" ac_petsc_libraries="NO" ac_petsc_bindir="NO" ac_petsc_dir="NO" PETSC_CFLAGS="" PETSC_LIBS="" PETSC_LIB="" PETSC_DIR="" AC_MSG_CHECKING(PETSc directory) AC_ARG_WITH(petsc-dir, [ --with-petsc-dir=DIR where the root of PETSc is installed.], [ petsc_i="$withval"/include ac_petsc_includes="$petsc_i" ac_petsc_libraries="$withval"/lib ac_petsc_bindir="$withval"/bin ac_petsc_dir="$withval" PETSC_DIR="$withval" AC_SUBST(PETSC_DIR) ]) if test "x$PETSC_DIR" = "x"; then # if a PETSC root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/petsc/current" ; then withval=/usr/pubsw/packages/petsc/current PETSC_DIR="$withval" ac_petsc_dir="$withval" petsc_i="$withval"/include ac_petsc_includes="$petsc_i" ac_petsc_libraries="$withval"/lib fi fi AC_ARG_WITH(petsc-include, [ --with-petsc-include=DIR root of PETSc include directory.], [ ac_petsc_includes="$withval" ]) AC_ARG_WITH(petsc-libraries, [ --with-petsc-libraries=DIR root of PETSc lib directory.], [ ac_petsc_libraries="$withval" ]) if test ! "$ac_petsc_includes" = "NO"; then AC_MSG_RESULT(PETSc directory is $withval) for item in $ac_petsc_includes; do PETSC_CFLAGS="${PETSC_CFLAGS} -I${item}" done PETSC_DIR=$ac_petsc_dir else AC_MSG_RESULT(PETSc directory is not supplied) fi if test ! "$ac_petsc_libraries" = "NO"; then PETSC_LIB=$ac_petsc_libraries PETSC_LIBS=-L$ac_petsc_libraries fi AC_SUBST(PETSC_CFLAGS) AC_SUBST(PETSC_LIBS) AC_SUBST(PETSC_LIB) AC_SUBST(PETSC_DIR) AM_CONDITIONAL(HAVE_PETSC_LIBS, ! test "x$ac_petsc_dir" = "xNO") ################################################################ # MPI ################################################################ ac_mpi_includes="NO" ac_mpi_libraries="NO" ac_mpi_bindir="NO" ac_mpi_dir="NO" MPI_CFLAGS="" MPI_LIBS="" MPI_LIB="" MPI_DIR="" AC_MSG_CHECKING(MPI directory) AC_ARG_WITH(mpi-dir, [ --with-mpi-dir=DIR where the root of MPI is installed.], [ ac_mpi_includes="$withval"/include ac_mpi_libraries="$withval"/lib ac_mpi_bindir="$withval"/bin ac_mpi_dir="$withval" ]) AC_ARG_WITH(mpi-include, [ --with-mpi-include=DIR root of MPI include directory.], [ ac_mpi_includes="$withval" ]) AC_ARG_WITH(mpi-libraries, [ --with-mpi-libraries=DIR root of MPI lib directory.], [ ac_mpi_libraries="$withval" ]) if test ! "$ac_mpi_includes" = "NO"; then AC_MSG_RESULT(MPI directory is $withval) MPI_CFLAGS=-I$ac_mpi_includes MPI_DIR=$ac_mpi_dir else AC_MSG_RESULT(MPI directory is not supplied) fi if test ! "$ac_mpi_libraries" = "NO"; then MPI_LIB=$ac_mpi_libraries MPI_LIBS=-L$ac_mpi_libraries fi AC_SUBST(MPI_CFLAGS) AC_SUBST(MPI_LIBS) AC_SUBST(MPI_LIB) AC_SUBST(MPI_DIR) AM_CONDITIONAL(HAVE_MPI_LIBS, ! test "x$ac_mpi_dir" = "xNO") ################################################################ # BOOST ################################################################ ac_boost_includes="NO" ac_boost_libraries="NO" ac_boost_dir="NO" BOOST_CFLAGS="" BOOST_LIBS="" BOOST_LIB="" BOOST_DIR="" AC_MSG_CHECKING(BOOST directory) AC_ARG_WITH(boost-dir, [ --with-boost-dir=DIR where the root of BOOST is installed.], [ ac_boost_includes="$withval"/include ac_boost_libraries="$withval"/lib ac_boost_dir="$withval" ]) if test "x$BOOST_DIR" = "x"; then # if a Boost root was not supplied, but one exists in the # default packages path at the NMR Center, AND this is a mac, # then use that: if test "$OS" = "Darwin"; then if test -d "/usr/pubsw/packages/boost/current" ; then withval=/usr/pubsw/packages/boost/current BOOST_DIR="$withval" ac_boost_dir="$withval" boost_i="$withval"/include ac_boost_includes="$boost_i" ac_boost_libraries="$withval"/lib fi fi fi AC_ARG_WITH(boost-include, [ --with-boost-include=DIR root of BOOST include directory.], [ ac_boost_includes="$withval" ]) AC_ARG_WITH(boost-libraries, [ --with-boost-libraries=DIR root of BOOST lib directory.], [ ac_boost_libraries="$withval" ]) if test ! "$ac_boost_includes" = "NO"; then AC_MSG_RESULT(BOOST directory is $withval) BOOST_CFLAGS=-I$ac_boost_includes BOOST_DIR=$ac_boost_dir else AC_MSG_RESULT(BOOST directory is not supplied) fi if test ! "$ac_boost_libraries" = "NO"; then BOOST_LIB=$ac_boost_libraries BOOST_LIBS=-L$ac_boost_libraries fi AC_SUBST(BOOST_CFLAGS) AC_SUBST(BOOST_LIBS) AC_SUBST(BOOST_LIB) AC_SUBST(BOOST_DIR) AM_CONDITIONAL(HAVE_BOOST_LIBS, ! test "x$ac_boost_libraries" = "xNO") ################################################################ # ANN (Approximate Nearest Neighbors library) ################################################################ ac_ann_includes="NO" ac_ann_libraries="NO" ac_ann_dir="NO" ANN_CFLAGS="" ANN_LIBS="" ANN_LIB="" ANN_DIR="" AC_MSG_CHECKING(ANN Approximate Nearest Neighbors directory) AC_ARG_WITH(ann-dir, [ --with-ann-dir=DIR where the root of ANN is installed.], [ ac_ann_includes="$withval"/include ac_ann_libraries="$withval"/lib ac_ann_dir="$withval" ANN_DIR="$withval" AC_SUBST(ANN_DIR) ]) if test "x$ANN_DIR" = "x"; then # if a ANN root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/ann/current" ; then withval=/usr/pubsw/packages/ann/current ANN_DIR="$withval" ac_ann_includes="$withval"/include ac_ann_libraries="$withval"/lib fi fi AC_ARG_WITH(ann-include, [ --with-ann-include=DIR root of ANN include directory.], [ ac_ann_includes="$withval" ]) AC_ARG_WITH(ann-libraries, [ --with-ann-libraries=DIR root of ANN lib directory.], [ ac_ann_libraries="$withval" ]) if test ! "$ac_ann_includes" = "NO"; then AC_MSG_RESULT(ANN directory is $withval) ANN_CFLAGS=-I$ac_ann_includes ANN_DIR=$ac_ann_dir else AC_MSG_RESULT(ANN directory is not supplied) fi if test ! "$ac_ann_libraries" = "NO"; then ANN_LIB=$ac_ann_libraries ANN_LIBS=-L$ac_ann_libraries fi AC_SUBST(ANN_CFLAGS) AC_SUBST(ANN_LIBS) AC_SUBST(ANN_LIB) AC_SUBST(ANN_DIR) AM_CONDITIONAL(HAVE_ANN_LIBS, ! test "x$ac_ann_libraries" = "xNO") ############################################################ # Catch-all flag to disable OpenGL, Tcl/Tk, ITK and KWW apps ############################################################ tcltk_apps="NO" itk_apps="NO" kww_apps="NO" AC_ARG_ENABLE(all-apps, [ --disable-all-apps disable building Tcl/Tk, ITK, VTK/KWWidgets, wxWidgets and OpenGL-based apps], [ tcltk_apps="NO" itk_apps="NO" vtk_apps="NO" kww_apps="NO" wxw_apps="NO" need_opengl="NO" ]) AC_ARG_ENABLE(gl-apps, [ --disable-gl-apps disable building OpenGL-based apps], [ need_opengl="NO" ]) #################################################### # Tcl/Tk #################################################### ac_tcl_includes="NO" ac_tcl_libraries="NO" TCL_CFLAGS="" TCL_LIBS="" TCL_LIB="" TCL_DIR="" AC_MSG_CHECKING(Tcl/Tk config) AC_ARG_WITH(tcl-dir, [ --with-tcl-dir=DIR where the root of Tcl/Tk is installed.], [ ac_tcl_includes="$withval"/include ac_tcl_libraries="$withval"/lib ac_tcl_dir="$withval" ]) if test "x$ac_tcl_dir" = "x"; then # if a Tcl/Tk/Tix/BLT root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/tcltktixblt/current" ; then withval=/usr/pubsw/packages/tcltktixblt/current ac_tcl_dir="$withval" ac_tcl_includes="$withval"/include ac_tcl_libraries="$withval"/lib fi fi AC_ARG_WITH(tcl-include, [ --with-tcl-include=DIR root of Tcl/Tk include directory.], [ ac_tcl_includes="$withval" ]) AC_ARG_WITH(tcl-libraries, [ --with-tcl-libraries=DIR root of Tcl/Tk lib directory.], [ ac_tcl_libraries="$withval" ]) if test ! "$ac_tcl_includes" = "NO"; then AC_MSG_RESULT([Tcl directory is $withval]) TCL_CFLAGS=-I$ac_tcl_includes fi if test ! "$ac_tcl_libraries" = "NO"; then TCL_LIBS=-L$ac_tcl_libraries TCL_LIB=$ac_tcl_libraries TCL_DIR=$ac_tcl_dir tcltk_apps="yes" fi AC_ARG_ENABLE(tcltk-apps, [ --disable-tcltk-apps disable building Tcl/Tk-based apps], [ tcltk_apps="NO" ]) if test "$tcltk_apps" = "yes"; then AC_MSG_RESULT([Enabled building of Tcl/Tk apps.]) # enable testing for OpenGL libs: need_opengl=yes else AC_MSG_RESULT([Not building Tcl/Tk apps.]) fi AM_CONDITIONAL(ENABLE_TCLTK_APPS, test "$tcltk_apps" = "yes") AC_SUBST(TCL_CFLAGS) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_LIB) AC_SUBST(LIBS_TCL) AC_SUBST(TCL_DIR) ################################################################## # allow user to specify tixwish AC_ARG_WITH(tixwish, [ --with-tixwish=TIXWISH where you specify the file for tixwish], [TIXWISH=$withval],[]) # if TIXWISH has been set, then it does not do anything AC_PATH_PROG([TIXWISH],[tixwish],[]) if test "x$TIXWISH" = "x"; then AC_PATH_PROG([TIXWISH],[tixwish8.1.8.3],[]) if test "x$TIXWISH" = "x"; then AC_PATH_PROG([TIXWISH],[tixwish8.1.8.4],[]) fi fi # and check if test "x$TIXWISH" = "x"; then if test "x$tcltk_apps" = "xyes"; then AC_MSG_RESULT([INFO: tixwish not found. Use --with-tixwish=... to specify]) fi fi AC_SUBST(TIXWISH) ################################################################ # BLT ################################################################ ac_blt_includes="NO" ac_blt_libraries="NO" ac_blt_bindir="NO" BLT_CFLAGS="" BLT_LIBS="" if test "$OS" = "SunOS"; then BLT_LIBS="-lm " fi AC_MSG_CHECKING(BLT directory) AC_ARG_WITH(BLT-dir, [ --with-BLT-dir=DIR where the root of BLT is installed.], [ ac_blt_includes="$withval"/include ac_blt_libraries="$withval"/lib ac_blt_bindir="$withval"/bin ]) if test ! "$ac_blt_includes" = "NO"; then AC_MSG_RESULT(BLT directory is $withval) BLT_CFLAGS=-I$ac_blt_includes else AC_MSG_RESULT(BLT directory is not supplied) fi if test ! "$ac_blt_libraries" = "NO"; then BLT_LIBS=-L$ac_blt_libraries fi TCL_CFLAGS="$BLT_CFLAGS $TCL_CFLAGS" AC_SUBST(TCL_CFLAGS) AC_SUBST(BLT_CFLAGS) AC_SUBST(BLT_LIBS) ################################################################ # XawPlus - the nmovie app uses this ################################################################ ac_xawplus_includes="NO" ac_xawplus_libraries="NO" ac_xawplus_dir="NO" xawplus_apps="NO" XAWPLUS_CFLAGS="" XAWPLUS_CXXFLAGS="" XAWPLUS_LIBS="" AC_MSG_CHECKING(XawPlus directory) AC_ARG_WITH(xawplus-dir, [ --with-xawplus-dir=DIR where the root of XawPlus is installed.], [ ac_xawplus_includes="$withval"/include ac_xawplus_libraries="$withval"/lib ac_xawplus_dir="$withval" ]) if test "x$ac_xawplus_dir" = "xNO"; then # if a Xawplus root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/xawplus/current" ; then withval=/usr/pubsw/packages/xawplus/current ac_xawplus_dir="$withval" ac_xawplus_includes="$withval"/include ac_xawplus_libraries="$withval"/lib fi fi if test ! "$ac_xawplus_includes" = "NO"; then AC_MSG_RESULT(XawPlus directory is $withval) for item in $ac_xawplus_includes; do XAWPLUS_CFLAGS="${XAWPLUS_CFLAGS} -I${item}" XAWPLUS_CXXFLAGS="${XAWPLUS_CXXFLAGS} -I${item}" done XAWPLUS_DIR=$ac_xawplus_dir AC_SUBST(XAWPLUS_DIR) xawplus_apps="yes" else AC_MSG_RESULT(XawPlus directory is not supplied) fi if test ! "$ac_xawplus_libraries" = "NO"; then for item in $ac_xawplus_libraries; do XAWPLUS_LIBS="${XAWPLUS_LIBS} -L${item}" done XAWPLUS_LIBS="${XAWPLUS_LIBS}" AC_SUBST(XAWPLUS_LIBS) fi AC_ARG_ENABLE(xawplus-apps, [ --enable-xawplus-apps enable building XawPlus-based apps], [ xawplus_apps="yes" ]) if test "$xawplus_apps" = "yes"; then AC_MSG_RESULT([Enabled building of XawPlus apps.]) # enable testing for OpenGL libs: need_opengl=yes fi AM_CONDITIONAL(ENABLE_XAWPLUS_APPS, test "$xawplus_apps" = "yes") AC_SUBST(XAWPLUS_CFLAGS) AC_SUBST(XAWPLUS_CXXFLAGS) AC_SUBST(XAWPLUS_LIBS) ################################################################ # tiff ################################################################ # default is to use the libtiff included in freesurfer src tree, # local libtiff static lib declared later in LIBS_MGH. # allow someone to override with their own using --with-tiff-dir: ac_tiff_includes="NO" ac_tiff_libraries="NO" ac_tiff_bindir="NO" TIFF_CFLAGS="" TIFF_LIBS="" LIB_TIFF="" AC_MSG_CHECKING(Tiff directory) AC_ARG_WITH(tiff-dir, [ --with-tiff-dir=DIR where the root of Tiff is installed.], [ ac_tiff_includes="$withval"/include ac_tiff_libraries="$withval"/lib ac_tiff_bindir="$withval"/bin ]) if test ! "$ac_tiff_includes" = "NO"; then AC_MSG_RESULT(Tiff directory is $withval) TIFF_CFLAGS=-I$ac_tiff_includes else AC_MSG_RESULT(Tiff directory is not supplied) fi if test ! "$ac_tiff_libraries" = "NO"; then TIFF_LIBS=-L$ac_tiff_libraries LIB_TIFF="-ltiff" fi AM_CONDITIONAL(USE_LOCAL_TIFF, test "$ac_tiff_libraries" = "NO") AC_SUBST(TIFF_CFLAGS) AC_SUBST(TIFF_LIBS) AC_SUBST(LIB_TIFF) ################################################################ # jpeg ################################################################ # default is to use the libjpeg included in freesurfer src tree, # allow someone to override with their own using --with-jpeg-dir. # local libjpeg static lib declared later in LIBS_MGH: ac_jpeg_includes="NO" ac_jpeg_libraries="NO" ac_jpeg_bindir="NO" JPEG_CFLAGS="" JPEG_LIBS="" LIB_JPEG="-ljpeg" AC_MSG_CHECKING(Jpeg directory) AC_ARG_WITH(jpeg-dir, [ --with-jpeg-dir=DIR where the root of Jpeg is installed.], [ ac_jpeg_includes="$withval"/include ac_jpeg_libraries="$withval"/lib ac_jpeg_bindir="$withval"/bin ]) if test ! "$ac_jpeg_includes" = "NO"; then AC_MSG_RESULT(Jpeg directory is $withval) JPEG_CFLAGS=-I$ac_jpeg_includes else AC_MSG_RESULT(Jpeg directory is not supplied) fi if test ! "$ac_jpeg_libraries" = "NO"; then JPEG_LIBS=-L$ac_jpeg_libraries fi # use static lib if found if test -e "$ac_tcl_libraries/libjpeg.a"; then LIB_JPEG="$ac_tcl_libraries/libjpeg.a" fi if test -e "/usr/lib/libjpeg.a"; then LIB_JPEG="/usr/lib/libjpeg.a" fi if test -e "/usr/lib64/libjpeg.a"; then LIB_JPEG="/usr/lib64/libjpeg.a" fi if test -e "/usr/pubsw/packages/tiffjpegglut/current/lib/libjpeg.a"; then LIB_JPEG="/usr/pubsw/packages/tiffjpegglut/current/lib/libjpeg.a" fi if test -e "$ac_jpeg_libraries/libjpeg.a"; then LIB_JPEG="$ac_jpeg_libraries/libjpeg.a" fi AM_CONDITIONAL(USE_LOCAL_JPEG, test "$ac_jpeg_libraries" = "NO") # BLT check (later in this file) needs a prebuilt libjpeg, use what we have # since we can't use the locally built libjpeg LIB_BLT_JPEG="$LIB_JPEG" AC_SUBST(JPEG_CFLAGS) AC_SUBST(JPEG_LIBS) AC_SUBST(LIB_JPEG) AC_SUBST(LIB_BLT_JPEG) ################################################################ # eXpat ################################################################ # default is to use the libexpat included in freesurfer src tree, # local libexpat static lib declared later in LIBS_MGH. # allow someone to override with their own using --with-expat-dir: ac_expat_includes="NO" ac_expat_libraries="NO" ac_expat_bindir="NO" EXPAT_CFLAGS="" EXPAT_LIBS="" LIB_EXPAT="" AC_MSG_CHECKING(Expat directory) AC_ARG_WITH(expat-dir, [ --with-expat-dir=DIR where the root of Expat is installed.], [ ac_expat_includes="$withval"/include ac_expat_libraries="$withval"/lib ac_expat_bindir="$withval"/bin ]) if test ! "$ac_expat_includes" = "NO"; then AC_MSG_RESULT(Expat directory is $withval) EXPAT_CFLAGS=-I$ac_expat_includes else AC_MSG_RESULT(Expat directory is not supplied) fi if test ! "$ac_expat_libraries" = "NO"; then EXPAT_LIBS=-L$ac_expat_libraries LIB_EXPAT="-lexpat" fi AM_CONDITIONAL(USE_LOCAL_EXPAT, test "$ac_expat_libraries" = "NO") AC_SUBST(EXPAT_CFLAGS) AC_SUBST(EXPAT_LIBS) AC_SUBST(LIB_EXPAT) # # these are used by the local freesurfer expat source, # declared in config.h # AC_DEFINE([XML_NS], 1, [Define to make XML Namespaces functionality available.]) AC_DEFINE([XML_DTD], 1, [Define to make parameter entity parsing functionality available.]) AC_DEFINE([XML_CONTEXT_BYTES], 1024, [Define to specify how much context to retain around the current parse point.]) ################################################################ # Qt ################################################################ QT_PATH="" m4_include([m4/autotroll.m4]) AT_WITH_QT([opengl]) # support for --without-qt: AM_CONDITIONAL(ENABLE_QT_APPS, ! test "x$QT_PATH" = "x") # hack: make sure our QT_LIBS overrides /usr/lib64 native Qt install # this is problematic on Centos6, where qt 4.6.3 is installed, but # we (at the NMR Center) want to use v4.7.1 in /usr/pubsw/packages/qt # and link-time errors (problem with 'detach_grow') appear if # qt 4.6.3 attempts to link because it is in /usr/lib64. this forces # an override: if test ! "x$QT_LIBS" = "x"; then QTLIBS=`echo $QT_LIBS | awk '{print $1}'` LDFLAGS="$QTLIBS $LDFLAGS" fi ################################################################# # If on a Mac, make scuba and qdec, bundles (Qt apps) SCUBA_BUNDLE_TARGET="" if test "x$target_vendor" = "xapple" ; then SCUBA_BUNDLE_TARGET="scuba_bundle" fi AC_SUBST(SCUBA_BUNDLE_TARGET) QDEC_BUNDLE_TARGET="" if test "x$target_vendor" = "xapple" ; then QDEC_BUNDLE_TARGET="qdec_bundle" fi AC_SUBST(QDEC_BUNDLE_TARGET) # default is to NOT build scuba/scuba2, --enable-scuba enables building ac_build_scuba=no AC_ARG_ENABLE(scuba, [ --enable-scuba enable build of scuba and scuba2], [ ac_build_scuba=yes AC_MSG_NOTICE(Building scuba and scuba2) ]) AM_CONDITIONAL(BUILD_SCUBA, test "x$ac_build_scuba" = "xyes") ################################################################ # CPPUNIT ################################################################ ac_cppunit_includes="NO" ac_cppunit_libraries="NO" ac_cppunit_bindir="NO" ac_cppunit_dir="NO" CPPUNIT_CFLAGS="" CPPUNIT_LIBS="" CPPUNIT_LIB="" CPPUNIT_DIR="" AC_MSG_CHECKING(CppUnit directory) AC_ARG_WITH(cppunit-dir, [ --with-cppunit-dir=DIR where the root of CppUnit is installed.], [ ac_cppunit_includes="$withval"/include ac_cppunit_libraries="$withval"/lib ac_cppunit_bindir="$withval"/bin ac_cppunit_dir="$withval" ]) if test "x$ac_cppunit_dir" = "xNO"; then # if a CppUnit root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/cppunit/current" ; then withval=/usr/pubsw/packages/cppunit/current ac_cppunit_includes="$withval"/include ac_cppunit_libraries="$withval"/lib ac_cppunit_bindir="$withval"/bin ac_cppunit_dir="$withval" fi fi if test ! "$ac_cppunit_includes" = "NO"; then AC_MSG_RESULT(CppUnit directory is $withval) CPPUNIT_CFLAGS=-I$ac_cppunit_includes CPPUNIT_DIR=$ac_cppunit_dir else AC_MSG_RESULT(CppUnit directory is not supplied) fi if test ! "$ac_cppunit_libraries" = "NO"; then CPPUNIT_LIB=$ac_cppunit_libraries CPPUNIT_LIBS=-L$ac_cppunit_libraries fi AC_SUBST(CPPUNIT_CFLAGS) AC_SUBST(CPPUNIT_LIBS) AC_SUBST(CPPUNIT_LIB) AC_SUBST(CPPUNIT_DIR) AM_CONDITIONAL(HAVE_CPPUNIT, ! test "x$ac_cppunit_dir" = "xNO") ################################################################ # VTK ################################################################ ac_vtk_includes="NO" ac_vtk_libraries="NO" ac_vtk_dir="NO" VTK_CFLAGS="" VTK_CXXFLAGS="" VTK_LIBS="" VTK_LIB="" VTK_LIB_VTK="" VTK_DIR="" AC_MSG_CHECKING(VTK config) AC_ARG_WITH(vtk-dir, [ --with-vtk-dir=DIR where the root of VTK is installed.], [ ac_vtk_includes="$withval/include" ac_vtk_libraries="$withval"/lib ac_vtk_dir="$withval" VTK_DIR=$ac_vtk_dir ]) if test "x$VTK_DIR" = "x"; then # if a VTK root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/vtk/current" ; then withval=/usr/pubsw/packages/vtk/current ac_vtk_includes="$withval/include" ac_vtk_libraries="$withval"/lib ac_vtk_dir="$withval" VTK_DIR=$ac_vtk_dir fi fi AC_ARG_WITH(vtk-include, [ --with-vtk-include=DIR root of VTK include directory.], [ vtk_i="$withval/include" ac_vtk_includes="$vtk_i" ]) AC_ARG_WITH(vtk-libraries, [ --with-vtk-libraries=DIR root of VTK lib directory.], [ ac_vtk_libraries="$withval" ]) if test ! "$ac_vtk_includes" = "NO"; then AC_MSG_RESULT(VTK directory is $withval) if test -e $ac_vtk_includes/vtk-5.6 ; then ac_vtk_includes="$ac_vtk_includes/vtk-5.6" elif test -e $ac_vtk_includes/vtk-5.5 ; then ac_vtk_includes="$ac_vtk_includes/vtk-5.5" elif test -e $ac_vtk_includes/vtk-5.4 ; then ac_vtk_includes="$ac_vtk_includes/vtk-5.4" elif test -e $ac_vtk_includes/vtk-5.3 ; then ac_vtk_includes="$ac_vtk_includes/vtk-5.3" elif test -e $ac_vtk_includes/vtk-5.2 ; then ac_vtk_includes="$ac_vtk_includes/vtk-5.2" elif test -e $ac_vtk_includes/vtk-5.1 ; then ac_vtk_includes="$ac_vtk_includes/vtk-5.1" elif test -e $ac_vtk_includes/vtk-5.0 ; then ac_vtk_includes="$ac_vtk_includes/vtk-5.0" elif test -e $ac_vtk_includes/vtk ; then ac_vtk_includes="$ac_vtk_includes/vtk" fi VTK_CFLAGS="${VTK_CFLAGS} -I$ac_vtk_includes" VTK_CXXFLAGS="${VTK_CXXFLAGS} -I$ac_vtk_includes" fi if test ! "$ac_vtk_libraries" = "NO"; then VTK_LIBS=-L$ac_vtk_libraries VTK_LIB=$ac_vtk_libraries if test -e $ac_vtk_libraries/vtk-5.6 ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk-5.6" VTK_LIBS=-L$ac_vtk_libraries/vtk-5.6 VTK_LIB=$ac_vtk_libraries/vtk-5.6 elif test -e $ac_vtk_libraries/vtk-5.5 ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk-5.5" VTK_LIBS=-L$ac_vtk_libraries/vtk-5.5 VTK_LIB=$ac_vtk_libraries/vtk-5.5 elif test -e $ac_vtk_libraries/vtk-5.4 ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk-5.4" VTK_LIBS=-L$ac_vtk_libraries/vtk-5.4 VTK_LIB=$ac_vtk_libraries/vtk-5.4 elif test -e $ac_vtk_libraries/vtk-5.3 ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk-5.3" VTK_LIBS=-L$ac_vtk_libraries/vtk-5.3 VTK_LIB=$ac_vtk_libraries/vtk-5.3 elif test -e $ac_vtk_libraries/vtk-5.2 ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk-5.2" VTK_LIBS=-L$ac_vtk_libraries/vtk-5.2 VTK_LIB=$ac_vtk_libraries/vtk-5.2 elif test -e $ac_vtk_libraries/vtk-5.1 ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk-5.1" elif test -e $ac_vtk_libraries/vtk-5.0 ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk-5.0" elif test -e $ac_vtk_libraries/vtk ; then VTK_LIB_VTK="$ac_vtk_libraries/vtk" fi fi AM_CONDITIONAL(HAVE_VTK_LIBS, test ! "x$VTK_DIR" = "x") AC_SUBST(VTK_CFLAGS) AC_SUBST(VTK_CXXFLAGS) AC_SUBST(VTK_LIBS) AC_SUBST(VTK_LIB) AC_SUBST(VTK_LIB_VTK) AC_SUBST(VTK_DIR) ################################################################ # VTK for Freeview in Mac ################################################################ # This is a static build of Cocoa VTK because KWWidgets doesn't play # nice with this VTK. Hence different VTK for different things ac_vtk_cocoa_includes="NO" ac_vtk_cocoa_libraries="NO" ac_vtk_cocoa_dir="NO" VTK_COCOA_CFLAGS="" VTK_COCOA_CXXFLAGS="" VTK_COCOA_LIBS="" VTK_COCOA_LIB="" VTK_COCOA_LIB_VTK="" VTK_COCOA_DIR="" AC_MSG_CHECKING(Cocoa VTK config) AC_ARG_WITH(vtk-cocoa-dir, [ --with-vtk-cocoa-dir=DIR where the root of VTK is installed.], [ ac_vtk_cocoa_includes="$withval/include" ac_vtk_cocoa_libraries="$withval"/lib ac_vtk_cocoa_dir="$withval" VTK_COCOA_DIR=$ac_vtk_cocoa_dir ]) if test ! "$ac_vtk_cocoa_includes" = "NO"; then AC_MSG_RESULT(VTK cocoa directory is $withval) if test -e $ac_vtk_cocoa_includes/vtk-5.6 ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk-5.6" elif test -e $ac_vtk_cocoa_includes/vtk-5.5 ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk-5.5" elif test -e $ac_vtk_cocoa_includes/vtk-5.4 ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk-5.4" elif test -e $ac_vtk_cocoa_includes/vtk-5.3 ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk-5.3" elif test -e $ac_vtk_cocoa_includes/vtk-5.2 ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk-5.2" elif test -e $ac_vtk_cocoa_includes/vtk-5.1 ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk-5.1" elif test -e $ac_vtk_cocoa_includes/vtk-5.0 ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk-5.0" elif test -e $ac_vtk_cocoa_includes/vtk ; then ac_vtk_cocoa_includes="$ac_vtk_cocoa_includes/vtk" fi VTK_COCOA_CFLAGS="${VTK_COCOA_CFLAGS} -I$ac_vtk_cocoa_includes" VTK_COCOA_CXXFLAGS="${VTK_COCOA_CXXFLAGS} -I$ac_vtk_cocoa_includes" fi if test ! "$ac_vtk_libraries" = "NO"; then VTK_COCOA_LIBS=-L$ac_vtk_cocoa_libraries VTK_COCOA_LIB=$ac_vtk_cocoa_libraries if test -e $ac_vtk_cocoa_libraries/vtk-5.6 ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk-5.6" VTK_COCOA_LIBS=-L$ac_vtk_cocoa_libraries/vtk-5.6 VTK_COCOA_LIB=$ac_vtk_cocoa_libraries/vtk-5.6 elif test -e $ac_vtk_cocoa_libraries/vtk-5.5 ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk-5.5" VTK_COCOA_LIBS=-L$ac_vtk_cocoa_libraries/vtk-5.5 VTK_COCOA_LIB=$ac_vtk_cocoa_libraries/vtk-5.5 elif test -e $ac_vtk_cocoa_libraries/vtk-5.4 ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk-5.4" VTK_COCOA_LIBS=-L$ac_vtk_cocoa_libraries/vtk-5.4 VTK_COCOA_LIB=$ac_vtk_cocoa_libraries/vtk-5.4 elif test -e $ac_vtk_cocoa_libraries/vtk-5.3 ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk-5.3" VTK_COCOA_LIBS=-L$ac_vtk_cocoa_libraries/vtk-5.3 VTK_COCOA_LIB=$ac_vtk_cocoa_libraries/vtk-5.3 elif test -e $ac_vtk_cocoa_libraries/vtk-5.2 ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk-5.2" VTK_COCOA_LIBS=-L$ac_vtk_cocoa_libraries/vtk-5.2 VTK_COCOA_LIB=$ac_vtk_cocoa_libraries/vtk-5.2 elif test -e $ac_vtk_cocoa_libraries/vtk-5.1 ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk-5.1" elif test -e $ac_vtk_cocoa_libraries/vtk-5.0 ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk-5.0" elif test -e $ac_vtk_cocoa_libraries/vtk ; then VTK_COCOA_LIB_VTK="$ac_vtk_cocoa_libraries/vtk" fi fi AM_CONDITIONAL(HAVE_COCOA_VTK_LIBS, test ! "x$VTK_COCOA_DIR" = "x") AC_SUBST(VTK_COCOA_CFLAGS) AC_SUBST(VTK_COCOA_CXXFLAGS) AC_SUBST(VTK_COCOA_LIBS) AC_SUBST(VTK_COCOA_LIB) AC_SUBST(VTK_COCOA_LIB_VTK) AC_SUBST(VTK_COCOA_DIR) ################################################################ # KWWidgets ################################################################ ac_kwwidgets_includes="NO" ac_kwwidgets_libraries="NO" ac_kwwidgets_dir="NO" KWWIDGETS_CFLAGS="" KWWIDGETS_CXXFLAGS="" KWWIDGETS_LIBS="" KWWIDGETS_DIR="" AC_MSG_CHECKING(KWWidgets config) AC_ARG_WITH(kwwidgets-dir, [ --with-kwwidgets-dir=DIR where the root of KWWidgets is installed.], [ ac_kwwidgets_includes="$withval"/include/KWWidgets ac_kwwidgets_libraries="$withval"/lib/KWWidgets ac_kwwidgets_dir="$withval" KWWIDGETS_DIR=$ac_kwwidgets_dir ]) if test "x$KWWIDGETS_DIR" = "x"; then # if a KWWidgets root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/KWWidgets/current" ; then withval=/usr/pubsw/packages/KWWidgets/current ac_kwwidgets_includes="$withval"/include/KWWidgets ac_kwwidgets_libraries="$withval"/lib/KWWidgets ac_kwwidgets_dir="$withval" KWWIDGETS_DIR=$ac_kwwidgets_dir kww_apps="yes" fi fi if test ! "$ac_kwwidgets_includes" = "NO"; then AC_MSG_RESULT(KWWidgets directory is $withval) for item in $ac_kwwidgets_includes; do KWWIDGETS_CFLAGS="${KWWIDGETS_CFLAGS} -I${item}" KWWIDGETS_CXXFLAGS="${KWWIDGETS_CXXFLAGS} -I${item}" done KWWIDGETS_DIR=$ac_kwwidgets_dir kww_apps="yes" fi if test ! "$ac_kwwidgets_libraries" = "NO"; then for item in $ac_kwwidgets_libraries; do KWWIDGETS_LIBS="${KWWIDGETS_LIBS} -L${item}" done KWWIDGETS_LIBS="${KWWIDGETS_LIBS}" kww_apps="yes" fi AC_ARG_ENABLE(kww-apps, [ --disable-kww-apps disable building KWWidgets-based apps], [ kww_apps="NO" ]) if test "$kww_apps" = "yes"; then AC_MSG_RESULT([Enabled building of KWWidgets apps.]) # enable testing for OpenGL libs: need_opengl=yes else AC_MSG_RESULT([Not building KWWidgets apps.]) fi AM_CONDITIONAL(ENABLE_KWWIDGETS_APPS, test "$kww_apps" = "yes") AC_SUBST(KWWIDGETS_CFLAGS) AC_SUBST(KWWIDGETS_CXXFLAGS) AC_SUBST(KWWIDGETS_LIBS) AC_SUBST(KWWIDGETS_DIR) ################################################################ # wxWidgets ################################################################ WXWIDGETS_CFLAGS="" WXWIDGETS_CXXFLAGS="" WXWIDGETS_LIBS="" WXWIDGETS_GL_LIBS="" WXWIDGETS_OPTIONAL_LIBS="" WXWIDGETS_DIR="" AC_MSG_CHECKING(wxWidgets config) AC_ARG_WITH(wxwidgets-dir, [ --with-wxwidgets-dir=DIR where the root of wxWidgets is installed.], [ WXWIDGETS_DIR="$withval" wxw_apps="yes" ]) if test "x$WXWIDGETS_DIR" = "x"; then # if a wxWidgets root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/wxWidgets/current" ; then WXWIDGETS_DIR=/usr/pubsw/packages/wxWidgets/current wxw_apps="yes" fi fi # use the handy wx-config utility to get the compiler and linker flags if test ! "x$WXWIDGETS_DIR" = "x"; then WXCONFIG="${WXWIDGETS_DIR}/bin/wx-config" WXWIDGETS_CFLAGS="`${WXCONFIG} --cflags`" WXWIDGETS_CXXFLAGS="`${WXCONFIG} --cxxflags`" # we want to use the local / static jpeg, tiff and expat libs WXWIDGETS_LIBS="`${WXCONFIG} --libs | sed 's/-ljpeg/..\/jpeg\/libjpeg.a/g' | sed 's/-ltiff/..\/tiff\/libtiff.a/g' | sed 's/-lexpat/..\/expat\/libexpat.a/g'`" WXWIDGETS_GL_LIBS="`${WXCONFIG} --libs gl | sed 's/-ljpeg/..\/jpeg\/libjpeg.a/g' | sed 's/-ltiff/..\/tiff\/libtiff.a/g' | sed 's/-lexpat/..\/expat\/libexpat.a/g'`" # except wx-config isn't so handy in including some header paths on Linux: if test -d /usr/include/gtk-2.0 ; then WXWIDGETS_GTK_CFLAGS="-D__WXGTK20__" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/include/gtk-2.0" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/lib/gtk-2.0/include" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/lib64/gtk-2.0/include" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/include/glib-2.0" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/lib/glib-2.0/include" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/lib64/glib-2.0/include" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/include/pango-1.0" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/include/cairo" WXWIDGETS_GTK_CFLAGS="$WXWIDGETS_GTK_CFLAGS -I/usr/include/atk-1.0" WXWIDGETS_CFLAGS="$WXWIDGETS_CFLAGS $WXWIDGETS_GTK_CFLAGS" WXWIDGETS_CXXFLAGS="$WXWIDGETS_CXXFLAGS $WXWIDGETS_GTK_CFLAGS" fi # seems like we gotta manually check for these... if test -e ${WXWIDGETS_DIR}/lib/libwx_gtk2_gl-2.8.a ; then WXWIDGETS_LIBS="$WXWIDGETS_LIBS -lwx_gtk2_gl-2.8" fi if test -e ${WXWIDGETS_DIR}/lib/libwx_gtk2u_gl-2.9.a ; then WXWIDGETS_LIBS="$WXWIDGETS_LIBS -lwx_gtk2u_gl-2.9" fi WXWIDGETS_OPTIONAL_LIBS= if test -e ${WXWIDGETS_DIR}/lib/libwx_gtk2u_aui-2.9.a ; then WXWIDGETS_LIBS="$WXWIDGETS_LIBS -lwx_gtk2u_aui-2.9" WXWIDGETS_OPTIONAL_LIBS="`${WXCONFIG} --optional-libs aui`" fi if test -e ${WXWIDGETS_DIR}/lib/libwx_gtk2u_core-2.9.a ; then WXWIDGETS_LIBS="$WXWIDGETS_LIBS -lwx_gtk2u_core-2.9" fi fi AC_ARG_ENABLE(wxw-apps, [ --disable-wxw-apps disable building wxWidgets-based apps], [ wxw_apps="NO" ]) if test "$wxw_apps" = "yes"; then AC_MSG_RESULT([Enabled building of wxWidgets apps.]) # enable testing for OpenGL libs: need_opengl=yes else AC_MSG_RESULT([Not building wxWidgets apps.]) fi AM_CONDITIONAL(ENABLE_WXWIDGETS_APPS, test "$wxw_apps" = "yes") AC_SUBST(WXWIDGETS_CFLAGS) AC_SUBST(WXWIDGETS_CXXFLAGS) AC_SUBST(WXWIDGETS_LIBS) AC_SUBST(WXWIDGETS_GL_LIBS) AC_SUBST(WXWIDGETS_OPTIONAL_LIBS) AC_SUBST(WXWIDGETS_DIR) ################################################################ # GTS ################################################################ GTS_CFLAGS="" GTS_LIBS="" GTS_DIR="" AC_MSG_CHECKING(GTS config) AC_ARG_WITH(gts-dir, [ --with-gts-dir=DIR where the root of GTS is installed.], [ GTS_DIR="$withval" ]) if test "x$GTS_DIR" = "x"; then # if a gts root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/gts/current" ; then GTS_DIR=/usr/pubsw/packages/gts/current fi fi # use the handy wx-config utility to get the compiler and linker flags if test ! "x$GTS_DIR" = "x"; then AC_MSG_RESULT([Enabled building of GTS apps.]) GTSCONFIG="${GTS_DIR}/bin/gts-config" GTS_CFLAGS="`${GTSCONFIG} --cflags`" # we want to use the local / static jpeg, tiff and expat libs GTS_LIBS="`${GTSCONFIG} --libs`" else AC_MSG_RESULT([Not building GTS apps.]) fi AM_CONDITIONAL(HAVE_GTS_LIBS, test ! "x$GTS_DIR" = "x") AC_SUBST(GTS_CFLAGS) AC_SUBST(GTS_LIBS) AC_SUBST(GTS_DIR) ################################################################ # ITK ################################################################ ac_itk_includes="NO" ac_itk_libraries="NO" ITK_CFLAGS="" ITK_LIBS="" ITK_LIB="" LIBS_ITK="" ITK_DIR="" AC_MSG_CHECKING(ITK directory) AC_ARG_WITH(itk-dir, [ --with-itk-dir=DIR where the root of ITK is installed.], [ itk_i="$withval/include/InsightToolkit" ac_itk_includes="$itk_i $itk_i/Algorithms $itk_i/BasicFilters $itk_i/Common $itk_i/IO $itk_i/Numerics $itk_i/Numerics/Statistics $itk_i/Review $itk_i/Review/Statistics $itk_i/SpatialObject $itk_i/Utilities" ac_itk_libraries="$withval"/lib/InsightToolkit ITK_DIR="$withval" itk_apps="yes" AC_SUBST(ITK_DIR) ]) AC_ARG_WITH(itk-include, [ --with-itk-include=DIR root of ITK include directory.], [ itk_i="$withval" ac_itk_includes="$itk_i" itk_apps="yes" ]) AC_ARG_WITH(itk-libraries, [ --with-itk-libraries=DIR root of ITK lib directory.], [ ac_itk_libraries="$withval/InsightToolkit" itk_apps="yes" ]) # if --without-itk-dir was specified: if test "x$ITK_DIR" = "xno"; then itk_apps="NO" fi if test "x$ITK_DIR" = "x"; then # if an ITK root was not supplied, but one exists in the # default packages path at the NMR Center, then use that: if test -d "/usr/pubsw/packages/itk/current" ; then withval=/usr/pubsw/packages/itk/current itk_i="$withval/include/InsightToolkit" ac_itk_includes="$itk_i $itk_i/Algorithms $itk_i/BasicFilters $itk_i/Common $itk_i/IO $itk_i/Numerics $itk_i/Numerics/Statistics $itk_i/Review $itk_i/Review/Statistics $itk_i/SpatialObject $itk_i/Utilities" ac_itk_libraries="$withval"/lib/InsightToolkit ITK_DIR="$withval" itk_apps="yes" AC_SUBST(ITK_DIR) fi fi if test ! "$ac_itk_includes" = "NO"; then AC_MSG_RESULT(ITK directory is $withval) for item in $ac_itk_includes; do ITK_CFLAGS="${ITK_CFLAGS} -I${item}" done fi if test ! "$ac_itk_libraries" = "NO"; then ITK_LIBS=-L$ac_itk_libraries ITK_LIB=$ac_itk_libraries fi AC_ARG_ENABLE(itk-apps, [ --disable-itk-apps disable building ITK-based apps], [ itk_apps="NO" ]) if test "$itk_apps" = "yes"; then AC_MSG_RESULT([Enabled building of ITK apps.]) # these are the minimum ITK libs necessary to support Nrrd IO, # notice they are all static (avoiding LD_LIBRARY_PATH usage) LIBS_ITK="$ac_itk_libraries/libITKIO.a \ $ac_itk_libraries/libITKAlgorithms.a \ $ac_itk_libraries/libITKCommon.a \ $ac_itk_libraries/libITKNumerics.a \ $ac_itk_libraries/libITKMetaIO.a \ $ac_itk_libraries/libITKniftiio.a \ $ac_itk_libraries/libITKNrrdIO.a \ $ac_itk_libraries/libitkpng.a \ $ac_itk_libraries/libitksys.a \ $ac_itk_libraries/libitktiff.a \ $ac_itk_libraries/libitkv3p_netlib.a \ $ac_itk_libraries/libitkzlib.a \ $ac_itk_libraries/libitkgdcm.a \ $ac_itk_libraries/libitkopenjpeg.a \ $ac_itk_libraries/libitkjpeg8.a \ $ac_itk_libraries/libitkjpeg12.a \ $ac_itk_libraries/libitkjpeg16.a \ $ac_itk_libraries/libITKDICOMParser.a" # ITK v3.16.0 needs libuuid for function `gdcm::Util::GenerateUUID' if test -e /usr/lib/libuuid.a ; then LIB_UUID_A="/usr/lib/libuuid.a" AC_SUBST(LIB_UUID_A) fi if test -e /usr/lib64/libuuid.a ; then LIB_UUID_A="/usr/lib64/libuuid.a" AC_SUBST(LIB_UUID_A) fi LIBS_ITK="$LIBS_ITK $LIB_UUID_A" else AC_MSG_RESULT([Not building ITK apps.]) fi AM_CONDITIONAL(ENABLE_ITK_APPS, test "$itk_apps" = "yes") AM_CONDITIONAL(HAVE_ITK_LIBS, test "$itk_apps" = "yes") AC_SUBST(ITK_CFLAGS) AC_SUBST(ITK_LIBS) AC_SUBST(ITK_LIB) AC_SUBST(LIBS_ITK) ##################################################### # OpenGL ##################################################### AC_MSG_NOTICE(Getting OpenGL info...) mac_gl_libs= ##### # GL ##### ac_gl_includes="NO" ac_gl_libraries="NO" ac_gl_bindir="NO" # these are lower-case because later AX_CHECK_GL trounces # GL_CLFLAGS and GL_LIBS: gl_cflags="" gl_libs="" AC_MSG_CHECKING(GL directory) AC_ARG_WITH(gl-dir, [ --with-gl-dir=DIR where the root of OpenGL is installed.], [ ac_gl_includes="$withval"/include ac_gl_libraries="$withval"/lib ac_gl_bindir="$withval"/bin ]) if test ! "$ac_gl_includes" = "NO"; then AC_MSG_RESULT(gl directory is $withval) gl_cflags=-I$ac_gl_includes else AC_MSG_RESULT(OpenGL directory is not supplied) fi if test ! "$ac_gl_libraries" = "NO"; then gl_libs=-L$ac_gl_libraries fi # stupid Mac OS Leopard fix: if test "$OS" = "Darwin"; then gl_cflags="-I/usr/X11R6/include" gl_libs="-L/usr/X11R6/lib $X_LIBS -Wl,-dylib_file,\ /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:\ /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" mac_gl_libs=$gl_libs fi AC_SUBST(gl_cflags) AC_SUBST(gl_libs) ##################################################### # AX_CHECK_GL produces GL_CFLAGS GL_LIBS ac_save_cflags=$CFLAGS ac_save_ldflags=$LDFLAGS CFLAGS="$gl_cflags $CFLAGS" # bug in AX_CHECK_GL: assumes HAVE_WINDOWS_H is defined, so fix CFLAGS # (note: Mac doesnt have this bug) if test ! "$OS" = "Darwin"; then CFLAGS="-DHAVE_WINDOWS_H=0 $CFLAGS" fi LDFLAGS="$gl_libs $LDFLAGS" AX_CHECK_GL if test "X$no_gl" = "Xyes"; then if test "X$need_opengl" = "Xyes"; then AC_MSG_ERROR([FATAL: GL not found. Use --with-gl-dir=... to specify]) else AC_MSG_RESULT([GL not found]) fi else AC_MSG_RESULT([GL found: Setting GL_CFLAGS='$GL_CFLAGS $gl_cflags' and GL_LIBS='$GL_LIBS']) GL_CFLAGS="$GL_CFLAGS $gl_cflags" LIBS_OPENGL="$GL_LIBS $mac_gl_libs" fi CFLAGS=$ac_save_cflags LDFLAGS=$ac_save_ldflags ##################################################### # AX_CHECK_GLU produces GLU_CFLAGS GLU_LIBS ac_save_cflags=$CFLAGS ac_save_ldflags=$LDFLAGS CFLAGS="$gl_cflags $CFLAGS" LDFLAGS="$gl_libs $LDFLAGS" AX_CHECK_GLU if test "X$no_glu" = "Xyes"; then if test "X$need_opengl" = "Xyes"; then AC_MSG_ERROR([FATAL: GLu not found. Use --with-gl-dir=... to specify]) else AC_MSG_RESULT([GLu not found]) fi else AC_MSG_RESULT([GLu found: Setting GLU_CFLAGS='$GLU_CFLAGS' and GLU_LIBS='$GLU_LIBS']) LIBS_OPENGL="$GLU_LIBS $mac_gl_libs" fi CFLAGS=$ac_save_cflags LDFLAGS=$ac_save_ldflags AC_SUBST(LIBS_OPENGL) ################################################################### # Install NMR Martinos Center files (not included in distribution) ################################################################### AC_ARG_ENABLE(nmr-install, [ --enable-nmr-install install NMR Center-only files], [case "${enableval}" in yes) nmrinstall=true ;; no) nmrinstall=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-nmr-install) ;; esac], [nmrinstall=false]) if test "x$nmrinstall" = "xtrue"; then AC_MSG_RESULT([Performing an NMR installation.]) else AC_MSG_RESULT([Performing an off-site installation.]) fi AM_CONDITIONAL(NMR_INSTALL, test x$nmrinstall = xtrue) ################################################ LIBDIRS_MGH="utils rgb unix dicom hipsstubs" AC_SUBST(LIBDIRS_MGH) # stupid circular dependency on iopen swapInt etc. LIBS_MGH="\ utils/libutils.a \ fsgdf/libfsgdf.a \ rgb/librgb.a \ unix/libunix.a \ dicom/libdicom.a \ hipsstubs/libhipsstubs.a \ log/liblog.a \ xml2/libxml2.a" # use local libjpeg if --with-jpeg-dir not used: if test "$ac_jpeg_libraries" = "NO"; then LIB_JPEG="" LIBS_MGH="${LIBS_MGH} jpeg/libjpeg.a" fi # use local libtiff if --with-tiff-dir not used: if test "$ac_tiff_libraries" = "NO"; then LIB_TIFF="" LIBS_MGH="${LIBS_MGH} tiff/libtiff.a" fi # use local libexpat if --with-expat-dir not used: if test "$ac_expat_libraries" = "NO"; then LIB_EXPAT="" LIBS_MGH="${LIBS_MGH} expat/libexpat.a" fi # to support CUDA, use libutils_cuda instead of libutils: LIBS_CUDA_MGH=`echo ${LIBS_MGH} | sed 's/libutils/libutils_cuda/g'` AC_SUBST(LIBS_MGH) AC_SUBST(LIBS_CUDA_MGH) AC_SUBST(LIB_JPEG) AC_SUBST(LIB_TIFF) AC_SUBST(LIB_EXPAT) ##################################################### # generic mods ##################################################### CPPFLAGS="$CPPFLAGS -D$OS -DANSI $OS_CPPFLAGS" LDFLAGS="$LDFLAGS $OS_LDFLAGS" ##################################################### # Checks for libraries. # the order is important ##################################################### # the entire libs here is passed as LIBS # thus save the current one, along with flags, which # are restored upon completion of these checks ac_save_libs=$LIBS ac_save_cppflags=$CPPFLAGS ac_save_ldflags=$LDFLAGS CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS $TIFF_CFLAGS $JPEG_CFLAGS \ $PETSC_CFLAGS $ITK_CFLAGS $ANN_CFLAGS \ $MNI_CFLAGS $TCL_CFLAGS $CPPUNIT_CFLAGS $VXL_CFLAGS $NIFTI_CFLAGS \ $GL_CFLAGS $GLU_CFLAGS $VTK_CFLAGS $KWWIDGETS_CFLAGS" LDFLAGS="$LDFLAGS $MNI_LIBS $TCL_LIBS $VXL_LIBS \ $EXPAT_LIBS $TIFF_LIBS $JPEG_LIBS \ $gl_libs $GL_LIBS $GLU_LIBS $VTK_LIBS $ITK_LIBS $KWWIDGETS_LIBS \ $PETSC_LIBS $NIFTI_LIBS $XAWPLUS_LIBS $ANN_LIBS" AC_MSG_NOTICE(Making sure that all libraries can be compiled...) # AC_MSG_NOTICE(CPPFLAGS: $CPPFLAGS) # AC_MSG_NOTICE(LDFLAGS: $LDFLAGS) AC_CHECK_LIB([m], [floor]) AC_CHECK_LIB([z], [gzopen]) AC_CHECK_LIB([crypt], [crypt],[],[echo "(Note: Mac OS X doesn't use crypt)"]) LIB_CRYPT="-lcrypt" if test "$OS" = "Darwin"; then LIB_CRYPT="" fi AC_SUBST(LIB_CRYPT) # test for libtiff only if --with-tiff-dir was used: if test ! "$ac_tiff_libraries" = "NO"; then CPPFLAGS="$CPPFLAGS $TIFF_CFLAGS" LDFLAGS="$LDFLAGS $TIFF_LIBS" AC_CHECK_LIB([tiff], [TIFFGetVersion],[], [AC_MSG_ERROR([FATAL: tiff lib not found. \ Please install tiff header files and libs.])] ) fi # test for libjpeg only if --with-jpeg-dir was used: if test ! "$ac_jpeg_libraries" = "NO"; then CPPFLAGS="$CPPFLAGS $JPEG_CFLAGS" LDFLAGS="$LDFLAGS $JPEG_LIBS" AC_CHECK_LIB([jpeg], [jpeg_start_compress],[], [AC_MSG_ERROR([FATAL: jpeg lib not found. Please install jpeg lib.])] ) fi # three mni libs AC_CHECK_LIB([netcdf], [nccreate],[], [AC_MSG_ERROR([FATAL: netcdf lib not found. \ Set LDFLAGS or --with-mni-dir.])] ) if test "x$MINC2" = "xYES"; then # check for newer build of mni tools AC_CHECK_LIB([minc2 -lhdf5], [miopen], [], [AC_MSG_ERROR([FATAL: minc2 lib not found. \ Set LDFLAGS or --with-mni-dir.])] ) AC_CHECK_LIB([volume_io2], [transform_point],[], [AC_MSG_ERROR([FATAL: volume_io2 lib not found. \ Set LDFLAGS or --with-mni-dir.])] ) else AC_CHECK_LIB([minc], [miopen], [], [AC_MSG_ERROR([FATAL: minc lib not found. \ Set LDFLAGS or --with-mni-dir.])] ) AC_CHECK_LIB([volume_io], [transform_point],[], [AC_MSG_ERROR([FATAL: volume_io lib not found. \ Set LDFLAGS or --with-mni-dir.])] ) fi # VXL check AC_CHECK_FILE($VXL_LIB/libvnl$DYNAMIC_LIB_EXT, [if test "x$LD_LIBRARY_PATH" = "x"; then export LD_LIBRARY_PATH=$VXL_LIB else export LD_LIBRARY_PATH="$VXL_LIB":"$LD_LIBRARY_PATH" fi],[]) AC_CHECK_LIB([vnl], [main],[], [AC_MSG_ERROR([FATAL: vnl lib not found. \ Set LDFLAGS or --with-vxl-dir.])] ) AC_CHECK_LIB([vnl_algo], [main],[], [AC_MSG_ERROR([FATAL: vnl_algo lib not found. \ Set LDFLAGS or --with-vxl-dir.])] ) # ANN check if test ! "x$ac_ann_dir" = "xNO"; then # if --with-ann-dir was used, make sure necessary libs exist AC_CHECK_LIB([ANN], [main],[], [AC_MSG_ERROR([FATAL: ANN Approximate Nearest Neighbors lib not found. \ Set LDFLAGS or --with-ann-dir.])] ) fi # PETSc check if test ! "x$ac_petsc_dir" = "xNO"; then # if --with-petsc-dir was used, make sure necessary libs exist if test "$OS" = "Darwin"; then PMPICH=-lpmpich else PMPICH= fi AC_CHECK_LIB([petsc -lmpich -lpthread ${PMPICH}], [PetscInitialize],[], [AC_MSG_ERROR([FATAL: petsc lib not found. \ Set LDFLAGS or --with-petsc-dir.])] ) fi # BOOST check BOOST_PO_LIB="" # if --with-boost-dir was used, make sure necessary lib(s) exist, # namely, boost_program_options, used by fem_elastic build dir if test ! "x$ac_boost_dir" = "xNO"; then BOOST_PO_LIB="${BOOST_LIBS} -lboost_program_options-mt" if test -e ${BOOST_LIB}/libboost_program_options-mt.a ; then BOOST_PO_LIB=${BOOST_LIB}/libboost_program_options-mt.a AC_MSG_RESULT([found '$BOOST_PO_LIB']) else if test -e ${BOOST_LIB}/libboost_program_options.a ; then BOOST_PO_LIB=${BOOST_LIB}/libboost_program_options.a AC_MSG_RESULT([found '$BOOST_PO_LIB']) fi fi else # else check for native install of boost program options lib if test -e /usr/lib/libboost_program_options.a ; then BOOST_PO_LIB=/usr/lib/libboost_program_options.a AC_MSG_RESULT([found '$BOOST_PO_LIB']) AM_CONDITIONAL(HAVE_BOOST_LIBS, ! test "x$BOOST_PO_LIB" = "xNO") fi if test -e /usr/lib64/libboost_program_options.a ; then BOOST_PO_LIB=/usr/lib64/libboost_program_options.a BOOST_LIB=/usr/lib64 BOOST_LIBS=-L/usr/lib64 AC_SUBST(BOOST_LIB) AC_SUBST(BOOST_LIBS) AC_MSG_RESULT([found '$BOOST_PO_LIB']) AM_CONDITIONAL(HAVE_BOOST_LIBS, ! test "x$BOOST_PO_LIB" = "xNO") else if test -e /usr/lib64/libboost_program_options.so ; then # note: centos 6 doesnt have the .a lib, so the shared is used instead BOOST_PO_LIB=-lboost_program_options BOOST_LIB=/usr/lib64 BOOST_LIBS=-L/usr/lib64 AC_SUBST(BOOST_LIB) AC_SUBST(BOOST_LIBS) AC_MSG_RESULT([found '$BOOST_PO_LIB']) AM_CONDITIONAL(HAVE_BOOST_LIBS, ! test "x$BOOST_PO_LIB" = "xNO") fi fi fi AC_SUBST(BOOST_PO_LIB) # NIfTI check if test ! "x$ac_nifti_dir" = "xNO"; then # if --with-nifti-dir was used, make sure necessary libs exist AC_CHECK_LIB([znz], [znzread],[], [AC_MSG_ERROR([FATAL: NIfTI znz lib not found. \ Set LDFLAGS or --with-nifti-dir.])] ) AC_CHECK_LIB([niftiio -lznz], [is_nifti_file],[], [AC_MSG_ERROR([FATAL: niftiio lib not found. \ Set LDFLAGS or --with-nifti-dir.])] ) LIBS_NIFTI="-lznz -lniftiio" else # check if libs installed natively somewhere AC_CHECK_LIB([znz], [znzread], [AC_CHECK_LIB([niftiio -lznz], [is_nifti_file], [AM_CONDITIONAL(HAVE_NIFTI_LIBS, test "1" = "1") LIBS_NIFTI="-lznz -lniftiio"],[])], []) fi AC_SUBST(LIBS_NIFTI) # test for vtk versions of system libs, and if not found (ie, not # built when vtk was built), then use the system lib # use local libexpat if --with-expat-dir not used: if test "$ac_expat_libraries" = "NO"; then if test ! "$OS" = "Darwin"; then VTK_EXPAT_LIB=../expat/libexpat.a else # else use whatever we can find AC_CHECK_LIB([vtkexpat], [main], [VTK_EXPAT_LIB="-lvtkexpat"], [AC_CHECK_LIB([expat],[main],[VTK_EXPAT_LIB="-lexpat"], [AC_MSG_ERROR([FATAL: libvtkexpat or libexpat not found.])])]) fi fi AC_SUBST(VTK_EXPAT_LIB) AC_CHECK_LIB([vtkfreetype], [FTC_Manager_LookupSize], [VTK_FREETYPE_LIB="-lvtkfreetype"], [AC_CHECK_LIB([vtkfreetype], [vtk_freetype_FTC_Manager_LookupSize], [VTK_FREETYPE_LIB="-lvtkfreetype"], [AC_CHECK_LIB([freetype],[FTC_Manager_LookupSize],[VTK_FREETYPE_LIB="-lfreetype"], [AC_MSG_ERROR([FATAL: libvtkfreetype or libfreetype not found.])])])]) AC_SUBST(VTK_FREETYPE_LIB) AC_CHECK_LIB([vtkzlib], [gzopen], [VTK_Z_LIB="-lvtkzlib"], [AC_CHECK_LIB([z],[gzopen],[VTK_Z_LIB="-lz"], [AC_MSG_ERROR([FATAL: libvtkzlib or libz not found.])])]) AC_SUBST(VTK_Z_LIB) # use local libjpeg if --with-jpeg-dir not used: if test "$ac_jpeg_libraries" = "NO"; then if test ! "$OS" = "Darwin"; then VTK_JPEG_LIB=../jpeg/libjpeg.a else # else use whatever we can find AC_CHECK_LIB([vtkjpeg], [vtk_jpeg_start_compress], [VTK_JPEG_LIB="-lvtkjpeg"], [VTK_JPEG_LIB="-ljpeg"]) fi fi AC_SUBST(VTK_JPEG_LIB) # use local libtiff if --with-tiff-dir not used: if test "$ac_tiff_libraries" = "NO"; then if test ! "$OS" = "Darwin"; then VTK_TIFF_LIB=../tiff/libtiff.a else # else use whatever we can find AC_CHECK_LIB([vtktiff $VTK_JPEG_LIB $VTK_Z_LIB], [vtk_TIFFGetVersion], [VTK_TIFF_LIB="-lvtktiff"], [VTK_TIFF_LIB="-ltiff"]) fi fi AC_SUBST(VTK_TIFF_LIB) AC_CHECK_LIB([vtkpng $VTK_Z_LIB], [main], [VTK_PNG_LIB="-lvtkpng"], [AC_CHECK_LIB([png],[main],[VTK_PNG_LIB="-lpng"], [AC_MSG_ERROR([FATAL: libvtkpng or libpng not found.])])]) AC_SUBST(VTK_PNG_LIB) # check for VTK libs AC_CHECK_FILE($VTK_LIB/libvtkCommon$DYNAMIC_LIB_EXT, [if test "x$LD_LIBRARY_PATH" = "x"; then export LD_LIBRARY_PATH=$VTK_LIB else export LD_LIBRARY_PATH="$VTK_LIB":"$LD_LIBRARY_PATH" fi],[]) AC_CHECK_LIB([vtkCommon -lstdc++], [main],[], [AC_MSG_RESULT([INFO: vtkCommon lib not found. \ Try setting LDFLAGS, LD_LIBRARY_PATH and-or --with-vtk-dir.])] ) # libverdict appeared in VTK v5.1.0, and is required by libvtkHybrid, # and libvtkGraphics (in v5.2.0), but doesnt exist in earlier versions of VTK VTK_VERDICT_LIB="" AC_CHECK_LIB([verdict], [main], [VTK_VERDICT_LIB="-lverdict"], [AC_CHECK_LIB([vtkverdict], [main], [VTK_VERDICT_LIB="-lvtkverdict"], [])]) AC_SUBST(VTK_VERDICT_LIB) # ditto for libvtksqlite VTK_SQLITE_LIB="" AC_CHECK_LIB([vtksqlite], [main], [VTK_SQLITE_LIB="-lvtksqlite"], []) AC_SUBST(VTK_SQLITE_LIB) # libvtkMPEG2Encode disappeared from VTK v5.1.0, so test for it VTK_MPEG2ENCODE_LIB="" AC_CHECK_LIB([vtkMPEG2Encode], [main], [VTK_MPEG2ENCODE_LIB="-lvtkMPEG2Encode"], []) AC_SUBST(VTK_MPEG2ENCODE_LIB) # libvtkmetaio appeared in VTK v5.1.0, so check for it # and, ugggg... it requires vtkpng and vtkzlib VTK_METAIO_LIB="" AC_CHECK_LIB([vtkmetaio], [main], [VTK_METAIO_LIB="-lvtkmetaio" AC_CHECK_LIB([vtkpng], [main], [VTK_PNG_LIB="-lvtkpng"], []) AC_CHECK_LIB([vtkzlib], [main], [VTK_Z_LIB="-lvtkzlib"], []) ], []) AC_SUBST(VTK_METAIO_LIB) # # check tcl/tk/tix/blt only if tcl/tk apps are enabled # if test "x$tcltk_apps" = "xyes"; then ################## Tcl # check tcl8.5 AC_CHECK_LIB([tcl8.5],[Tcl_Init], [LIB_TCL=-ltcl8.5], # check tcl8.4 [ AC_CHECK_LIB([tcl8.4],[Tcl_Init], [LIB_TCL=-ltcl8.4], # check tcl8.3 [ AC_CHECK_LIB([tcl8.3],[Tcl_Init], [LIB_TCL=-ltcl8.3], # check tcl83 [ AC_CHECK_LIB([tcl83],[Tcl_Init], [LIB_TCL=-ltcl83], # check tcl [ AC_CHECK_LIB([tcl],[Tcl_Init], [LIB_TCL=-ltcl], # check tclstub [ AC_CHECK_LIB([tclstub],[Tcl_Init], [LIB_TCL=-ltclstub], [AC_MSG_ERROR([FATAL: libtcl not found. \ Check config.log. Set LDFLAGS or --with-tcl-dir.]) ]) ]) ]) ]) ]) ]) AC_SUBST(LIB_TCL) #################### Tk needs X11 (or Aqua) LIBS="$X_LIBS $LIBS" CPPFLAGS="$GL_CFLAGS $CPPFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" # check tk8.5 AC_CHECK_LIB([tk8.5],[Tk_Init], [LIB_TK=-ltk8.5], # check tk8.4 [ AC_CHECK_LIB([tk8.4],[Tk_Init], [LIB_TK=-ltk8.4], # check tk8.3 [ AC_CHECK_LIB([tk8.3],[Tk_Init], [LIB_TK=-ltk8.3], # check tk83 [ AC_CHECK_LIB([tk83],[Tk_Init], [LIB_TK=-ltk83], # check tk [ AC_CHECK_LIB([tk],[Tk_Init], [LIB_TK=-ltk], [AC_MSG_ERROR([FATAL: libtk not found. \ Check config.log. Set LDFLAGS or --with-tcl-dir.]) ]) ]) ]) ]) ]) AC_SUBST(LIB_TK) ##################### Tix LIBS="$X_LIBS $LIB_TK $LIB_TCL $LIBS" # check Tix8.4.2 first, as that is known to work best with tcl/tk 8.5 AC_CHECK_LIB([Tix8.4.2], [Tix_Init], [LIB_TIX=-lTix8.4.2], [ # check tix8.1.8.4, as that is known to work best with tcl/tk 8.4 AC_CHECK_LIB([tix8.1.8.4], [Tix_Init], [LIB_TIX=-ltix8.1.8.4], [ # check tix8.1.8.3 AC_CHECK_LIB([tix8.1.8.3], [Tix_Init], [LIB_TIX=-ltix8.1.8.3], [ # check tix8183 AC_CHECK_LIB([tix8183], [Tix_Init], [LIB_TIX=-ltix8183], [ # check tix8.4 AC_CHECK_LIB([Tix8.4], [Tix_Init], [LIB_TIX=-lTix8.4], [ # check tix AC_CHECK_LIB([tix],[Tix_Init], [LIB_TIX=-ltix], [AC_MSG_ERROR([FATAL: libtix not found. \ Check config.log. Set LDFLAGS or --with-tcl-dir.]) ]) ]) ]) ]) ]) ]) AC_SUBST(LIB_TIX) ######## BLT (we cannot build BLT in Aqua) must use X11 AC_CHECK_LIB([BLT25 $LIB_BLT_JPEG],[Blt_Init], [LIB_BLT=-lBLT25], [ AC_CHECK_LIB([BLT $LIB_BLT_JPEG],[Blt_Init], [LIB_BLT=-lBLT], # check BLT.2 (MacOSX) [ AC_CHECK_LIB([BLT.2 $LIB_BLT_JPEG],[Blt_Init], [LIB_BLT=-lBLT.2], [ # check BLT24 (Fedora) AC_CHECK_LIB([BLT24 $LIB_BLT_JPEG],[Blt_Init], [LIB_BLT=-lBLT24], [AC_MSG_ERROR([FATAL: libBLT not found. \ Check config.log. Set LDFLAGS or --with-BLT-dir.]) ]) ]) ]) ]) AC_SUBST(LIB_BLT) fi # check for KWWidget libs only if kww app building is enabled if test ! "x$kww_apps" = "xNO"; then LDFLAGS="$LDFLAGS $LIB_TCL" AC_CHECK_LIB([KWWidgets], [main],[], [AC_MSG_ERROR([FATAL: KWWidgets lib not found. \ Set LDFLAGS or --with-KWWidgets-dir.])] ) fi # check for XawPlus lib only if xawplus app building is enabled if test ! "x$xawplus_apps" = "xNO"; then # with and without libXpm (Centos 6 doesnt have it) AC_CHECK_LIB([X11 -lXt -lXpm -lXawPlus], [XawInitializeWidgetSet], [LIBS_XAWPLUS="-lXt -lXpm -lXawPlus"], [AC_CHECK_LIB([X11 -lXt -lXawPlus], [XawInitializeWidgetSet], [LIBS_XAWPLUS="-lXt -lXawPlus"], [AC_MSG_ERROR([FATAL: XawPlus lib not found. \ Set LDFLAGS or --with-xawplus-dir.])])]) AC_SUBST(LIBS_XAWPLUS) fi ########################################################### # Intel C/C++ compiler stuff ########################################################### LIBS_ICC="" if test "x$CC" = "xicc"; then LIBS_ICC="-lirc -lsvml -lguide -limf -lpthread" fi AC_SUBST(LIBS_ICC) AM_CONDITIONAL(HAVE_INTEL_COMPILER, test "x$CC" = "xicc" ) # # recover previous settings, from prior to checks. # let each Makefile.am set as appropriate, choose from: # MNI_CFLAGS, MNI_LIBS # JPEG_CFLAGS, JPEG_LIBS # TIFF_CFLAGS, TIFF_LIBS # TCL_CFLAGS, TCL_LIBS, LIB_TCL, ENABLE_TCLTK_APPS # TK_CFLAGS, TK_LIBS, LIB_TK, LIB_TIX # BLT_CFLAGS, BLT_LIBS, LIB_BLT # GL_CFLAGS, GL_LIBS # GLU_CFLAGS, GLU_LIBS # VXL_CFLAGS, VXL_LIBS # VTK_CFLAGS, VTK_LIBS # KWWIDGETS_CFLAGS, KWWIDGETS_LIBS, ENABLE_KWWIDGETS_APPS # ITK_CFLAGS, ITK_LIBS LIBS=$ac_save_libs CPPFLAGS=$ac_save_cppflags LDFLAGS=$ac_save_ldflags # ...or use combined flags LDFLAGS_TCL="$BLT_LIBS $TCL_LIBS" if test "$OS" = "Darwin"; then LDFLAGS_TCL="-bind_at_load $LDFLAGS_TCL" fi LIBS_TCL="$LIB_BLT $LIB_TIX $LIB_TK $LIB_TCL" LIBS_TCL_OPENGL="$LIBS_TCL $LIBS_OPENGL" AC_SUBST(LDFLAGS_TCL) AC_SUBST(LIBS_TCL) AC_SUBST(LIBS_TCL_OPENGL) ########################################################### # some common flags and libs ########################################################### CPPFLAGS="$CPPFLAGS $MNI_CFLAGS" LDFLAGS="$LDFLAGS $JPEG_LIBS $TIFF_LIBS $MNI_LIBS $VXL_LIBS $NIFTI_LIBS \ $ITK_LIBS $EXPAT_LIBS" # The order is important here. When adding or removing a lib, be sure # to test the link line to make sure you don't need to adjust the # order. LIBS="-lz -lm $LIB_CRYPT -ldl -lpthread $LIBS" LIBS="$LIBS $LIB_JPEG" LIBS="$LIBS $LIB_TIFF" LIBS="$LIBS $LIB_EXPAT" LIBS="$LIBS $LIBS_MNI" LIBS="$LIBS $LIBS_VXL" LIBS="$LIBS $LIBS_NIFTI" LIBS="$LIBS_ITK $LIBS" LIBS="$LIBS_ICC $LIBS" LIBS="$LIBS_OPEN64 $LIBS" AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LIBS) ######################################################################## # check whether needs Itcl_Init() and Itk_Init() # except when using Tcl8.4, which doesn't contain Itcl_Init or Itk_Init ######################################################################## if test "x$tcltk_apps" = "xyes"; then if ! test "$LIB_TCL" = "-ltcl8.5"; then if ! test "$LIB_TCL" = "-ltcl8.4"; then if ! test "$LIB_TCL" = "-ltcl83"; then AX_TIX_INITCHECK($TCL_CFLAGS, $LDFLAGS_TCL, $LIBS_TCL) fi fi fi fi ######################################################################## # Indicate whether we have OpenGL (HAVE_OPENGL is undefined if not) ######################################################################## HAVE_OPENGL="-DHAVE_OPENGL" if test "x$GL_LIBS" = "x"; then HAVE_OPENGL="" fi AC_SUBST(HAVE_OPENGL) AM_CONDITIONAL(HAVE_OPENGL_LIBS, ! test "X$GL_LIBS" = "X") ######################################################################### # 'make check' environment setup ######################################################################### # # When 'make check' is run, the tests specified in TESTS will inherit # these environment variable. The first one bypasses the need for a # license in FREESURFER_HOME, the others specify necessary libs. # TESTS_ENVIRONMENT="SURFER_FRONTDOOR=1 LD_LIBRARY_PATH=$TCL_LIB" if (! test "x$ac_cppunit_dir" = "xNO"); then TESTS_ENVIRONMENT="$TESTS_ENVIRONMENT:$CPPUNIT_LIB" fi AC_SUBST(TESTS_ENVIRONMENT) ######################################################################### # output ######################################################################### AC_OUTPUT([Makefile GEMS/Makefile GEMS/data/Makefile GEMS/scripts/Makefile check_siemens_dir/Makefile cudatest/Makefile cudatest/gcatest/Makefile cudatest/volumecopy/Makefile cudatest/mrilabeltest/Makefile dicom/Makefile distribution/Makefile distribution/average/Makefile distribution/average/surf/Makefile distribution/average/Yeo_JNeurophysiol11_MNI152/Makefile distribution/docs/Makefile distribution/diffusion/Makefile distribution/diffusion/mgh-dti-seqpack/Makefile distribution/trctrain/Makefile distribution/fsafd/Makefile distribution/grad_unwarp_tables/Makefile distribution/lib/Makefile distribution/lib/bem/Makefile distribution/sessions/Makefile distribution/subjects/Makefile distribution/fsl-extra/Makefile dmri_poistats/Makefile dmri_tensoreig/Makefile dngtester/Makefile dummy/Makefile expat/Makefile fem_elastic/Makefile fsfast/Makefile fsfast/bin/Makefile fsfast/docs/Makefile fsfast/toolbox/Makefile fsgdf/Makefile fslutils/Makefile glut/Makefile gpu_utils/Makefile opencl_algorithms/Makefile hiam_make_surfaces/Makefile hiam_register/Makefile hiam_make_template/Makefile hipsstubs/Makefile histo_register/Makefile histo_register/SimpleBaseLib/Makefile histo_register/ParticleVideoLib/Makefile histo_segment/Makefile histo_synthesize/Makefile histo_compute_joint_density/Makefile histo_register_block/Makefile images/Makefile include/Makefile include/NrrdIO/Makefile include/dicom/Makefile include/xview/Makefile include/pixrect/Makefile include/sys/Makefile include/topology/Makefile include/fs_vnl/Makefile itkio/Makefile itkutils/Makefile jpeg/Makefile label_area/Makefile label_border/Makefile label2patch/Makefile label2flat/Makefile log/Makefile matlab/Makefile mkxsubjreg/Makefile mri_bias/Makefile mri_log_likelihood/Makefile mri_add_xform_to_header/Makefile mri_annotation2label/Makefile mri_aparc2aseg/Makefile mri_aparc2wmseg/Makefile mri_apply_inu_correction/Makefile mri_aseg_edit_train/Makefile mri_aseg_edit_reclassify/Makefile mri_auto_fill/Makefile mri_average/Makefile mri_dct_align/Makefile mri_bc_sc_bias_correct/Makefile mri_binarize/Makefile mri_build_priors/Makefile mri_ca_label/Makefile mri_ca_normalize/Makefile mri_ca_register/Makefile mri_ca_tissue_parms/Makefile mri_ca_train/Makefile mri_gcab_train/Makefile mri_cc/Makefile mri_cht2p/Makefile mri_cnr/Makefile mri_compile_edits/Makefile mri_update_gca/Makefile mri_compute_overlap/Makefile mri_compute_seg_overlap/Makefile mri_concat/Makefile mri_concatenate_gcam/Makefile mri_concatenate_lta/Makefile mri_convert/Makefile mri_convert_mdh/Makefile mri_copy_values/Makefile mri_cor2label/Makefile mri_cvs_register/Makefile mri_deface/Makefile mri_diff/Makefile mri_distance_transform/Makefile mri_edit_segmentation/Makefile mri_edit_segmentation_with_surfaces/Makefile mri_edit_wm_with_aseg/Makefile mri_em_register/Makefile mri_estimate_tissue_parms/Makefile mri_evaluate_morph/Makefile mri_extract/Makefile mri_extract_conditions/Makefile mri_extract_label/Makefile mri_extract_largest_CC/Makefile mri_fieldsign/Makefile mri_fill/Makefile mri_fslmat_to_lta/Makefile mri_fwhm/Makefile mri_gca_ambiguous/Makefile mri_gcut/Makefile mri_gdfglm/Makefile mri_glmfit/Makefile mri_head/Makefile mri_hires_register/Makefile mri_otl/Makefile mri_histo_eq/Makefile mri_histo_normalize/Makefile histo_fix_topology/Makefile mri_ibmc/Makefile mri_info/Makefile mri_and/Makefile mri_hausdorff_dist/Makefile mri_fuse_segmentations/Makefile mri_fuse_intensity_images/Makefile mri_simulate_atrophy/Makefile mri_joint_density/Makefile mri_label2label/Makefile mri_label2vol/Makefile mri_label_histo/Makefile mri_label_vals/Makefile mri_label_volume/Makefile mri_linear_register/Makefile mri_compute_structure_transforms/Makefile mri_make_bem_surfaces/Makefile mri_make_density_map/Makefile mri_make_register/Makefile mri_make_template/Makefile mri_map_cpdat/Makefile mri_mark_temporal_lobe/Makefile mri_mask/Makefile mri_matrix_multiply/Makefile mri_mc/Makefile mri_mcsim/Makefile mri_modify/Makefile mri_morphology/Makefile mri_jacobian/Makefile mri_compute_volume_fractions/Makefile mri_interpolate/Makefile mri_ms_EM/Makefile mri_ms_EM_with_atlas/Makefile mri_ms_LDA/Makefile mri_ms_fitparms/Makefile mri_elastic_energy/Makefile mri_nlfilter/Makefile mri_normalize/Makefile mri_normalize_tp2/Makefile mri_paint/Makefile mri_parse_sdcmdir/Makefile mri_parselabel/Makefile mri_partial_ribbon/Makefile mri_path2label/Makefile mri_polv/Makefile mri_probe_ima/Makefile mri_probedicom/Makefile mri_reduce/Makefile mri_register/Makefile mri_relabel_hypointensities/Makefile mri_remove_neck/Makefile mri_ribbon/Makefile mri_rigid_register/Makefile mri_robust_register/Makefile mri_seg_diff/Makefile mri_seghead/Makefile mri_segment/Makefile mri_segment_tumor/Makefile mri_segment_wm_damage/Makefile mri_segreg/Makefile mri_segstats/Makefile mri_stats2seg/Makefile mri_strip_nonwhite/Makefile mri_strip_subject_info/Makefile mri_surf2surf/Makefile mri_surf2vol/Makefile mri_surfacemask/Makefile mri_surfcluster/Makefile mri_synthesize/Makefile mri_tessellate/Makefile mri_threshold/Makefile mri_topologycorrection/Makefile mri_train/Makefile mri_transform/Makefile mri_transform_to_COR/Makefile mri_twoclass/Makefile mri_vol2roi/Makefile mri_vol2surf/Makefile mri_vol2vol/Makefile mri_volcluster/Makefile mri_voldiff/Makefile mri_volsynth/Makefile mri_watershed/Makefile mri_watershed/brain_volume/Makefile mri_wmfilter/Makefile mri_xvolavg/Makefile mri_z2p/Makefile mri_label_accuracy/Makefile mri_multispectral_segment/Makefile mri_multiscale_segment/Makefile mri_compute_change_map/Makefile mris2rgb/Makefile mris_hausdorff_dist/Makefile mris_map_cuts/Makefile mris_merge_parcellations/Makefile mris_distance_transform/Makefile mris_add_template/Makefile mris_aseg_distance/Makefile mris_density/Makefile mris_fill/Makefile mris_fbirn_annot/Makefile mris_anatomical_stats/Makefile mris_annot_to_segmentation/Makefile mris_apply_reg/Makefile mris_average_curvature/Makefile mris_ca_label/Makefile mris_divide_parcellation/Makefile mris_ca_train/Makefile mris_svm_classify/Makefile mris_svm_train/Makefile mris_calc/Makefile mris_classify_thickness/Makefile mris_compute_acorr/Makefile mris_compute_lgi/Makefile mris_compute_overlap/Makefile mris_compute_parc_overlap/Makefile mris_congeal/Makefile mris_convert/Makefile mris_distance_map/Makefile mris_curvature/Makefile mris_curvature_stats/Makefile mris_decimate/Makefile mris_decimate_gui/Makefile mris_diff/Makefile mris_distance_to_label/Makefile mris_entropy/Makefile mris_errors/Makefile mris_euler_number/Makefile mris_expand/Makefile mris_find_flat_regions/Makefile mris_fix_topology/Makefile mris_topo_fixer/Makefile mris_flatten/Makefile mris_fwhm/Makefile mris_glm/Makefile mris_inflate/Makefile mris_info/Makefile mris_jacobian/Makefile mris_label_area/Makefile mris_label_calc/Makefile mris_label_mode/Makefile mris_label2annot/Makefile mris_make_average_surface/Makefile mris_make_surfaces/Makefile mris_make_template/Makefile mris_morph_stats/Makefile mris_deform/Makefile mris_ms_refine/Makefile mris_ms_surface_CNR/Makefile mris_multiscale_stats/Makefile mris_niters2fwhm/Makefile mris_pmake/Makefile mris_register/Makefile mris_left_right_register/Makefile mris_register_to_volume/Makefile mris_interpolate_warp/Makefile mris_remove_variance/Makefile mris_resample/Makefile mris_rescale/Makefile mris_reverse/Makefile mris_rotate/Makefile mris_sample_label/Makefile mris_sample_parc/Makefile mris_segment_vals/Makefile mris_segment/Makefile mris_seg2annot/Makefile mris_shrinkwrap/Makefile mris_show/Makefile mris_smooth/Makefile mris_parcellate_connectivity/Makefile mris_make_face_parcellation/Makefile mris_sphere/Makefile mris_spherical_average/Makefile mris_average_parcellation/Makefile mris_surface_stats/Makefile mris_surface_to_vol_distances/Makefile mris_talairach/Makefile mris_thickness/Makefile mris_surface_change/Makefile mris_BA_segment/Makefile mris_compute_optimal_kernel/Makefile mris_thickness_comparison/Makefile mris_thickness_diff/Makefile mris_transform/Makefile mris_translate_annotation/Makefile mris_twoclass/Makefile mris_volume/Makefile mris_volmask/Makefile mris_w_to_curv/Makefile mrisp_paint/Makefile mris_longitudinal_surfaces/Makefile nmovie/Makefile optseq2/Makefile orient_mri/Makefile qdec/Makefile rbftest/Makefile regdat2xfm/Makefile repair_siemens_file/Makefile rgb/Makefile scripts/Makefile scuba/Makefile scuba2/Makefile freeview/Makefile connectgraph/Makefile spherical_stats/Makefile stat_normalize/Makefile stim_polar/Makefile svm-lib/Makefile talairach_afd/Makefile talairach_avi/Makefile test_makevol/Makefile test_window_env/Makefile tetgen/Makefile tiff/Makefile tkmedit/Makefile tkregister2/Makefile tkregister2/cmdl/Makefile tksurfer/Makefile trc/Makefile tridec/Makefile unix/Makefile utils/Makefile utils/cephes/Makefile utils/NrrdIO/Makefile utils/test/Makefile utils/test/mrishash/Makefile utilscpp/Makefile utilscpp/test/Makefile qdec_glmfit/Makefile qdecproject/Makefile vtkfsio/Makefile vtkutils/Makefile xml2/Makefile]) # mri_edit_seg_with_ribbons/Makefile ######################################################################## builddir=`pwd` AC_MSG_RESULT( [ FreeSurfer is now configured for ${host} Source directory: ${srcdir} Build directory: ${builddir} Install directory: ${prefix} C compiler: ${CC} ${CPPFLAGS} ${CFLAGS} C++ compiler: ${CXX} ${CPPFLAGS} ${CXXFLAGS} Fortran: ${F77} ${FFLAGS} Linker: ${LD} ${LDFLAGS} Libs: ${LIBS} ])