From 47a6b2b4bbfa3f2acb62c6a0a48569f3b5194f15 Mon Sep 17 00:00:00 2001 From: navarrop Date: Tue, 23 Nov 2010 10:14:10 +0000 Subject: [PATCH] Add a dependency for smpi. 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 | 17 +++++++++++ buildtools/Cmake/Modules/FindF2c.cmake | 39 ++++++++++++++++++++++++++ buildtools/Cmake/PrintArgs.cmake | 6 ++++ 3 files changed, 62 insertions(+) create mode 100644 buildtools/Cmake/Modules/FindF2c.cmake diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index ba549716ee..4e916724e1 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -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 index 0000000000..75121eb39b --- /dev/null +++ b/buildtools/Cmake/Modules/FindF2c.cmake @@ -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 diff --git a/buildtools/Cmake/PrintArgs.cmake b/buildtools/Cmake/PrintArgs.cmake index 11cfe5a773..3c91cfd694 100644 --- a/buildtools/Cmake/PrintArgs.cmake +++ b/buildtools/Cmake/PrintArgs.cmake @@ -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("________________________________________________________________________________") -- 2.20.1