瀏覽代碼

makefile: use variables detected by configure

Nathalie Furmento 6 年之前
父節點
當前提交
ef8e7d8238
共有 4 個文件被更改,包括 29 次插入41 次删除
  1. 7 7
      Makefile.am
  2. 16 28
      configure.ac
  3. 3 3
      examples/stencil/Makefile.am
  4. 3 3
      src/Makefile.am

+ 7 - 7
Makefile.am

@@ -2,7 +2,7 @@
 #
 #
 # Copyright (C) 2011-2017                                Inria
 # Copyright (C) 2011-2017                                Inria
 # Copyright (C) 2009-2017                                Université de Bordeaux
 # Copyright (C) 2009-2017                                Université de Bordeaux
-# Copyright (C) 2010-2017                                CNRS
+# Copyright (C) 2010-2018                                CNRS
 #
 #
 # StarPU is free software; you can redistribute it and/or modify
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
 # it under the terms of the GNU Lesser General Public License as published by
@@ -122,17 +122,17 @@ else
 all-local:
 all-local:
 endif
 endif
 if STARPU_DEVEL
 if STARPU_DEVEL
-	@if grep -r sys/time.h $$( find $(srcdir)/examples $(srcdir)/tests $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_util.h -a \! -name timer.h -a \! -name loader.c ) ; \
+	@if $(GREP) -r sys/time.h $$( find $(srcdir)/examples $(srcdir)/tests $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_util.h -a \! -name timer.h -a \! -name loader.c ) ; \
 	then \
 	then \
 		echo "Please do not include sys/time, it is not available on Windows, include starpu_util.h and use starpu_timing_now() instead" ; \
 		echo "Please do not include sys/time, it is not available on Windows, include starpu_util.h and use starpu_timing_now() instead" ; \
 		false ; \
 		false ; \
 	fi
 	fi
-	@if grep -re '\<ssize_t' $$( find $(srcdir)/examples $(srcdir)/tests $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_config.h ) ; \
+	@if $(GREP) -re '\<ssize_t' $$( find $(srcdir)/examples $(srcdir)/tests $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_config.h ) ; \
 	then \
 	then \
 		echo "Please do not use ssize_t, it is not available on Windows, use starpu_ssize_t instead"; \
 		echo "Please do not use ssize_t, it is not available on Windows, use starpu_ssize_t instead"; \
 		false ; \
 		false ; \
 	fi
 	fi
-	@if grep -re '\<getenv\>' $$( find $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_util.h -a \! -name utils.c -a \! -name simgrid.h) ; \
+	@if $(GREP) -re '\<getenv\>' $$( find $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_util.h -a \! -name utils.c -a \! -name simgrid.h) ; \
 	then \
 	then \
 		echo "Please do not use getenv, use starpu_getenv instead, which catches unsafe uses"; \
 		echo "Please do not use getenv, use starpu_getenv instead, which catches unsafe uses"; \
 		false ; \
 		false ; \
@@ -140,8 +140,8 @@ if STARPU_DEVEL
 # we count the number of files which include unistd.h
 # we count the number of files which include unistd.h
 # we count the number of files which properly include unistd.h i.e by first detecting if it's available
 # we count the number of files which properly include unistd.h i.e by first detecting if it's available
 # and then we check both numbers are the same ...a
 # and then we check both numbers are the same ...a
-	@UNISTD_ALL_LINES=$(shell grep -B1 -rs "^#include <unistd.h>" $(srcdir)/src/ $(srcdir)/include/ $(srcdir)/mpi/src $(srcdir)/mpi/include  |grep -v dolib|grep -v -e "--" | tr '\012' '@' | sed 's/unistd.h>@/unistd.h>\n/g' | wc -l) ;\
-	UNISTD_CORRECT_LINES=$(shell grep -B1 -rs "^#include <unistd.h>" $(srcdir)/src/ $(srcdir)/include/ $(srcdir)/mpi/src $(srcdir)/mpi/include  |grep -v dolib|grep -v -e "--" | tr '\012' '@' | sed 's/unistd.h>@/unistd.h>\n/g' | grep '#ifdef .*HAVE_UNISTD_H.*:#include <unistd.h>' | wc -l) ;\
+	@UNISTD_ALL_LINES=$(shell $(GREP) -B1 -rs "^#include <unistd.h>" $(srcdir)/src/ $(srcdir)/include/ $(srcdir)/mpi/src $(srcdir)/mpi/include  |$(GREP) -v dolib|$(GREP) -v -e "--" | tr '\012' '@' | $(SED) 's/unistd.h>@/unistd.h>\n/g' | wc -l) ;\
+	UNISTD_CORRECT_LINES=$(shell $(GREP) -B1 -rs "^#include <unistd.h>" $(srcdir)/src/ $(srcdir)/include/ $(srcdir)/mpi/src $(srcdir)/mpi/include  |$(GREP) -v dolib|$(GREP) -v -e "--" | tr '\012' '@' | $(SED) 's/unistd.h>@/unistd.h>\n/g' | $(GREP) '#ifdef .*HAVE_UNISTD_H.*:#include <unistd.h>' | wc -l) ;\
 	if test $$UNISTD_ALL_LINES -ne $$UNISTD_CORRECT_LINES ; \
 	if test $$UNISTD_ALL_LINES -ne $$UNISTD_CORRECT_LINES ; \
 	then \
 	then \
 		echo "Please do not unconditionally include unistd.h, it is not available on Windows, include config.h and test for HAVE_UNISTD_H" ; \
 		echo "Please do not unconditionally include unistd.h, it is not available on Windows, include config.h and test for HAVE_UNISTD_H" ; \
@@ -201,7 +201,7 @@ showcheck:
 
 
 ctags-local:
 ctags-local:
 	cd $(top_srcdir) ; $(CTAGS) -R -I LIST_TYPE
 	cd $(top_srcdir) ; $(CTAGS) -R -I LIST_TYPE
-	sed -i $(top_srcdir)/tags -e '/^[^	]* [^	]*	/d' -e '/^[^	]*$$/d' 
+	$(SED) -i $(top_srcdir)/tags -e '/^[^	]* [^	]*	/d' -e '/^[^	]*$$/d' 
 
 
 
 
 # Cyclomatic complexity reports.
 # Cyclomatic complexity reports.

+ 16 - 28
configure.ac

@@ -81,6 +81,8 @@ AC_PROG_F77
 AC_PROG_FC
 AC_PROG_FC
 AC_PROG_GREP
 AC_PROG_GREP
 AC_PROG_EGREP
 AC_PROG_EGREP
+AC_PROG_INSTALL
+AC_PROG_MKDIR_P
 AC_CHECK_PROGS(PROG_STAT,gstat stat)
 AC_CHECK_PROGS(PROG_STAT,gstat stat)
 AC_CHECK_PROGS(PROG_DATE,gdate date)
 AC_CHECK_PROGS(PROG_DATE,gdate date)
 AC_OPENMP
 AC_OPENMP
@@ -243,10 +245,10 @@ if test x$enable_blocking = xno ; then
 fi
 fi
 
 
 if test x$enable_blocking = xyes ; then
 if test x$enable_blocking = xyes ; then
-AC_MSG_CHECKING(whether worker callbacks should be enabled)
-AC_ARG_ENABLE(worker-callbacks, [AS_HELP_STRING([--enable-worker-callbacks], [enable worker callbacks])],
+	AC_MSG_CHECKING(whether worker callbacks should be enabled)
+	AC_ARG_ENABLE(worker-callbacks, [AS_HELP_STRING([--enable-worker-callbacks], [enable worker callbacks])],
 				enable_worker_cb=$enableval, enable_worker_cb=no)
 				enable_worker_cb=$enableval, enable_worker_cb=no)
-AC_MSG_RESULT($enable_worker_cb)
+	AC_MSG_RESULT($enable_worker_cb)
 else
 else
 	# worker sleep/wake-up callbacks only make sense if blocking drivers are enabled
 	# worker sleep/wake-up callbacks only make sense if blocking drivers are enabled
 	enable_worker_cb=no
 	enable_worker_cb=no
@@ -391,7 +393,7 @@ AC_SUBST(CC_OR_MPICC, $cc_or_mpicc)
 AC_ARG_ENABLE(mpi-pedantic-isend, [AS_HELP_STRING([--enable-mpi-pedantic-isend],
 AC_ARG_ENABLE(mpi-pedantic-isend, [AS_HELP_STRING([--enable-mpi-pedantic-isend],
 				   [Enable StarPU MPI pedantic isend])],
 				   [Enable StarPU MPI pedantic isend])],
 				   enable_mpi_pedantic_isend=$enableval, enable_mpi_pedantic_isend=no)
 				   enable_mpi_pedantic_isend=$enableval, enable_mpi_pedantic_isend=no)
-if  test x$enable_mpi_pedantic_isend = xyes; then
+if test x$enable_mpi_pedantic_isend = xyes; then
 	AC_DEFINE(STARPU_MPI_PEDANTIC_ISEND, [1], [enable StarPU MPI pedantic isend])
 	AC_DEFINE(STARPU_MPI_PEDANTIC_ISEND, [1], [enable StarPU MPI pedantic isend])
 fi
 fi
 
 
@@ -499,10 +501,6 @@ fi
 LT_PREREQ([2.2])
 LT_PREREQ([2.2])
 LT_INIT([win32-dll])
 LT_INIT([win32-dll])
 
 
-AC_PROG_INSTALL
-AC_PROG_MKDIR_P
-AC_PROG_LN_S
-
 AC_HEADER_STDC
 AC_HEADER_STDC
 
 
 AC_C_RESTRICT
 AC_C_RESTRICT
@@ -558,8 +556,7 @@ if test x$enable_simgrid = xno ; then
         ],
         ],
         [
         [
             # nothing was specified: look in the path
             # nothing was specified: look in the path
-	    if test x$mpicc_path = x
-	    then
+	    if test x$mpicc_path = x ; then
 		AC_PATH_PROG(mpiexec_path, mpiexec, [no], [$PATH])
 		AC_PATH_PROG(mpiexec_path, mpiexec, [no], [$PATH])
 	    else
 	    else
 		AC_PATH_PROG(mpiexec_path, mpiexec, [no], [$(dirname $mpicc_path):$PATH])
 		AC_PATH_PROG(mpiexec_path, mpiexec, [no], [$(dirname $mpicc_path):$PATH])
@@ -572,8 +569,7 @@ if test x$enable_simgrid = xno ; then
     # We test if MPIEXEC exists
     # We test if MPIEXEC exists
     if test ! -x $mpiexec_path; then
     if test ! -x $mpiexec_path; then
         # if it's not valid, it could be the parameter given to configure.ac was not a full path, let's look for it
         # if it's not valid, it could be the parameter given to configure.ac was not a full path, let's look for it
-	if test x$mpicc_path = x
-	then
+	if test x$mpicc_path = x ; then
             AC_PATH_PROG(mpiexec_path_bis, $mpiexec_path, [no], [$PATH])
             AC_PATH_PROG(mpiexec_path_bis, $mpiexec_path, [no], [$PATH])
 	else
 	else
             AC_PATH_PROG(mpiexec_path_bis, $mpiexec_path, [no], [$(dirname $mpicc_path):$PATH])
             AC_PATH_PROG(mpiexec_path_bis, $mpiexec_path, [no], [$(dirname $mpicc_path):$PATH])
@@ -749,8 +745,7 @@ case "$target" in
     				   enable_native_winthreads=$enableval, enable_native_winthreads=no)
     				   enable_native_winthreads=$enableval, enable_native_winthreads=no)
     ;;
     ;;
 esac
 esac
-if test x"$enable_native_winthreads" != xyes
-then
+if test x"$enable_native_winthreads" != xyes ; then
     INCLUDE_PTHREAD_H='#include <pthread.h>'
     INCLUDE_PTHREAD_H='#include <pthread.h>'
 fi
 fi
 
 
@@ -768,8 +763,7 @@ AC_CHECK_TYPE([struct timespec],
 $INCLUDE_PTHREAD_H
 $INCLUDE_PTHREAD_H
 ])
 ])
 
 
-if test x"$enable_native_winthreads" = xyes
-then
+if test x"$enable_native_winthreads" = xyes ; then
     CPPFLAGS+=" -I$STARPU_SRC_DIR/include/pthread_win32 "
     CPPFLAGS+=" -I$STARPU_SRC_DIR/include/pthread_win32 "
     AC_COMPILE_IFELSE(
     AC_COMPILE_IFELSE(
           [AC_LANG_PROGRAM([[
           [AC_LANG_PROGRAM([[
@@ -897,8 +891,7 @@ AC_CHECK_FUNCS([pread pwrite])
 AC_ARG_ENABLE(hdf5, [AS_HELP_STRING([--disable-hdf5], [disable HDF5 support])],
 AC_ARG_ENABLE(hdf5, [AS_HELP_STRING([--disable-hdf5], [disable HDF5 support])],
                     enable_hdf5=$enableval, enable_hdf5=maybe)
                     enable_hdf5=$enableval, enable_hdf5=maybe)
 
 
-if test "x$enable_hdf5" != xno
-then
+if test "x$enable_hdf5" != xno ; then
 	AC_ARG_WITH(hdf5-include-dir,
 	AC_ARG_WITH(hdf5-include-dir,
 		[AS_HELP_STRING([--with-hdf5-include-dir=<path>],
 		[AS_HELP_STRING([--with-hdf5-include-dir=<path>],
 		[specify where HDF5 headers are installed])],
 		[specify where HDF5 headers are installed])],
@@ -2271,8 +2264,7 @@ if test x$maxnodes = x0 ; then
 	if test x$enable_simgrid = xyes ; then
 	if test x$enable_simgrid = xyes ; then
 		# We need the room for the virtual CUDA/OpenCL devices
 		# We need the room for the virtual CUDA/OpenCL devices
 		nodes=`expr 4 + $nmaxcudadev + $nmaxopencldev + $nmaxmicdev + 1 + $nmaxmpidev`
 		nodes=`expr 4 + $nmaxcudadev + $nmaxopencldev + $nmaxmicdev + 1 + $nmaxmpidev`
-		if test $nodes -gt 32
-		then
+		if test $nodes -gt 32 ; then
 			nodes=32
 			nodes=32
 		fi
 		fi
 	else
 	else
@@ -3026,8 +3018,7 @@ fi
 
 
 if test x$blas_lib = xmaybe -o x$blas_lib = xmkl; then
 if test x$blas_lib = xmaybe -o x$blas_lib = xmkl; then
     # Should we use MKL ?
     # Should we use MKL ?
-    if test -n "$MKLROOT"
-    then
+    if test -n "$MKLROOT" ; then
         CPPFLAGS="${CPPFLAGS} -I$MKLROOT/include"
         CPPFLAGS="${CPPFLAGS} -I$MKLROOT/include"
 	case $host_vendor in
 	case $host_vendor in
 	    *1om) mkl_plat=mic ;;
 	    *1om) mkl_plat=mic ;;
@@ -3349,8 +3340,7 @@ if test "$enable_build_doc" = "yes" ; then
    fi
    fi
 fi
 fi
 available_doc="no"
 available_doc="no"
-if test -f "$srcdir/doc/doxygen/starpu.pdf"
-then
+if test -f "$srcdir/doc/doxygen/starpu.pdf" ; then
    enable_build_doc="no"
    enable_build_doc="no"
    available_doc="yes"
    available_doc="yes"
 fi
 fi
@@ -3578,16 +3568,14 @@ To run the tests, you need to install the OCL implementation of ICD
 and set the variable SOCL_OCL_LIB_OPENCL to the location of the libOpenCL.so.])
 and set the variable SOCL_OCL_LIB_OPENCL to the location of the libOpenCL.so.])
 fi
 fi
 
 
-if test x"$have_valid_hwloc" = xno -a "$enable_simgrid" = "no"
-then
+if test x"$have_valid_hwloc" = xno -a "$enable_simgrid" = "no" ; then
   AC_MSG_NOTICE([
   AC_MSG_NOTICE([
 WARNING: hwloc was not enabled.  If the target machine is hyperthreaded the
 WARNING: hwloc was not enabled.  If the target machine is hyperthreaded the
 performance may be impacted a lot.  It is strongly recommended to install
 performance may be impacted a lot.  It is strongly recommended to install
 hwloc])
 hwloc])
 fi
 fi
 
 
-if test x"$starpu_windows" = xyes -a "x$STARPU_MS_LIB" = "x"
-then
+if test x"$starpu_windows" = xyes -a "x$STARPU_MS_LIB" = "x" ; then
   AC_MSG_NOTICE([
   AC_MSG_NOTICE([
 WARNING: lib was not found, you will not be able to build StarPU applications
 WARNING: lib was not found, you will not be able to build StarPU applications
 with Microsoft Visual Studio. Add to your PATH the directories for MSVC, e.g
 with Microsoft Visual Studio. Add to your PATH the directories for MSVC, e.g

+ 3 - 3
examples/stencil/Makefile.am

@@ -1,7 +1,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
 #
 # Copyright (C) 2011,2016-2017                           Inria
 # Copyright (C) 2011,2016-2017                           Inria
-# Copyright (C) 2011-2017                                CNRS
+# Copyright (C) 2011-2018                                CNRS
 # Copyright (C) 2010-2017                                Université de Bordeaux
 # Copyright (C) 2010-2017                                Université de Bordeaux
 #
 #
 # StarPU is free software; you can redistribute it and/or modify
 # StarPU is free software; you can redistribute it and/or modify
@@ -185,7 +185,7 @@ CLEANFILES = *.gcno *.gcda *.xpm starpu_idle_microsec.log
 
 
 
 
 .out.out2:
 .out.out2:
-	grep '^|' $< | tr -d ' ' > $@
+	$(GREP) '^|' $< | tr -d ' ' > $@
 
 
 .out2.xpm:
 .out2.xpm:
 	( width=$$(expr $$(head -n 1 < $< | wc -c) - 1) ; \
 	( width=$$(expr $$(head -n 1 < $< | wc -c) - 1) ; \
@@ -202,7 +202,7 @@ CLEANFILES = *.gcno *.gcda *.xpm starpu_idle_microsec.log
 	echo "\"5	c #00FFFF\"," ; \
 	echo "\"5	c #00FFFF\"," ; \
 	echo "\"|	c #FFFFFF\"," ; \
 	echo "\"|	c #FFFFFF\"," ; \
 	echo "\"*	c #000000\"," ; \
 	echo "\"*	c #000000\"," ; \
-	< $< sed -e 's/^/"/' -e 's/$$/",/' | sed -e '$$s/",$$/"};/' ) > $@
+	< $< $(SED) -e 's/^/"/' -e 's/$$/",/' | $(SED) -e '$$s/",$$/"};/' ) > $@
 
 
 view:
 view:
 	feh --zoom 800 -F 0.xpm 0.5.xpm 1.xpm 2.xpm 3.xpm 4.xpm 6.xpm mpi.xpm
 	feh --zoom 800 -F 0.xpm 0.5.xpm 1.xpm 2.xpm 3.xpm 4.xpm 6.xpm mpi.xpm

+ 3 - 3
src/Makefile.am

@@ -2,7 +2,7 @@
 #
 #
 # Copyright (C) 2011-2017                                Inria
 # Copyright (C) 2011-2017                                Inria
 # Copyright (C) 2009-2018                                Université de Bordeaux
 # Copyright (C) 2009-2018                                Université de Bordeaux
-# Copyright (C) 2010-2015,2017                           CNRS
+# Copyright (C) 2010-2015,2017,2018                           CNRS
 #
 #
 # StarPU is free software; you can redistribute it and/or modify
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
 # it under the terms of the GNU Lesser General Public License as published by
@@ -400,9 +400,9 @@ endif
 # static inline definition
 # static inline definition
 dist-hook:
 dist-hook:
 	failed=0 ; \
 	failed=0 ; \
-	for i in $$( grep "static inline" $$(find $(srcdir) -name \*.h) | sed -e 's/.*static inline //g' | grep -v ENAME | sed -e 's/[^(]* \(\|\*\)\([^ (]*\)(.*/\2/' | grep -v _starpu_spin_init) ; do \
+	for i in $$( $(GREP) "static inline" $$(find $(srcdir) -name \*.h) | $(SED) -e 's/.*static inline //g' | $(GREP) -v ENAME | $(SED) -e 's/[^(]* \(\|\*\)\([^ (]*\)(.*/\2/' | $(GREP) -v _starpu_spin_init) ; do \
 		for j in .libs/*.o ; do \
 		for j in .libs/*.o ; do \
-			nm $$j | grep "U $$i$$" && { echo $$j ; failed=1 ; } ; \
+			nm $$j | $(GREP) "U $$i$$" && { echo $$j ; failed=1 ; } ; \
 		done ; \
 		done ; \
 	done ; \
 	done ; \
 	[ $$failed == 0 ]
 	[ $$failed == 0 ]