From 4fb1f678c8da43cdf1bfcc6108883ef2a4cea952 Mon Sep 17 00:00:00 2001 From: navarro Date: Fri, 19 Oct 2012 17:53:38 +0200 Subject: [PATCH] Fix compilation error for smpi. Can enable smpi whitout f2c --- buildtools/Cmake/CompleteInFiles.cmake | 4 +--- buildtools/Cmake/Modules/FindF2c.cmake | 5 ++++- buildtools/Cmake/PrintArgs.cmake | 3 ++- include/smpi/smpif.h.in | 8 ++++---- src/smpi/private.h | 2 -- src/surf/maxmin.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index fc3baef7f5..f020bf1ea0 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -80,9 +80,7 @@ if(enable_gtnets) endif(enable_gtnets) if(enable_smpi) include(FindF2c) - if(HAVE_F2C_H) - SET(HAVE_SMPI 1) - endif(HAVE_F2C_H) + SET(HAVE_SMPI 1) endif(enable_smpi) if(enable_lua) include(FindLua51Simgrid) diff --git a/buildtools/Cmake/Modules/FindF2c.cmake b/buildtools/Cmake/Modules/FindF2c.cmake index bef6bbc9c5..e73fcc4c71 100644 --- a/buildtools/Cmake/Modules/FindF2c.cmake +++ b/buildtools/Cmake/Modules/FindF2c.cmake @@ -52,8 +52,11 @@ else(HAVE_F2C_LIB) message(STATUS "Looking for lib f2c - not found") endif(HAVE_F2C_LIB) +message(STATUS "Looking for bin f2c") if(F2C_EXE) message(STATUS "Found F2C: ${F2C_EXE}") +else(F2C_EXE) + message(STATUS "Looking for bin f2c - not found") endif(F2C_EXE) mark_as_advanced(HAVE_F2C_H) @@ -73,4 +76,4 @@ endif(HAVE_F2C_H) set(SMPI_F2C 0) if(HAVE_F2C_H AND F2C_EXE AND HAVE_F2C_LIB) set(SMPI_F2C 1) -endif(HAVE_F2C_H AND F2C_EXE AND HAVE_F2C_LIB) \ No newline at end of file +endif(HAVE_F2C_H AND F2C_EXE AND HAVE_F2C_LIB) diff --git a/buildtools/Cmake/PrintArgs.cmake b/buildtools/Cmake/PrintArgs.cmake index 8518ffefe9..26e15db2f0 100644 --- a/buildtools/Cmake/PrintArgs.cmake +++ b/buildtools/Cmake/PrintArgs.cmake @@ -95,7 +95,8 @@ if(NOT APPLE AND NOT WIN32) message(" NS-3 path ...........: ${ns3_path}") endif(NOT APPLE AND NOT WIN32) message(" Compile Lua .........: ${HAVE_LUA}") -message(" Compile Smpi ........: ${enable_smpi}") +message(" Compile Smpi ........: ${HAVE_SMPI}") +message(" Compile Smpi f77 ....: ${SMPI_F2C}") message(" Compile Static ......: ${enable_lib_static}") message("") message(" Maintainer mode .....: ${enable_maintainer_mode}") diff --git a/include/smpi/smpif.h.in b/include/smpi/smpif.h.in index bbcb661ac1..c407af8346 100644 --- a/include/smpi/smpif.h.in +++ b/include/smpi/smpif.h.in @@ -7,11 +7,9 @@ #ifndef SMPIF_H #define SMPIF_H -#cmakedefine HAVE_F2C_H @HAVE_SMPI_F2C_H@ +#cmakedefine SMPI_F2C @SMPI_F2C@ -#ifndef HAVE_F2C_H -#error F2C is mandatory -#endif +#ifdef SMPI_F2C #include #include @@ -45,3 +43,5 @@ XBT_PUBLIC(int) smpi_global_size(void); #endif + +#endif // SMPI_F2C diff --git a/src/smpi/private.h b/src/smpi/private.h index 71a9ec831e..74b35689e7 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -11,9 +11,7 @@ #include "xbt/xbt_os_time.h" #include "simgrid/simix.h" #include "smpi/smpi.h" -#ifdef SMPI_F2C #include "smpi/smpif.h" -#endif #include "smpi/smpi_cocci.h" #include "instr/instr_private.h" diff --git a/src/surf/maxmin.c b/src/surf/maxmin.c index dc00903ec1..ea964d5af2 100644 --- a/src/surf/maxmin.c +++ b/src/surf/maxmin.c @@ -21,7 +21,7 @@ typedef struct s_dyn_light { int size; } s_dyn_light_t, *dyn_light_t; -XBT_PUBLIC(double) sg_maxmin_precision = 0.00001; +XBT_EXPORT_NO_IMPORT(double) sg_maxmin_precision = 0.00001; static void *lmm_variable_mallocator_new_f(void); static void lmm_variable_mallocator_free_f(void *var); -- 2.20.1