+++ /dev/null
-#ifndef RB_MSG
-#define RB_MSG
-#include <stdio.h>
-#include "msg/msg.h"
-#ifndef RUBY_H
- #include <ruby.h>
-#endif
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
- "Messages specific for this msg example");
-
-// #include "msg/private.h"
-// #include "simix/private.h"
-// #include "simix/smx_context_ruby.h"
-
-// MSG Module
-VALUE rb_msg;
-// MSG Classes
-VALUE rb_task;
-VALUE rb_host;
-
-//init_Msg Called When The Ruby Interpreter loads this C extension
-void Init_msg();
-
-// Msg_Init From Ruby
-static void msg_init(VALUE Class,VALUE args);
-
-// Msg_Run From Ruby
-static void msg_run(VALUE Class);
-
-// Create Environment
-static void msg_createEnvironment(VALUE Class,VALUE plateformFile);
-
-// deploy Application
-static void msg_deployApplication(VALUE Class,VALUE deploymntFile);
-
-// Tools
-static void msg_info(VALUE Class,VALUE msg);
-
-//get Clock
-static void msg_get_clock(VALUE Class);
-
-//pajeOutput
-static void msg_paje_output(VALUE Class,VALUE pajeFile);
-
-// Ruby Introspection : To instanciate a Ruby Class from its Name
-static VALUE msg_new_ruby_instance(VALUE Class,VALUE className);
-
-// The Same ... This Time with Args
-static VALUE msg_new_ruby_instance_with_args(VALUE Class,VALUE className,VALUE args);
-
-#endif
+++ /dev/null
-/*
- * $Id$
- *
- * Copyright 2010 Martin Quinson, Mehdi Fekari
- * All right reserved.
- *
- * 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 "rb_msg_host.h"
-
-// Free Method
-void host_free(m_host_t ht) {
- //Nothing to do !!?
-}
-
-// New Method : return a Host
-static VALUE host_get_by_name(VALUE class, VALUE name)
-{
-
- const char * h_name = RSTRING(name)->ptr;
- m_host_t host = MSG_get_host_by_name(h_name);
- if(!host)
- rb_raise(rb_eRuntimeError,"MSG_get_host_by_name() failled");
-
- return Data_Wrap_Struct(class,0,host_free,host);
-
-}
-
-//Get Name
-static VALUE host_name(VALUE class,VALUE host)
-{
-
- // Wrap Ruby Value to m_host_t struct
- m_host_t *ht;
- Data_Get_Struct(host, m_host_t, ht);
- return rb_str_new2(MSG_host_get_name(*ht));
-
-}
-
-// Get Number
-static VALUE host_number(VALUE class)
-{
-
- return INT2NUM(MSG_get_host_number());
-
-}
-
-// Host Speed ( Double )
-static VALUE host_speed(VALUE class,VALUE host)
-{
- m_host_t *ht ;
- Data_Get_Struct(host,m_host_t,ht);
- return MSG_get_host_speed(*ht);
-
-}
-
-// Host Set Data
-static void host_set_data(VALUE class,VALUE host,VALUE data)
-{
- //...
-}
-
-// Host Get Data
-static VALUE host_get_data(VALUE class,VALUE host)
-{
- //...
- return Qnil;
-}
-
-// Host is Avail
-static VALUE host_is_avail(VALUE class,VALUE host)
-{
-
- m_host_t *ht;
- Data_Get_Struct(host,m_host_t,ht);
- if (!*ht)
- {
- rb_raise(rb_eRuntimeError,"Host not Bound");
- return Qnil;
- }
-
- if(MSG_host_is_avail(*ht))
- return Qtrue;
-
- return Qfalse;
-}
+++ /dev/null
-#ifndef RB_MSG_HOST
- #define RB_MSG_HOST
-
- #include <ruby.h>
- #include "msg/msg.h"
-
- // Free Method
- void host_free(m_host_t ht);
-
- // New Method
- static VALUE host_get_by_name(VALUE Class, VALUE name);
-
- //Get Name
- static VALUE host_name(VALUE Class,VALUE host);
-
- //Get Number
- static VALUE host_number(VALUE Class);
-
- // get Speed
- static VALUE host_speed(VALUE Class,VALUE host);
-
- // Set Data
- static void host_set_data(VALUE Class,VALUE host,VALUE data);
-
- // Get Data
- static VALUE host_get_data( VALUE Class,VALUE host);
-
-
- //is Available
- static VALUE host_is_avail(VALUE Class,VALUE host);
-#endif
+++ /dev/null
-/*
- * $Id$
- *
- * Copyright 2010 Martin Quinson, Mehdi Fekari
- * All right reserved.
- *
- * 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 "rb_msg_process.h"
-
-#define DEBUG
-// Init Ruby
-static void initRuby()
-{
-
- ruby_init();
- ruby_init_loadpath();
- rb_require("RubyProcess.rb");
-
-}
-
-
-/***********************************************
-
-Functions for Ruby Process Management ( Up Call)
-
-Idependant Methods
-
-************************************************/
-
-
-// get Ruby Process Name
-static VALUE process_getName( VALUE ruby_process )
-{
-
- initRuby();
- // instance = rb_funcall3(rb_const_get(rb_cObject, rb_intern("RbProcess")), rb_intern("new"), 0, 0);
- return rb_funcall(ruby_process,rb_intern("getName"),0);
-
-}
-
-// Get Process ID
-static VALUE process_getID(VALUE ruby_process)
-{
-
- initRuby();
- return rb_funcall(ruby_process,rb_intern("getID"),0);
-
-}
-
-// Get Bind
-static VALUE process_getBind(VALUE ruby_process)
-{
-
- initRuby();
- return rb_funcall(ruby_process,rb_intern("getBind"),0);
-
-}
-
-
-// Set Bind
-static void process_setBind(VALUE ruby_process,long bind)
-{
-
- initRuby();
- VALUE r_bind = LONG2FIX(bind);
- rb_funcall(ruby_process,rb_intern("setBind"),1,r_bind);
-
-}
-
-// isAlive
-static VALUE process_isAlive(VALUE ruby_process)
-{
-
- initRuby();
- return rb_funcall(ruby_process,rb_intern("alive?"),0);
-
-}
-
-// Kill Process
-static void process_kill(VALUE ruby_process)
-{
-
- initRuby();
- rb_funcall(ruby_process,rb_intern("kill"),0);
-
-}
-
-// join Process
-static void process_join( VALUE ruby_process )
-{
-
- initRuby();
- rb_funcall(ruby_process,rb_intern("join"),0);
-
-}
-
-// unschedule Process
-static void process_unschedule( VALUE ruby_process )
-{
-
- initRuby();
- rb_funcall(ruby_process,rb_intern("unschedule"),0);
-
-}
-
-// schedule Process
-static void process_schedule( VALUE ruby_process )
-{
-
- initRuby();
- rb_funcall(ruby_process,rb_intern("schedule"),0);
-
-}
-
-/***************************************************
-
-Function for Native Process ( Bound ) Management
-
-Methods Belong to MSG Module
-
-****************************************************/
-
-// Process To Native
-
-static m_process_t process_to_native(VALUE ruby_process)
-{
-
- VALUE id = process_getBind(ruby_process);
- if (!id)
- {
- rb_raise(rb_eRuntimeError,"Process Not Bound >>> id_Bind Null");
- return NULL;
- }
- long l_id= FIX2LONG(id);
- return (m_process_t)l_id;
-
-}
-
-// Bind Process
-
-static void processBind(VALUE ruby_process,m_process_t process)
-{
-
- long bind = (long)(process);
- process_setBind(ruby_process,bind);
-
-}
-
-
-// processCreate
-
-static void processCreate(VALUE class,VALUE ruby_process,VALUE host)
-{
-
- VALUE rbName; // Name of Java Process instance
- m_process_t process; // Native Process to Create
- const char * name ; // Name of C Native Process
- char alias[MAX_ALIAS_NAME + 1 ] = {0};
- msg_mailbox_t mailbox;
- rbName = process_getName(ruby_process);
-
- if(!rbName)
- {
- rb_raise(rb_eRuntimeError,"Internal error : Process Name Cannot be NULL");
- return;
- }
- // Allocate the data for the simulation
- process = xbt_new0(s_m_process_t,1);
- process->simdata = xbt_new0(s_simdata_process_t,1);
- // Do we Really Need to Create Ruby Process Instance , >> process is already a Ruby Process !! So..Keep on ;)
- // Bind The Ruby Process instance to The Native Process
- processBind(ruby_process,process);
- name = RSTRING(rbName)->ptr;
- process->name = xbt_strdup(name);
- Data_Get_Struct(host,m_host_t,process->simdata->m_host);
-
- if(!(process->simdata->m_host)) // Not Binded
- {
- free(process->simdata);
- free(process->data);
- free(process);
- rb_raise(rb_eRuntimeError,"Host not bound...while creating native process");
- return;
- }
- process->simdata->PID = msg_global->PID++; // msg_global ??
- /*DEBUG
- ("fil in process %s/%s (pid=%d) %p (sd=%p, host=%p, host->sd=%p) ",
- process->name ,process->simdata->m_host->name,process->simdata->PID,
- process,process->simdata, process->simdata->m_host,
- process->simdata->m_host->simdata);*/
-
- #ifdef DEBUG
- printf("fill in process %s/%s (pid=%d) %p (sd=%p , host=%p, host->sd=%p)\n",
- process->name , process->simdata->m_host->name,process->simdata->PID,
- process,process->simdata, process->simdata->m_host,
- process->simdata->m_host->simdata);
- #endif
- process->simdata->s_process =
- SIMIX_process_create(process->name,
- (xbt_main_func_t)ruby_process,
- (void *) process,
- process->simdata->m_host->simdata->smx_host->name,
- 0,NULL,NULL);
-
- //DEBUG ( "context created (s_process=%p)",process->simdata->s_process);
- #ifdef DEBUG
- printf("context created (s_process=%p)\n",process->simdata->s_process);
- #endif
- if (SIMIX_process_self()) { // SomeOne Created Me !!
- process->simdata->PPID = MSG_process_get_PID(SIMIX_process_self()->data);
- }
- else
- {
- process->simdata->PPID = -1;
- }
- process->simdata->last_errno = MSG_OK;
- // let's Add the Process to the list of the Simulation's Processes
- xbt_fifo_unshift(msg_global->process_list,process);
- sprintf(alias,"%s:%s",(process->simdata->m_host->simdata->smx_host)->name,
- process->name);
-
- mailbox = MSG_mailbox_new(alias);
-
-}
-
-
-// Process Management
-
-static void processSuspend(VALUE class,VALUE ruby_process)
-{
-
- m_process_t process = process_to_native(ruby_process);
-
- if (!process)
- {
- rb_raise(rb_eRuntimeError,"Process Not Bound...while suspending process");
- return;
- }
-
- // Trying to suspend The Process
-
- if ( MSG_OK != MSG_process_suspend(process))
- rb_raise(rb_eRuntimeError,"MSG_process_suspend() failed");
-
-
-}
-
-static void processResume(VALUE class,VALUE ruby_process)
-{
- m_process_t process = process_to_native(ruby_process);
- if (!process)
- {
- rb_raise(rb_eRuntimeError,"Process not Bound...while resuming process");
- return ;
- }
- // Trying to resume the process
- if ( MSG_OK != MSG_process_resume(process))
- rb_raise(rb_eRuntimeError,"MSG_process_resume() failed");
-
-}
-
-static VALUE processIsSuspend(VALUE class,VALUE ruby_process)
-{
-
- m_process_t process = process_to_native(ruby_process);
- if (!process)
- {
- rb_raise (rb_eRuntimeError,"Process not Bound...while testing if suspended");
- return;
- }
-
- // 1 is The Process is Suspended , 0 Otherwise
- if(MSG_process_is_suspended(process))
- return Qtrue;
-
- return Qfalse;
-
-}
-
-static void processKill(VALUE class,VALUE ruby_process)
-{
- m_process_t process = process_to_native(ruby_process);
-
- if(!process)
- {
- rb_raise (rb_eRuntimeError,"Process Not Bound...while killing process");
- return ;
- }
- // Delete The Global Reference / Ruby Process
- process_kill(ruby_process);
- // Delete the Native Process
- MSG_process_kill(process);
-
-}
-
-static VALUE processGetHost(VALUE class,VALUE ruby_process)
-{
-
- m_process_t process = process_to_native(ruby_process);
- m_host_t host;
-
- if (!process)
- {
- rb_raise(rb_eRuntimeError,"Process Not Bound...while getting Host");
- return Qnil; // NULL
- }
-
- host = MSG_process_get_host(process);
-
- if(!host->data)
- {
- rb_raise (rb_eRuntimeError,"MSG_process_get_host() failed");
- return Qnil;
- }
-
- return Data_Wrap_Struct(class, 0, host_free, host);
-
-}
-
-static void processExit(VALUE class,VALUE ruby_process)
-{
-
- m_process_t process = process_to_native(ruby_process);
- if(!process)
- {
- rb_raise(rb_eRuntimeError,"Process Not Bound...while exiting process");
- return;
- }
- SIMIX_context_stop(SIMIX_process_self()->context);
-
-}
+++ /dev/null
-/*
- * $Id$
- *
- * Copyright 2010 Martin Quinson, Mehdi Fekari
- * All right reserved.
- *
- * 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 "rb_msg_task.h"
-
-// Free Method
-static void task_free(m_task_t tk) {
- MSG_task_destroy(tk);
-}
-
-// New Method
-static VALUE task_new(VALUE class, VALUE name,VALUE comp_size,VALUE comm_size)
-{
-
- //char * t_name = RSTRING(name)->ptr;
- m_task_t task = MSG_task_create(RSTRING(name)->ptr,NUM2INT(comp_size),NUM2INT(comm_size),NULL);
- // Wrap m_task_t to a Ruby Value
- return Data_Wrap_Struct(class, 0, task_free, task);
-
-}
-
-//Get Computation Size
-static VALUE task_comp(VALUE class,VALUE task)
-{
- double size;
- m_task_t *tk;
- // Wrap Ruby Value to m_task_t struct
- Data_Get_Struct(task, m_task_t, tk);
- size = MSG_task_get_compute_duration(*tk);
- return rb_float_new(size);
-}
-
-//Get Name
-static VALUE task_name(VALUE class,VALUE task)
-{
-
- // Wrap Ruby Value to m_task_t struct
- m_task_t *tk;
- Data_Get_Struct(task, m_task_t, tk);
- return rb_str_new2(MSG_task_get_name(*tk));
-
-}
-
-// Execute Task
-static VALUE task_execute(VALUE class,VALUE task)
-{
-
- // Wrap Ruby Value to m_task_t struct
- m_task_t *tk;
- Data_Get_Struct(task, m_task_t, tk);
- return INT2NUM(MSG_task_execute(*tk));
-
-}
-
-// Sending Task
-static void task_send(VALUE class,VALUE task,VALUE mailbox)
-{
-
- // Wrap Ruby Value to m_task_t struct
- m_task_t *tk;
- Data_Get_Struct(task, m_task_t, tk);
- int res = MSG_task_send(*tk,RSTRING(mailbox)->ptr);
- if(res != MSG_OK)
- rb_raise(rb_eRuntimeError,"MSG_task_send failed");
-
- return;
-}
-
-// Recieving Task
-
-/**
-*It Return a Task
-*/
-
-static VALUE task_receive(VALUE class,VALUE mailbox)
-{
- // Task
- m_task_t task = NULL;
- MSG_task_receive(&task,RSTRING(mailbox)->ptr);
- return Data_Wrap_Struct(class, 0, task_free, task);
-}
-
-// Recieve Task 2
-// Not Appreciated
-static void task_receive2(VALUE class,VALUE task,VALUE mailbox)
-{
- m_task_t *tk;
- Data_Get_Struct(task, m_task_t, tk);
- MSG_task_receive(tk,RSTRING(mailbox)->ptr);
-
-}
-
-// It Return a Native Process ( m_process_t )
-static VALUE task_sender(VALUE class,VALUE task)
-{
- m_task_t *tk;
- Data_Get_Struct(task,m_task_t,tk);
- return (VALUE) MSG_task_get_sender(*tk);
-}
-
-// it return a Host
-static VALUE task_source(VALUE class,VALUE task)
-{
- m_task_t *tk;
- Data_Get_Struct(task,m_task_t,tk);
-
- m_host_t host = MSG_task_get_source(*tk);
- if(!host->data)
- {
- rb_raise(rb_eRuntimeError,"MSG_task_get_source() failed");
- return Qnil;
- }
- return (VALUE) host;
-
-}
-
-// Return Boolean
-static VALUE task_listen(VALUE class,VALUE task,VALUE alias)
-{
- m_task_t *tk;
- const char *p_alias;
- int rv;
-
- Data_Get_Struct(task,m_task_t,tk);
- p_alias = RSTRING(alias)->ptr;
-
- rv = MSG_task_listen(p_alias);
-
- if(rv) return Qtrue;
-
- return Qfalse;
-
-}
-
-// return Boolean
-static VALUE task_listen_host(VALUE class,VALUE task,VALUE alias,VALUE host)
-{
-
- m_task_t *tk;
- m_host_t *ht;
- const char *p_alias;
- int rv;
-
- Data_Get_Struct(task,m_task_t,tk);
- Data_Get_Struct(host,m_host_t,ht);
- p_alias = RSTRING(alias)->ptr;
-
- rv = MSG_task_listen_from_host(p_alias,*ht);
-
- if (rv) return Qtrue;
-
- return Qfalse;
-
-}
-
-
-// Put
-static void task_put(VALUE class,VALUE task,VALUE host)
-{
-
- m_task_t *tk;
- m_host_t *ht;
-
- Data_Get_Struct(task,m_task_t,tk);
- Data_Get_Struct(host,m_host_t,ht);
- MSG_task_put(*tk,*ht,PORT_22); //Channel set to 0
-
-}
-
-//get
-static VALUE task_get(VALUE class)
-{
-
- m_task_t task = NULL;
- int res = MSG_task_get(&task,PORT_22); // Channel set to 0
- xbt_assert0(res == MSG_OK, "MSG_task_get failed");
- return Data_Wrap_Struct(class, 0, task_free, task);
-
-}
+++ /dev/null
-/* a fast and simple context switching library */
-
-/* Copyright (c) 2004-2008 the SimGrid team. */
-/* All rights reserved. */
-
-/* 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 "portable.h"
-#include "xbt/log.h"
-#include "xbt/swag.h"
-#include "private.h"
-#include <lua5.1/lauxlib.h>
-#ifndef RUBY_H
- #include <ruby.h>
-#endif
-#include "smx_context_ruby.c"
-
-#define HAVE_RUBY /* HACK HACK */
-// #define DEBUG
-
-#ifdef HAVE_RUBY
- extern void SIMIX_ctx_ruby_factory_init(smx_context_factory_t *factory);
-#endif
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix, "Context switching mecanism");
-
-const char *xbt_ctx_factory_to_use = NULL;
-
-/**
- * This function is call by SIMIX_global_init() to initialize the context module.
- */
-
-void SIMIX_context_mod_init(void)
-{
- if (!simix_global->context_factory) {
- /* select context factory to use to create the context(depends of the macro definitions) */
- if (xbt_ctx_factory_to_use) {
- SIMIX_context_select_factory(xbt_ctx_factory_to_use);
- } else {
-#ifdef CONTEXT_THREADS
- /* context switch based os thread */
- SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
-#elif !defined(WIN32)
- /* context switch based ucontext */
- SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
-#else
- /* context switch is not allowed on Windows */
-#error ERROR [__FILE__, line __LINE__]: no context based implementation specified.
-#endif
- }
- }
-}
-
-/**
- * This function is call by SIMIX_clean() to finalize the context module.
- */
-void SIMIX_context_mod_exit(void)
-{
- if (simix_global->context_factory) {
- smx_pfn_context_factory_finalize_t finalize_factory;
-
- /* finalize the context factory */
- finalize_factory = simix_global->context_factory->finalize;
- (*finalize_factory) (&simix_global->context_factory);
- }
-}
-
-/**
- * This function is used to change the context factory.
- * Warning: it destroy all the existing processes (even for maestro), and it
- * will create a new maestro process using the new context factory.
- */
-int SIMIX_context_select_factory(const char *name)
-{
- /* if a context factory is already instantiated and it is different from the
- newly selected one, then kill all the processes, exit the context module
- and initialize the new factory.
- */
-
-
- if (simix_global->context_factory != NULL) {
- if (strcmp(simix_global->context_factory->name, name)){
-
- SIMIX_process_killall();
-
- /* kill maestro process */
- SIMIX_context_free(simix_global->maestro_process->context);
- free(simix_global->maestro_process);
- simix_global->maestro_process = NULL;
-
- SIMIX_context_mod_exit();
- }
- else
- /* the same context factory is requested return directly */
- return 0;
- }
-
- /* init the desired factory */
- SIMIX_context_init_factory_by_name(&simix_global->context_factory, name);
-
- SIMIX_create_maestro_process ();
-
-
-
- return 0;
-}
-
-/**
- * Initializes a context factory given by its name
- */
-void SIMIX_context_init_factory_by_name(smx_context_factory_t * factory,
- const char *name)
-{
-
- if (!strcmp(name, "java"))
-#ifdef HAVE_JAVA
- SIMIX_ctx_java_factory_init(factory);
-#else
- THROW0(not_found_error, 0, "Factory 'Java' does not exist: Java support was not compiled in the SimGrid library");
-#endif /* HAVE_JAVA */
-
- else if (!strcmp(name, "thread"))
-#ifdef CONTEXT_THREADS
- SIMIX_ctx_thread_factory_init(factory);
-#else
- THROW0(not_found_error, 0, "Factory 'thread' does not exist: thread support was not compiled in the SimGrid library");
-#endif /* CONTEXT_THREADS */
-
- else if (!strcmp(name, "sysv"))
- #if !defined(WIN32) && !defined(CONTEXT_THREADS)
- SIMIX_ctx_sysv_factory_init(factory);
- #else
- THROW0(not_found_error, 0, "Factory 'sysv' does not exist: no System V thread support under Windows");
- #endif
- else if (!strcmp(name, "lua"))
-#ifdef HAVE_LUA
- SIMIX_ctx_lua_factory_init(factory);
-#else
-
- THROW0(not_found_error, 0, "Factory 'lua' does not exist: Lua support was not compiled in the SimGrid library");
-#endif /* HAVE_LUA */
-
- else if (!strcmp(name,"ruby"))
-#ifdef HAVE_RUBY
- SIMIX_ctx_ruby_factory_init(factory);
-#else
- THROW0(not_found_error, 0, "Factory 'ruby' does not exist: Ruby support was not compiled in the SimGrid library");
-#endif
- else
- THROW1(not_found_error, 0, "Factory '%s' does not exist", name);
-}
+++ /dev/null
-/* $Id$ */
-
-/* context_Ruby - implementation of context switching with lua coroutines */
-
-/* Copyright (c) 2004-2008 the SimGrid team. All right reserved */
-
-/* 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. */
-#ifndef RUBY_H
- #include <ruby.h>
-#endif
-#include "private.h"
-#include "xbt/function_types.h"
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "xbt/asserts.h"
-#include "context_sysv_config.h"
-#include "bindings/ruby/rb_msg_process.c"
-// #include "bindings/ruby/rb_msg.c"
-
-// #define MY_DEBUG
-
-
-typedef struct s_smx_ctx_ruby
-
-{
- SMX_CTX_BASE_T;
- VALUE process; // The Ruby Process Instance
- //...
-}s_smx_ctx_ruby_t,*smx_ctx_ruby_t;
-
-static smx_context_t
-smx_ctx_ruby_create_context(xbt_main_func_t code,int argc,char** argv,
- void_f_pvoid_t cleanup_func,void *cleanup_arg);
-
-static int smx_ctx_ruby_factory_finalize(smx_context_factory_t *factory);
-
-static void smx_ctx_ruby_free(smx_context_t context);
-
-static void smx_ctx_ruby_start(smx_context_t context);
-
-static void smx_ctx_ruby_stop(smx_context_t context);
-
-static void smx_ctx_ruby_suspend(smx_context_t context);
-
-static void
- smx_ctx_ruby_resume(smx_context_t old_context,smx_context_t new_context);
-
-static void smx_ctx_ruby_wrapper(void);
-
-
-
-void SIMIX_ctx_ruby_factory_init(smx_context_factory_t *factory)
-{
-
- *factory = xbt_new0(s_smx_context_factory_t,1);
-
- (*factory)->create_context = smx_ctx_ruby_create_context;
- (*factory)->finalize = smx_ctx_ruby_factory_finalize;
- (*factory)->free = smx_ctx_ruby_free;
- (*factory)->start = smx_ctx_ruby_start;
- (*factory)->stop = smx_ctx_ruby_stop;
- (*factory)->suspend = smx_ctx_ruby_suspend;
- (*factory)->resume = smx_ctx_ruby_resume;
- (*factory)->name = "smx_ruby_context_factory";
- ruby_init();
- ruby_init_loadpath();
- #ifdef MY_DEBUG
- printf("SIMIX_ctx_ruby_factory_init...Done\n");
- #endif
-}
-
-static int smx_ctx_ruby_factory_finalize(smx_context_factory_t *factory)
-{
-
- free(*factory);
- *factory = NULL;
- return 0;
-
-}
-
-static smx_context_t
- smx_ctx_ruby_create_context(xbt_main_func_t code,int argc,char** argv,
- void_f_pvoid_t cleanup_func,void* cleanup_arg)
-{
-
- smx_ctx_ruby_t context = xbt_new0(s_smx_ctx_ruby_t,1);
-
- /*if the user provided a function for the process , then use it
- Otherwise it's the context for maestro */
- if( code )
- {
- context->cleanup_func = cleanup_func;
- context->cleanup_arg = cleanup_arg;
- context->process = (VALUE)code;
-
- #ifdef MY_DEBUG
- printf("smx_ctx_ruby_create_context...Done\n");
- #endif
-
- }
- return (smx_context_t) context;
-
-}
-
-static void smx_ctx_ruby_free(smx_context_t context)
-{
- /* VALUE process;
- if (context)
- {
- smx_ctx_ruby_t ctx_ruby = (smx_ctx_ruby_t) context;
-
- if (ctx_ruby->process){
- // if the Ruby Process is Alive , Join it
- // if ( process_isAlive(ctx_ruby->process))
- {
- process = ctx_ruby->process;
- ctx_ruby->process = Qnil;
- process_join(process);
- }
-
- }
- free(context);
- context = NULL;
- }*/
- free (context);
- context = NULL;
- #ifdef MY_DEBUG
- printf("smx_ctx_ruby_free_context...Done\n");
- #endif
-
-}
-
-static void smx_ctx_ruby_start(smx_context_t context)
-{
-
- /* Already Done .. Since a Ruby Process is launched within initialization
- We Start it Within the Initializer ... We Use the Semaphore To Keep
- The Thread Alive Waitin' For Mutex Signal to Execute The Main*/
-
-}
-
-static void smx_ctx_ruby_stop(smx_context_t context)
-{
-
-
- VALUE process = Qnil;
- smx_ctx_ruby_t ctx_ruby,current;
-
- if ( context->cleanup_func)
- (*(context->cleanup_func)) (context->cleanup_arg);
-
- ctx_ruby = (smx_ctx_ruby_t) context;
-
- // Well , Let's Do The Same as JNI Stoppin' Process
- if ( simix_global->current_process->iwannadie )
- {
- if( ctx_ruby->process )
- {
- //if the Ruby Process still Alive ,let's Schedule it
- if ( process_isAlive( ctx_ruby->process ) )
- {
- current = (smx_ctx_ruby_t)simix_global->current_process->context;
- process_schedule(current->process);
- process = ctx_ruby->process;
- // interupt/kill The Ruby Process
- process_kill(process);
- }
- }
- }else {
-
- process = ctx_ruby->process;
- ctx_ruby->process = Qnil;
-
- }
- #ifdef MY_DEBUG
- printf("smx_ctx_ruby_stop...Done\n");
- #endif
-}
-
-static void smx_ctx_ruby_suspend(smx_context_t context)
-{
-
-if (context)
-{
-smx_ctx_ruby_t ctx_ruby = (smx_ctx_ruby_t) context;
- if (ctx_ruby->process)
- process_unschedule( ctx_ruby->process ) ;
-#ifdef MY_DEBUG
- printf("smx_ctx_ruby_unschedule...Done\n");
-#endif
-}
-
- else
- rb_raise(rb_eRuntimeError,"smx_ctx_ruby_suspend failed");
-
-}
-
-static void smx_ctx_ruby_resume(smx_context_t old_context,smx_context_t new_context)
-{
-
- smx_ctx_ruby_t ctx_ruby = (smx_ctx_ruby_t) new_context;
- process_schedule(ctx_ruby->process);
-
- #ifdef MY_DEBUG
- printf("smx_ctx_ruby_schedule...Done\n");
- #endif
-
-}
+++ /dev/null
-/* $Id: stub_generator.c 6309 2009-05-26 15:29:22Z mquinson $ */
-
-/* gras_stub_generator - creates the main() to use a GRAS program */
-
-/* Copyright (c) 2003-2007 Martin Quinson, Arnaud Legrand, Malek Cherier. */
-/* All rights reserved. */
-
-/* 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. */
-
-/* specific to Borland Compiler */
-#ifdef __BORLANDDC__
-#pragma hdrstop
-#endif
-
-#include <stdio.h>
-#include "xbt/sysdep.h"
-#include "xbt/function_types.h"
-#include "xbt/log.h"
-#include "surf/surfxml_parse.h"
-#include "surf/surf.h"
-#include "portable.h" /* Needed for the time of the SIMIX convertion */
-
-#include "gras_stub_generator.h"
-#include <stdarg.h>
-
-
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(stubgen, gras, "Stub generator");
-
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-/* specific to Borland Compiler */
-#ifdef __BORLANDDC__
-#pragma argsused
-#endif
-
-
-/**********************************************/
-/********* Parse XML deployment file **********/
-/**********************************************/
-xbt_dict_t process_function_set = NULL;
-xbt_dynar_t process_list = NULL;
-xbt_dict_t machine_set = NULL;
-
-void s_process_free(void *process)
-{
- s_process_t *p = (s_process_t *) process;
- int i;
- for (i = 0; i < p->argc; i++)
- free(p->argv[i]);
- free(p->argv);
- free(p->host);
-}
-
-static s_process_t process;
-
-static void parse_process_init(void)
-{
- xbt_dict_set(process_function_set, A_surfxml_process_function, NULL, NULL);
- xbt_dict_set(machine_set, A_surfxml_process_host, NULL, NULL);
- process.argc = 1;
- process.argv = xbt_new(char *, 1);
- process.argv[0] = xbt_strdup(A_surfxml_process_function);
- process.host = strdup(A_surfxml_process_host);
- /*VERB1("Function: %s",A_surfxml_process_function); */
-}
-
-static void parse_argument(void)
-{
- process.argc++;
- process.argv = xbt_realloc(process.argv, (process.argc) * sizeof(char *));
- process.argv[(process.argc) - 1] = xbt_strdup(A_surfxml_argument_value);
-}
-
-static void parse_process_finalize(void)
-{
- xbt_dynar_push(process_list, &process);
- /*VERB1("Function: %s",process.argv[0]); */
-}
-
-/*void surfxml_add_callback(xbt_dynar_t cb_list, void_f_void_t function)
-{
- xbt_dynar_push(cb_list, &function);
-}*/
-
-
-int main(int argc, char *argv[])
-{
- char *project_name = NULL;
- char *deployment_file = NULL;
- int i;
-
- surf_init(&argc, argv);
- process_function_set = xbt_dict_new();
- process_list = xbt_dynar_new(sizeof(s_process_t), s_process_free);
- machine_set = xbt_dict_new();
-
- for (i = 1; i < argc; i++) {
- int need_removal = 0;
- if (!strncmp("--extra-process=", argv[i], strlen("--extra-process="))) {
- xbt_dict_set(process_function_set, argv[i] + strlen("--extra-process="),
- NULL, NULL);
- need_removal = 1;
- }
-
-
- if (need_removal) { /* remove the handled argument from argv */
- int j;
- for (j = i + 1; j < argc; j++) {
- argv[j - 1] = argv[j];
- }
- argv[j - 1] = NULL;
- argc--;
- i--; /* compensate effect of next loop incrementation */
- }
- }
-
- xbt_assert1((argc >= 3),
- "Usage: %s project_name deployment_file [deployment_file...]\n",
- argv[0]);
-
- project_name = argv[1];
-
- surf_parse_reset_parser();
- DEBUG2("%p %p", parse_process_init, &parse_process_init);
- surfxml_add_callback(STag_surfxml_process_cb_list, &parse_process_init);
- surfxml_add_callback(ETag_surfxml_argument_cb_list, &parse_argument);
- surfxml_add_callback(ETag_surfxml_process_cb_list, &parse_process_finalize);
-
- for (i = 2; i < argc; i++) {
- deployment_file = argv[i];
- surf_parse_open(deployment_file);
- if (surf_parse())
- xbt_assert1(0, "Parse error in %s", deployment_file);
-
- surf_parse_close();
- }
-
-
- warning = xbt_new(char, strlen(WARN) + strlen(deployment_file) + 10);
- sprintf(warning, WARN, deployment_file);
-
- /*if(XBT_LOG_ISENABLED(stubgen, xbt_log_priority_debug)) {
- xbt_dict_cursor_t cursor=NULL;
- char *key = NULL;
- void *data = NULL;
-
- for (cursor=NULL, xbt_dict_cursor_first((process_function_set),&(cursor)) ;
- xbt_dict_cursor_get_or_free(&(cursor),&(key),(void**)(&data));
- xbt_dict_cursor_step(cursor) ) {
- DEBUG1("Function %s", key);
- }
-
- xbt_dict_dump(process_function_set,print);
- } */
-
- generate_sim(project_name);
- generate_rl(project_name);
- generate_makefile_local(project_name, deployment_file);
-#ifdef _WIN32
- generate_borland_simulation_project(project_name);
- generate_borland_real_life_project(project_name);
- generate_simulation_dsp_file(project_name);
- generate_real_live_dsp_file(project_name);
-
- if (__gras_path)
- xbt_free(__gras_path);
-#endif
-
- free(warning);
- surf_exit();
- return 0;
-}
+++ /dev/null
-make clean
-rm -rf CMakeFiles Testing
-rm Makefile CMakeCache.txt conftestval DartConfiguration.tcl *.cmake
find_path(VALGRIND_PATH NAMES valgrind PATHS NO_DEFAULT_PATHS)
### AUTO DETECT THE PROJECT_DIRECTORY
-exec_program("${PWD_EXE}" ARGS "| ${SED_EXE} 's/\\/CPACK//g'" OUTPUT_VARIABLE PROJECT_DIRECTORY)
+exec_program("${PWD_EXE}" ARGS "| ${SED_EXE} 's/\\/Cmake//g'" OUTPUT_VARIABLE PROJECT_DIRECTORY)
### SET THE PROJECT_DIRECTORY
#SET(PROJECT_DIRECTORY "/home/navarrop/Bureau/simgrid-trunk")
add_definitions (${INCLUDES} -fprofile-arcs -ftest-coverage)
### Setup Options
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeOption.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeOption.txt)
### Make the *.h files with *.h.in files
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeCompleteInFiles.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeCompleteInFiles.txt)
### Define source packages for Libs
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeDefinePackages.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDefinePackages.txt)
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeFLEXml.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeFLEXml.txt)
### Setup gcc flags
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeFlags.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeFlags.txt)
### Make Libs and Exes
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeMakeExeLib.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeMakeExeLib.txt)
### Make tests
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeTest.txt)
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CTestConfig.cmake)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeTest.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CTestConfig.cmake)
### Setup the distrib
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeDistrib.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDistrib.txt)
### Print ARGS
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakePrintArgs.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakePrintArgs.txt)
### Make Docs
-include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeDocs.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDocs.txt)
INCLUDE(Dart)
SET(BUILDNAME "GTNETS" CACHE TYPE INTERNAL FORCE)
set(GTNETS_LDFLAGS "-L${gtnets_path}/lib")
set(GTNETS_CPPFLAGS "-I${gtnets_path}/include/gtnets")
- exec_program("${CMAKE_CXX_COMPILER} ${GTNETS_CPPFLAGS} -lgtnets ${GTNETS_LDFLAGS} ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_gtnets.cpp " OUTPUT_VARIABLE COMPILE_GTNETS_VAR)
+ exec_program("${CMAKE_CXX_COMPILER} ${GTNETS_CPPFLAGS} -lgtnets ${GTNETS_LDFLAGS} ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_gtnets.cpp " OUTPUT_VARIABLE COMPILE_GTNETS_VAR)
if(COMPILE_GTNETS_VAR)
SET(HAVE_GTNETS 0)
message("GTnetS doesn't works : set -Ddisable_gtnets=on")
### HAVE_SEM_INIT
CHECK_LIBRARY_EXISTS(pthread sem_init NO_DEFAULT_PATHS HAVE_SEM_INIT_LIB)
if(HAVE_SEM_INIT_LIB)
- exec_program("${CMAKE_C_COMPILER} -lpthread ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_sem_init.c" OUTPUT_VARIABLE HAVE_SEM_INIT_run)
+ exec_program("${CMAKE_C_COMPILER} -lpthread ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_sem_init.c" OUTPUT_VARIABLE HAVE_SEM_INIT_run)
if(HAVE_SEM_INIT_run)
set(HAVE_SEM_INIT 0)
else(HAVE_SEM_INIT_run)
### HAVE_SEM_TIMEDWAIT
CHECK_LIBRARY_EXISTS(pthread sem_timedwait NO_DEFAULT_PATHS HAVE_SEM_TIMEDWAIT_LIB)
if(HAVE_SEM_TIMEDWAIT_LIB)
- exec_program("${CMAKE_C_COMPILER} -lpthread ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_sem_timedwait.c" OUTPUT_VARIABLE HAVE_SEM_TIMEDWAIT_run)
+ exec_program("${CMAKE_C_COMPILER} -lpthread ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_sem_timedwait.c" OUTPUT_VARIABLE HAVE_SEM_TIMEDWAIT_run)
if(HAVE_SEM_TIMEDWAIT_run)
set(HAVE_SEM_TIMEDWAIT 0)
else(HAVE_SEM_TIMEDWAIT_run)
### HAVE_MUTEX_TIMEDLOCK
CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock NO_DEFAULT_PATHS HAVE_MUTEX_TIMEDLOCK_LIB)
if(HAVE_MUTEX_TIMEDLOCK_LIB)
- exec_program("${CMAKE_C_COMPILER} -lpthread ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_mutex_timedlock.c" OUTPUT_VARIABLE HAVE_SEM_TIMEDWAIT_run)
+ exec_program("${CMAKE_C_COMPILER} -lpthread ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_mutex_timedlock.c" OUTPUT_VARIABLE HAVE_SEM_TIMEDWAIT_run)
if(HAVE_MUTEX_TIMEDLOCK_run)
set(HAVE_MUTEX_TIMEDLOCK 0)
else(HAVE_MUTEX_TIMEDLOCK_run)
try_run(RUN_mcsc_VAR COMPILE_mcsc_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_AC_CHECK_MCSC.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_AC_CHECK_MCSC.c
COMPILE_DEFINITIONS "${mcsc_flags}"
)
file(READ "${PROJECT_DIRECTORY}/conftestval" mcsc)
# Check architecture signature begin
try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_GRAS_ARCH.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_GRAS_ARCH.c
RUN_OUTPUT_VARIABLE var1
)
if(BIGENDIAN)
# Check architecture signature end
try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_GRAS_CHECK_STRUCT_COMPACTION.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_GRAS_CHECK_STRUCT_COMPACTION.c
RUN_OUTPUT_VARIABLE var2
)
separate_arguments(var2)
# Check for [SIZEOF_MAX]
try_run(RUN_SM_VAR COMPILE_SM_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_max_size.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_max_size.c
RUN_OUTPUT_VARIABLE var3
)
SET(SIZEOF_MAX ${var3})
try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_stacksetup.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_stacksetup.c
COMPILE_DEFINITIONS "${makecontext_CPPFLAGS} ${makecontext_CPPFLAGS_2}"
)
try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_stackgrowth.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_stackgrowth.c
)
file(READ "${PROJECT_DIRECTORY}/conftestval" stack)
if(stack MATCHES "down")
#AC_PRINTF_NULL
try_run(RUN_PRINTF_NULL_VAR COMPILE_PRINTF_NULL_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_printf_null.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_printf_null.c
)
if(RUN_PRINTF_NULL_VAR MATCHES "FAILED_TO_RUN")
)
foreach(fct ${diff_va})
- write_file("${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_va_copy.c" "#include <stdlib.h>
+ write_file("${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_va_copy.c" "#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#define DO_VA_COPY(d,s) ${fct}
)
try_run(RUN_VA_NULL_VAR COMPILE_VA_NULL_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_va_copy.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_va_copy.c
)
if(RUN_VA_NULL_VAR MATCHES "FAILED_TO_RUN")
else(RUN_VA_NULL_VAR MATCHES "FAILED_TO_RUN")
### Try execut getline command
try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_getline.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_getline.c
OUTPUT_VARIABLE GETLINE_OUTPUT
)
try_run(RUN_SNPRINTF_FUNC_VAR COMPILE_SNPRINTF_FUNC_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_snprintf.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_snprintf.c
)
if(CMAKE_CROSSCOMPILING)
#message("SNPRINTF_FUNC CROSSCOMPILING")
try_run(RUN_VSNPRINTF_FUNC_VAR COMPILE_VSNPRINTF_FUNC_VAR
${PROJECT_DIRECTORY}
- ${PROJECT_DIRECTORY}/buildtools/CPACK/prog_test/prog_vsnprintf.c
+ ${PROJECT_DIRECTORY}/buildtools/Cmake/prog_test/prog_vsnprintf.c
)
if(CMAKE_CROSSCOMPILING)
#message("VSNPRINTF_FUNC CROSSCOMPILING")
configure_file(${PROJECT_DIRECTORY}/src/context_sysv_config.h.in ${PROJECT_DIRECTORY}/src/context_sysv_config.h)
SET( CMAKEDEFINE "#cmakedefine" )
-configure_file("${PROJECT_DIRECTORY}/buildtools/CPACK/src/gras_config.h.in" "${PROJECT_DIRECTORY}/buildtools/CPACK/src/tmp_gras_config.h.in" @ONLY IMMEDIATE)
-configure_file("${PROJECT_DIRECTORY}/buildtools/CPACK/src/tmp_gras_config.h.in" "${PROJECT_DIRECTORY}/src/gras_config.h" @ONLY IMMEDIATE)
+configure_file("${PROJECT_DIRECTORY}/buildtools/Cmake/src/gras_config.h.in" "${PROJECT_DIRECTORY}/buildtools/Cmake/src/tmp_gras_config.h.in" @ONLY IMMEDIATE)
+configure_file("${PROJECT_DIRECTORY}/buildtools/Cmake/src/tmp_gras_config.h.in" "${PROJECT_DIRECTORY}/src/gras_config.h" @ONLY IMMEDIATE)
configure_file(${PROJECT_DIRECTORY}/include/simgrid_config.h.in ${PROJECT_DIRECTORY}/include/simgrid_config.h)
if(NOT prefix)
set(includedir ${prefix}/include)
set(top_builddir ${PROJECT_DIRECTORY})
set(libdir ${exec_prefix}/lib)
-configure_file(${PROJECT_DIRECTORY}/buildtools/CPACK/src/smpicc.in ${PROJECT_DIRECTORY}/src/smpi/smpicc @ONLY)
-configure_file(${PROJECT_DIRECTORY}/buildtools/CPACK/src/smpirun.in ${PROJECT_DIRECTORY}/src/smpi/smpirun @ONLY)
+configure_file(${PROJECT_DIRECTORY}/buildtools/Cmake/src/smpicc.in ${PROJECT_DIRECTORY}/src/smpi/smpicc @ONLY)
+configure_file(${PROJECT_DIRECTORY}/buildtools/Cmake/src/smpirun.in ${PROJECT_DIRECTORY}/src/smpi/smpirun @ONLY)
#message("__END_GRAS_&_SIMGRID____\n")
)
###buildtools
-install(DIRECTORY "${PROJECT_DIRECTORY}/buildtools/CPACK/"
-DESTINATION "/buildtools/CPACK/"
+install(DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/"
+DESTINATION "/buildtools/Cmake/"
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
PATTERN "*~" EXCLUDE
find_path(BIBTOOL_PATH NAMES bibtool PATHS NO_DEFAULT_PATHS)
if(NOT EXISTS "${PROJECT_DIRECTORY}/bibtex2html-1.02/src/bibtex2html")
- write_file("${PROJECT_DIRECTORY}/buildtools/CPACK/bibtex2html_install.sh"
+ write_file("${PROJECT_DIRECTORY}/buildtools/Cmake/bibtex2html_install.sh"
"#! /bin/sh
wget ftp://ftp-sop.inria.fr/epidaure/Softs/bibtex2html/bibtex2html-1.02.tar.gz
rm -rf bibtex2html-1.02
cd bibtex2html-1.02/src
make"
)
- exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/buildtools/CPACK/bibtex2html_install.sh")
- exec_program("${PROJECT_DIRECTORY}/buildtools/CPACK/bibtex2html_install.sh" OUTPUT_VARIABLE OKITOKI)
+ exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/buildtools/Cmake/bibtex2html_install.sh")
+ exec_program("${PROJECT_DIRECTORY}/buildtools/Cmake/bibtex2html_install.sh" OUTPUT_VARIABLE OKITOKI)
if(EXISTS "${PROJECT_DIRECTORY}/bibtex2html-1.02/src/bibtex2html")
set(BIBTEX2HTML_PATH ${PROJECT_DIRECTORY}/bibtex2html-1.02/src)
### Make Libs
if(supernovae)
- include(${PROJECT_DIRECTORY}/buildtools/CPACK/src/CMakeSupernovae.txt)
+ include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeSupernovae.txt)
else(supernovae)
add_library(simgrid SHARED ${simgrid_sources})
add_library(simgrid_static STATIC ${simgrid_sources})
### Be sure we can execut some launch file
-exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/buildtools/CPACK/test_java.sh" OUTPUT_VARIABLE "OKITOKI")
+exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/buildtools/Cmake/test_java.sh" OUTPUT_VARIABLE "OKITOKI")
exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/src/smpi/smpirun" OUTPUT_VARIABLE "OKITOKI")
### For code coverage
if(HAVE_JAVA)
# java examples
-ADD_TEST(java-basic ${PROJECT_DIRECTORY}/buildtools/CPACK/test_java.sh ${PROJECT_DIRECTORY}/examples/java/basic BasicTest)
-ADD_TEST(java-pingpong ${PROJECT_DIRECTORY}/buildtools/CPACK/test_java.sh ${PROJECT_DIRECTORY}/examples/java/ping_pong PingPongTest)
-ADD_TEST(java-comm_time ${PROJECT_DIRECTORY}/buildtools/CPACK/test_java.sh ${PROJECT_DIRECTORY}/examples/java/comm_time CommTimeTest)
-ADD_TEST(java-suspend ${PROJECT_DIRECTORY}/buildtools/CPACK/test_java.sh ${PROJECT_DIRECTORY}/examples/java/suspend SuspendTest)
+ADD_TEST(java-basic ${PROJECT_DIRECTORY}/buildtools/Cmake/test_java.sh ${PROJECT_DIRECTORY}/examples/java/basic BasicTest)
+ADD_TEST(java-pingpong ${PROJECT_DIRECTORY}/buildtools/Cmake/test_java.sh ${PROJECT_DIRECTORY}/examples/java/ping_pong PingPongTest)
+ADD_TEST(java-comm_time ${PROJECT_DIRECTORY}/buildtools/Cmake/test_java.sh ${PROJECT_DIRECTORY}/examples/java/comm_time CommTimeTest)
+ADD_TEST(java-suspend ${PROJECT_DIRECTORY}/buildtools/Cmake/test_java.sh ${PROJECT_DIRECTORY}/examples/java/suspend SuspendTest)
endif(HAVE_JAVA)
# smpi examples
ADD_TEST(smpi-bcast ${PROJECT_DIRECTORY}/tools/tesh/tesh --cd ${PROJECT_DIRECTORY}/examples/smpi bcast.tesh)
# CMake generated Testfile for
# Source directory: /home/navarrop/Bureau/simgrid/src
-# Build directory: /home/navarrop/Bureau/simgrid/CPACK/src
+# Build directory: /home/navarrop/Bureau/simgrid/Cmake/src
#
# This file includes the relevent testing commands required for
# testing this directory and lists subdirectories to be tested as well.
+++ /dev/null
-#! /bin/sh
-make clean
-make
-ctest -D ExperimentalStart
-ctest -D ExperimentalUpdate
-ctest -D ExperimentalConfigure
-ctest -D ExperimentalBuild
-ctest -D ExperimentalTest
-ctest -D ExperimentalCoverage
-ctest -D ExperimentalMemCheck
-#ctest -D ExperimentalSubmit
-