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

SCM Repository

[diderot] Diff of /branches/vis15/configure.ac
ViewVC logotype

Diff of /branches/vis15/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3914, Wed May 25 15:47:42 2016 UTC revision 4842, Tue Dec 20 17:46:11 2016 UTC
# Line 6  Line 6 
6  dnl All rights reserved.  dnl All rights reserved.
7  dnl  dnl
8    
9  AC_INIT(diderot,1.0,)  AC_INIT(diderot,2.0,)
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])
# Line 17  Line 17 
17  dnl  dnl
18  dnl set the following to the name of the branch  dnl set the following to the name of the branch
19  dnl  dnl
20  BRANCH="master"  BRANCH="vis15"
21  AC_SUBST(BRANCH)  AC_SUBST(BRANCH)
22    
23  dnl  dnl
24  dnl include additional macros  dnl include additional macros
25  dnl  dnl
26    sinclude(config/ax_check_compile_flag.m4)
27    sinclude(config/ax_gcc_x86_cpuid.m4)
28    sinclude(config/ax_gcc_x86_avx_xgetbv.m4)
29    sinclude(config/ax_ext.m4)
30  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
31  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
32  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
# Line 34  Line 38 
38  dnl  dnl
39  AC_CANONICAL_HOST  AC_CANONICAL_HOST
40    
41    #################### Paths configuration ####################
42    
43    DIDEROT_ROOT=`pwd`
44    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
45    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
46    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
47    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
48    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
49    
50    AC_SUBST(DIDEROT_ROOT)
51    AC_SUBST(DIDEROT_DOCDIR)
52    AC_SUBST(DIDEROT_SRCDIR)
53    AC_SUBST(DIDEROT_LIBDIR)
54    AC_SUBST(DIDEROT_BINDIR)
55    AC_SUBST(DIDEROT_MKDIR)
56    
57    dnl
58    dnl the log-file description
59    dnl
60    DEFAULT_LOG_EVENTS_PATH=$DIDEROT_SRCDIR/logging/log-events.json
61    AC_SUBST(DEFAULT_LOG_EVENTS_PATH)
62    
63    #################### end Paths configuration ####################
64    
65  dnl check for standard programs  dnl check for standard programs
66  dnl  dnl
67  AC_PROG_CPP  AC_PROG_CPP
68    AC_PROG_CC([clang gcc cc])
69  AC_PROG_CXX([clang++ g++ c++])  AC_PROG_CXX([clang++ g++ c++])
70  AX_CXX_COMPILE_STDCXX(11,[],[mandatory])  AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
71  AC_PROG_INSTALL  AC_PROG_INSTALL
# Line 52  Line 81 
81    
82  dnl extra compiler options  dnl extra compiler options
83  dnl  dnl
84  CXXFLAGS_BASE="$CXXFLAGS -Wformat -Wreturn-type -Wuninitialized"  CXXFLAGS_BASE="-Wreturn-type -Wuninitialized"
85    
86    dnl check for SIMD support
87    dnl
88    AX_EXT
89    
90  AC_ARG_ENABLE([32-bit],  AC_ARG_ENABLE([32-bit],
91    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
92    [CXXFLAG_Mxx="-m32"],    [CXXFLAG_Mxx="-m32"],
93    [CXXFLAG_Mxx="-m64"])    [CXXFLAG_Mxx="-m64"])
 if test x"$CXX" != "xclang++" ; then  
   CXXFLAGS_BASE="$CXXFLAGS_BASE -fno-implicit-templates"  
 fi  
94    
95  CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"  CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
96  AC_SUBST(CXXFLAG_Mxx)  AC_SUBST(CXXFLAG_Mxx)
97  AC_SUBST(CXXFLAGS_BASE)  AC_SUBST(CXXFLAGS_BASE)
98    
99  dnl  dnl
100    dnl run the compiler tests in 64-bit mode
101    dnl
102    save_CFLAGS=$CFLAGS
103    CFLAGS="$CFLAGS $CFLAG_MXX"
104    
105    dnl
106    dnl check for gcc builtin atomic operations
107    dnl
108    AC_MSG_CHECKING([for builtin atomic operations])
109    AC_LINK_IFELSE(
110       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
111       AC_MSG_RESULT(yes)
112       AC_DEFINE(
113        [HAVE_BUILTIN_ATOMIC_OPS], 1,
114        [Define to 1 if gcc compiler provides atomic operations.]),
115       AC_MSG_RESULT(no))
116    
117    AC_C_BIGENDIAN
118    
119    #
120    # determine the sizes of the standard C types
121    AC_CHECK_SIZEOF([int])
122    SIZEOF_C_INT=$ac_cv_sizeof_int
123    AC_CHECK_SIZEOF([long])
124    SIZEOF_C_LONG=$ac_cv_sizeof_long
125    AC_CHECK_SIZEOF([float])
126    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
127    AC_CHECK_SIZEOF([double])
128    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
129    
130    AC_SUBST(SIZEOF_C_INT)
131    AC_SUBST(SIZEOF_C_LONG)
132    AC_SUBST(SIZEOF_C_FLOAT)
133    AC_SUBST(SIZEOF_C_DOUBLE)
134    
135    dnl
136    dnl restore CFLAGS
137    dnl
138    CFLAGS=$save_CFLAGS
139    
140    dnl
141  dnl check for <stdbool.h>, which we use in the C API  dnl check for <stdbool.h>, which we use in the C API
142  dnl  dnl
143  AC_HEADER_STDBOOL  AC_HEADER_STDBOOL
144    
145  dnl  dnl
146    dnl the C boolean type to use in generated library headers
147    dnl
148    if test x"$ac_cv_header_stdbool_h" = xyes ; then
149      BOOLTY="bool"
150    elif test "x$ac_cv_type__Bool" = xyes; then
151      BOOLTY="_Bool"
152    else
153      BOOLTY="int"
154    fi
155    AC_SUBST(BOOLTY)
156    
157    dnl
158  dnl check for pthreads support  dnl check for pthreads support
159  dnl  dnl
160  ACX_PTHREAD  ACX_PTHREAD
161    
162  dnl  dnl
163    dnl check for various library routines etc.
164    dnl
165    AC_CHECK_FUNCS(posix_memalign)
166    if test x"$ac_cv_func_posix_memalign" != xyes ; then
167      AC_CHECK_FUNCS(memalign)
168      if test x"$ac_cv_func_posix_memalign" != xyes ; then
169        AC_CHECK_FUNCS(valloc)
170      fi
171    fi
172    
173    AC_CHECK_FUNCS(mach_absolute_time)
174    AC_CHECK_TYPES([struct timespec])
175    AC_CHECK_FUNCS(pthread_barrier_init)
176    
177    dnl
178    dnl check for clock_gettime.  On Linux, this requires librt.
179    dnl
180    save_LIBS=$LIBS
181    LIBS="-lrt $LIBS"
182    AC_MSG_CHECKING([for clock_gettime])
183    AC_LINK_IFELSE(
184      [AC_LANG_PROGRAM(
185        [[#include <time.h>]],
186        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
187      [ ac_cv_func_clock_gettime=yes;
188        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
189      [ac_cv_func_clock_gettime=no])
190    AC_MSG_RESULT($ac_cv_func_clock_gettime)
191    if test "$ac_cv_func_clock_gettime" = "no" ; then
192      LIBS=$save_LIBS
193    fi
194    
195    AC_CHECK_FUNCS(pthread_getcpuclockid)
196    AC_CHECK_FUNCS(sigtimedwait nanosleep)
197    
198    dnl
199    dnl check for sched_setaffinity
200    dnl
201    AC_CHECK_FUNCS(sched_setaffinity)
202    
203    dnl
204    dnl check for pthread_setaffinity_np
205    dnl
206    save_LIBS=$LIBS
207    save_CFLAGS=$CFLAGS
208    LIBS="$PTHREAD_LIBS $LIBS"
209    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
210    AC_MSG_CHECKING([for pthread_setaffinity_np])
211    AC_LINK_IFELSE(
212      [AC_LANG_PROGRAM(
213        [[#include <pthread.h>]],
214        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
215      [ ac_cv_func_pthread_setaffinity_np=yes;
216        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
217      [ac_cv_func_pthread_setaffinity_np=no])
218    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
219    LIBS=$save_LIBS
220    CFLAGS=$save_CFLAGS
221    
222    dnl
223    dnl check for Linux NUMA support (libnuma)
224    dnl
225    AC_CHECK_LIB(numa,numa_available)
226    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
227      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
228    fi
229    
230    dnl check for /proc/cpuinfo
231    dnl
232    AC_CHECK_FILES(/proc/cpuinfo)
233    
234    dnl
235    dnl OS-specific linking issues
236    dnl
237    LD_NEEDS_RPATH=false;
238    LIBM=""
239    case "$host_os" in
240      darwin*) # On Mac OS X we check for the presence of macports and/or fink
241        if test -x /opt/local/bin/port ; then
242          HAS_MACPORTS=yes
243        else
244          HAS_MACPORTS=no
245        fi
246        if test -x /sw/bin/fink ; then
247          HAS_FINK=yes
248        else
249          HAS_FINK=no
250        fi
251      ;;
252      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
253        LD_NEEDS_RPATH=true
254        LIBM="-lm"
255      ;;
256    esac
257    
258    if test x"$HAS_MACPORTS" = xyes ; then
259      LDPATHS="-L/opt/local/lib"
260    elif test x"$HAS_FINK" = xyes ; then
261      LDPATHS="-L/sw/lib"
262    else
263      LDPATHS=""
264    fi
265    AC_SUBST(LDPATHS)
266    AC_SUBST(LD_NEEDS_RPATH)
267    AC_SUBST(LIBM)
268    
269    #################### Logging configuration ####################
270    
271    LOGGING_ENABLED=false
272    AC_ARG_ENABLE([event-logging],
273      AC_HELP_STRING([--enable-event-logging], [include event-logging support for parallel target]),
274      [LOGGING_ENABLED=true],
275      [LOGGING_ENABLED=false])
276    
277    AC_SUBST(LOGGING_ENABLED)
278    
279    #################### end Logging configuration ####################
280    
281    #################### CUDA configuration ####################
282    
283    AC_ARG_ENABLE([cuda],
284      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
285    
286    if test "${enable_cuda+set}" = set ; then
287    dnl
288  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
289  dnl  dnl
290  AC_MSG_NOTICE([checking for CUDA and nvcc])  AC_MSG_NOTICE([checking for CUDA and nvcc])
# Line 89  Line 297 
297    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
298    CUDA_ENABLED=true    CUDA_ENABLED=true
299  fi  fi
300    else
301      NVCC=":"
302      CUDA_ENABLED=false
303    fi
304  AC_SUBST(NVCC)  AC_SUBST(NVCC)
305  AC_SUBST(CUDA_ENABLED)  AC_SUBST(CUDA_ENABLED)
306    
307    #################### end CUDA configuration ####################
308    
309    #################### OpenCL configuration ####################
310    
311    AC_ARG_ENABLE([opencl],
312      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
313    
314    if test "${enable_opencl+set}" = set ; then
315    
316  dnl  dnl
317  dnl check for OpenCL support  dnl check for OpenCL support
318  dnl  dnl
# Line 210  Line 431 
431    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
432    fi    fi
433  fi  fi
434    else
435      CL_ENABLED=false
436      CL_VERSION="0"
437      SIZEOF_CL_INT="0"
438      SIZEOF_CL_LONG="0"
439      SIZEOF_CL_FLOAT="0"
440      SIZEOF_CL_DOUBLE="0"
441    fi
442    
443  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
444  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
445  AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])  AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
# Line 219  Line 449 
449  AC_SUBST(SIZEOF_CL_FLOAT)  AC_SUBST(SIZEOF_CL_FLOAT)
450  AC_SUBST(SIZEOF_CL_DOUBLE)  AC_SUBST(SIZEOF_CL_DOUBLE)
451    
452  dnl  #################### end OpenCL configuration ####################
 dnl check for various library routines etc.  
 dnl  
 AC_CHECK_FUNCS(posix_memalign)  
 if test x"$ac_cv_func_posix_memalign" != xyes ; then  
   AC_CHECK_FUNCS(memalign)  
   if test x"$ac_cv_func_posix_memalign" != xyes ; then  
     AC_CHECK_FUNCS(valloc)  
   fi  
 fi  
453    
454  AC_CHECK_FUNCS(mach_absolute_time)  #################### Teem configuration ####################
 AC_CHECK_TYPES([struct timespec])  
 AC_CHECK_FUNCS(pthread_barrier_init)  
   
 dnl  
 dnl check for clock_gettime.  On Linux, this requires librt.  
 dnl  
 save_LIBS=$LIBS  
 LIBS="-lrt $LIBS"  
 AC_MSG_CHECKING([for clock_gettime])  
 AC_LINK_IFELSE(  
   [AC_LANG_PROGRAM(  
     [[#include <time.h>]],  
     [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],  
   [ ac_cv_func_clock_gettime=yes;  
     AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],  
   [ac_cv_func_clock_gettime=no])  
 AC_MSG_RESULT($ac_cv_func_clock_gettime)  
 if test "$ac_cv_func_clock_gettime" = "no" ; then  
   LIBS=$save_LIBS  
 fi  
   
 AC_CHECK_FUNCS(pthread_getcpuclockid)  
 AC_CHECK_FUNCS(sigtimedwait nanosleep)  
455    
 dnl  
 dnl check for sched_setaffinity  
 dnl  
 AC_CHECK_FUNCS(sched_setaffinity)  
   
 dnl  
 dnl check for pthread_setaffinity_np  
 dnl  
 save_LIBS=$LIBS  
 save_CFLAGS=$CFLAGS  
 LIBS="$PTHREAD_LIBS $LIBS"  
 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"  
 AC_MSG_CHECKING([for pthread_setaffinity_np])  
 AC_LINK_IFELSE(  
   [AC_LANG_PROGRAM(  
     [[#include <pthread.h>]],  
     [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],  
   [ ac_cv_func_pthread_setaffinity_np=yes;  
     AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],  
   [ac_cv_func_pthread_setaffinity_np=no])  
 AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)  
 LIBS=$save_LIBS  
 CFLAGS=$save_CFLAGS  
   
 dnl  
 dnl check for Linux NUMA support (libnuma)  
 dnl  
 AC_CHECK_LIB(numa,numa_available)  
 if test "$ac_cv_lib_numa_numa_available" = "yes" ; then  
   PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"  
 fi  
   
 dnl check for /proc/cpuinfo  
 dnl  
 AC_CHECK_FILES(/proc/cpuinfo)  
   
 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  
456  dnl get the path to the TEEM installation.  We need this to build the Diderot  dnl get the path to the TEEM installation.  We need this to build the Diderot
457  dnl runtime code and we use the path when searching for teem in the Diderot  dnl runtime code and we use the path when searching for teem in the Diderot
458  dnl compiler.  dnl compiler.
459  dnl  dnl
460    
461    dnl the path can be specified using "--with-teem=..." too
462    dnl
463  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
464    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
465    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
466    
467  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
468    dnl search for Teem in some standard places
469    dnl
470      AC_MSG_CHECKING([for teem])
471    TEEM_DIR=none    TEEM_DIR=none
472      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
473      for dir in $POSSIBLE_TEEM_DIRS ; do
474        if test -f $dir/include/teem/nrrd.h ; then
475          TEEM_DIR=$dir
476          AC_MSG_RESULT([$TEEM_DIR])
477          break
478        fi
479      done
480      if test $TEEM_DIR = none ; then
481        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
482      fi
483  else  else
484    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
485    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 349  Line 493 
493        AC_MSG_RESULT([yes])        AC_MSG_RESULT([yes])
494      else      else
495        TEEM_DIR=none        TEEM_DIR=none
496        AC_MSG_RESULT([no])        AC_MSG_RESULT([invalid path to teem])
497      fi      fi
498    else    else
499      TEEM_DIR=none      TEEM_DIR=none
500      AC_MSG_RESULT([no])      AC_MSG_RESULT([invalid path to teem])
501    fi    fi
502  fi  fi
503  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
504    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])    AC_MSG_ERROR([unable to find teem])
505  fi  fi
506  dnl  dnl
507  dnl check that unu supports the dnorm command  dnl check that teem supports the nrrdMetaDataNormalize function
508  dnl  dnl
509  if test x"$TEEM_DIR" != xnone ; then  save_LDFLAGS=$LDFLAGS
510    AC_MSG_CHECKING([that \"unu dnorm\" works])  save_LIBS=$LIBS
511    if test -x $TEEM_DIR/bin/unu ; then  LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
512      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null  LIBS="$LIBS -lteem -lm"
513      if test $? -eq 0 ; then  AC_CHECK_FUNCS([nrrdMetaDataNormalize])
514        AC_MSG_RESULT([yes])  LDFLAGS=$save_LDFLAGS
515      else  LIBS=$save_LIBS
516        AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])  
517      fi  if test "x$ac_cv_func_nrrdMetaDataNormalize" != xyes; then
518    else    AC_MSG_ERROR(["please update your teem installation"])
     AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])  
   fi  
519  fi  fi
520    
521  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
522    
523  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
524    
525    #################### SML configuration ####################
526    
527  dnl  dnl
528  dnl We support building with both SML/NJ (the default) or MLton.  dnl We support building with both SML/NJ (the default) or MLton.
529  dnl  dnl
# Line 413  Line 559 
559    
560    dnl check that we have a compatible version of SML/NJ    dnl check that we have a compatible version of SML/NJ
561    dnl    dnl
562    CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])])    CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; please add it to your PATH or set SML_CMD])])
563    if test $SMLNJ_MAJOR_VERSION -lt 110 \    if test $SMLNJ_MAJOR_VERSION -lt 110 \
564      -o $SMLNJ_MINOR_VERSION -lt 79      -o $SMLNJ_MINOR_VERSION -lt 80
565    then    then
566      AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])      AC_MSG_ERROR([installation requires SML/NJ version 110.80+ (available from smlnj.org)])
567    fi    fi
568    
569    dnl determine the heap-image suffix    dnl determine the heap-image suffix
# Line 427  Line 573 
573    
574    dnl look for ml-makedepend    dnl look for ml-makedepend
575    dnl    dnl
   AC_MSG_CHECKING([for ml-makedepend])  
576    tmpPATH="$SMLNJ_PATH:$PATH"    tmpPATH="$SMLNJ_PATH:$PATH"
577    AC_PATH_PROG(ML_MAKEDEPEND, ml-makedepend, ":", $tmpPATH)    AC_PATH_PROG(ML_MAKEDEPEND, ml-makedepend, ":", $tmpPATH)
   if test $ML_MAKEDEPEND = none ; then  
     AC_MSG_ERROR([ml-makedepend not found])  
   else  
     AC_MSG_RESULT([$ML_MAKEDEPEND])  
   fi  
578    AC_SUBST(ML_MAKEDEPEND)    AC_SUBST(ML_MAKEDEPEND)
579    
580    dnl    dnl
# Line 448  Line 588 
588    AC_SUBST(ML_BUILD)    AC_SUBST(ML_BUILD)
589    SML=smlnj    SML=smlnj
590    
591      HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
592      INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh
593      AC_SUBST(HEAP_IMAGE_DIR)
594      AC_SUBST(INSTALL_SMLNJ_WRAPPER)
595    
596  else  else
597    
598    # we are using MLton    # we are using MLton
599    MLTON=$with_mlton    MLTON=$with_mlton
600    AC_SUBST(MLTON)    AC_SUBST(MLTON)
601    SML=mlton    SML=mlton
602    
603  fi  fi
604  AC_SUBST(SML)  AC_SUBST(SML)
605    
606  dnl ******************** Documentation tools ********************  #################### end SML configuration ####################
607    
608    #################### Documentation tools configuration ####################
609    
610  dnl check for doxygen  dnl check for doxygen
611  dnl  dnl
# Line 507  Line 656 
656  AC_SUBST(HIGHLIGHTER)  AC_SUBST(HIGHLIGHTER)
657  AC_SUBST(DBLATEX)  AC_SUBST(DBLATEX)
658    
659    #################### end Documentation tools configuration ####################
660    
661  dnl ******************** Paths ********************  #################### config.h ####################
   
 DIDEROT_ROOT=`pwd`  
 DIDEROT_DOCDIR=$DIDEROT_ROOT/doc  
 DIDEROT_SRCDIR=$DIDEROT_ROOT/src  
 DIDEROT_LIBDIR=$DIDEROT_ROOT/lib  
 DIDEROT_BINDIR=$DIDEROT_ROOT/bin  
 DIDEROT_MKDIR=$DIDEROT_ROOT/mk  
   
 HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  
 INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh  
   
 AC_SUBST(DIDEROT_ROOT)  
 AC_SUBST(DIDEROT_DOCDIR)  
 AC_SUBST(DIDEROT_SRCDIR)  
 AC_SUBST(DIDEROT_LIBDIR)  
 AC_SUBST(DIDEROT_BINDIR)  
 AC_SUBST(DIDEROT_MKDIR)  
 AC_SUBST(HEAP_IMAGE_DIR)  
 AC_SUBST(INSTALL_SMLNJ_WRAPPER)  
   
 dnl  
 dnl ******************** C compiler properties ********************  
 dnl  
   
 dnl  
 dnl run the compiler tests in 64-bit mode  
 dnl  
 save_CFLAGS=$CFLAGS  
 CFLAGS="$CFLAGS $CFLAG_MXX"  
   
 dnl  
 dnl check for gcc builtin atomic operations  
 dnl  
 AC_MSG_CHECKING([for builtin atomic operations])  
 AC_LINK_IFELSE(  
    [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],  
    AC_MSG_RESULT(yes)  
    AC_DEFINE(  
     [HAVE_BUILTIN_ATOMIC_OPS], 1,  
     [Define to 1 if gcc compiler provides atomic operations.]),  
    AC_MSG_RESULT(no))  
   
 AC_C_BIGENDIAN  
   
 #  
 # determine the sizes of the standard C types  
 AC_CHECK_SIZEOF([int])  
 SIZEOF_C_INT=$ac_cv_sizeof_int  
 AC_CHECK_SIZEOF([long])  
 SIZEOF_C_LONG=$ac_cv_sizeof_long  
 AC_CHECK_SIZEOF([float])  
 SIZEOF_C_FLOAT=$ac_cv_sizeof_float  
 AC_CHECK_SIZEOF([double])  
 SIZEOF_C_DOUBLE=$ac_cv_sizeof_double  
   
 AC_SUBST(SIZEOF_C_INT)  
 AC_SUBST(SIZEOF_C_LONG)  
 AC_SUBST(SIZEOF_C_FLOAT)  
 AC_SUBST(SIZEOF_C_DOUBLE)  
   
 dnl  
 dnl restore CFLAGS  
 dnl  
 CFLAGS=$save_CFLAGS  
   
 dnl  
 dnl ******************** config.h stuff ********************  
 dnl  
662    
663  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
664    
# Line 596  Line 678 
678  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
679  ])  ])
680    
681  dnl  #################### end config.h ####################
682  dnl ******************** write output ********************  
683  dnl  #################### write output ####################
684    
685  dnl The compiler Makefile depends on which SML system we are  dnl The compiler Makefile depends on which SML system we are
686  dnl using.  dnl using.
# Line 616  Line 698 
698  dnl  doc/man/Makefile  dnl  doc/man/Makefile
699  dnl  src/clinfo/Makefile  dnl  src/clinfo/Makefile
700    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
701  dnl  src/lib/build/Makefile    src/lib/build/Makefile
702  dnl  src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in    src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
703  dnl  test/MIP/Makefile    src/logging/gen/Makefile
 dnl  test/probe/Makefile  
 dnl  test/iso2d-polyline/Makefile  
 dnl  test/vr-lite-cam/Makefile  
 dnl  test/hlic/Makefile  
704  dnl  dnl
705  dnl ***** SML source files *****  dnl ***** SML source files *****
706    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in
707    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
708    src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in    src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
709    src/compiler/options/version.sml:src/compiler/options/version_sml.in    src/compiler/options/version.sml:src/compiler/options/version_sml.in
710      src/logging/gen/main.sml:src/logging/gen/main_sml.in
711  )  )
712    
 #AC_CONFIG_HEADERS(src/compiler/c-util/fragments/config.in:config/config_h.in)  
713  AC_CONFIG_HEADERS(src/lib/include/diderot/config.h:config/config_h.in)  AC_CONFIG_HEADERS(src/lib/include/diderot/config.h:config/config_h.in)
714    
715  dnl  dnl
# Line 646  Line 724 
724  AC_CONFIG_FILES([  AC_CONFIG_FILES([
725    src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in    src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
726  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
 # AC_CONFIG_FILES([  
 #   rtest/scripts/run.sh:rtest/scripts/run_sh.in  
 # ], [chmod +x rtest/scripts/run.sh])  
 # AC_CONFIG_FILES([  
 #   rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in  
 # ], [chmod +x rtest/scripts/run-one.sh])  
 #  
 # more regression tests; should merge with rtest at some point  
 #  
 # AC_CONFIG_FILES([  
 #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in  
 # ], [chmod +x rtest2/scripts/run.sh])  
 # AC_CONFIG_FILES([  
 #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in  
 # ], [chmod +x rtest2/scripts/run-one.sh])  
727    
728  dnl  dnl
729  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
730  dnl  dnl
731  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
732  dnl  dnl
733    dnl where the options are taken from [debug, parallel]
734    dnl
735  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
736      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
737        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 679  Line 744 
744      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
745    ])    ])
746    
747  #MK_BUILD_DIR(rt-seq-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
748  #MK_BUILD_DIR(rt-seq-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
749  #MK_BUILD_DIR(rt-seq-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
750  #MK_BUILD_DIR(rt-seq-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
751  #MK_BUILD_DIR(rt-par-f, parallel, [parallel float])  
752  #MK_BUILD_DIR(rt-par-d, parallel, [parallel double])  if test x"$LOGGING_ENABLED" = xtrue ; then
753  #MK_BUILD_DIR(rt-par-f-debug, parallel, [parallel float debug])  MK_BUILD_DIR(rt-par-log, parallel, [parallel logging])
754  #MK_BUILD_DIR(rt-par-d-debug, parallel, [parallel double debug])  fi
755    
756  #if test x"$CL_ENABLED" = xtrue ; then  #if test x"$CL_ENABLED" = xtrue ; then
757  #  MK_BUILD_DIR(rt-cl-f, cl, [float])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
758  #  MK_BUILD_DIR(rt-cl-d, cl, [double])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
759  #  MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])  #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
760  #  MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
761  #fi  #fi
762    
763  AC_OUTPUT  AC_OUTPUT
764    
765    #################### end write output ####################

Legend:
Removed from v.3914  
changed lines
  Added in v.4842

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