Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compilation fix on SMPI with WIN32
authornavarro <pierre.navarro@imag.fr>
Wed, 24 Oct 2012 20:03:53 +0000 (13:03 -0700)
committernavarro <pierre.navarro@imag.fr>
Thu, 25 Oct 2012 17:24:47 +0000 (10:24 -0700)
16 files changed:
examples/smpi/CMakeLists.txt
examples/smpi/MM/CMakeLists.txt
examples/smpi/MM/MM_mpi.c
examples/smpi/NAS/MPI_dummy/mpi_dummy.c
examples/smpi/bcbench.c
examples/smpi/replay/replay.c
examples/smpi/tracing/smpi_traced.c
examples/smpi/tracing/smpi_traced_simple.c
src/smpi/smpicc.in
teshsuite/smpi/CMakeLists.txt
teshsuite/smpi/alltoall2.c
teshsuite/smpi/alltoall_basic.c
teshsuite/smpi/alltoallv.c
teshsuite/smpi/indexed_test.c
teshsuite/smpi/sendrecv.c
teshsuite/smpi/ttest01.c

index eaeb8d0..70df6b0 100644 (file)
@@ -1,7 +1,11 @@
 cmake_minimum_required(VERSION 2.6)
 
 if(enable_smpi)
-  set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/bin/smpicc")
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else(WIN32)
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/bin/smpicc")
+  endif(WIN32)
 
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
index af62a30..e4ea2c2 100644 (file)
@@ -2,19 +2,16 @@ cmake_minimum_required(VERSION 2.6)
 
 if(enable_smpi)
   set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/bin/smpicc")
-
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
   include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
 
-add_executable(MM_mpi MM_mpi.c 2.5D_MM.c Summa.c Matrix_init.c)
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(MM_mpi simgrid pthread m smpi)
-else()
-  target_link_libraries(MM_mpi simgrid smpi)
-endif()
+  if(NOT WIN32)
+    add_executable(MM_mpi MM_mpi.c 2.5D_MM.c Summa.c Matrix_init.c)
+    ### Add definitions for compile
+    target_link_libraries(MM_mpi simgrid pthread m smpi)
+  else()
+    target_link_libraries(MM_mpi simgrid smpi)
+  endif()
 endif()
 
 set(tesh_files
index df0b9bc..d112cde 100644 (file)
 /*int sched_setaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask);
   int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask);
  */
+#include <stdio.h>
+#include <string.h>
 #include <mpi.h>
 #include <math.h>
 #include <getopt.h>
-#include <stdio.h>
-#include <string.h>
 
  XBT_LOG_NEW_DEFAULT_CATEGORY(MM_mpi,
                              "Messages specific for this msg example");
index d2cbfb8..4cb7f06 100644 (file)
@@ -1,8 +1,6 @@
+#include <stdlib.h>
 #include "mpi.h"
 #include "wtime.h"
-#include <stdlib.h>
-
-
 
 void  mpi_error( void )
 {
index 75defac..5cd2f64 100644 (file)
@@ -8,6 +8,11 @@
 #include <stdlib.h>
 #include <mpi.h>
 
+#ifdef _WIN32
+  #define srandom srand
+  #define random rand
+#endif
+
 #define GETTIMEOFDAY_ERROR 1
 
 #define N_START 1
index 3aad3c2..f508f9d 100644 (file)
@@ -4,6 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <stdio.h>
 #include "smpi/smpi.h"
 
 int main(int argc, char *argv[])
index f23bb7b..6c9e8fe 100644 (file)
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "mpi.h"
 #include <stdio.h>
+#include "mpi.h"
 #include "instr/instr.h"
 
 #define DATATOSENT 100000
index 1de1115..ff92c0e 100644 (file)
@@ -3,8 +3,9 @@
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
-#include <mpi.h>
+
 #include <stdio.h>
+#include <mpi.h>
 
 int main(int argc, char *argv[])
 {
index a1d1de1..c5627b3 100755 (executable)
@@ -1,11 +1,17 @@
 #! /bin/bash
 
 CC=@CMAKE_C_COMPILER@
-CFLAGS="-O2 -Dmain=smpi_simulated_main"
 
-INCLUDEARGS="-I@includedir@ -I@includedir@/smpi"
+INCLUDEARGS="-I@includedir@ -I@includedir@/smpi -I@CMAKE_BINARY_DIR@/include"
 CMAKE_LINKARGS="-L@CMAKE_LINKARGS@"
+
+if [ @WIN32@ != 1 ]; then
 LINKARGS="-lsimgrid -lsmpi -lm"
+CFLAGS="-O2 -Dmain=smpi_simulated_main"
+else
+CFLAGS="-O2 -include @includedir@/smpi/smpi_main.h"
+LINKARGS="@CMAKE_BINARY_DIR@\lib\libsimgrid.dll @CMAKE_BINARY_DIR@\lib\libsmpi.dll"
+fi
 
 CMDLINE=""
 while [ -n "$1" ]; do
index 6d9731a..0396a4a 100644 (file)
@@ -1,10 +1,14 @@
 cmake_minimum_required(VERSION 2.6)
 
 if(enable_smpi)
-  set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/bin/smpicc")
-
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else(WIN32)
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/bin/smpicc")
+  endif(WIN32)
+  
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
+  
   include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
 
   add_executable(alltoall2 alltoall2.c )
@@ -19,7 +23,6 @@ if(enable_smpi)
   add_executable(scatter scatter.c)
   add_executable(reduce reduce.c)
   add_executable(split split.c)
-  add_executable(dsend dsend.c)
   add_executable(smpi_sendrecv sendrecv.c)
   add_executable(ttest01 ttest01.c)
   add_executable(vector_test vector_test.c)
@@ -39,7 +42,6 @@ if(enable_smpi)
   target_link_libraries(scatter m simgrid smpi )
   target_link_libraries(reduce m simgrid smpi )
   target_link_libraries(split m simgrid smpi )
-  target_link_libraries(dsend m simgrid smpi )
   target_link_libraries(smpi_sendrecv m simgrid smpi )
   target_link_libraries(ttest01 m simgrid smpi )
   target_link_libraries(vector_test m simgrid smpi )
@@ -48,8 +50,15 @@ if(enable_smpi)
   target_link_libraries(struct_test m simgrid smpi )
 
   set_target_properties(smpi_sendrecv PROPERTIES RENAME sendrecv)
+
+  if(NOT WIN32)
+    add_executable(dsend dsend.c)
+    target_link_libraries(dsend m simgrid smpi )
+  endif()
+
 endif()
 
+
 set(tesh_files
   ${tesh_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/bcast.tesh
index ef2068e..34e5912 100644 (file)
 
 ****************************************************************************
 */
-#include "mpi.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-
+#include "mpi.h"
 
 #define MAXLEN 10000
 
index 485752e..ad25e7a 100644 (file)
@@ -4,11 +4,11 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "mpi.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+#include "mpi.h"
 
 #ifndef EXIT_SUCCESS
 #define EXIT_SUCCESS 0
index 492db4e..f2717b9 100644 (file)
@@ -3,11 +3,11 @@
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
-#include "mpi.h"
 #include <string.h>
 
 #include <stdlib.h>
 #include <stdio.h>
+#include "mpi.h"
 
 /*
    This program tests MPI_Alltoallv by having processor i send different
index e557575..3afb440 100644 (file)
@@ -1,5 +1,5 @@
-#include "mpi.h"
 #include <stdio.h>
+#include "mpi.h"
 
 int main(int argc, char *argv[])
 {
index ae9e297..1e4962d 100644 (file)
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "mpi.h"
 #include <stdio.h>
+#include "mpi.h"
 
 static int test(int myid, int numprocs)
 {
index ada55b9..981d2a2 100644 (file)
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "mpi.h"
 #include <stdio.h>
+#include "mpi.h"
 #include "instr/instr.h"
 
 #define DATATOSENT 100000000