Browse Source

configure: detect availability of header file f77.h and compile fortran example only when available

Nathalie Furmento 14 years ago
parent
commit
5807291b01
2 changed files with 27 additions and 9 deletions
  1. 11 0
      configure.ac
  2. 16 9
      examples/Makefile.am

+ 11 - 0
configure.ac

@@ -871,6 +871,17 @@ PKG_CHECK_MODULES([HWLOC], [hwloc], [
 ], [:])
 AC_SUBST(HWLOC_REQUIRES)
 
+# is the header file f77.h available ?
+have_f77_h=yes
+AC_CHECK_HEADER([f77.h],,[have_f77_h=no])
+AC_MSG_CHECKING(whether header file f77.h is available)
+AC_MSG_RESULT($have_f77_h)
+AC_SUBST(STARPU_HAVE_F77_H, $have_f77_h)
+AM_CONDITIONAL(STARPU_HAVE_F77_H, test x$have_f77_h = xyes)
+if test x$have_f77_h = xyes; then
+        AC_DEFINE([STARPU_HAVE_F77_H], [1], [Define to 1 if you have the <f77.h> header file.])
+fi
+
 AC_CONFIG_COMMANDS([executable-scripts], [chmod +x ]tests/regression/regression.sh tests/coverage/coverage_test.sh)
 AC_CONFIG_FILES(tests/regression/regression.sh tests/regression/profiles tests/regression/profiles.build.only tests/coverage/coverage_test.sh)
 AC_CONFIG_HEADER(src/common/config.h include/starpu_config.h)

+ 16 - 9
examples/Makefile.am

@@ -141,13 +141,7 @@ basic_examples_hello_world_SOURCES =		\
 	basic_examples/hello_world.c
 
 examplebin_PROGRAMS +=				\
-	basic_examples/vector_scal		\
-	basic_examples/vector_scal_fortran
-
-basic_examples_vector_scal_fortran_SOURCES =	\
-	basic_examples/vector_scal_fortran.F	\
-	basic_examples/vector_scal_c.c		\
-	basic_examples/vector_scal_cpu.c
+	basic_examples/vector_scal
 
 basic_examples_vector_scal_SOURCES =		\
 	basic_examples/vector_scal.c		\
@@ -156,8 +150,6 @@ basic_examples_vector_scal_SOURCES =		\
 if STARPU_USE_CUDA
 basic_examples_vector_scal_SOURCES +=		\
 	basic_examples/vector_scal_cuda.cu
-basic_examples_vector_scal_fortran_SOURCES +=	\
-	basic_examples/vector_scal_cuda.cu
 endif
 
 if STARPU_USE_OPENCL
@@ -168,6 +160,21 @@ endif
 nobase_STARPU_OPENCL_DATA_DATA = \
 	basic_examples/vector_scal_opencl_codelet.cl
 
+if STARPU_HAVE_F77_H
+examplebin_PROGRAMS +=				\
+	basic_examples/vector_scal_fortran
+
+basic_examples_vector_scal_fortran_SOURCES =	\
+	basic_examples/vector_scal_fortran.F	\
+	basic_examples/vector_scal_c.c		\
+	basic_examples/vector_scal_cpu.c
+
+if STARPU_USE_CUDA
+basic_examples_vector_scal_fortran_SOURCES +=	\
+	basic_examples/vector_scal_cuda.cu
+endif
+endif
+
 examplebin_PROGRAMS +=				\
 	basic_examples/mult