Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
c59540c832781a0a20182cf52406341e5aebcc61
[simgrid.git] / examples / 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}     ${x}/${x}.c)
9   target_link_libraries(${x}     simgrid)
10   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
11   set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
12   set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
13 endforeach()
14
15 # CPP examples
16 foreach(x maestro-set)
17   add_executable       (${x}     ${x}/${x}.cpp)
18   target_link_libraries(${x}     simgrid)
19   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
20   set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
21   set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
22 endforeach()
23
24 if(SIMGRID_HAVE_NS3)
25   add_executable       (network-ns3 network-ns3/network-ns3.c)
26   target_link_libraries(network-ns3 simgrid)
27   set_target_properties(network-ns3  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
28 endif()
29
30 add_executable       (dht-kademlia dht-kademlia/dht-kademlia.c dht-kademlia/node.c dht-kademlia/routing_table.c dht-kademlia/task.c dht-kademlia/answer.c)
31 target_link_libraries(dht-kademlia simgrid)
32 set_target_properties(dht-kademlia PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-kademlia)
33 foreach (file answer dht-kademlia node routing_table task)
34   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.c  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.h)
35 endforeach()
36
37 foreach (file app-masterworker dht-kademlia dht-pastry)
38   set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml)
39 endforeach()
40
41 set(txt_files    ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/README.doc          PARENT_SCOPE)
42 set(bin_files    ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py
43                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-pastry/generate.py                       PARENT_SCOPE)
44 set(examples_src ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/common.h
45                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/network-ns3.c                    PARENT_SCOPE)
46 set(tesh_files   ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/dht-kademlia.tesh
47                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore.tesh
48                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi.tesh
49                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/network-ns3.tesh                 PARENT_SCOPE)
50 set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore_d.xml
51                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi_d.xml
52                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3hosts_2links_d.xml
53                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3links-timer_d.xml
54                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3links_d.xml
55                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/crosstraffic_d.xml
56                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/dogbone_d.xml
57                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/onelink_d.xml
58                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/one_cluster_d.xml        PARENT_SCOPE)
59
60 foreach(x app-masterworker cloud-masterworker
61           dht-pastry dht-kademlia # FIXME: platform-failures is disabled
62           energy-vm
63           process-create 
64           synchro-semaphore)
65   ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" 
66                               --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x}
67                               --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/${x} 
68                               --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
69                               ${CMAKE_HOME_DIRECTORY}/examples/msg/${x}/${x}.tesh)
70 endforeach()
71
72 foreach (x trace-categories trace-route-user-variables trace-link-user-variables trace-masterworker trace-process-migration trace-host-user-variables)
73   ADD_TESH(msg-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x}
74                     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/${x} 
75                     --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
76                     --cd ${CMAKE_BINARY_DIR}/examples/msg/${x}
77                     ${CMAKE_HOME_DIRECTORY}/examples/msg/${x}/${x}.tesh)
78 endforeach()
79
80 if(HAVE_SANITIZER_THREAD)
81   ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "thread" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO}
82                                                --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/dht-kademlia
83                                                --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia
84                                                --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
85                                                ${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia/dht-kademlia.tesh)
86 else()
87   ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "thread;ucontext;raw;boost" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO}
88                                                --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/dht-kademlia
89                                                --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia
90                                                --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
91                                                ${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia/dht-kademlia.tesh)
92 endif()
93
94 if(NOT WIN32)
95   ADD_TESH_FACTORIES(msg-maestro-set   "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/maestro-set/maestro-set.tesh)
96 else()
97   message("Test maestro-set disabled on windows: this feature is not working")
98 endif()
99
100 ADD_TESH_FACTORIES(app-masterworker-multicore   "thread;ucontext;raw;boost" 
101                                                 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker 
102                                                 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/app-masterworker
103                                                 --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
104                                                 ${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker/app-masterworker-multicore.tesh)
105 ADD_TESH_FACTORIES(app-masterworker-vivaldi     "thread;ucontext;raw;boost" 
106                                                 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker 
107                                                 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/app-masterworker
108                                                 --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
109                                                 ${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker/app-masterworker-vivaldi.tesh)
110
111 if(SIMGRID_HAVE_NS3)
112   ADD_TESH_FACTORIES(msg-network-ns3 "thread;ucontext;raw;boost"
113                                       --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg
114                                       --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg
115                                       --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
116                                       ${CMAKE_HOME_DIRECTORY}/examples/msg/network-ns3/network-ns3.tesh)
117 endif()