From 18c4ea4a3ba045706899395c8a85e2e7226d7122 Mon Sep 17 00:00:00 2001 From: mquinson Date: Sun, 28 Nov 2010 10:45:50 +0000 Subject: [PATCH] let the binding examples work without the funky symlinks. This is a step further to real out of source builds git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8713 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- buildtools/Cmake/MakeExeLib.cmake | 30 +------------------ examples/lua/master_slave.tesh | 3 ++ examples/lua/master_slave_bypass.tesh | 3 ++ examples/lua/mult_matrix.tesh | 3 ++ .../msg/masterslave/masterslave_console.tesh | 3 ++ examples/ruby/MasterSlave.tesh | 5 +++- examples/ruby/PingPong.tesh | 3 ++ examples/ruby/Quicksort.tesh | 3 ++ 8 files changed, 23 insertions(+), 30 deletions(-) diff --git a/buildtools/Cmake/MakeExeLib.cmake b/buildtools/Cmake/MakeExeLib.cmake index 90ced4c2f0..4edd843e33 100644 --- a/buildtools/Cmake/MakeExeLib.cmake +++ b/buildtools/Cmake/MakeExeLib.cmake @@ -36,14 +36,6 @@ endif(HAVE_PCRE_LIB) if(HAVE_RUBY) set(SIMGRID_DEP "${SIMGRID_DEP} -l${RUBY_LIBRARY_NAME} -module") - ADD_CUSTOM_TARGET(link_simgrid_ruby ALL - DEPENDS simgrid ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} - ) - add_custom_command( - OUTPUT ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} - COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand - COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} - ) endif(HAVE_RUBY) if(CMAKE_SYSTEM_NAME MATCHES "Darwin") @@ -61,27 +53,7 @@ if(pthread) endif(pthread) if(HAVE_LUA) - SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl -l${LIB_LUA_NAME}") - - ADD_CUSTOM_TARGET(link_simgrid_lua ALL - DEPENDS simgrid - ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} - ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} - ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} - ) - add_custom_command( - OUTPUT ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} - ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} - ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} - COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand - COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} #for test - - COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand - COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} #for test - - COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand - COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} #for test - ) + SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl -l${LIB_LUA_NAME}") endif(HAVE_LUA) if(HAVE_GRAPHVIZ) diff --git a/examples/lua/master_slave.tesh b/examples/lua/master_slave.tesh index 75cbf910f3..3707638c35 100644 --- a/examples/lua/master_slave.tesh +++ b/examples/lua/master_slave.tesh @@ -2,6 +2,9 @@ # Later modify the commande and specify the platform and deployment path +# The setenv is mandatory until the make install only +! setenv LUA_CPATH=../../lib/lua/5.1/?.so; + $ lua master_slave.lua > [Tremblay:Master:(1) 0.000000] [lua/INFO] Hello from lua, I'm the master > [Tremblay:Master:(1) 0.000000] [lua/INFO] Got 20 diff --git a/examples/lua/master_slave_bypass.tesh b/examples/lua/master_slave_bypass.tesh index 14b6f6d7ba..f9473ef611 100644 --- a/examples/lua/master_slave_bypass.tesh +++ b/examples/lua/master_slave_bypass.tesh @@ -1,5 +1,8 @@ # compile the master_slave_bypass example +# The setenv is mandatory until the make install only +! setenv LUA_CPATH=../../lib/lua/5.1/?.so; + $ lua master_slave.lua --log=surf_parse.thres:critical > [Tremblay:Master:(1) 0.000000] [lua/INFO] Hello from lua, I'm the master > [Tremblay:Master:(1) 0.000000] [lua/INFO] Got 20 diff --git a/examples/lua/mult_matrix.tesh b/examples/lua/mult_matrix.tesh index 24fd093958..8f10b123aa 100644 --- a/examples/lua/mult_matrix.tesh +++ b/examples/lua/mult_matrix.tesh @@ -2,6 +2,9 @@ # Later modify the commande and specify the platform and deployment path +# The setenv is mandatory until the make install only +! setenv LUA_CPATH=../../lib/lua/5.1/?.so; + $ lua mult_matrix.lua > [Inmos:Sender:(1) 0.000000] [lua/INFO] Hello From Sender > [Inmos:Sender:(1) 0.000000] [lua/INFO] Argc=4 (should be 4) diff --git a/examples/msg/masterslave/masterslave_console.tesh b/examples/msg/masterslave/masterslave_console.tesh index fbd8ab2cc0..0b9c96485e 100644 --- a/examples/msg/masterslave/masterslave_console.tesh +++ b/examples/msg/masterslave/masterslave_console.tesh @@ -1,5 +1,8 @@ #! ./tesh +# The setenv is mandatory until the make install only +! setenv LUA_CPATH=../../../lib/lua/5.1/?.so; + $ $SG_TEST_EXENV ./masterslave_console platform_script.lua --log=surf_parse.thres:critical > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 4 slaves and 20 tasks to process > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0" diff --git a/examples/ruby/MasterSlave.tesh b/examples/ruby/MasterSlave.tesh index 0522dd885d..3a38d3fedf 100644 --- a/examples/ruby/MasterSlave.tesh +++ b/examples/ruby/MasterSlave.tesh @@ -1,6 +1,9 @@ # MasterSlave Ruby Example + +# This setenv and the -I arg are mandatory until the make install only ! setenv RUBYLIB=../../lib -$ ruby -I../../src/bindings/ruby MasterSlave.rb + +$ ruby -I ../../src/bindings/ruby MasterSlave.rb > [Tremblay:Master:(1) 0.000000] [ruby/INFO] args[0]=20 > [Tremblay:Master:(1) 0.000000] [ruby/INFO] args[1]=50000000 > [Tremblay:Master:(1) 0.000000] [ruby/INFO] args[2]=1000000 diff --git a/examples/ruby/PingPong.tesh b/examples/ruby/PingPong.tesh index d0d6ae5d1c..501b23c873 100644 --- a/examples/ruby/PingPong.tesh +++ b/examples/ruby/PingPong.tesh @@ -1,5 +1,8 @@ #PingPong Example + +# This setenv and the -I arg are mandatory until the make install only ! setenv RUBYLIB=../../lib + $ ruby -I ../../src/bindings/ruby PingPong.rb > [Inmos:Sender:(1) 0.000000] [ruby/INFO] Hello from Sender > [Inmos:Sender:(1) 0.000000] [ruby/INFO] Host count :1 diff --git a/examples/ruby/Quicksort.tesh b/examples/ruby/Quicksort.tesh index 866e3ae9cd..19a035298a 100644 --- a/examples/ruby/Quicksort.tesh +++ b/examples/ruby/Quicksort.tesh @@ -1,5 +1,8 @@ #QuickSort Ruby Example + +# This setenv and the -I arg are mandatory until the make install only ! setenv RUBYLIB=../../lib + $ ruby -I ../../src/bindings/ruby Quicksort.rb > [Inmos:Sender:(1) 0.000000] [ruby/INFO] Hello Bellevue !!, Please !! I need you to help me to sort my table , Here it is : > [1, -2, 45, 67, 87, 76, 89, 56, 78, 3, -4, 99] -- 2.20.1