+++ /dev/null
-# This file automatize the testing of SimGrid on Windows using the appveyor.com continuous integration service
-#
-# Build logs: https://ci.appveyor.com/project/simgrid/simgrid
-
-# Documentation: https://www.appveyor.com/docs/
-# https://www.appveyor.com/docs/installed-software/
-
-image:
- - Visual Studio 2019
-# - Ubuntu
-
-version: "{build}"
-clone_depth: 1
-
-# scripts that are called at very beginning, before repo cloning
-init:
-- git config --global core.longpaths true
-- git config --global core.autocrlf input
-
-branches:
- only:
- - master
- - appveyor
-
-environment:
- global:
- BOOST_ROOT: C:\Libraries\boost_1_77_0
-
-install:
-# Strawberry perl is the one to work with gcc; AppVeyor provides ActiveState perl, which is the one to work with visual.
-# This package is so outdated and broken that we cannot use it anymore. So we build without perl
-# - choco install --limit-output strawberryperl --version 5.20.1.1
-# - SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
-# We need python v3
-- cmd: SET PATH=C:\Python37-x64;%PATH% # We need python v3
-# Ugly hack to ignore versions 3.8 and later of Python
-- rename "C:\Python38-x64\python.exe" "python-ignored.exe"
-- rename "C:\Python39-x64\python.exe" "python-ignored.exe"
-- rename "C:\Python310-x64\python.exe" "python-ignored.exe"
-- rename "C:\Python311-x64\python.exe" "python-ignored.exe"
-# Use the mingw-w64 provided by Appveyor (must be placed before Perl in the path)
-- cmd: SET PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\;%PATH%
-# Work around a bug on appveyor where the default sh is not the one I expect
-- rename "C:\Program Files\Git\usr\bin\sh.exe" "sh-ignored.exe"
-# We need pybind11. SimGrid will pick it automatically if the subdir is here
-- cmd: git clone --branch stable --depth=1 https://github.com/pybind/pybind11.git
-
-before_build:
- - cmd: if not exist C:\"Program Files"\Eigen\include\eigen3\Eigen\Core (
- curl -LO https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz &&
- cmake -E tar zxf eigen-3.4.0.tar.gz &&
- cd eigen-3.4.0 &&
- mkdir build &&
- cd build &&
- cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\projects .. &&
- cmake --build . --target install &&
- cd ..\..
- ) else (echo Using cached Eigen3)
-
-build_script:
-- cmake -G "MinGW Makefiles" -Denable_documentation=OFF -Denable_java=ON -Denable_msg=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .
-- mingw32-make.exe VERBOSE=1 java-all python-bindings # Only the Java and Python parts
-- ctest --output-on-failure -R java
-- ctest --output-on-failure -R python
-
-artifacts:
-- path: simgrid.jar
- name: jarfile
-
-# IRC notifications, even if https://github.com/appveyor/ci/issues/88 is not closed yet
-on_failure:
- - "python tools/appveyor-irc-notify.py simgrid [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_red}Failed,Details: {build_url},Commit: {commit_url}"
-#on_success:
-# - "python tools/appveyor-irc-notify.py simgrid [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_green}Succeeded,Details: {build_url},Commit: {commit_url}"
set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}")
endif()
+if(WIN32 OR MINGW)
+ message(FATAL "SimGrid does not build on native windows, nor with MinGW. Please use WSL2 instead.")
+endif()
+
message(STATUS "Configuring SimGrid v${release_version}")
set(SIMGRID_VERSION_STRING "SimGrid version ${release_version}")
### SET THE LIBRARY EXTENSION
if(APPLE)
set(LIB_EXE "dylib")
-elseif(WIN32)
- set(LIB_EXE "a")
- set(BIN_EXE ".exe")
else()
set(LIB_EXE "so")
endif()
set(INTERNAL_INCLUDES ${INTERNAL_INCLUDES} /usr/include/)
endif()
-if(WIN32)
- set(CMAKE_INCLUDE_WIN "${CMAKE_C_COMPILER}")
- set(CMAKE_LIB_WIN "${CMAKE_C_COMPILER}")
- string(REGEX REPLACE "/bin/gcc.*" "/include" CMAKE_INCLUDE_WIN "${CMAKE_INCLUDE_WIN}")
- string(REGEX REPLACE "/bin/gcc.*" "/lib" CMAKE_LIB_WIN "${CMAKE_LIB_WIN}")
- set(INTERNAL_INCLUDES ${INTERNAL_INCLUDES} ${CMAKE_INCLUDE_WIN})
- unset(CMAKE_INCLUDE_WIN)
-endif()
-
# library dependency cannot start with a space (CMP0004), so initialize it with something that is never deactivated.
set(SIMGRID_DEP "-lm")
set(SIMGRID_PROCESSOR_i686 0)
set(SIMGRID_PROCESSOR_x86_64 1)
ENDIF()
- if (WIN32)
- message(STATUS "Disable fast raw contexts on Windows.")
- elseif(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
message(STATUS "Disable fast raw contexts on x32 ABI.")
else()
set(HAVE_RAW_CONTEXTS 1)
set(SIMGRID_HAVE_MSG 1)
endif()
-if(WIN32)
- set(Boost_USE_STATIC_LIBS 1)
-endif()
-
set(HAVE_PAPI 0)
if(enable_smpi_papi)
include(FindPAPI)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE")
-elseif(MINGW)
- # Use the GNU version of unusual modifiers like PRIx64
- add_definitions(-D__USE_MINGW_ANSI_STDIO=1)
- set(CMAKE_REQUIRED_DEFINITIONS "-D__USE_MINGW_ANSI_STDIO=1")
else()
set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
endif()
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
+if(NOT HAVE_SYSCONF)
+ message(FATAL_ERROR "Cannot build without sysconf.")
+endif()
CHECK_FUNCTION_EXISTS(process_vm_readv HAVE_PROCESS_VM_READV)
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
CHECK_FUNCTION_EXISTS(mremap HAVE_MREMAP)
CHECK_SYMBOL_EXISTS(vasprintf stdio.h HAVE_VASPRINTF)
-if(MINGW)
- # The detection of vasprintf fails on MinGW, assumingly because it's
- # defined as an inline function in stdio.h instead of a regular
- # function. So force the result to be 1 despite of the test.
- set(HAVE_VASPRINTF 1)
-endif()
CHECK_INCLUDE_FILE("sys/sendfile.h" HAVE_SENDFILE_H)
CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
if(enable_smpi)
SET(HAVE_SMPI 1)
- if(WIN32)
- message (STATUS "Warning: no support for SMPI automatic privatization on Windows.")
- SET(HAVE_PRIVATIZATION 0)
- else()
- SET(HAVE_PRIVATIZATION 1)
- endif()
+ SET(HAVE_PRIVATIZATION 1)
else()
SET(HAVE_SMPI 0)
endif()
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpi${script}.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script} @ONLY)
endforeach()
-if(NOT WIN32)
- foreach(script cc cxx ff f90 run)
- execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpi${script})
- execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script})
- endforeach()
-endif()
+foreach(script cc cxx ff f90 run)
+ execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpi${script})
+ execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script})
+endforeach()
set(generated_headers_to_install
${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake)
### Make Libs
-if(NOT WIN32)
- include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
-else()
- include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLibWin.cmake)
-endif()
+include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
if(enable_java)
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Java.cmake)
SimGrid (3.32.1) not released yet (target december 22)
+General:
+ - On Windows, you now need to install WSL2 as the native builds are now disabled.
+ It was not really working anyway.
+
S4U:
- Activity::set_remaining() is not public anymore. Use for example
Comm::set_payload_size() to change the size of the simulated data.
auto-detection fails for you). They are approximately sorted here from
the slowest to the most efficient:
- - **thread:** very slow factory using full featured threads (either
- pthreads or windows native threads). They are slow but very
- standard. Some debuggers or profilers only work with this factory.
+ - **thread:** very slow factory using full featured threads (pthreads).
+ They are slow but very standard. Some debuggers or profilers only work with this factory.
- **java:** Java applications are virtualized onto java threads (that
are regular pthreads registered to the JVM)
- **ucontext:** fast factory using System V contexts (Linux and FreeBSD only)
Disabling Stack Guard Pages
...........................
-**Option** ``contexts/guard-size`` **Default** 1 page in most case (0 pages on Windows or with MC)
+**Option** ``contexts/guard-size`` **Default** 1 page in most case (0 pages with MC)
Unless you use the threads context factory (see
:ref:`cfg=contexts/factory`), a stack guard page is usually used
SG_END_DECL= \
SIMGRID_REGISTER_PLUGIN(id,desc,init)= \
XBT_PUBLIC= \
- XBT_EXPORT_NO_IMPORT= \
- XBT_IMPORT_NO_EXPORT= \
XBT_PUBLIC_DATA=extern \
XBT_PUBLIC= \
XBT_INLINE= \
SimGrid should work out of the box on Linux, macOS, FreeBSD, and
-Windows (under Windows, you need to install the Windows Subsystem
-Linux to get more than the Java bindings).
+Windows (with WSL).
Pre-compiled Packages
---------------------
The best solution to get SimGrid working on windows is to install the
Ubuntu subsystem of Windows 10. All of SimGrid (but the model checker)
-works in this setting.
-
-Native builds not very well supported. Have a look to our `appveypor
-configuration file
-<https://framagit.org/simgrid/simgrid/blob/master/.appveyor.yml>`_ to
-see how we manage to use mingw-64 to build the DLL that the Java file
-needs.
-
-The drawback of MinGW-64 is that the produced DLL are not compatible
-with MS Visual C. Some clang-based tools seem promising to fix this,
-but this is of rather low priority for us. It it's important for you
-and if you get it working, please @ref community_contact "tell us".
+works in this setting. Native builds never really worked, and they are
+disabled starting with SimGrid v3.33.
Python-specific instructions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
set(_actor-stacksize_factories "^thread") # Threads ignore modifications of the stack size
-# The maestro-set example only works for threads and when not using windows.
+# The maestro-set example only works for threads
set(_maestro-set_factories "thread")
-if(WIN32)
- set(_maestro-set_disable 1)
-endif()
if(SIMGRID_HAVE_MC)
# These tests timeout with threads, maybe because of dwarf parsing? not sure
${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}.tesh)
endforeach()
-if (NOT enable_memcheck AND NOT WIN32)
+if (NOT enable_memcheck)
ADD_TESH(debug-breakpoint --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/comm-pingpong
--setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
${CMAKE_CURRENT_SOURCE_DIR}/comm-pingpong/debug-breakpoint.tesh)
if(enable_smpi)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
add_executable (is EXCLUDE_FROM_ALL is.c nas_common.c)
#include <vector>
#endif
-#ifdef _WIN32
-#define MPI_CALL(type, name, args) \
- type name args; \
- type _XBT_CONCAT(P, name) args
-#else
#define MPI_CALL(type, name, args) \
type name args __attribute__((weak)); \
- type _XBT_CONCAT(P, name) args
-#endif
+ type _XBT_CONCAT(P, name) \
+ args
SG_BEGIN_DECL
#define MPI_THREAD_SINGLE 0
# define _GNU_SOURCE
#endif
-/* On MinGW, stdio.h defines __MINGW_PRINTF_FORMAT and __MINGW_SCANF_FORMAT
- which are the suitable format style (either gnu_printf or ms_printf)
- depending on which version is available (__USE_MINGW_ANSI_STDIO): */
-#ifdef __MINGW32__
-# include <stdio.h>
-
-#define XBT_ATTRIB_PRINTF(format_idx, arg_idx) \
- __attribute__((__format__(__MINGW_PRINTF_FORMAT, (format_idx), (arg_idx))))
-#define XBT_ATTRIB_SCANF(format_idx, arg_idx) __attribute__((__MINGW_SCANF_FORMAT(__scanf__, (format_idx), (arg_idx))))
-#else
#define XBT_ATTRIB_PRINTF(format_idx, arg_idx) __attribute__((__format__(__printf__, (format_idx), (arg_idx))))
#define XBT_ATTRIB_SCANF(format_idx, arg_idx) __attribute__((__format__(__scanf__, (format_idx), (arg_idx))))
-#endif
#if defined(__cplusplus)
#if __cplusplus >= 201103L
*
* * If you link your application against the DLL or if you do a UNIX build, don't do anything special. This file
* will do the right thing for you by default.
- *
- * Rationale of XBT_EXPORT_NO_IMPORT: (windows-only)
- * * Symbols which must be exported in the DLL, but not imported from it.
- *
- * * This is obviously useful for initialized globals (which cannot be extern or similar).
- * * This is also used in the log mechanism where a macro creates the variable automatically. When the macro is
- * called from within SimGrid, the symbol must be exported, but when called from within the client code, it must
- * not try to retrieve the symbol from the DLL since it's not in there.
- *
- * Rationale of XBT_IMPORT_NO_EXPORT: (windows-only)
- * * Symbols which must be imported from the DLL, but not explicitly exported from it.
- *
- * * The root log category is already exported, but not imported explicitly when creating a subcategory since we
- * cannot import the parent category to deal with the fact that the parent may be in application space, not DLL
- * space.
*/
-/* Build the DLL */
-#if defined(DLL_EXPORT)
-# define XBT_PUBLIC __declspec(dllexport)
-# define XBT_EXPORT_NO_IMPORT __declspec(dllexport)
-# define XBT_IMPORT_NO_EXPORT
-# define XBT_PUBLIC_DATA extern __declspec(dllexport)
-# define XBT_PRIVATE
-
-/* Link against the DLL */
-#elif (defined(_WIN32) && !defined(DLL_EXPORT))
-# define XBT_PUBLIC __declspec(dllimport)
-# define XBT_EXPORT_NO_IMPORT
-# define XBT_IMPORT_NO_EXPORT __declspec(dllimport)
-# define XBT_PUBLIC_DATA extern __declspec(dllimport)
-# define XBT_PRIVATE
-
-#elif defined(__ELF__)
-# define XBT_PUBLIC __attribute__((visibility("default")))
-# define XBT_EXPORT_NO_IMPORT __attribute__((visibility("default")))
-# define XBT_IMPORT_NO_EXPORT __attribute__((visibility("default")))
+#if defined(__ELF__)
+#define XBT_PUBLIC __attribute__((visibility("default")))
# define XBT_PUBLIC_DATA extern __attribute__((visibility("default")))
# define XBT_PRIVATE __attribute__((visibility("hidden")))
#else
-# define XBT_PUBLIC /* public */
-# define XBT_EXPORT_NO_IMPORT
-# define XBT_IMPORT_NO_EXPORT
+#define XBT_PUBLIC /* public */
# define XBT_PUBLIC_DATA extern
# define XBT_PRIVATE /** @private */
XBT_LOG_EXTERNAL_CATEGORY(catName); \
(void)_xbt_log_cat_init(&_XBT_LOGV(catName), xbt_log_priority_uninitialized); \
} \
- XBT_EXPORT_NO_IMPORT s_xbt_log_category_t _XBT_LOGV(catName) = { \
+ s_xbt_log_category_t _XBT_LOGV(catName) = { \
&_XBT_LOGV(parent), \
NULL /* firstChild */, \
NULL /* nextSibling */, \
#include "xbt/xbt_os_time.h"
#include <sys/stat.h>
-#ifdef WIN32
-#include <direct.h> // _mkdir
-#endif
#include <fstream>
#include <string>
if (not simgrid::config::get_value<bool>("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
std::string folder_name = simgrid::config::get_value<std::string>("tracing/filename") + "_files";
std::string filename = folder_name + "/" + std::to_string(prefix) + "_" + c.get_name() + ".txt";
-#ifdef WIN32
- _mkdir(folder_name.c_str());
-#else
mkdir(folder_name.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
-#endif
ti_unique_file = new std::ofstream(filename.c_str(), std::ofstream::out);
xbt_assert(not ti_unique_file->fail(), "Tracefile %s could not be opened for writing", filename.c_str());
tracing_file << filename << '\n';
#cmakedefine01 HAVE_MMAP
/* Function mremap */
#cmakedefine01 HAVE_MREMAP
-/* Function sysconf */
-#cmakedefine01 HAVE_SYSCONF
/* Function vasprintf */
#cmakedefine01 HAVE_VASPRINTF
#include "xbt/xbt_modinter.h" /* whether initialization was already done */
#include <boost/algorithm/string/predicate.hpp>
-#ifndef _WIN32
#include <dlfcn.h>
-#endif /* _WIN32 */
#if SIMGRID_HAVE_MC
#include "src/mc/remote/AppSide.hpp"
exit(1);
}
-#ifndef _WIN32
static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
{
if ((siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) || siginfo->si_signo == SIGBUS) {
}
}
-#endif /* _WIN32 */
-
namespace simgrid::kernel {
EngineImpl::~EngineImpl()
/* Prepare to display some more info when dying on Ctrl-C pressing */
std::signal(SIGINT, inthandler);
-
-#ifndef _WIN32
install_segvhandler();
-#endif
/* register a function to be called by SURF after the environment creation */
sg_platf_init();
{
double start = xbt_os_time();
if (boost::algorithm::ends_with(platf, ".so") || boost::algorithm::ends_with(platf, ".dylib")) {
-#ifdef _WIN32
- xbt_die("loading platform through shared library isn't supported on windows");
-#else
void* handle = dlopen(platf.c_str(), RTLD_LAZY);
xbt_assert(handle, "Impossible to open platform file: %s", platf.c_str());
platf_handle_ = std::unique_ptr<void, std::function<int(void*)>>(handle, dlclose);
const char* dlsym_error = dlerror();
xbt_assert(not dlsym_error, "Error: %s", dlsym_error);
callable(*simgrid::s4u::Engine::get_instance());
-#endif /* _WIN32 */
} else {
parse_platform_file(platf);
}
thread_local Context* Context::current_context_ = nullptr;
-#ifndef WIN32
/* Install or disable alternate signal stack, for SIGSEGV handler. */
int Context::install_sigsegv_stack(stack_t* old_stack, bool enable)
{
stack.ss_flags = enable ? 0 : SS_DISABLE;
return sigaltstack(&stack, old_stack);
}
-#endif
Context* Context::self()
{
void declare_context(std::size_t size);
public:
-#ifndef WIN32
static int install_sigsegv_stack(stack_t* old_stack, bool enable);
-#endif
Context(std::function<void()>&& code, actor::ActorImpl* actor, bool maestro);
Context(const Context&) = delete;
#if HAVE_RAW_CONTEXTS
#if SIMGRID_PROCESSOR_x86_64
-__asm__ (
+__asm__(
#if defined(__APPLE__)
- ".text\n"
- ".globl _raw_makecontext\n"
- "_raw_makecontext:\n"
-#elif defined(_WIN32)
- ".text\n"
- ".globl raw_makecontext\n"
- "raw_makecontext:\n"
+ ".text\n"
+ ".globl _raw_makecontext\n"
+ "_raw_makecontext:\n"
#else
- ".text\n"
- ".globl raw_makecontext\n"
- ".type raw_makecontext,@function\n"
- "raw_makecontext:\n"/* Calling convention sets the arguments in rdi, rsi, rdx and rcx, respectively */
+ ".text\n"
+ ".globl raw_makecontext\n"
+ ".type raw_makecontext,@function\n"
+ "raw_makecontext:\n" /* Calling convention sets the arguments in rdi, rsi, rdx and rcx, respectively */
#endif
- " mov %rdi,%rax\n" /* stack */
- " add %rsi,%rax\n" /* size */
- " andq $-16, %rax\n" /* align stack */
- " movq $0, -8(%rax)\n" /* @return for func */
- " mov %rdx,-16(%rax)\n" /* func */
- " mov %rcx,-24(%rax)\n" /* arg/rdi */
- " movq $0, -32(%rax)\n" /* rsi */
- " movq $0, -40(%rax)\n" /* rdx */
- " movq $0, -48(%rax)\n" /* rcx */
- " movq $0, -56(%rax)\n" /* r8 */
- " movq $0, -64(%rax)\n" /* r9 */
- " movq $0, -72(%rax)\n" /* rbp */
- " movq $0, -80(%rax)\n" /* rbx */
- " movq $0, -88(%rax)\n" /* r12 */
- " movq $0, -96(%rax)\n" /* r13 */
- " movq $0, -104(%rax)\n" /* r14 */
- " movq $0, -112(%rax)\n" /* r15 */
- " sub $112,%rax\n"
- " ret\n"
-);
-
-__asm__ (
+ " mov %rdi,%rax\n" /* stack */
+ " add %rsi,%rax\n" /* size */
+ " andq $-16, %rax\n" /* align stack */
+ " movq $0, -8(%rax)\n" /* @return for func */
+ " mov %rdx,-16(%rax)\n" /* func */
+ " mov %rcx,-24(%rax)\n" /* arg/rdi */
+ " movq $0, -32(%rax)\n" /* rsi */
+ " movq $0, -40(%rax)\n" /* rdx */
+ " movq $0, -48(%rax)\n" /* rcx */
+ " movq $0, -56(%rax)\n" /* r8 */
+ " movq $0, -64(%rax)\n" /* r9 */
+ " movq $0, -72(%rax)\n" /* rbp */
+ " movq $0, -80(%rax)\n" /* rbx */
+ " movq $0, -88(%rax)\n" /* r12 */
+ " movq $0, -96(%rax)\n" /* r13 */
+ " movq $0, -104(%rax)\n" /* r14 */
+ " movq $0, -112(%rax)\n" /* r15 */
+ " sub $112,%rax\n"
+ " ret\n");
+
+__asm__(
#if defined(__APPLE__)
- ".text\n"
- ".globl _raw_swapcontext\n"
- "_raw_swapcontext:\n"
-#elif defined(_WIN32)
- ".text\n"
- ".globl raw_swapcontext\n"
- "raw_swapcontext:\n"
+ ".text\n"
+ ".globl _raw_swapcontext\n"
+ "_raw_swapcontext:\n"
#else
- ".text\n"
- ".globl raw_swapcontext\n"
- ".type raw_swapcontext,@function\n"
- "raw_swapcontext:\n" /* Calling convention sets the arguments in rdi and rsi, respectively */
+ ".text\n"
+ ".globl raw_swapcontext\n"
+ ".type raw_swapcontext,@function\n"
+ "raw_swapcontext:\n" /* Calling convention sets the arguments in rdi and rsi, respectively */
#endif
- " push %rdi\n"
- " push %rsi\n"
- " push %rdx\n"
- " push %rcx\n"
- " push %r8\n"
- " push %r9\n"
- " push %rbp\n"
- " push %rbx\n"
- " push %r12\n"
- " push %r13\n"
- " push %r14\n"
- " push %r15\n"
- " mov %rsp,(%rdi)\n" /* old */
- " mov %rsi,%rsp\n" /* new */
- " pop %r15\n"
- " pop %r14\n"
- " pop %r13\n"
- " pop %r12\n"
- " pop %rbx\n"
- " pop %rbp\n"
- " pop %r9\n"
- " pop %r8\n"
- " pop %rcx\n"
- " pop %rdx\n"
- " pop %rsi\n"
- " pop %rdi\n"
- " ret\n"
-);
+ " push %rdi\n"
+ " push %rsi\n"
+ " push %rdx\n"
+ " push %rcx\n"
+ " push %r8\n"
+ " push %r9\n"
+ " push %rbp\n"
+ " push %rbx\n"
+ " push %r12\n"
+ " push %r13\n"
+ " push %r14\n"
+ " push %r15\n"
+ " mov %rsp,(%rdi)\n" /* old */
+ " mov %rsi,%rsp\n" /* new */
+ " pop %r15\n"
+ " pop %r14\n"
+ " pop %r13\n"
+ " pop %r12\n"
+ " pop %rbx\n"
+ " pop %rbp\n"
+ " pop %r9\n"
+ " pop %r8\n"
+ " pop %rcx\n"
+ " pop %rdx\n"
+ " pop %rsi\n"
+ " pop %rdi\n"
+ " ret\n");
#elif SIMGRID_PROCESSOR_i686
-__asm__ (
-#if defined(__APPLE__) || defined(_WIN32)
- ".text\n"
- ".globl _raw_makecontext\n"
- "_raw_makecontext:\n"
+__asm__(
+#if defined(__APPLE__)
+ ".text\n"
+ ".globl _raw_makecontext\n"
+ "_raw_makecontext:\n"
#else
- ".text\n"
- ".globl raw_makecontext\n"
- ".type raw_makecontext,@function\n"
- "raw_makecontext:\n"
+ ".text\n"
+ ".globl raw_makecontext\n"
+ ".type raw_makecontext,@function\n"
+ "raw_makecontext:\n"
#endif
- " movl 4(%esp),%eax\n" /* stack */
- " addl 8(%esp),%eax\n" /* size */
- " andl $-16, %eax\n" /* align stack */
- " movl 12(%esp),%ecx\n" /* func */
- " movl 16(%esp),%edx\n" /* arg */
- " movl %edx, -4(%eax)\n"
- " movl $0, -8(%eax)\n" /* @return for func */
- " movl %ecx,-12(%eax)\n"
- " movl $0, -16(%eax)\n" /* ebp */
- " movl $0, -20(%eax)\n" /* ebx */
- " movl $0, -24(%eax)\n" /* esi */
- " movl $0, -28(%eax)\n" /* edi */
- " subl $28,%eax\n"
- " retl\n"
-);
-
-__asm__ (
-#if defined(__APPLE__) || defined(_WIN32)
- ".text\n"
- ".globl _raw_swapcontext\n"
- "_raw_swapcontext:\n"
+ " movl 4(%esp),%eax\n" /* stack */
+ " addl 8(%esp),%eax\n" /* size */
+ " andl $-16, %eax\n" /* align stack */
+ " movl 12(%esp),%ecx\n" /* func */
+ " movl 16(%esp),%edx\n" /* arg */
+ " movl %edx, -4(%eax)\n"
+ " movl $0, -8(%eax)\n" /* @return for func */
+ " movl %ecx,-12(%eax)\n"
+ " movl $0, -16(%eax)\n" /* ebp */
+ " movl $0, -20(%eax)\n" /* ebx */
+ " movl $0, -24(%eax)\n" /* esi */
+ " movl $0, -28(%eax)\n" /* edi */
+ " subl $28,%eax\n"
+ " retl\n");
+
+__asm__(
+#if defined(__APPLE__)
+ ".text\n"
+ ".globl _raw_swapcontext\n"
+ "_raw_swapcontext:\n"
#else
- ".text\n"
- ".globl raw_swapcontext\n"
- ".type raw_swapcontext,@function\n"
- "raw_swapcontext:\n"
+ ".text\n"
+ ".globl raw_swapcontext\n"
+ ".type raw_swapcontext,@function\n"
+ "raw_swapcontext:\n"
#endif
- // Fetch the parameters:
- " movl 4(%esp),%eax\n" /* old (raw_stack_t*) */
- " movl 8(%esp),%edx\n" /* new (raw_stack_t) */
- // Save registers of the current context on the stack:
- " pushl %ebp\n"
- " pushl %ebx\n"
- " pushl %esi\n"
- " pushl %edi\n"
- // Save the current context (stack pointer) in *old:
- " movl %esp,(%eax)\n"
- // Switch to the stack of the new context:
- " movl %edx,%esp\n"
- // Pop the values of the new context:
- " popl %edi\n"
- " popl %esi\n"
- " popl %ebx\n"
- " popl %ebp\n"
- // Return using the return address of the new context:
- " retl\n"
-);
+ // Fetch the parameters:
+ " movl 4(%esp),%eax\n" /* old (raw_stack_t*) */
+ " movl 8(%esp),%edx\n" /* new (raw_stack_t) */
+ // Save registers of the current context on the stack:
+ " pushl %ebp\n"
+ " pushl %ebx\n"
+ " pushl %esi\n"
+ " pushl %edi\n"
+ // Save the current context (stack pointer) in *old:
+ " movl %esp,(%eax)\n"
+ // Switch to the stack of the new context:
+ " movl %edx,%esp\n"
+ // Pop the values of the new context:
+ " popl %edi\n"
+ " popl %esi\n"
+ " popl %ebx\n"
+ " popl %ebp\n"
+ // Return using the return address of the new context:
+ " retl\n");
#else
#error HAVE_RAW_CONTEXTS defined, but neither SIMGRID_PROCESSOR_x86_64 nor SIMGRID_PROCESSOR_i686. Please update the code.
#endif
#include <boost/core/demangle.hpp>
#include <memory>
-#include <typeinfo>
-
-#ifdef _WIN32
-#include <malloc.h>
-#include <windows.h>
-#else
#include <sys/mman.h>
-#endif
-
-#ifdef __MINGW32__
-#define _aligned_malloc __mingw_aligned_malloc
-#define _aligned_free __mingw_aligned_free
-#endif /*MINGW*/
+#include <typeinfo>
#if HAVE_VALGRIND_H
#include <valgrind/valgrind.h>
auto* alloc = static_cast<unsigned char*>(xbt_malloc0(size + xbt_pagesize));
stack_ = alloc - (reinterpret_cast<uintptr_t>(alloc) & (xbt_pagesize - 1)) + xbt_pagesize;
reinterpret_cast<unsigned char**>(stack_)[-1] = alloc;
-#elif !defined(_WIN32)
+#else
void* alloc;
xbt_assert(posix_memalign(&alloc, xbt_pagesize, size) == 0, "Failed to allocate stack.");
this->stack_ = static_cast<unsigned char*>(alloc);
-#else
- this->stack_ = static_cast<unsigned char*>(_aligned_malloc(size, xbt_pagesize));
#endif
-#ifndef _WIN32
/* This is fatal. We are going to fail at some point when we try reusing this. */
xbt_assert(
mprotect(this->stack_, guard_size, PROT_NONE) != -1,
"Please see https://simgrid.org/doc/latest/Configuring_SimGrid.html#configuring-the-user-code-virtualization "
"for more information.",
strerror(errno));
-#endif
+
this->stack_ = this->stack_ + guard_size;
} else {
this->stack_ = static_cast<unsigned char*>(xbt_malloc0(actor->get_stacksize()));
VALGRIND_STACK_DEREGISTER(valgrind_stack_id_);
#endif
-#ifndef _WIN32
if (guard_size > 0 && not MC_is_active()) {
stack_ = stack_ - guard_size;
if (mprotect(stack_, guard_size, PROT_READ | PROT_WRITE) == -1) {
stack_ = reinterpret_cast<unsigned char**>(stack_)[-1];
#endif
}
-#endif /* not windows */
xbt_free(stack_);
}
{
Context::set_current(context);
-#ifndef WIN32
install_sigsegv_stack(nullptr, true);
-#endif
// Tell the caller (normally the maestro) we are starting, and wait for its green light
context->end_.release();
context->start();
// Signal to the caller (normally the maestro) that we have finished:
context->yield();
-#ifndef WIN32
install_sigsegv_stack(nullptr, false);
-#endif
XBT_DEBUG("Terminating");
Context::set_current(nullptr);
}
#include <libunwind.h>
#endif
-#ifndef _WIN32
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
-#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc, "Logging specific to MC (global)");
void simgrid_set_maestro(void (*code)(void*), void* data)
{
-#ifdef _WIN32
- XBT_WARN("simgrid_set_maestro is believed to not work on windows. Please help us investigating this issue if "
- "you need that feature");
-#endif
maestro_code = std::bind(code, data);
}
[](int value) { simgrid::kernel::context::stack_size = value * 1024; }};
/* guard size for contexts stacks in memory pages */
-#if defined(_WIN32) || (PTH_STACKGROWTH != -1)
+#if (PTH_STACKGROWTH != -1)
int default_guard_size = 0;
#else
int default_guard_size = 1;
#include "xbt/file.hpp"
#include "src/smpi/include/smpi_actor.hpp"
-#include <unordered_map>
-#ifndef WIN32
-#include <sys/mman.h>
-#endif
#include <cerrno>
#include <cmath>
+#include <sys/mman.h>
+#include <unordered_map>
#if HAVE_PAPI
#include <papi.h>
double secs = trunc(now);
double usecs = (now - secs) * 1e6;
tv->tv_sec = static_cast<time_t>(secs);
- tv->tv_usec = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t (or useconds_t on WIN32)
+ tv->tv_usec = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t
}
if (smpi_wtime_sleep > 0)
simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep);
/* 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 "private.hpp"
+#include "src/internal_config.h"
+#include "src/smpi/include/smpi_actor.hpp"
+#include "src/xbt/memory_map.hpp"
+#include "xbt/virtu.h"
+
#include <algorithm>
#include <cerrno>
#include <climits>
#include <cstring>
#include <deque>
#include <fcntl.h>
+#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <vector>
-
-#ifndef WIN32
-#include <sys/mman.h>
#include <unistd.h>
-
-#include "private.hpp"
-#include "src/internal_config.h"
-#include "src/smpi/include/smpi_actor.hpp"
-#include "src/xbt/memory_map.hpp"
-#include "xbt/virtu.h"
+#include <vector>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_memory, smpi, "Memory layout support for SMPI");
}
xbt_die("Did not find my data segment.");
}
-#endif
#if HAVE_SANITIZER_ADDRESS
#include <sanitizer/asan_interface.h>
#include <cerrno>
-#include <sys/types.h>
-#ifndef WIN32
-#include <sys/mman.h>
-#endif
+#include "smpi_utils.hpp"
#include <stdlib.h>
+#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
-#include "smpi_utils.hpp"
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
std::map<const void*, shared_metadata_t> allocs_metadata;
std::map<std::string, void*, std::less<>> calls;
-#ifndef WIN32
int smpi_shared_malloc_bogusfile = -1;
int smpi_shared_malloc_bogusfile_huge_page = -1;
unsigned long smpi_shared_malloc_blocksize = 1UL << 20;
-#endif
}
void smpi_shared_destroy()
calls.clear();
}
-#ifndef WIN32
static void* shm_map(int fd, size_t size, shared_data_key_type* data)
{
void* mem = smpi_temp_shm_mmap(fd, size);
xbt_free(ptr);
}
}
-#endif
int smpi_shared_known_call(const char* func, const char* input)
{
list_set CFLAGS @SMPI_C_FLAGS@
list_add LINKARGS
-if [ "x@WIN32@" = "x1" ]; then
- list_add CFLAGS "-include" "@includedir@/smpi/smpi_main.h"
- list_add LINKARGS "@libdir@\libsimgrid.dll"
-elif [ "x@APPLE@" = "x1" ]; then
+if [ "x@APPLE@" = "x1" ]; then
if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
list_add CFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
list_add LINKARGS "-shared"
esac
done
-if [ "x@WIN32@" != "x1" ]; then
- list_add CMDARGS "-fPIC"
-fi
+list_add CMDARGS "-fPIC"
list_set CMDLINE "${CC}"
list_add_not_empty CMDLINE "${CFLAGS}"
LINKER_UNDEFINED_ERROR="1"
fi
-if [ "x@WIN32@" = "x1" ]; then
- list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_main.h"
- list_add LINKARGS "@libdir@\libsimgrid.dll"
-elif [ "x@APPLE@" = "x1" ]; then
+if [ "x@APPLE@" = "x1" ]; then
if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
list_add LINKARGS "-shared"
esac
done
-if [ "x@WIN32@" != "x1" ]; then
- list_add CMDARGS "-fPIC"
-fi
+list_add CMDARGS "-fPIC"
list_set CMDLINE "${CXX}"
list_add_not_empty CMDLINE "${CXXFLAGS}"
double secs = trunc(now);
double usecs = (now - secs) * 1e6;
tv->tv_sec = static_cast<time_t>(secs);
- tv->tv_usec = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t (or useconds_t on WIN32)
+ tv->tv_usec = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t
}
return 0;
}
#include <fstream>
#include <string>
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf, "Logging specific to SURF (kernel)");
/* returns whether #file_path is an absolute file path. Surprising, isn't it ? */
static bool is_absolute_file_path(const std::string& file_path)
{
-#ifdef _WIN32
- WIN32_FIND_DATA wfd = {0};
- HANDLE hFile = FindFirstFile(file_path.c_str(), &wfd);
-
- if (INVALID_HANDLE_VALUE == hFile)
- return false;
-
- FindClose(hFile);
- return true;
-#else
return (file_path.c_str()[0] == '/');
-#endif
}
std::ifstream* surf_ifsopen(const std::string& name)
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
-XBT_EXPORT_NO_IMPORT xbt_cfg_t simgrid_config = nullptr;
+xbt_cfg_t simgrid_config = nullptr;
namespace simgrid::config {
#include <cmath>
#include <cstdio>
-#ifdef _WIN32
-# include <csignal> /* To silence MSVC on abort() */
-#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
{ // when libsthread is LD_PRELOADED. In this case, sthread's implem gets used instead.
}
-#ifdef _WIN32
-#include <windows.h>
-
-#ifndef __GNUC__
-/* Should not be necessary but for some reason, DllMain is called twice at attachment and at detachment.*/
-/* see also http://msdn.microsoft.com/en-us/library/ms682583%28VS.85%29.aspx */
-/* and http://www.microsoft.com/whdc/driver/kernel/DLL_bestprac.mspx */
-static BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
- static bool xbt_dll_process_is_attached = false;
- if (fdwReason == DLL_PROCESS_ATTACH && not xbt_dll_process_is_attached) {
- xbt_dll_process_is_attached = true;
- xbt_preinit();
- } else if (fdwReason == DLL_PROCESS_DETACH && xbt_dll_process_is_attached) {
- xbt_dll_process_is_attached = false;
- }
- return 1;
-}
-#endif
-
-#endif
-
static void xbt_preinit()
{
-#ifdef _WIN32
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- xbt_pagesize = si.dwPageSize;
-#elif HAVE_SYSCONF
xbt_pagesize = static_cast<int>(sysconf(_SC_PAGESIZE));
-#else
-# error Cannot get page size.
-#endif
-
xbt_pagebits = static_cast<int>(log2(xbt_pagesize));
-#ifdef _TWO_DIGIT_EXPONENT
- /* Even printf behaves differently on Windows... */
- _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
xbt_log_preinit();
xbt_dict_preinit();
atexit(xbt_postexit);
{
/* Call __gcov_flush on abort when compiling with coverage options. */
coverage_checkpoint();
-#ifdef _WIN32
- /* We said *in silence*. We don't want to see the error message printed by Microsoft's implementation of abort(). */
- raise(SIGABRT);
- signal(SIGABRT, SIG_DFL);
- raise(SIGABRT);
-#endif
abort();
}
#include "xbt/asserts.h"
#include "xbt/file.hpp" /* this module */
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
#if HAVE_UNISTD_H
#include <array>
#include <cerrno>
#include <sys/time.h>
#include <time.h>
-#ifdef _WIN32
-#include <sys/timeb.h>
-#include <windows.h>
-#else
#include <unistd.h>
-#endif
//Freebsd doesn't provide this clock_gettime flag yet, because it was added too recently (after 1993)
#if defined (CLOCK_PROF) && ! defined (CLOCK_PROCESS_CPUTIME_ID)
#include <mach/task.h>
#endif
-#ifdef _WIN32
-static void w32_time_to_timeval(struct timeval* tv, const FILETIME* ft)
-{
- unsigned __int64 tm;
- tm = (unsigned __int64)ft->dwHighDateTime << 32;
- tm |= ft->dwLowDateTime;
- tm /= 10;
- tm -= 11644473600000000ULL;
- tv->tv_sec = (long)(tm / 1000000L);
- tv->tv_usec = (long)(tm % 1000000L);
-}
-
-static void w32_times_to_timeval(struct timeval* tv, const FILETIME* kernel_time, const FILETIME* user_time)
-{
- unsigned __int64 ktm, utm;
- ktm = (unsigned __int64)kernel_time->dwHighDateTime << 32;
- ktm |= kernel_time->dwLowDateTime;
- ktm /= 10;
- utm = (unsigned __int64)user_time->dwHighDateTime << 32;
- utm |= user_time->dwLowDateTime;
- utm /= 10;
- tv->tv_sec = (long)(ktm / 1000000L) + (long)(utm / 1000000L);
- tv->tv_usec = (long)(ktm % 1000000L) + (long)(utm % 1000000L);
-}
-#endif
-
double xbt_os_time(void)
{
#if HAVE_GETTIMEOFDAY
struct timeval tv;
gettimeofday(&tv, NULL);
-#elif defined(_WIN32)
- struct timeval tv;
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- w32_time_to_timeval(&tv, &ft);
-#else /* not windows, no gettimeofday => poor resolution */
+#else /* no gettimeofday => poor resolution */
return (double) (time(NULL));
#endif /* HAVE_GETTIMEOFDAY? */
void xbt_os_sleep(double sec)
{
-#ifdef _WIN32
- Sleep((floor(sec) * 1000) + ((sec - floor(sec)) * 1000));
-
-#elif HAVE_NANOSLEEP
+#if HAVE_NANOSLEEP
struct timespec ts;
ts.tv_sec = (time_t)sec;
ts.tv_nsec = (long)((sec - floor(sec)) * 1e9);
struct timespec start;
struct timespec stop;
struct timespec elapse;
-#elif HAVE_GETTIMEOFDAY || defined(_WIN32)
+#elif HAVE_GETTIMEOFDAY
struct timeval start;
struct timeval stop;
struct timeval elapse;
#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
return ((double) timer->stop.tv_sec) - ((double) timer->start.tv_sec) + ((double) timer->elapse.tv_sec ) +
((((double) timer->stop.tv_nsec) - ((double) timer->start.tv_nsec) + ((double) timer->elapse.tv_nsec )) / 1e9);
-#elif HAVE_GETTIMEOFDAY || defined(_WIN32)
+#elif HAVE_GETTIMEOFDAY
return ((double) timer->stop.tv_sec) - ((double) timer->start.tv_sec) + ((double) timer->elapse.tv_sec ) +
((((double) timer->stop.tv_usec) - ((double) timer->start.tv_usec) + ((double) timer->elapse.tv_usec )) /
1000000.0);
timer->elapse.tv_sec = 0;
timer->elapse.tv_usec = 0;
gettimeofday(&(timer->start), NULL);
-#elif defined(_WIN32)
- timer->elapse.tv_sec = 0;
- timer->elapse.tv_usec = 0;
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- w32_time_to_timeval(&timer->start, &ft);
#else
timer->elapse = 0;
timer->start = (unsigned long int) (time(NULL));
timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
gettimeofday(&(timer->start), NULL);
-#elif defined(_WIN32)
- timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
- timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- w32_time_to_timeval(&timer->start, &ft);
#else
timer->elapse = timer->stop - timer->start;
timer->start = (unsigned long int) (time(NULL));
clock_gettime(CLOCK_REALTIME, &(timer->stop));
#elif HAVE_GETTIMEOFDAY
gettimeofday(&(timer->stop), NULL);
-#elif defined(_WIN32)
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- w32_time_to_timeval(&timer->stop, &ft);
#else
timer->stop = (unsigned long int) (time(NULL));
#endif
timer->elapse.tv_sec = 0;
timer->elapse.tv_usec = 0;
gettimeofday(&(timer->start), NULL);
-#elif defined(_WIN32)
- timer->elapse.tv_sec = 0;
- timer->elapse.tv_usec = 0;
- HANDLE h = GetCurrentProcess();
- FILETIME creationTime, exitTime, kernelTime, userTime;
- GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
- w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
#else
# error The cpu timers of SimGrid do not seem to work on your platform.
#endif
timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
gettimeofday(&(timer->start), NULL);
-#elif defined(_WIN32)
- timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
- timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
- HANDLE h = GetCurrentProcess();
- FILETIME creationTime, exitTime, kernelTime, userTime;
- GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
- w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
#else
# error The cpu timers of SimGrid do not seem to work on your platform.
#endif
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->stop));
#elif HAVE_GETTIMEOFDAY
gettimeofday(&(timer->stop), NULL);
-#elif defined(_WIN32)
- HANDLE h = GetCurrentProcess();
- FILETIME creationTime, exitTime, kernelTime, userTime;
- GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
- w32_times_to_timeval(&timer->stop, &kernelTime, &userTime);
#else
# error The cpu timers of SimGrid do not seem to work on your platform.
#endif
timer->elapse.tv_sec = 0;
timer->elapse.tv_usec = 0;
gettimeofday(&(timer->start), NULL);
-#elif defined(_WIN32)
- HANDLE h = GetCurrentThread();
- FILETIME creationTime, exitTime, kernelTime, userTime;
- GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
- w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
#else
# error The thread timers of SimGrid do not seem to work on your platform.
#endif
timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
gettimeofday(&(timer->start), NULL);
-#elif defined(_WIN32)
- timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
- timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
- HANDLE h = GetCurrentThread();
- FILETIME creationTime, exitTime, kernelTime, userTime;
- GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
- w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
#else
# error The thread timers of SimGrid do not seem to work on your platform.
#endif
timer->stop.tv_sec = thi->system_time.seconds + thi->user_time.seconds;
#elif HAVE_GETTIMEOFDAY //if nothing else is available, return just time
gettimeofday(&(timer->stop), NULL);
-#elif defined(_WIN32)
- HANDLE h = GetCurrentThread();
- FILETIME creationTime, exitTime, kernelTime, userTime;
- GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
- w32_times_to_timeval(&timer->stop, &kernelTime, &userTime);
#else
# error The thread timers of SimGrid do not seem to work on your platform.
#endif
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/stack-overflow/stack-overflow.tesh)
if (NOT enable_memcheck AND NOT enable_address_sanitizer AND NOT enable_thread_sanitizer)
ADD_TESH_FACTORIES(stack-overflow "^thread" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/kernel/stack-overflow --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/kernel/stack-overflow stack-overflow.tesh)
- if (WIN32)
- SET_TESH_PROPERTIES(stack-overflow "^thread" WILL_FAIL true)
- endif()
endif()
## Add the tests for context-default
# these tests need assertions
ADD_TESH(tesh-parser-bogus-symmetric --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/platforms ${CMAKE_HOME_DIRECTORY}/teshsuite/platforms/bogus_two_hosts_asymetric.tesh)
ADD_TESH(tesh-parser-bogus-missing-gw --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/platforms ${CMAKE_HOME_DIRECTORY}/teshsuite/platforms/bogus_missing_gateway.tesh)
-
- #These tests fail on Windows as the signal returned is not the same as Unix would send.
- if(WIN32)
- set_property(TEST tesh-parser-bogus-symmetric PROPERTY WILL_FAIL TRUE)
- set_property(TEST tesh-parser-bogus-missing-gw PROPERTY WILL_FAIL TRUE)
- endif()
endif()
if(enable_smpi)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
foreach(x coll-allgather coll-allgatherv coll-allreduce coll-allreduce-with-leaks coll-alltoall coll-alltoallv coll-barrier coll-bcast
add_dependencies(tests ${x})
endforeach()
- if(NOT WIN32)
- foreach(x macro-shared auto-shared macro-partial-shared macro-partial-shared-communication )
- add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
- target_link_libraries(${x} simgrid)
- set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- add_dependencies(tests ${x})
- endforeach()
- endif()
+ foreach(x macro-shared auto-shared macro-partial-shared macro-partial-shared-communication )
+ add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
+ target_link_libraries(${x} simgrid)
+ set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+ add_dependencies(tests ${x})
+ endforeach()
if(enable_smpi AND SMPI_FORTRAN)
set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
if(enable_smpi)
- if(NOT WIN32)
- ADD_TESH_FACTORIES(tesh-smpi-macro-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-shared/macro-shared.tesh)
- ADD_TESH_FACTORIES(tesh-smpi-auto-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/auto-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/auto-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/auto-shared/auto-shared.tesh)
- ADD_TESH_FACTORIES(tesh-smpi-macro-partial-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-partial-shared/macro-partial-shared.tesh)
- ADD_TESH_FACTORIES(tesh-smpi-macro-partial-shared-communication "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared-communication --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared-communication ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-partial-shared-communication/macro-partial-shared-communication.tesh)
- endif()
+ ADD_TESH_FACTORIES(tesh-smpi-macro-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-shared/macro-shared.tesh)
+ ADD_TESH_FACTORIES(tesh-smpi-auto-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/auto-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/auto-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/auto-shared/auto-shared.tesh)
+ ADD_TESH_FACTORIES(tesh-smpi-macro-partial-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-partial-shared/macro-partial-shared.tesh)
+ ADD_TESH_FACTORIES(tesh-smpi-macro-partial-shared-communication "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared-communication --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared-communication ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-partial-shared-communication/macro-partial-shared-communication.tesh)
foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast
coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong
#build only once files used in each test (C version compiled here at root, F77 is in f77/util, and F90 in F90/util)
-if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
-else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-endif()
+set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
# There are too many warnings with these programs
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-sign-compare")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1 -Wno-error=unused-variable")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
if(enable_smpi AND enable_smpi_MPICH3_testsuite)
- if(WIN32)
- set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
- else()
- set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
- set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
- endif()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
message(STATUS "Add LDFLAGS: \"$ENV{LDFLAGS}\" to CMAKE_C_LINK_FLAGS")
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} $ENV{LDFLAGS}")
endif()
-
-if(MINGW)
- # http://stackoverflow.com/questions/10452262/create-64-bit-jni-under-windows
- # We don't want to ship libgcc_s_seh-1.dll nor libstdc++-6.dll
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
- set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc")
- set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++")
-
- # JNI searches for stdcalls
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--add-stdcall-alias")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--add-stdcall-alias")
- set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -Wl,--add-stdcall-alias")
- set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -Wl,--add-stdcall-alias")
-
- # Specify the data model that we are using (yeah it may help Java)
- if(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
- else()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
- endif()
-endif()
message(STATUS "[Java] JNI found: ${JNI_FOUND}")
message(STATUS "[Java] JNI include dirs: ${JNI_INCLUDE_DIRS}")
-if(WIN32)
- execute_process(COMMAND java -d64 -version
- OUTPUT_VARIABLE JVM_IS_64_BITS)
- if("${JVM_IS_64_BITS}" MATCHES "Error")
- message(fatal_error "SimGrid can only use Java 64 bits")
- endif()
-endif()
-
# Rules to build libsimgrid-java
################################
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/lib/${LIBSIMGRID_JAVA_SO} ${JAVA_NATIVE_PATH}/${LIBSIMGRID_JAVA_SO}
)
-if(WIN32)
- add_custom_command(
- TARGET simgrid-java_jar POST_BUILD
- COMMENT "Add the windows-specific native libs into simgrid.jar..."
- DEPENDS simgrid simgrid-java ${JAVALIBS}
-
- # There is no way to disable the dependency of mingw-64 on that lib, unfortunately nor to script cmake -E properly
- # So let's be brutal and copy it in any case (even on non-windows builds) from the location where appveyor provides it.
- # The copy is only expected to work on the appveyor builder, but that's all we need right now
- # since our users are directed to download that file as nightly build.
- COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/libwinpthread-1.dll ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true
- COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true
- )
-endif()
-
if(APPLE)
add_custom_command(
TARGET simgrid-java_jar POST_BUILD
# Let's generate header files required by SMPI when the call location tracing
# has been activated.
-if(enable_maintainer_mode AND NOT WIN32)
+if(enable_maintainer_mode)
add_custom_command(OUTPUT ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces.h
${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces_fortran.h
DEPENDS
)
endif()
-if(enable_maintainer_mode AND NOT WIN32)
+if(enable_maintainer_mode)
find_program(FLEX_EXE NAMES flex)
find_program(FLEXML_EXE NAMES flexml)
find_program(SED_EXE NAMES sed)
+++ /dev/null
-### Make Libs
-
-add_library(simgrid SHARED ${simgrid_sources})
-
-if(MSVC)
- set_target_properties(simgrid PROPERTIES
- COMPILE_FLAGS "/DDLL_EXPORT"
- VERSION ${libsimgrid_version} )
-else()
- set_target_properties(simgrid PROPERTIES
- COMPILE_FLAGS "-DDLL_EXPORT"
- LINK_FLAGS "-shared"
- VERSION ${libsimgrid_version}
- PREFIX "lib" SUFFIX ".dll"
- IMPORT_PREFIX "lib" IMPORT_SUFFIX ".dll")
-
- set(SIMGRID_DEP "-lm")
-
- if (HAVE_BOOST_CONTEXTS)
- target_link_libraries(simgrid ${Boost_CONTEXT_LIBRARY})
- endif()
-
- if (HAVE_BOOST_STACKTRACE_BACKTRACE)
- target_link_libraries(simgrid ${Boost_STACKTRACE_BACKTRACE_LIBRARY})
- endif()
-
- if (HAVE_BOOST_ADDR2LINE_BACKTRACE)
- target_link_libraries(simgrid ${Boost_STACKTRACE_ADDR2LINE_LIBRARY})
- endif()
-endif()
-
-target_link_libraries(simgrid ${SIMGRID_DEP})
-
-# The library can obviously use the internal headers
-set_property(TARGET simgrid
- APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
SET(enable_model-checking ON CACHE BOOL "Whether to compile the model-checker" FORCE)
endif()
-if(WIN32)
- option(enable_smpi "Whether SMPI is included in the library." off)
-else()
- option(enable_smpi "Whether SMPI is included in the library." on)
- # PAPI does not support windows (they did in 3.7, but not anymore in 5.x)
- # See http://icl.cs.utk.edu/papi/custom/index.html?lid=62&slid=96
- option(enable_smpi_papi "Whether SMPI supports PAPI bindings." off)
-endif()
+option(enable_smpi "Whether SMPI is included in the library." on)
+option(enable_smpi_papi "Whether SMPI supports PAPI bindings." off)
option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
option(enable_smpi_MBI_testsuite "Whether the test suite from MBI should be built." off)
MACRO(ADD_TESH NAME)
SET(ARGT ${ARGV})
LIST(REMOVE_AT ARGT 0)
- IF(WIN32)
- STRING(REPLACE "§" "\;" ARGT "${ARGT}")
- ENDIF()
if(VALGRIND_WRAPPER)
ADD_TEST(${NAME} ${TESH_COMMAND} --wrapper "${VALGRIND_WRAPPER}" ${TESH_OPTION} ${ARGT})
else()
ENDMACRO()
IF(enable_java)
- IF(WIN32)
- SET(TESH_CLASSPATH_SEPARATOR "§")
- ELSE()
- SET(TESH_CLASSPATH_SEPARATOR ":")
- ENDIF()
+ SET(TESH_CLASSPATH_SEPARATOR ":")
SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/deprecated/java/${TESH_CLASSPATH_SEPARATOR}${CMAKE_BINARY_DIR}/teshsuite/java/${TESH_CLASSPATH_SEPARATOR}${SIMGRID_JAR}")
ENDIF()
catch-all-bg-output catch-return catch-signal catch-timeout catch-timeout-output catch-wrong-output cd color
ignore-regexp IO-bigsize IO-broken-pipe IO-orders)
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.tesh)
- if(NOT enable_memcheck AND NOT WIN32)
+ if(NOT enable_memcheck)
ADD_TESH(tesh-self-${x} --setenv bindir=${CMAKE_BINARY_DIR}/bin ${CMAKE_HOME_DIRECTORY}/tools/tesh/${x}.tesh)
endif()
endforeach()