Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a dependency for smpi.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Nov 2010 10:14:10 +0000 (10:14 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Nov 2010 10:14:10 +0000 (10:14 +0000)
Need f2c.h to compile.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8611 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/Modules/FindF2c.cmake [new file with mode: 0644]
buildtools/Cmake/PrintArgs.cmake

index ba54971..4e91672 100644 (file)
@@ -140,6 +140,23 @@ if(enable_ruby)
        
 endif(enable_ruby)
 
+#--------------------------------------------------------------------------------------------------
+### Initialize of Smpi
+
+if(enable_smpi)
+       include(FindF2c)
+       if(HAVE_F2C_H)
+       string(REGEX MATCH "-I${HAVE_F2C_H} " operation "${CMAKE_C_FLAGS}")
+          if(NOT operation)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${HAVE_F2C_H} ")
+          endif(NOT operation)
+       else(HAVE_F2C_H)
+               message("-- Smpi Need \"f2c.h\".")
+               message("-- Please install f2c before use smpi or set LD_LIBRARY_PATH to \"f2c.h\".")
+               message(FATAL_ERROR "SMPI DEPENDENCIES")
+       endif(HAVE_F2C_H)       
+endif(enable_smpi)
+
 #--------------------------------------------------------------------------------------------------
 ### Initialize of CONTEXT JAVA
 
diff --git a/buildtools/Cmake/Modules/FindF2c.cmake b/buildtools/Cmake/Modules/FindF2c.cmake
new file mode 100644 (file)
index 0000000..75121eb
--- /dev/null
@@ -0,0 +1,39 @@
+find_path(HAVE_F2C_H f2c.h
+    HINTS
+    $ENV{LD_LIBRARY_PATH}
+    PATH_SUFFIXES include/
+    PATHS
+    /opt
+    /opt/local
+    /opt/csw
+    /sw
+    /usr
+)
+
+find_program(F2C_EXE 
+       NAME f2c
+    PATH_SUFFIXES bin/
+    PATHS
+    /opt
+    /opt/local
+    /opt/csw
+    /sw
+    /usr
+)
+
+find_library(HAVE_F2C_LIB
+    NAME f2c
+    HINTS
+    $ENV{LD_LIBRARY_PATH}
+    PATH_SUFFIXES lib/
+    PATHS
+    /opt
+    /opt/local
+    /opt/csw
+    /sw
+    /usr
+)
+
+mark_as_advanced(HAVE_F2C_H)
+mark_as_advanced(F2C_EXE)
+mark_as_advanced(HAVE_F2C_LIB)
\ No newline at end of file
index 11cfe5a..3c91cfd 100644 (file)
@@ -154,6 +154,12 @@ if(enable_print_message)
     message("PATH_LIBPCRE : ${PATHLIBPCRE}")
     message("PATH_PCRE_H  : ${PATH_PCRE_H}")
        endif(HAVE_PCRE_LIB)
+       if(enable_smpi)
+       message("")
+       message("HAVE_F2C_H     : ${HAVE_F2C_H}")
+       message("F2C_EXE                : ${F2C_EXE}")
+       message("HAVE_F2C_LIB   : ${HAVE_F2C_LIB}")
+       endif(enable_smpi)
     message("")
     message("LIB_EXE : ${LIB_EXE}")
        message("________________________________________________________________________________")