Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /benchmarks/configure.ac
ViewVC logotype

View of /benchmarks/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3057 - (download) (annotate)
Fri Mar 13 02:15:46 2015 UTC (4 years ago) by jhr
File size: 5394 byte(s)
  report is now a JSON formatted file
dnl Process this file with autoconf to produce a configure script.
dnl
dnl COPYRIGHT (c) 2011 The Diderot Project
dnl All rights reserved.
dnl

AC_INIT(diderot-benchmarks,0.1,)

AC_PREREQ(2.60)
AC_COPYRIGHT([[COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])
AC_CONFIG_SRCDIR(programs/vr-lite-cam/bmark-teem.c)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)

dnl
dnl get host information
dnl
AC_CANONICAL_HOST

dnl check for standard programs
dnl
AC_PROG_CC([clang gcc cc])
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET

dnl check for c99 support
dnl
AC_PROG_CC_C99
if test x"$ac_cv_prog_cc_c99" = xno ; then
  AC_MSG_ERROR([Diderot requires c99 support])
fi

dnl extra C compiler options
dnl
CFLAGS=""
CFLAG_M64="-m64"
CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
AC_SUBST(CFLAG_M64)
AC_SUBST(CFLAGS_BASE)

dnl
dnl OS-specific linking issues
dnl
LD_NEEDS_RPATH=false;
LIBM=""
case "$host_os" in
  darwin*) # On Mac OS X we check for the presence of macports and/or fink
    if test -x /opt/local/bin/port ; then
      HAS_MACPORTS=yes
    else
      HAS_MACPORTS=no
    fi
    if test -x /sw/bin/fink ; then
      HAS_FINK=yes
    else
      HAS_FINK=no
    fi
  ;;
  linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
    LD_NEEDS_RPATH=true
    LIBM="-lm"
  ;;
esac

if test x"$HAS_MACPORTS" = xyes ; then
  LDPATHS="-L/opt/local/lib"
elif test x"$HAS_FINK" = xyes ; then
  LDPATHS="-L/sw/lib"
else
  LDPATHS=""
fi
AC_SUBST(LDPATHS)
AC_SUBST(LD_NEEDS_RPATH)
AC_SUBST(LIBM)

dnl
dnl get the path to the TEEM installation
dnl
AC_ARG_WITH(teem,
  AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
  [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
if test x"$ac_cv_use_teem" = xno ; then
  TEEM_DIR=none
else
  AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
  case $ac_cv_use_teem in
    /*) ;;
    *) AC_MSG_ERROR([path to teem must be absolute]) ;;
  esac
  if test -x $ac_cv_use_teem ; then
    TEEM_DIR=$ac_cv_use_teem
    # check that TEEM_DIR actually points to something that looks like teem
    if test -f $TEEM_DIR/include/teem/nrrd.h ; then
      AC_MSG_RESULT([ okay])
    else
      TEEM_DIR=none
      AC_MSG_RESULT([ invalid])
    fi
  else
    TEEM_DIR=none
    AC_MSG_RESULT([ invalid])
  fi
fi
if test x"$TEEM_DIR" = xnone ; then
  AC_MSG_ERROR([unable to find teem])
fi
AC_SUBST(TEEM_DIR)

dnl ******************** Diderot configuration ********************
dnl

dnl
dnl get the path to the diderot executable
dnl
AC_ARG_WITH(diderotc,
  AC_HELP_STRING([--with-diderotc=<path>], [specify path to Diderot compiler]),
  [ac_cv_use_diderotc=$withval], [ac_cv_use_diderotc=no])
if test x"$ac_cv_use_diderotc" = xno ; then
  DIDEROTC=none
else
  AC_MSG_CHECKING([path to diderotc ($ac_cv_use_diderotc)])
  case $ac_cv_use_diderotc in
    /*) DIDEROTC=$ac_cv_use_diderotc ;;
    *) DIDEROTC=$BMARKS_ROOT$ac_cv_use_diderotc ;;
  esac
  # check that diderotc exists and is executable
  if test -x $DIDEROTC ; then
    AC_MSG_RESULT([ okay])
  else
    DIDEROTC=none
    AC_MSG_RESULT([ invalid])
  fi
fi
if test x"$DIDEROTC" = xnone ; then
  AC_MSG_ERROR([unable to find diderotc])
fi
AC_SUBST(DIDEROTC)

dnl ******************** Paths ********************

BMARKS_ROOT=`pwd`
BMARKS_BINDIR=$BMARKS_ROOT/scripts
BMARKS_DATADIR=$BMARKS_ROOT/data
BMARKS_INCDIR=$BMARKS_ROOT/include
BMARKS_MKDIR=$BMARKS_ROOT/mk
BMARKS_SRCDIR=$BMARKS_ROOT/programs

AC_SUBST(BMARKS_ROOT)
AC_SUBST(BMARKS_BINDIR)
AC_SUBST(BMARKS_DATADIR)
AC_SUBST(BMARKS_INCDIR)
AC_SUBST(BMARKS_MKDIR)
AC_SUBST(BMARKS_SRCDIR)

dnl
dnl ******************** C compiler properties ********************
dnl

dnl
dnl run the compiler tests in 64-bit mode
dnl
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $CFLAG_M64"

AC_C_BIGENDIAN

dnl
dnl restore CFLAGS
dnl
CFLAGS=$save_CFLAGS

dnl
dnl ******************** disable targets ********************
dnl

AC_ARG_ENABLE([teem],
  [AS_HELP_STRING([--disable-teem], [disable running teem version of benchmarks])],
  [TARGET_TEEM=""],
  [TARGET_TEEM=bmark-teem])

AC_ARG_ENABLE([seq],
  [AS_HELP_STRING([--disable-seq], [disable running sequential version of benchmarks])],
  [TARGET_SEQ=""],
  [TARGET_SEQ=bmark-seq])

AC_ARG_ENABLE([par],
  [AS_HELP_STRING([--disable-par], [disable running parallel version of benchmarks])],
  [TARGET_PAR=""],
  [TARGET_PAR=bmark-par])

AC_ARG_ENABLE([cl],
  [AS_HELP_STRING([--disable-cl], [disable running OpenCL version of benchmarks])],
  [TARGET_CL=""],
  [TARGET_CL=bmark-cl])

# CUDA is not yet supported
#
#AC_ARG_ENABLE([cuda],
#  [AS_HELP_STRING([--disable-cuda], [disable running CUDA version of benchmarks])],
#  [TARGET_CUDA=""],
#  [TARGET_CUDA=bmark-cuda])
TARGET_CUDA=""

AC_SUBST(TARGET_TEEM)
AC_SUBST(TARGET_SEQ)
AC_SUBST(TARGET_PAR)
AC_SUBST(TARGET_CL)
AC_SUBST(TARGET_CUDA)

dnl
dnl ******************** write output ********************
dnl

AC_CONFIG_FILES(
dnl
dnl ***** Makefiles *****
  mk/build-rules.gmk:mk/build-rules_gmk.in
  mk/Makefile
)

dnl
dnl shell scripts
dnl
AC_CONFIG_FILES([
  scripts/run-one.sh:scripts/run-one_sh.in
], [chmod +x scripts/run-one.sh])
AC_CONFIG_FILES([
  scripts/run.sh:scripts/run_sh.in
], [chmod +x scripts/run.sh])

AC_CONFIG_COMMANDS([makefiles],
  [for d in programs/* ; do
     echo "               create $d/Makefile"
     cp -p ./mk/Makefile $d/Makefile
   done],
  [])

AC_OUTPUT

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0