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

trunk/configure.ac revision 134, Fri Jul 2 21:44:54 2010 UTC branches/vis15/configure.ac revision 4419, Wed Aug 17 12:49:55 2016 UTC
# Line 1  Line 1 
1  dnl Process this file with autoconf to produce a configure script.  dnl Process this file with autoconf to produce a configure script.
2  dnl  dnl
3  dnl COPYRIGHT (c) 2010 The Diderot Project  dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4    dnl
5    dnl COPYRIGHT (c) 2016 The University of Chicago
6  dnl All rights reserved.  dnl All rights reserved.
7  dnl  dnl
8    
9  dnl NOTE: MANTICORE_DIST_VERSION is an M4 variable defined in config/aclocal.m4  AC_INIT(diderot,1.0,)
 dnl  
 AC_INIT(diderot,0.1,)  
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project]])  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])
13  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)  AC_CONFIG_SRCDIR(src/compiler/options/ctl.sml)
14  AC_CONFIG_AUX_DIR(config)  AC_CONFIG_AUX_DIR(config)
15  AC_CONFIG_MACRO_DIR(config)  AC_CONFIG_MACRO_DIR(config)
16    
17  dnl  dnl
18    dnl set the following to the name of the branch
19    dnl
20    BRANCH="vis15"
21    AC_SUBST(BRANCH)
22    
23    dnl
24  dnl include additional macros  dnl include additional macros
25  dnl  dnl
26  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
27  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
28  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
29    sinclude(config/ax_check_framework.m4)
30    sinclude(config/ax_cxx_compile_stdcxx.m4)
31    
32  dnl  dnl
33  dnl get host information  dnl get host information
34  dnl  dnl
35  AC_CANONICAL_HOST  AC_CANONICAL_HOST
36    
37    #################### Paths configuration ####################
38    
39    DIDEROT_ROOT=`pwd`
40    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
41    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
42    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
43    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
44    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
45    
46    AC_SUBST(DIDEROT_ROOT)
47    AC_SUBST(DIDEROT_DOCDIR)
48    AC_SUBST(DIDEROT_SRCDIR)
49    AC_SUBST(DIDEROT_LIBDIR)
50    AC_SUBST(DIDEROT_BINDIR)
51    AC_SUBST(DIDEROT_MKDIR)
52    
53    #################### end Paths configuration ####################
54    
55  dnl check for standard programs  dnl check for standard programs
56  dnl  dnl
 AC_PROG_CC_C99  
57  AC_PROG_CPP  AC_PROG_CPP
58    AC_PROG_CC([clang gcc cc])
59    AC_PROG_CXX([clang++ g++ c++])
60    AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
61  AC_PROG_INSTALL  AC_PROG_INSTALL
62  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
63    
64    dnl FIXME: this works for now, but we should probably switch to libtool
65    dnl
66    AC_PATH_PROG(LD, [ld], [none])
67    if test x$LD = xnone ; then
68      AC_MSG_ERROR([cannot find ld command])
69    fi
70    AC_SUBST(LD)
71    
72    dnl extra compiler options
73  dnl  dnl
74  dnl If we are on Mac OS X, check for the presence of macports and/or fink  CXXFLAGS_BASE="-Wreturn-type -Wuninitialized"
75    
76    AC_ARG_ENABLE([32-bit],
77      AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
78      [CXXFLAG_Mxx="-m32"],
79      [CXXFLAG_Mxx="-m64"])
80    
81    dnl check to see if we need the explicitly instantiate templates (as required by gcc).
82  dnl  dnl
83    case x"$CXX" in
84      xclang*)
85        EXPLICIT_TEMPLATES="false"
86        ;;
87      *)
88        CXXFLAGS_BASE="$CXXFLAGS_BASE -fno-implicit-templates"
89        EXPLICIT_TEMPLATES="true"
90        ;;
91    esac
92    
93    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
94    AC_SUBST(CXXFLAG_Mxx)
95    AC_SUBST(CXXFLAGS_BASE)
96    AC_SUBST(EXPLICIT_TEMPLATES)
97    
98    dnl
99    dnl run the compiler tests in 64-bit mode
100    dnl
101    save_CFLAGS=$CFLAGS
102    CFLAGS="$CFLAGS $CFLAG_MXX"
103    
104    dnl
105    dnl check for gcc builtin atomic operations
106    dnl
107    AC_MSG_CHECKING([for builtin atomic operations])
108    AC_LINK_IFELSE(
109       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
110       AC_MSG_RESULT(yes)
111       AC_DEFINE(
112        [HAVE_BUILTIN_ATOMIC_OPS], 1,
113        [Define to 1 if gcc compiler provides atomic operations.]),
114       AC_MSG_RESULT(no))
115    
116    AC_C_BIGENDIAN
117    
118    #
119    # determine the sizes of the standard C types
120    AC_CHECK_SIZEOF([int])
121    SIZEOF_C_INT=$ac_cv_sizeof_int
122    AC_CHECK_SIZEOF([long])
123    SIZEOF_C_LONG=$ac_cv_sizeof_long
124    AC_CHECK_SIZEOF([float])
125    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
126    AC_CHECK_SIZEOF([double])
127    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
128    
129    AC_SUBST(SIZEOF_C_INT)
130    AC_SUBST(SIZEOF_C_LONG)
131    AC_SUBST(SIZEOF_C_FLOAT)
132    AC_SUBST(SIZEOF_C_DOUBLE)
133    
134    dnl
135    dnl restore CFLAGS
136    dnl
137    CFLAGS=$save_CFLAGS
138    
139    dnl
140    dnl check for <stdbool.h>, which we use in the C API
141    dnl
142    AC_HEADER_STDBOOL
143    
144    dnl
145    dnl the C boolean type to use in generated library headers
146    dnl
147    if test x"$ac_cv_header_stdbool_h" = xyes ; then
148      BOOLTY="bool"
149    elif test "x$ac_cv_type__Bool" = xyes; then
150      BOOLTY="_Bool"
151    else
152      BOOLTY="int"
153    fi
154    AC_SUBST(BOOLTY)
155    
156    dnl
157    dnl check for pthreads support
158    dnl
159    ACX_PTHREAD
160    
161    dnl
162    dnl check for various library routines etc.
163    dnl
164    AC_CHECK_FUNCS(posix_memalign)
165    if test x"$ac_cv_func_posix_memalign" != xyes ; then
166      AC_CHECK_FUNCS(memalign)
167      if test x"$ac_cv_func_posix_memalign" != xyes ; then
168        AC_CHECK_FUNCS(valloc)
169      fi
170    fi
171    
172    AC_CHECK_FUNCS(mach_absolute_time)
173    AC_CHECK_TYPES([struct timespec])
174    AC_CHECK_FUNCS(pthread_barrier_init)
175    
176    dnl
177    dnl check for clock_gettime.  On Linux, this requires librt.
178    dnl
179    save_LIBS=$LIBS
180    LIBS="-lrt $LIBS"
181    AC_MSG_CHECKING([for clock_gettime])
182    AC_LINK_IFELSE(
183      [AC_LANG_PROGRAM(
184        [[#include <time.h>]],
185        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
186      [ ac_cv_func_clock_gettime=yes;
187        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
188      [ac_cv_func_clock_gettime=no])
189    AC_MSG_RESULT($ac_cv_func_clock_gettime)
190    if test "$ac_cv_func_clock_gettime" = "no" ; then
191      LIBS=$save_LIBS
192    fi
193    
194    AC_CHECK_FUNCS(pthread_getcpuclockid)
195    AC_CHECK_FUNCS(sigtimedwait nanosleep)
196    
197    dnl
198    dnl check for sched_setaffinity
199    dnl
200    AC_CHECK_FUNCS(sched_setaffinity)
201    
202    dnl
203    dnl check for pthread_setaffinity_np
204    dnl
205    save_LIBS=$LIBS
206    save_CFLAGS=$CFLAGS
207    LIBS="$PTHREAD_LIBS $LIBS"
208    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
209    AC_MSG_CHECKING([for pthread_setaffinity_np])
210    AC_LINK_IFELSE(
211      [AC_LANG_PROGRAM(
212        [[#include <pthread.h>]],
213        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
214      [ ac_cv_func_pthread_setaffinity_np=yes;
215        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
216      [ac_cv_func_pthread_setaffinity_np=no])
217    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
218    LIBS=$save_LIBS
219    CFLAGS=$save_CFLAGS
220    
221    dnl
222    dnl check for Linux NUMA support (libnuma)
223    dnl
224    AC_CHECK_LIB(numa,numa_available)
225    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
226      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
227    fi
228    
229    dnl check for /proc/cpuinfo
230    dnl
231    AC_CHECK_FILES(/proc/cpuinfo)
232    
233    dnl
234    dnl OS-specific linking issues
235    dnl
236    LD_NEEDS_RPATH=false;
237    LIBM=""
238  case "$host_os" in  case "$host_os" in
239    darwin*) # On Mac OS X we check for installed frameworks    darwin*) # On Mac OS X we check for the presence of macports and/or fink
240      if test -x /opt/local/bin/port ; then      if test -x /opt/local/bin/port ; then
241        HAS_MACPORTS=yes        HAS_MACPORTS=yes
242      else      else
# Line 50  Line 248 
248        HAS_FINK=no        HAS_FINK=no
249      fi      fi
250    ;;    ;;
251      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
252        LD_NEEDS_RPATH=true
253        LIBM="-lm"
254      ;;
255  esac  esac
256    
257  if test x"$HAS_MACPORTS" = xyes ; then  if test x"$HAS_MACPORTS" = xyes ; then
# Line 60  Line 262 
262    LDPATHS=""    LDPATHS=""
263  fi  fi
264  AC_SUBST(LDPATHS)  AC_SUBST(LDPATHS)
265    AC_SUBST(LD_NEEDS_RPATH)
266    AC_SUBST(LIBM)
267    
268    #################### CUDA configuration ####################
269    
270    AC_ARG_ENABLE([cuda],
271      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
272    
273    if test "${enable_cuda+set}" = set ; then
274    dnl
275    dnl Look for NVIDIA's nvcc compiler
276    dnl
277      AC_MSG_NOTICE([checking for CUDA and nvcc])
278      AC_PATH_PROG(NVCC, nvcc, no, $PATH)
279      if test x"$NVCC" = xno ; then
280        AC_MSG_WARN([nvcc not found])
281        CUDA_ENABLED=false
282        NVCC=":"
283      else
284        AC_MSG_RESULT([$NVCC])
285        CUDA_ENABLED=true
286      fi
287    else
288      NVCC=":"
289      CUDA_ENABLED=false
290    fi
291    AC_SUBST(NVCC)
292    AC_SUBST(CUDA_ENABLED)
293    
294    #################### end CUDA configuration ####################
295    
296    #################### OpenCL configuration ####################
297    
298    AC_ARG_ENABLE([opencl],
299      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
300    
301    if test "${enable_opencl+set}" = set ; then
302    
303    dnl
304    dnl check for OpenCL support
305    dnl
306      LIBS_CL="none"
307      case "$host_os" in
308        darwin*) # On Mac OS X we check for installed frameworks
309          AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
310        ;;
311        *)
312          AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
313        ;;
314      esac
315      if test x"$LIBS_CL" = xnone ; then
316        AC_MSG_WARN([no OpenCL library found])
317        CL_ENABLED=false
318        CL_VERSION=0
319      else
320        CL_ENABLED=true
321        CPPFLAGS_CL=""
322        CL_HEADER=""
323        AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
324        if test x"$HAVE_CL_H" = xno ; then
325          # check for AMD's SDK
326          AC_MSG_CHECKING([for cl.h in AMD's SDK])
327          if test -d /opt/AMDAPP/include/CL ; then
328            HAVE_CL_H="yes"
329            CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
330            AC_DEFINE([HAVE_CL_CL_H])
331            CPPFLAGS_CL="-I/opt/AMDAPP/include"
332          fi
333          AC_MSG_RESULT([$HAVE_CL_H])
334        fi
335        if test x"$HAVE_CL_H" = xno ; then
336          # check for NVIDIA's SDK
337          AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
338          CUDA_HOME=none
339          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
340            if test -d /usr/local/$CUDA/include/CL ; then
341              CUDA_HOME=/usr/local/$CUDA
342              break
343            fi
344          done
345          if test x"$CUDA_HOME" != xnone ; then
346            HAVE_CL_H="yes"
347            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
348            AC_DEFINE([HAVE_CL_CL_H])
349            CPPFLAGS_CL="-I$CUDA_HOME/include"
350          fi
351          AC_MSG_RESULT([$HAVE_CL_H])
352        fi
353        if test x"$HAVE_CL_H" = xno ; then
354          AC_MSG_WARN([no cl.h found])
355          CL_ENABLED=false
356          CL_VERSION=0
357          SIZEOF_CL_INT=0
358          SIZEOF_CL_LONG=0
359          SIZEOF_CL_FLOAT=0
360          SIZEOF_CL_DOUBLE=0
361        else
362          # check the cl.h header for which version of OpenCL is supported
363          AC_LANG([C])
364          save_CPPFLAGS=$CPPFLAGS
365          CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
366          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
367    #include <stdio.h>
368    # ifdef HAVE_CL_CL_H
369    #   include <CL/cl.h>
370    # elif defined(HAVE_OPENCL_CL_H)
371    #   include <OpenCL/cl.h>
372    # else
373    #   error no cl.h
374    # endif]],
375    [[#if defined(CL_VERSION_1_2)
376      printf("120\n");
377    #elif defined(CL_VERSION_1_1)
378      printf("110\n");
379    #elif defined(CL_VERSION_1_0)
380      printf("100\n");
381    #else
382      printf("0\n");
383    #endif
384            ]])],
385            [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
386    dnl
387    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
388    dnl the specification specifies the behavior, but it was unspecified in 1.0.
389    dnl
390          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
391      #include "$CL_HEADER"
392      ]],
393            [[cl_float4 x; x[0] = 0.0;]])],
394            [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
395      dnl
396      dnl not arrays, so try the OpenCL 1.1 structure representation
397      dnl
398            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
399    #include "$CL_HEADER"
400    ]],
401            [[cl_float4 x; x.s[0] = 0.0;]])],
402            [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
403            [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
404        # restore saved CPPFLAGS
405          CPPFLAGS=$save_CPPFLAGS
406        # substitutions
407          AC_SUBST(LIBS_CL)
408          AC_SUBST(CPPFLAGS_CL)
409        #
410        # determine the sizes of the host-side OpenCL types
411        AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
412        SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
413        AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
414        SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
415        AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
416        SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
417        AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
418        SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
419        fi
420      fi
421    else
422      CL_ENABLED=false
423      CL_VERSION="0"
424      SIZEOF_CL_INT="0"
425      SIZEOF_CL_LONG="0"
426      SIZEOF_CL_FLOAT="0"
427      SIZEOF_CL_DOUBLE="0"
428    fi
429    
430    AC_SUBST(CL_ENABLED)
431    AC_SUBST(CL_VERSION)
432    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
433    
434    AC_SUBST(SIZEOF_CL_INT)
435    AC_SUBST(SIZEOF_CL_LONG)
436    AC_SUBST(SIZEOF_CL_FLOAT)
437    AC_SUBST(SIZEOF_CL_DOUBLE)
438    
439    #################### end OpenCL configuration ####################
440    
441    #################### Teem configuration ####################
442    
443    dnl get the path to the TEEM installation.  We need this to build the Diderot
444    dnl runtime code and we use the path when searching for teem in the Diderot
445    dnl compiler.
446  dnl  dnl
447  dnl get the path to the TEEM installation  
448    dnl the path can be specified using "--with-teem=..." too
449  dnl  dnl
450  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
451    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
452    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
453    
454  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
455    dnl search for Teem in some standard places
456    dnl
457      AC_MSG_CHECKING([for teem])
458    TEEM_DIR=none    TEEM_DIR=none
459      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
460      for dir in $POSSIBLE_TEEM_DIRS ; do
461        if test -f $dir/include/teem/nrrd.h ; then
462          TEEM_DIR=$dir
463          AC_MSG_RESULT([$TEEM_DIR])
464          break
465        fi
466      done
467      if test $TEEM_DIR = none ; then
468        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
469      fi
470  else  else
471    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
472    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 77  Line 475 
475    esac    esac
476    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
477      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
478      AC_MSG_RESULT([ okay])      # check that TEEM_DIR actually points to something that looks like teem
479        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
480          AC_MSG_RESULT([yes])
481        else
482          TEEM_DIR=none
483          AC_MSG_RESULT([invalid path to teem])
484        fi
485    else    else
486      TEEM_DIR=none      TEEM_DIR=none
487      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
488    fi    fi
489  fi  fi
490  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
491    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
492  fi  fi
493    dnl
494    dnl check that unu supports the dnorm command
495    dnl
496    AC_MSG_CHECKING([that \"unu dnorm\" works])
497    if test -x $TEEM_DIR/bin/unu ; then
498      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
499      if test $? -eq 0 ; then
500        AC_MSG_RESULT([yes])
501      else
502        AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
503      fi
504    else
505      AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
506    fi
507    
508  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
509    
510  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
511    
512    #################### SML configuration ####################
513    
514    dnl
515    dnl We support building with both SML/NJ (the default) or MLton.
516  dnl  dnl
517    
518    dnl first check for --with-mlton=path flag
519    dnl
520    AC_ARG_WITH([mlton],
521      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
522        [use the MLton Standard ML compiler to build Diderot])],
523      [with_mlton=yes],[with_mlton=no])
524    if test x"$with_mlton" = xyes ; then
525      if test x"$ac_cv_path_with_mlton" = x ; then
526        # look for mlton in the PATH
527        AC_PATH_PROGS(with_mlton, mlton, no)
528        if test x"$MLTON" = xno ; then
529          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
530        fi
531      else
532        with_mlton=$ac_cv_path_with_mlton
533        case $with_mlton in
534          /*) ;;
535          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
536        esac
537        if test ! -x $with_mlton ; then
538          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
539        fi
540      fi
541    fi
542    
543    if test x"$with_mlton" = xno ; then
544      # we are using SML/NJ
545      #
546    
547  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
548  dnl  dnl
549  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; check your PATH or set SMLNJ_CMD])])
550  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
551    -o $SMLNJ_MINOR_VERSION -lt 72      -o $SMLNJ_MINOR_VERSION -lt 79
552  then  then
553    AC_MSG_ERROR([installation requires SML/NJ version 110.72+])      AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])
554  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
555    
556  dnl determine the heap-image suffix  dnl determine the heap-image suffix
557  dnl  dnl
# Line 108  Line 560 
560    
561  dnl look for ml-makedepend  dnl look for ml-makedepend
562  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
563  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
564  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  
565  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
566    
567  dnl  dnl
# Line 127  Line 573 
573    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
574  fi  fi
575  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
576      SML=smlnj
 dnl ******************** Paths ********************  
   
 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  
577    
578  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
579  INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh  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)  
580  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
581  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
582    
583    else
584    
585      # we are using MLton
586      MLTON=$with_mlton
587      AC_SUBST(MLTON)
588      SML=mlton
589    
590    fi
591    AC_SUBST(SML)
592    
593    #################### end SML configuration ####################
594    
595    #################### Documentation tools configuration ####################
596    
597    dnl check for doxygen
598    dnl
599    AC_ARG_WITH([doxygen],
600      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
601      [DOXYGEN=$with_doxygen],
602      [DOXYGEN=none])
603    if test x$DOXYGEN = xnone ; then
604      # see if we can find doxygen in the user's path
605      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
606    fi
607    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
608      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
609    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
610      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
611    elif test x$DOXYGEN != xnone ; then
612  dnl  dnl
613  dnl ******************** write output ********************  dnl verify that $DOXYGEN is an absolute path
614  dnl  dnl
615      case $DOXYGEN in
616        /*) ;;
617        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
618      esac
619    fi
620    if test $DOXYGEN = xnone ; then
621      DOXYGEN=:
622    fi
623    AC_SUBST(DOXYGEN)
624    
625    dnl check for asciidoc and related tools
626    dnl
627    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
628    AC_PATH_PROGS([A2X], [a2x], [none])
629    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
630    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
631    
632    dnl
633    dnl get the path to the asciidoc cofiguration files
634    dnl
635    if test x"$ASCIIDOC" != xnone ; then
636      AC_MSG_CHECKING([path to asciidoc configuration files])
637      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
638      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
639    fi
640    AC_SUBST(ASCIIDOC)
641    AC_SUBST(A2X)
642    AC_SUBST(ASCIIDOC_CONF_DIR)
643    AC_SUBST(HIGHLIGHTER)
644    AC_SUBST(DBLATEX)
645    
646    #################### end Documentation tools configuration ####################
647    
648    #################### config.h ####################
649    
650    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
651    
652    AH_TOP([
653    /*
654     * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
655     *
656     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
657     */
658    
659    #ifndef _DIDEROT_CONFIG_H_
660    #define _DIDEROT_CONFIG_H_
661    
662    ])
663    AH_BOTTOM([
664    
665    #endif /* !_DIDEROT_CONFIG_H_ */
666    ])
667    
668    #################### end config.h ####################
669    
670    #################### write output ####################
671    
672    dnl The compiler Makefile depends on which SML system we are
673    dnl using.
674    if test x"$SML" = xmlton ; then
675      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
676    else
677      COMPILER_MAKEFILE_IN=""
678    fi
679    
680  AC_CONFIG_FILES(  AC_CONFIG_FILES(
681  dnl  dnl
682  dnl ***** Makefiles *****  dnl ***** Makefiles *****
683    src/dnorm/Makefile    Makefile
684    src/compiler/Makefile  dnl  doc/Makefile
685    dnl  doc/man/Makefile
686    dnl  src/clinfo/Makefile
687      src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
688      src/lib/build/Makefile
689      src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
690    dnl  test/MIP/Makefile
691    dnl  test/probe/Makefile
692    dnl  test/iso2d-polyline/Makefile
693    dnl  test/vr-lite-cam/Makefile
694    dnl  test/hlic/Makefile
695  dnl  dnl
696  dnl ***** SML source files *****  dnl ***** SML source files *****
697    src/compiler/IL/run-dnorm.sml:src/compiler/IL/run-dnorm_sml.in    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in
698      src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
699      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
700      src/compiler/options/version.sml:src/compiler/options/version_sml.in
701  )  )
702    
703    AC_CONFIG_HEADERS(src/lib/include/diderot/config.h:config/config_h.in)
704    
705  dnl  dnl
706  dnl shell scripts  dnl shell scripts
707  dnl  dnl
708  AC_CONFIG_FILES([  AC_CONFIG_FILES([
709    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
710  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
711    AC_CONFIG_FILES([
712      src/compiler/gen/fragments/mkfrags.sh:src/compiler/gen/fragments/mkfrags_sh.in
713    ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
714    AC_CONFIG_FILES([
715      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
716    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
717    AC_CONFIG_FILES([
718      src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
719    ], [chmod +x src/tests/rtest/scripts/run.sh])
720    AC_CONFIG_FILES([
721      src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
722    ], [chmod +x src/tests/rtest/scripts/run-one.sh])
723    #
724    # more regression tests; should merge with rtest at some point
725    #
726    # AC_CONFIG_FILES([
727    #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
728    # ], [chmod +x rtest2/scripts/run.sh])
729    # AC_CONFIG_FILES([
730    #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
731    # ], [chmod +x rtest2/scripts/run-one.sh])
732    
733    dnl
734    dnl generate makefiles for runtime library builds
735    dnl
736    dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
737    dnl
738    dnl where the options are taken from [debug, parallel]
739    dnl
740    AC_DEFUN([MK_BUILD_DIR], [
741        if test ! -d src/lib/build/$1 ; then
742          mkdir src/lib/build/$1
743        fi
744        [sed -e 's,@BUILD_TARGET@,$1,g' \
745          -e 's,@TARGET_PLATFORM@,$2,g' \
746          -e 's,@BUILD_OPTIONS@,$3,g' \
747          src/lib/build/mk/Makefile.in \
748            > src/lib/build/$1/Makefile.in]
749        AC_CONFIG_FILES(src/lib/build/$1/Makefile)
750      ])
751    
752    MK_BUILD_DIR(rt-seq, sequential, [])
753    MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
754    MK_BUILD_DIR(rt-par, parallel, [parallel])
755    MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
756    
757    #if test x"$CL_ENABLED" = xtrue ; then
758    #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
759    #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
760    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
761    #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
762    #fi
763    
764  AC_OUTPUT  AC_OUTPUT
765    
766    #################### end write output ####################

Legend:
Removed from v.134  
changed lines
  Added in v.4419

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