X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=configure.ac;h=31367951c808e72ae939e2207a2785dcd5e28aa6;hp=a048b4709f4ccc8a008145af8e3c22aea90e1d18;hb=9ac3b88884957e2c07bf365c2503c6c1fbeaa60e;hpb=d84febd85035c7985334618cdda43df21824efbe diff --git a/configure.ac b/configure.ac index a048b47..3136795 100644 --- a/configure.ac +++ b/configure.ac @@ -27,10 +27,15 @@ dnl Process this file with autoconf to produce a configure script. dnl Must reset CDPATH so that bash's cd does not print to stdout dnl CDPATH= -AC_INIT +AC_INIT([CTSim], [6.0.0], [ctsim-users@kpe.io], [ctsim], [http://www.ctsim.org/]) AC_CONFIG_SRCDIR([src/ctsim.cpp]) +AC_CONFIG_MACRO_DIR([scripts]) +dnl permit auxiliary scripts directory (e.g. config.sub, config.guess, install-sh) +AC_CONFIG_AUX_DIR(scripts/) + +AC_CANONICAL_TARGET AM_MAINTAINER_MODE -AM_INIT_AUTOMAKE(ctsim,5.1.1) +AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) dnl Checks for programs. @@ -41,6 +46,9 @@ AC_PROG_RANLIB AC_PROG_CC AC_PROG_CXX +CFLAGS="" +CXXFLAGS="" + AC_C_BIGENDIAN AC_PATH_PROG(wxconfig,wx-config) @@ -54,7 +62,6 @@ AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(float, 4) AC_CHECK_SIZEOF(double, 8) -dnl Add define templates dnl Checks for libraries. AC_CHECK_LIB(z, deflate, [ zlib="true" ], [ zlib="false" ; AC_MSG_WARN([zlib missing. Will need zlib for PNG support])]) @@ -77,8 +84,8 @@ if test "$hasx11gtk2" = "true" ; then CFLAGS="${CFLAGS} ${g76GTK_CFLAGS} ${GLIB_CFLAGS}" fi -AC_CHECK_LIB(wx_gtk2u_core-2.8, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])], [], [-L/usr/lib64 -L/usr/lib ${GTK_LIBS} ${GLIB_LIBS} ]) -AC_CHECK_LIB(wx_mac_core-2.8, main, [wxwin=true; wx_mac=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])]) +AC_CHECK_LIB(wx_gtk2u_core-3.0, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])], [], [-L/usr/lib64 -L/usr/lib ${GTK_LIBS} ${GLIB_LIBS} ]) +AC_CHECK_LIB(wx_mac_core-3.0, main, [wxwin=true; wx_mac=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])]) AC_CHECK_LIB(fftw3, fftw_malloc, [fftw=true; AC_DEFINE(HAVE_FFTW,1,[FFTW library])], [fftw=false], [-L/usr/lib64 -L/usr/lib]) AC_CHECK_LIB(GL, main, [libgl=true], [libgl=false], [-L/usr/X11R6/lib -L/usr/X11R6/lib64]) AC_CHECK_LIB(pthread, main, [pthread=true], [pthread=false]) @@ -122,6 +129,26 @@ if test "${getopt_long}" = "false" ; then fi AM_CONDITIONAL(INCLUDED_GETOPT_LONG, test "$GETOPTLONG"="1") +ARCH_OPTION="" +case $target_cpu in + i386|i486|i586|i686|x86|x86_64) + AX_EXT + CFLAGS="$CFLAGS $CPUEXT_FLAGS $SIMD_FLAGS" + CXXFLAGS="$CXXFLAGS $CPUEXT_FLAGS $SIMD_FLAGS" + ;; + powerpc*) + ARCH_OPTION="-fno-common -faltivec";; + armv1*|armv2*|armv3*|armv4*|armv5*|armv6*) + ARCH_OPTION="-ffast-math";; + armv7*|armv8*) + ARCH_OPTION="-ffast-math -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4";; + *) + # unknown architecture : use portable C version + ARCH_OPTION="";; +esac +CPPFLAGS="$CPPFLAGS $ARCH_OPTION" +CXXFLAGS="$CPPFLAGS $ARCH_OPTION" + if test "${readline}" = "true" ; then ctlibs_base="$ctlibs_base -lreadline" if test "${ncurses}" = "true"; then @@ -158,7 +185,7 @@ if test "$debug" = "true" ; then CFLAGS="$CFLAGS -g -O0 -DDEBUG" AC_DEFINE(DEBUG,1,[turn on debugging]) else - CFLAGS="$CFLAGS -O2 -DNDEBUG -fomit-frame-pointer" + CFLAGS="$CFLAGS -g -O4 -DNDEBUG -fomit-frame-pointer" AC_DEFINE(NDEBUG,1,[no debugging]) fi @@ -209,6 +236,24 @@ AC_ARG_ENABLE(static, esac ], AC_MSG_RESULT(no) ) +dnl Checking if use OpenMP +AC_MSG_CHECKING(OpenMP) +AC_ARG_ENABLE(openmp, +[ --enable-openmp + Enable use of OpenMP.], +[ case "$enableval" in + yes) + AC_MSG_RESULT(yes) + AX_OPENMP + CFLAGS="$CFLAGS $OPENMP_CFLAGS" + CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], AC_MSG_RESULT(no) +) + dnl Set LAM path AC_ARG_WITH(lam, [ --with-lam[=PATH] Set path of LAM MPI ], @@ -251,7 +296,7 @@ AC_ARG_WITH(ctn, fi ] ) -if test "$withval" == "no" -o "$withval" == "NONE" ; then +if test "$withval" = "no" -o "$withval" = "NONE" ; then AC_MSG_CHECKING([for CTN DICOM installation]) AC_MSG_RESULT([disabled]) else @@ -270,7 +315,7 @@ else break fi done - if test "$ctnlib" == "true" -a "$ctninclude" == "true" ; then + if test "$ctnlib" = "true" -a "$ctninclude" = "true" ; then ctn="true" AC_DEFINE(HAVE_CTN_DICOM,1,[ctn dicom library]) AC_MSG_RESULT([yes]) @@ -284,7 +329,7 @@ AC_MSG_CHECKING([for CPU specification]) AC_ARG_WITH(mcpu, [ --with-mcpu[=CPU] Set name of CPU for gcc -mcpu]) -if test "$withval" == "no" -o "$withval" == "yes" -o "$withval" == ""; then +if test "$withval" = "no" -o "$withval" = "yes" -o "$withval" = ""; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([$withval]) @@ -354,7 +399,6 @@ dnl whether X should be supported. AM_CONDITIONAL(NO_X, test "x$with_x" = "xno") my_includes="$my_includes -I../include -I.. -I/usr/local/include" -AC_SUBST(my_includes) LDFLAGS="$LDFLAGS -L/usr/local/lib" @@ -362,12 +406,13 @@ AC_MSG_CHECKING([for X]) if test "$with_x" != "no" && test "$wxwin" = "true"; then AC_DEFINE(HAVE_X11,1,[X11 system]) LDFLAGS="$LDFLAGS -L../libctgraphics -L/usr/X11R6/lib -L/usr/X11R6/lib64" - my_includes="$my_includes -I/usr/X11R6/include" + my_includes="$my_includes -I/usr/X11R6/include -I/usr/include/X11" ctlib_graphics="$ctlibs_base -lctgraphics" AC_MSG_RESULT(yes) ctlib_graphics="$ctlib_graphics $X_BASIC_LIBS $X_TOOLKIT_LIBS" + wx_cppflags="`$wxconfig --cppflags`" if test "$libgl" = "true" ; then - # Removed "-lglut" for Mac OS X compilation + dnl Removed "-lglut" for Mac OS X compilation ctlib_graphics="$ctlib_graphics -lGL -lGLU" if test "$wxwin" = "true" ; then wxdebug="" @@ -375,9 +420,10 @@ if test "$with_x" != "no" && test "$wxwin" = "true"; then wxdebug="--debug" fi if test "x$wx_gtk" != "x" ; then - ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl` ${GTK_LIBS} ${GLIB_LIBS}" + ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=3.0 --libs std,gl` ${GTK_LIBS} ${GLIB_LIBS}" + elif test "x$wx_mac" != "x" ; then - ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl`" + ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=3.0 --libs std,gl`" fi fi fi @@ -451,7 +497,7 @@ fi if test "$wxwin" = "true" ; then if test "$wx_gtk" = "true" -o "$wx_mac" = "true" ; then - wxcflags=`$wxconfig $wxdebug --cxxflags --version=2.8` + wxcflags=`$wxconfig $wxdebug --cxxflags --version=3.0` #wxlibs=`$wxconfig --libs` else wxcflags="-D__WXMSW__ -D__WIN32__ -D__GNUWIN32__" @@ -478,6 +524,9 @@ fi CXXFLAGS="$CFLAGS" +AC_SUBST(my_includes) +AC_SUBST(wx_cppflags) + AC_CONFIG_FILES([Makefile libctgraphics/Makefile libctsupport/Makefile libctsim/Makefile man/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/simulate.html html/Makefile include/Makefile getopt/Makefile tools/sample-ctsim.sh cgi-bin/ctsim.conf tools/Makefile src/Makefile helical/Makefile helical/sample-helical.sh]) AC_OUTPUT