Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Disable parallel ucontexts on 64bit SunOS.
[simgrid.git] / examples / deprecated / msg / CMakeLists.txt
1 # C examples
2 foreach(x app-masterworker cloud-masterworker
3           dht-pastry energy-vm platform-failures 
4           process-create 
5           synchro-semaphore trace-categories 
6           trace-route-user-variables trace-link-user-variables trace-masterworker
7           trace-process-migration trace-host-user-variables)
8   add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.c)
9   target_link_libraries(${x}  simgrid)
10   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
11   add_dependencies(tests ${x})
12   set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
13   set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
14 endforeach()
15
16 if(SIMGRID_HAVE_NS3)
17   add_executable       (network-ns3 EXCLUDE_FROM_ALL network-ns3/network-ns3.c)
18   target_link_libraries(network-ns3 simgrid)
19   set_target_properties(network-ns3  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
20   add_dependencies(tests network-ns3)    
21 endif()
22
23 add_executable       (dht-kademlia EXCLUDE_FROM_ALL dht-kademlia/dht-kademlia.c dht-kademlia/node.c dht-kademlia/routing_table.c dht-kademlia/task.c dht-kademlia/answer.c)
24 target_link_libraries(dht-kademlia simgrid)
25 set_target_properties(dht-kademlia PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-kademlia)
26 add_dependencies(tests dht-kademlia)
27 foreach (file answer dht-kademlia node routing_table task)
28   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.c  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.h)
29 endforeach()
30
31 foreach (file app-masterworker dht-kademlia dht-pastry)
32   set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml)
33 endforeach()
34
35 set(txt_files    ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/README.doc          PARENT_SCOPE)
36 set(bin_files    ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py
37                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-pastry/generate.py                       PARENT_SCOPE)
38 set(examples_src ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/common.h
39                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/network-ns3.c                    PARENT_SCOPE)
40 set(tesh_files   ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/dht-kademlia.tesh
41                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore.tesh
42                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi.tesh
43                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/network-ns3.tesh                 PARENT_SCOPE)
44 set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore_d.xml
45                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi_d.xml
46                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3hosts_2links_d.xml
47                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3links-timer_d.xml
48                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3links_d.xml
49                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/crosstraffic_d.xml
50                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/dogbone_d.xml
51                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/onelink_d.xml
52                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/one_cluster_d.xml        PARENT_SCOPE)
53
54 foreach(x app-masterworker cloud-masterworker
55           dht-pastry dht-kademlia platform-failures
56           energy-vm
57           process-create 
58           synchro-semaphore)
59   ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" 
60                               --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
61                               --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x} 
62                               --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
63                               ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh)
64 endforeach()
65
66 foreach (x trace-categories trace-route-user-variables trace-link-user-variables trace-masterworker trace-process-migration trace-host-user-variables)
67   ADD_TESH(msg-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
68                     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x} 
69                     --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
70                     --cd ${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
71                     ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh)
72 endforeach()
73
74 if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
75   # Thread-local storage (TLS) is needed for parallel execution, but it doesn't
76   # play well with Ucontexts on 64bit SunOS (at least on x86_64).
77   set(parallel-factories "thread;raw;boost")
78 else()
79   set(parallel-factories "thread;ucontext;raw;boost")
80 endif()
81 ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "${parallel-factories}" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO}
82                                              --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/dht-kademlia
83                                              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/dht-kademlia
84                                              --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
85                                              ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/dht-kademlia/dht-kademlia.tesh)
86
87 ADD_TESH_FACTORIES(app-masterworker-multicore   "thread;ucontext;raw;boost" 
88                                                 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker 
89                                                 --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/app-masterworker
90                                                 --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
91                                                 ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker/app-masterworker-multicore.tesh)
92 ADD_TESH_FACTORIES(app-masterworker-vivaldi     "thread;ucontext;raw;boost" 
93                                                 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker 
94                                                 --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/app-masterworker
95                                                 --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
96                                                 ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker/app-masterworker-vivaldi.tesh)
97
98 if(SIMGRID_HAVE_NS3)
99   ADD_TESH_FACTORIES(msg-network-ns3 "thread;ucontext;raw;boost"
100                                       --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg
101                                       --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg
102                                       --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
103                                       ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/network-ns3/network-ns3.tesh)
104 endif()