FailBochs build process reversed

The FailBochs client is not linked by the Bochs build system anymore, but
by our cmake scripts (make fail-client):
 -  All Bochs libraries are merged into libfailbochs.a (a new target
    within the Bochs Autotools scripts).
 -  The previous libfail.a is *not* a merge of all Fail* libraries anymore,
    but pulls these in via library dependencies.

Additionally I did a lot of build system cleanup, e.g. additional external
libraries may now be pulled in where they're needed.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1390 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-06-29 22:22:41 +00:00
parent 651738fcca
commit 4a4b3ea7e2
28 changed files with 1298 additions and 171 deletions

View File

@ -12,28 +12,25 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core)
add_subdirectory(core)
# Here we add all user-defined experiments (which fills the target list)
add_subdirectory(experiments/)
add_subdirectory(experiments)
message(STATUS "[${PROJECT_NAME}] Chosen experiment targets:")
foreach(experiment_name ${EXPERIMENTS_ACTIVATED})
message(STATUS "[${PROJECT_NAME}] -> ${experiment_name}")
endforeach(experiment_name)
# Here we add activated plugins
add_subdirectory(plugins/)
add_subdirectory(plugins)
message(STATUS "[${PROJECT_NAME}] Chosen plugin targets:")
foreach(plugin_name ${PLUGINS_ACTIVATED})
message(STATUS "[${PROJECT_NAME}] -> ${plugin_name}")
endforeach(plugin_name)
## Merge all resulting Fail* libs into a single libfail.a and copy it into the fail source directory
add_custom_target(fail
COMMAND ${CMAKE_SOURCE_DIR}/cmake/mergelib.sh ${LIBRARY_OUTPUT_PATH} && ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/libfail.a ${CMAKE_SOURCE_DIR}/src
)
# FIXME: "libfail.a" should not be located in the source-tree...?!
# libfail: dummy library that pulls in all other libraries as dependencies
# (probably there's a smarter way to do that with cmake?)
add_library(fail dummy.cc)
## Setup build dependencies of the Fail* lib
## -> the Fail* targets and user defined experiment targets
add_dependencies(fail sal util cpn efw comm protomessages ${EXPERIMENTS_ACTIVATED} ${PLUGINS_ACTIVATED})
# Let make clean also delete libfail.a
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${LIBRARY_OUTPUT_PATH}/libfail.a)
# start/end-group: ld must iterate over these archives more than once to figure
# out which objects are needed
target_link_libraries(fail -Wl,--start-group ${EXPERIMENTS_ACTIVATED} ${PLUGINS_ACTIVATED} sal cpn efw comm util -Wl,--end-group)

View File

@ -1,11 +1,10 @@
### Add Boost and Threads
find_package(Boost 1.42 COMPONENTS thread REQUIRED)
find_package(Threads)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
### Setup doxygen documentation
# TODO: put into helpers.cmake
# TODO: put into helpers.cmake (?)
find_package(Doxygen)
if(DOXYGEN_FOUND)
# Using a .in file means we can use CMake to insert project settings

View File

@ -1,8 +1,20 @@
set(SRCS
ExperimentData.hpp
SocketComm.hpp
SocketComm.cc
)
add_subdirectory(msg)
## Setup desired protobuf descriptions HERE ##
set(MY_PROTOS
FailControlMessage.proto
)
add_library(comm ${SRCS})
add_dependencies(comm msg)
#### PROTOBUFS ####
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS})
add_library(comm ${SRCS} ${PROTO_SRCS} ${PROTO_HDRS})
target_link_libraries(comm ${PROTOBUF_LIBRARY})

View File

@ -1,15 +0,0 @@
## Setup desired protobuf descriptions HERE ##
set(MY_PROTOS
FailControlMessage.proto
)
#### PROTOBUFS ####
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS})
## Build library
add_library(msg ${PROTO_SRCS} ${PROTO_HDRS})

View File

@ -1,2 +0,0 @@
#!/bin/bash
protoc --cpp_out=. FailControlMessage.proto

View File

@ -9,7 +9,7 @@
#include <string.h>
#include <arpa/inet.h>
#include "comm/msg/FailControlMessage.pb.h"
#include "comm/FailControlMessage.pb.h"
#include "comm/SocketComm.hpp"
#include "JobServer.hpp"
#include "Minion.hpp"

View File

@ -1,10 +1,15 @@
set(SRCS
CoroutineManager.hpp
CoroutineManager.cc
ExperimentFlow.hpp
JobClient.hpp
JobClient.cc
)
# FIXME: Add dependency check for pcl-library here.
add_library(efw ${SRCS})
add_dependencies(efw comm)
find_package(LibPCL REQUIRED)
include_directories(${LIBPCL_INCLUDE_DIRS})
link_directories(${LIBPCL_LINK_DIRS})
target_link_libraries(efw ${LIBPCL_LIBRARIES})

View File

@ -9,7 +9,7 @@
#include "comm/SocketComm.hpp"
#include "comm/ExperimentData.hpp"
#include "comm/msg/FailControlMessage.pb.h"
#include "comm/FailControlMessage.pb.h"
#include "config/FailConfig.hpp"
namespace fail {

View File

@ -1,10 +1,24 @@
set(SRCS
SynchronizedCounter.cc
Logger.hpp
Logger.cc
Logger.hpp
MemoryMap.hpp
ProtoStream.cc
ProtoStream.hpp
SynchronizedCounter.cc
SynchronizedCounter.hpp
SynchronizedMap.hpp
SynchronizedQueue.hpp
)
add_library(util ${SRCS})
# required by ProtoStream.cc:
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# FIXME: Add protobuf-dependency (required by ProtoStream.cc@line56)
# required by Synchronized*.cc:
find_package(Boost 1.42 COMPONENTS thread REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
add_library(util ${SRCS})
target_link_libraries(util ${PROTOBUF_LIBRARY} ${Boost_THREAD_LIBRARY})

0
src/dummy.cc Normal file
View File