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")
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)
# 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
# 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
# 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)
#! ./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"
# 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
#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
#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]