Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Look for gfortran before enabling support for smpif90.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 7 Nov 2013 20:45:53 +0000 (21:45 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 7 Nov 2013 20:47:36 +0000 (21:47 +0100)
(cherry picked from commit 85b2dce67ce8e0e1b4c68f6fbbf4d6f427bca3ff)

buildtools/Cmake/AddTests.cmake
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/Modules/FindGFortran.cmake [new file with mode: 0644]
buildtools/Cmake/PrintArgs.cmake
examples/smpi/energy/f90/CMakeLists.txt
src/smpi/smpif90.in
teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt

index 41f7fae..ee959c3 100644 (file)
@@ -438,9 +438,9 @@ if(NOT enable_memcheck)
     ADD_TEST(smpi-energy                        ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh)
     if(SMPI_F2C)
       ADD_TEST(smpi-energy-f77                  ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh)
     ADD_TEST(smpi-energy                        ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh)
     if(SMPI_F2C)
       ADD_TEST(smpi-energy-f77                  ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh)
-      if(NOT HAVE_MC)
-        ADD_TEST(smpi-energy-f90                ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90/energy.tesh)
-      endif()
+    endif()
+    if(SMPI_F90)
+      ADD_TEST(smpi-energy-f90                  ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90/energy.tesh)
     endif()
 
     if(HAVE_TRACING)
     endif()
 
     if(HAVE_TRACING)
@@ -530,10 +530,10 @@ if(NOT enable_memcheck)
     if(SMPI_F2C)
       ADD_TEST(smpi-mpich3-thread-f77           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=contexts/stack_size:8000)
       set_tests_properties(smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     if(SMPI_F2C)
       ADD_TEST(smpi-mpich3-thread-f77           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=contexts/stack_size:8000)
       set_tests_properties(smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
-      if(NOT HAVE_MC)
-        ADD_TEST(smpi-mpich3-thread-f90         ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=contexts/factory:thread)
-        set_tests_properties(smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
-      endif()
+    endif()
+    if(SMPI_F90)
+      ADD_TEST(smpi-mpich3-thread-f90           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=contexts/factory:thread)
+      set_tests_properties(smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
 
     endif()
   endif()
 
index eaf6c29..21f068f 100644 (file)
@@ -78,10 +78,6 @@ set(HAVE_GTNETS 0)
 if(enable_gtnets)
   include(FindGTnets)
 endif()
 if(enable_gtnets)
   include(FindGTnets)
 endif()
-if(enable_smpi)
-  include(FindF2c)
-  SET(HAVE_SMPI 1)
-endif()
 if(enable_java)
   find_package(Java REQUIRED COMPONENTS Runtime Development)
   find_package(JNI REQUIRED)
 if(enable_java)
   find_package(Java REQUIRED COMPONENTS Runtime Development)
   find_package(JNI REQUIRED)
@@ -221,6 +217,13 @@ else()
   SET(MMALLOC_WANT_OVERRIDE_LEGACY 0)
 endif()
 
   SET(MMALLOC_WANT_OVERRIDE_LEGACY 0)
 endif()
 
+# must come after having set HAVE_MC (FindGFortran uses it)
+if(enable_smpi)
+  include(FindF2c)
+  include(FindGFortran)
+  SET(HAVE_SMPI 1)
+endif()
+
 #--------------------------------------------------------------------------------------------------
 ### Check for some architecture dependent values
 CHECK_TYPE_SIZE(int SIZEOF_INT)
 #--------------------------------------------------------------------------------------------------
 ### Check for some architecture dependent values
 CHECK_TYPE_SIZE(int SIZEOF_INT)
index 7747b9c..c8652bd 100644 (file)
@@ -970,6 +970,7 @@ set(CMAKE_SOURCE_FILES
   buildtools/Cmake/MakeLib.cmake
   buildtools/Cmake/MakeLibWin.cmake
   buildtools/Cmake/Modules/FindF2c.cmake
   buildtools/Cmake/MakeLib.cmake
   buildtools/Cmake/MakeLibWin.cmake
   buildtools/Cmake/Modules/FindF2c.cmake
+  buildtools/Cmake/Modules/FindGFortran.cmake
   buildtools/Cmake/Modules/FindGTnets.cmake
   buildtools/Cmake/Modules/FindGraphviz.cmake
   buildtools/Cmake/Modules/FindLibunwind.cmake
   buildtools/Cmake/Modules/FindGTnets.cmake
   buildtools/Cmake/Modules/FindGraphviz.cmake
   buildtools/Cmake/Modules/FindLibunwind.cmake
diff --git a/buildtools/Cmake/Modules/FindGFortran.cmake b/buildtools/Cmake/Modules/FindGFortran.cmake
new file mode 100644 (file)
index 0000000..b15409e
--- /dev/null
@@ -0,0 +1,32 @@
+find_program(GFORTRAN_EXE
+  NAME gfortran
+  PATH_SUFFIXES bin/
+  PATHS
+  /opt
+  /opt/local
+  /opt/csw
+  /sw
+  /usr
+  )
+
+mark_as_advanced(GFORTRAN_EXE)
+
+message(STATUS "Looking for bin gfortran")
+if(GFORTRAN_EXE)
+  message(STATUS "Found gfortran: ${GFORTRAN_EXE}")
+else()
+  message(STATUS "Looking for bin gfortran - not found")
+endif()
+
+set(SMPI_F90 0)
+if(GFORTRAN_EXE)
+  if(HAVE_MC)
+    message("-- Fortran 90 support for smpi is currently not compatible with model checking.")
+  else()
+    set(SMPI_F90 1)
+  endif()
+endif()
+
+if(NOT SMPI_F90)
+  message("-- Fortran 90 support for smpi is disabled.")
+endif()
index 200f671..054222c 100644 (file)
@@ -111,6 +111,7 @@ message("        Compile Lua .........: ${HAVE_LUA}")
 message("        Compile Smpi ........: ${HAVE_SMPI}")
 message("        Compile MPI testsuite: ${enable_smpi_MPICH3_testsuite}")
 message("        Compile Smpi f77 ....: ${SMPI_F2C}")
 message("        Compile Smpi ........: ${HAVE_SMPI}")
 message("        Compile MPI testsuite: ${enable_smpi_MPICH3_testsuite}")
 message("        Compile Smpi f77 ....: ${SMPI_F2C}")
+message("        Compile Smpi f90 ....: ${SMPI_F90}")
 message("        Compile Static ......: ${enable_lib_static}")
 message("")
 message("        Maintainer mode .....: ${enable_maintainer_mode}")
 message("        Compile Static ......: ${enable_lib_static}")
 message("")
 message("        Maintainer mode .....: ${enable_maintainer_mode}")
index 03d1288..84b55b5 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND SMPI_F90)
   set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
 
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
   set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
 
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
index 5dd979e..39ed749 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/bash
 
 #! /bin/bash
 
-F90=gfortran
+F90=@GFORTRAN_EXE@
 
 INCLUDEARGS="@includeflag@"
 CMAKE_LINKARGS="-L@libdir@"
 
 INCLUDEARGS="@includeflag@"
 CMAKE_LINKARGS="-L@libdir@"
index 1d9cc9e..b2da152 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F90)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index a8a0b84..ca51980 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F90)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index d64be2f..3e4ec84 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F90)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 682e23c..dfed73b 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F90)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()