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 5072, Fri Jul 14 22:37:27 2017 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    #################### end Paths configuration ####################
58    
59  dnl check for standard programs  dnl check for standard programs
60  dnl  dnl
61  AC_PROG_CPP  AC_PROG_CPP
62    AC_PROG_CC([clang gcc cc])
63  AC_PROG_CXX([clang++ g++ c++])  AC_PROG_CXX([clang++ g++ c++])
64  AX_CXX_COMPILE_STDCXX(11,[],[mandatory])  AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
65  AC_PROG_INSTALL  AC_PROG_INSTALL
# Line 52  Line 75 
75    
76  dnl extra compiler options  dnl extra compiler options
77  dnl  dnl
78  CXXFLAGS_BASE="$CXXFLAGS -Wformat -Wreturn-type -Wuninitialized"  CXXFLAGS_BASE="-Wreturn-type -Wuninitialized"
79    
80    dnl check for SIMD support
81    dnl
82    AX_EXT
83    
84  AC_ARG_ENABLE([32-bit],  AC_ARG_ENABLE([32-bit],
85    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]),
86    [CXXFLAG_Mxx="-m32"],    [CXXFLAG_Mxx="-m32"],
87    [CXXFLAG_Mxx="-m64"])    [CXXFLAG_Mxx="-m64"])
 if test x"$CXX" != "xclang++" ; then  
   CXXFLAGS_BASE="$CXXFLAGS_BASE -fno-implicit-templates"  
 fi  
88    
89  CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"  CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
90  AC_SUBST(CXXFLAG_Mxx)  AC_SUBST(CXXFLAG_Mxx)
91  AC_SUBST(CXXFLAGS_BASE)  AC_SUBST(CXXFLAGS_BASE)
92    
93  dnl  dnl
94    dnl run the compiler tests in 64-bit mode
95    dnl
96    save_CFLAGS=$CFLAGS
97    CFLAGS="$CFLAGS $CFLAG_MXX"
98    
99    dnl
100    dnl check for gcc builtin atomic operations
101    dnl
102    AC_MSG_CHECKING([for builtin atomic operations])
103    AC_LINK_IFELSE(
104       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
105       AC_MSG_RESULT(yes)
106       AC_DEFINE(
107        [HAVE_BUILTIN_ATOMIC_OPS], 1,
108        [Define to 1 if gcc compiler provides atomic operations.]),
109       AC_MSG_RESULT(no))
110    
111    AC_C_BIGENDIAN
112    
113    #
114    # determine the sizes of the standard C types
115    AC_CHECK_SIZEOF([int])
116    SIZEOF_C_INT=$ac_cv_sizeof_int
117    AC_CHECK_SIZEOF([long])
118    SIZEOF_C_LONG=$ac_cv_sizeof_long
119    AC_CHECK_SIZEOF([float])
120    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
121    AC_CHECK_SIZEOF([double])
122    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
123    
124    AC_SUBST(SIZEOF_C_INT)
125    AC_SUBST(SIZEOF_C_LONG)
126    AC_SUBST(SIZEOF_C_FLOAT)
127    AC_SUBST(SIZEOF_C_DOUBLE)
128    
129    dnl
130    dnl restore CFLAGS
131    dnl
132    CFLAGS=$save_CFLAGS
133    
134    dnl
135  dnl check for <stdbool.h>, which we use in the C API  dnl check for <stdbool.h>, which we use in the C API
136  dnl  dnl
137  AC_HEADER_STDBOOL  AC_HEADER_STDBOOL
138    
139  dnl  dnl
140    dnl the C boolean type to use in generated library headers
141    dnl
142    if test x"$ac_cv_header_stdbool_h" = xyes ; then
143      BOOLTY="bool"
144    elif test "x$ac_cv_type__Bool" = xyes; then
145      BOOLTY="_Bool"
146    else
147      BOOLTY="int"
148    fi
149    AC_SUBST(BOOLTY)
150    
151    dnl
152  dnl check for pthreads support  dnl check for pthreads support
153  dnl  dnl
154  ACX_PTHREAD  ACX_PTHREAD
155    
156  dnl  dnl
157    dnl check for various library routines etc.
158    dnl
159    AC_CHECK_FUNCS(posix_memalign)
160    if test x"$ac_cv_func_posix_memalign" != xyes ; then
161      AC_CHECK_FUNCS(memalign)
162      if test x"$ac_cv_func_posix_memalign" != xyes ; then
163        AC_CHECK_FUNCS(valloc)
164      fi
165    fi
166    
167    AC_CHECK_FUNCS(mach_absolute_time)
168    AC_CHECK_TYPES([struct timespec])
169    AC_CHECK_FUNCS(pthread_barrier_init)
170    
171    dnl
172    dnl check for clock_gettime.  On Linux, this requires librt.
173    dnl
174    save_LIBS=$LIBS
175    LIBS="-lrt $LIBS"
176    AC_MSG_CHECKING([for clock_gettime])
177    AC_LINK_IFELSE(
178      [AC_LANG_PROGRAM(
179        [[#include <time.h>]],
180        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
181      [ ac_cv_func_clock_gettime=yes;
182        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
183      [ac_cv_func_clock_gettime=no])
184    AC_MSG_RESULT($ac_cv_func_clock_gettime)
185    if test "$ac_cv_func_clock_gettime" = "no" ; then
186      LIBS=$save_LIBS
187    fi
188    
189    AC_CHECK_FUNCS(pthread_getcpuclockid)
190    AC_CHECK_FUNCS(sigtimedwait nanosleep)
191    
192    dnl
193    dnl check for pthread_setaffinity_np
194    dnl
195    save_LIBS=$LIBS
196    save_CFLAGS=$CFLAGS
197    LIBS="$PTHREAD_LIBS $LIBS"
198    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
199    AC_MSG_CHECKING([for pthread_setaffinity_np])
200    AC_LINK_IFELSE(
201      [AC_LANG_PROGRAM(
202        [[#include <pthread.h>]],
203        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
204      [ ac_cv_func_pthread_setaffinity_np=yes;
205        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
206      [ac_cv_func_pthread_setaffinity_np=no])
207    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
208    LIBS=$save_LIBS
209    CFLAGS=$save_CFLAGS
210    
211    dnl
212    dnl check for Linux NUMA support (libnuma)
213    dnl
214    AC_CHECK_LIB(numa,numa_available)
215    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
216      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
217    fi
218    
219    dnl check for /proc/cpuinfo
220    dnl
221    AC_CHECK_FILES(/proc/cpuinfo)
222    
223    dnl check for getcpu and/or sched_getcpu
224    dnl
225    hasGetCPU=no;
226    AC_CHECK_HEADERS([linux/getcpu.h])
227    if test "x$ac_cv_header_linux_getcpu_h" = xyes; then
228      AC_CHECK_FUNCS([getcpu])
229      hasGetCPU=yes;
230    else
231      # getcpu is usually called using syscall
232      #
233      AC_MSG_CHECKING([SYS_getcpu])
234      AC_RUN_IFELSE([AC_LANG_SOURCE([[
235        #define _GNU_SOURCE
236        #include <unistd.h>
237        #include <sys/syscall.h>
238        int main () {
239          unsigned cpu, node;
240          return syscall (SYS_getcpu, &cpu, &node, 0);
241        }
242        ]])],[hasGetCPU=yes],[])
243      AC_MSG_RESULT([$hasGetCPU])
244      if test x"$hasGetCPU" = xyes ; then
245        AC_DEFINE([HAVE_SYS_GETCPU],[1],[Define if SYS_getcpu is defined in <sys/syscall.h>])
246      fi
247    fi
248    if test x"$hasGetCPU" != xyes ; then
249    AC_CHECK_FUNCS([sched_getcpu])
250    fi
251    
252    dnl
253    dnl OS-specific linking issues
254    dnl
255    LD_NEEDS_RPATH=false;
256    LIBM=""
257    case "$host_os" in
258      darwin*) # On Mac OS X we check for the presence of macports and/or fink
259        if test -x /opt/local/bin/port ; then
260          HAS_MACPORTS=yes
261        else
262          HAS_MACPORTS=no
263        fi
264        if test -x /sw/bin/fink ; then
265          HAS_FINK=yes
266        else
267          HAS_FINK=no
268        fi
269      ;;
270      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
271        LD_NEEDS_RPATH=true
272        LIBM="-lm"
273      ;;
274    esac
275    
276    if test x"$HAS_MACPORTS" = xyes ; then
277      LDPATHS="-L/opt/local/lib"
278    elif test x"$HAS_FINK" = xyes ; then
279      LDPATHS="-L/sw/lib"
280    else
281      LDPATHS=""
282    fi
283    AC_SUBST(LDPATHS)
284    AC_SUBST(LD_NEEDS_RPATH)
285    AC_SUBST(LIBM)
286    
287    #################### Logging configuration ####################
288    
289    LOGGING_ENABLED=false
290    AC_ARG_ENABLE([event-logging],
291      AC_HELP_STRING([--enable-event-logging], [include event-logging support for parallel target]),
292      [LOGGING_ENABLED=true],
293      [LOGGING_ENABLED=false])
294    
295    AC_SUBST(LOGGING_ENABLED)
296    
297    #################### end Logging configuration ####################
298    
299    #################### Diderot Debugger configuration ####################
300    
301    DEBUGGER_ENABLED=false
302    AC_ARG_ENABLE([debugger],
303      AC_HELP_STRING([--enable-debugger], [build the Diderot debugger (experimental)]),
304      [DEBUGGER_ENABLED=true],
305      [DEBUGGER_ENABLED=false])
306    
307    AC_SUBST(DEBUGGER_ENABLED)
308    
309    #################### end Diderot Debugger configuration ####################
310    
311    #################### CUDA configuration ####################
312    
313    AC_ARG_ENABLE([cuda],
314      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
315    
316    if test "${enable_cuda+set}" = set ; then
317    dnl
318  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
319  dnl  dnl
320  AC_MSG_NOTICE([checking for CUDA and nvcc])  AC_MSG_NOTICE([checking for CUDA and nvcc])
# Line 89  Line 327 
327    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
328    CUDA_ENABLED=true    CUDA_ENABLED=true
329  fi  fi
330    else
331      NVCC=":"
332      CUDA_ENABLED=false
333    fi
334  AC_SUBST(NVCC)  AC_SUBST(NVCC)
335  AC_SUBST(CUDA_ENABLED)  AC_SUBST(CUDA_ENABLED)
336    
337    #################### end CUDA configuration ####################
338    
339    #################### OpenCL configuration ####################
340    
341    AC_ARG_ENABLE([opencl],
342      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
343    
344    if test "${enable_opencl+set}" = set ; then
345    
346  dnl  dnl
347  dnl check for OpenCL support  dnl check for OpenCL support
348  dnl  dnl
# Line 210  Line 461 
461    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
462    fi    fi
463  fi  fi
464    else
465      CL_ENABLED=false
466      CL_VERSION="0"
467      SIZEOF_CL_INT="0"
468      SIZEOF_CL_LONG="0"
469      SIZEOF_CL_FLOAT="0"
470      SIZEOF_CL_DOUBLE="0"
471    fi
472    
473  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
474  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
475  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 479 
479  AC_SUBST(SIZEOF_CL_FLOAT)  AC_SUBST(SIZEOF_CL_FLOAT)
480  AC_SUBST(SIZEOF_CL_DOUBLE)  AC_SUBST(SIZEOF_CL_DOUBLE)
481    
482  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  
483    
484  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)  
   
 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  
485    
 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  
486  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
487  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
488  dnl compiler.  dnl compiler.
489  dnl  dnl
490    
491    dnl the path can be specified using "--with-teem=..." too
492    dnl
493  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
494    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
495    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
496    
497  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
498    dnl search for Teem in some standard places
499    dnl
500      AC_MSG_CHECKING([for teem])
501    TEEM_DIR=none    TEEM_DIR=none
502      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
503      for dir in $POSSIBLE_TEEM_DIRS ; do
504        if test -f $dir/include/teem/nrrd.h ; then
505          TEEM_DIR=$dir
506          AC_MSG_RESULT([$TEEM_DIR])
507          break
508        fi
509      done
510      if test $TEEM_DIR = none ; then
511        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
512      fi
513  else  else
514    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
515    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 349  Line 523 
523        AC_MSG_RESULT([yes])        AC_MSG_RESULT([yes])
524      else      else
525        TEEM_DIR=none        TEEM_DIR=none
526        AC_MSG_RESULT([no])        AC_MSG_RESULT([invalid path to teem])
527      fi      fi
528    else    else
529      TEEM_DIR=none      TEEM_DIR=none
530      AC_MSG_RESULT([no])      AC_MSG_RESULT([invalid path to teem])
531    fi    fi
532  fi  fi
533  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
534    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])    AC_MSG_ERROR([unable to find teem])
535  fi  fi
536  dnl  dnl
537  dnl check that unu supports the dnorm command  dnl check that teem supports the nrrdMetaDataNormalize function
538  dnl  dnl
539  if test x"$TEEM_DIR" != xnone ; then  save_LDFLAGS=$LDFLAGS
540    AC_MSG_CHECKING([that \"unu dnorm\" works])  save_LIBS=$LIBS
541    if test -x $TEEM_DIR/bin/unu ; then  LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
542      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null  LIBS="$LIBS -lteem -lm"
543      if test $? -eq 0 ; then  AC_CHECK_FUNCS([nrrdMetaDataNormalize])
544        AC_MSG_RESULT([yes])  LDFLAGS=$save_LDFLAGS
545      else  LIBS=$save_LIBS
546        AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])  
547      fi  if test "x$ac_cv_func_nrrdMetaDataNormalize" != xyes; then
548    else    AC_MSG_ERROR(["please update your teem installation"])
     AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])  
   fi  
549  fi  fi
550    
551  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
552    
553  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
554    
555    #################### SML configuration ####################
556    
557  dnl  dnl
558  dnl We support building with both SML/NJ (the default) or MLton.  dnl We support building with both SML/NJ (the default) or MLton.
559  dnl  dnl
# Line 413  Line 589 
589    
590    dnl check that we have a compatible version of SML/NJ    dnl check that we have a compatible version of SML/NJ
591    dnl    dnl
592    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])])
593    if test $SMLNJ_MAJOR_VERSION -lt 110 \    if test $SMLNJ_MAJOR_VERSION -lt 110 \
594      -o $SMLNJ_MINOR_VERSION -lt 79      -o $SMLNJ_MINOR_VERSION -lt 80
595    then    then
596      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)])
597    fi    fi
598    
599    dnl determine the heap-image suffix    dnl determine the heap-image suffix
# Line 427  Line 603 
603    
604    dnl look for ml-makedepend    dnl look for ml-makedepend
605    dnl    dnl
   AC_MSG_CHECKING([for ml-makedepend])  
606    tmpPATH="$SMLNJ_PATH:$PATH"    tmpPATH="$SMLNJ_PATH:$PATH"
607    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  
608    AC_SUBST(ML_MAKEDEPEND)    AC_SUBST(ML_MAKEDEPEND)
609    
610    dnl    dnl
# Line 448  Line 618 
618    AC_SUBST(ML_BUILD)    AC_SUBST(ML_BUILD)
619    SML=smlnj    SML=smlnj
620    
621      HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
622      INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh
623      AC_SUBST(HEAP_IMAGE_DIR)
624      AC_SUBST(INSTALL_SMLNJ_WRAPPER)
625    
626  else  else
627    
628    # we are using MLton    # we are using MLton
629    MLTON=$with_mlton    MLTON=$with_mlton
630    AC_SUBST(MLTON)    AC_SUBST(MLTON)
631    SML=mlton    SML=mlton
632    
633  fi  fi
634  AC_SUBST(SML)  AC_SUBST(SML)
635    
636  dnl ******************** Documentation tools ********************  #################### end SML configuration ####################
637    
638    #################### Documentation tools configuration ####################
639    
640  dnl check for doxygen  dnl check for doxygen
641  dnl  dnl
# Line 507  Line 686 
686  AC_SUBST(HIGHLIGHTER)  AC_SUBST(HIGHLIGHTER)
687  AC_SUBST(DBLATEX)  AC_SUBST(DBLATEX)
688    
689    #################### end Documentation tools configuration ####################
690    
691  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  
692    
693  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])
694    
# Line 596  Line 708 
708  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
709  ])  ])
710    
711  dnl  #################### end config.h ####################
712  dnl ******************** write output ********************  
713  dnl  #################### write output ####################
714    
715  dnl The compiler Makefile depends on which SML system we are  dnl The compiler Makefile depends on which SML system we are
716  dnl using.  dnl using.
# Line 616  Line 728 
728  dnl  doc/man/Makefile  dnl  doc/man/Makefile
729  dnl  src/clinfo/Makefile  dnl  src/clinfo/Makefile
730    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
731  dnl  src/lib/build/Makefile    src/lib/build/Makefile
732  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
 dnl  test/MIP/Makefile  
 dnl  test/probe/Makefile  
 dnl  test/iso2d-polyline/Makefile  
 dnl  test/vr-lite-cam/Makefile  
 dnl  test/hlic/Makefile  
733  dnl  dnl
734  dnl ***** SML source files *****  dnl ***** SML source files *****
735    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
# Line 631  Line 738 
738    src/compiler/options/version.sml:src/compiler/options/version_sml.in    src/compiler/options/version.sml:src/compiler/options/version_sml.in
739  )  )
740    
 #AC_CONFIG_HEADERS(src/compiler/c-util/fragments/config.in:config/config_h.in)  
741  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)
742    
743  dnl  dnl
# Line 646  Line 752 
752  AC_CONFIG_FILES([  AC_CONFIG_FILES([
753    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
754  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
755  # AC_CONFIG_FILES([  
756  #   rtest/scripts/run.sh:rtest/scripts/run_sh.in  dnl
757  # ], [chmod +x rtest/scripts/run.sh])  dnl additional files for logging tools
758  # AC_CONFIG_FILES([  dnl
759  #   rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in  if test x"$LOGGING_ENABLED" = xtrue ; then
760  # ], [chmod +x rtest/scripts/run-one.sh])    AC_CONFIG_FILES([
761  #      src/logging/gen/Makefile
762  # more regression tests; should merge with rtest at some point      src/logging/log-analyze/Makefile
763  #      src/logging/log-dump/Makefile
764  # AC_CONFIG_FILES([      src/logging/gen/log-gen.sh:src/logging/gen/log-gen_sh.in
765  #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in      src/logging/gen/main.sml:src/logging/gen/main_sml.in
766  # ], [chmod +x rtest2/scripts/run.sh])      src/logging/lib/default-log-paths.hxx:src/logging/lib/default-log-paths_hxx.in
767  # AC_CONFIG_FILES([    ], [chmod +x src/logging/gen/log-gen.sh])
768  #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in  fi
 # ], [chmod +x rtest2/scripts/run-one.sh])  
769    
770  dnl  dnl
771  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
772  dnl  dnl
773  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
774  dnl  dnl
775    dnl where the options are taken from [debug, parallel]
776    dnl
777  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
778      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
779        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 679  Line 786 
786      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
787    ])    ])
788    
789  #MK_BUILD_DIR(rt-seq-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
790  #MK_BUILD_DIR(rt-seq-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequentiagetcpul, [debug])
791  #MK_BUILD_DIR(rt-seq-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
792  #MK_BUILD_DIR(rt-seq-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
793  #MK_BUILD_DIR(rt-par-f, parallel, [parallel float])  
794  #MK_BUILD_DIR(rt-par-d, parallel, [parallel double])  if test x"$LOGGING_ENABLED" = xtrue ; then
795  #MK_BUILD_DIR(rt-par-f-debug, parallel, [parallel float debug])    MK_BUILD_DIR(rt-par-log, parallel, [parallel logging])
796  #MK_BUILD_DIR(rt-par-d-debug, parallel, [parallel double debug])  fi
797    
798  #if test x"$CL_ENABLED" = xtrue ; then  #if test x"$CL_ENABLED" = xtrue ; then
799  #  MK_BUILD_DIR(rt-cl-f, cl, [float])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
800  #  MK_BUILD_DIR(rt-cl-d, cl, [double])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
801  #  MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])  #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
802  #  MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
803  #fi  #fi
804    
805  AC_OUTPUT  AC_OUTPUT
806    
807    #################### end write output ####################

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

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