Commit b7da9605 authored by Jens Korinth's avatar Jens Korinth
Browse files

WIP: Some more fixes for building libtapasco

parent 541247ab
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8)
project(arch-axi4mm)
set(CMAKE_INSTALL_PREFIX "..")
set(CMAKE_SKIP_RPATH true)
if (NOT EXISTS "$ENV{TAPASCO_HOME}")
message(FATAL_ERROR "Please set TAPASCO_HOME environment variable to root directory of Tapasco")
......@@ -11,9 +10,6 @@ include ("$ENV{TAPASCO_HOME}/cmake/Tapasco.cmake")
set(SRCDIR "src")
set(CMNDIR "../common/src")
set(GCMNDIR "${TAPASCO_HOME}/common")
set(PLATFORMDIR "${TAPASCO_HOME}/platform")
set(LIBPLATFORM_STATIC "${TAPASCO_HOME}/platform/lib/${TAPASCO_TARGET}/static/libplatform.a")
set(AXI4MM_SOURCES "${SRCDIR}/tapasco_axi4mm.c"
"${SRCDIR}/tapasco_device.c"
......@@ -28,18 +24,16 @@ set(COMMON_SOURCES "${CMNDIR}/tapasco_delayed_transfers.c"
"${CMNDIR}/tapasco_pemgmt.c"
"${CMNDIR}/tapasco_scheduler.c"
"${CMNDIR}/tapasco_version.c"
"${GCMNDIR}/src/gen_mem.c"
"${GCMNDIR}/src/gen_queue.c")
"${TAPASCO_COMMON_DIR}/src/gen_mem.c"
"${TAPASCO_COMMON_DIR}/src/gen_queue.c")
set(TAPASCO_LIBS_DIR "${TAPASCO_HOME}/arch/lib")
include_directories("include" "../common/include" "${PLATFORMDIR}/common/include" "${GCMNDIR}/include")
link_directories("${PLATFORMDIR}/lib/${TAPASCO_TARGET}")
include_directories(${TAPASCO_INCDIRS})
include_directories("include" "../common/include" "${PLATFORMDIR}/common/include" "${TAPASCO_COMMON_DIR}/src/include")
add_definitions(-DUSE_ASSERTIONS)
set_source_files_properties(${AXI4MM_SOURCES} ${COMMON_SOURCES} PROPERTIES COMPILE_FLAGS "-g -O3 -Wall -Werror -std=gnu11")
set_source_files_properties(${AXI4MM_SOURCES} ${COMMON_SOURCES} PROPERTIES COMPILE_FLAGS ${TAPASCO_CFLAGS})
add_library(tapasco SHARED ${AXI4MM_SOURCES} ${COMMON_SOURCES})
add_library(libtapasco-static STATIC ${AXI4MM_SOURCES} ${COMMON_SOURCES} ${LIBPLATFORM_STATIC})
add_library(libtapasco-static STATIC ${AXI4MM_SOURCES} ${COMMON_SOURCES} ${TAPASCO_PLATFORM_LIB})
target_link_libraries(tapasco platform atomic pthread)
set_target_properties(libtapasco-static PROPERTIES OUTPUT_NAME tapasco)
......@@ -47,8 +41,3 @@ set_target_properties(libtapasco-static PROPERTIES OUTPUT_NAME tapasco)
install(TARGETS tapasco libtapasco-static
LIBRARY DESTINATION "lib/${TAPASCO_TARGET}"
ARCHIVE DESTINATION "lib/${TAPASCO_TARGET}/static")
get_filename_component(LIBSDIR "lib" REALPATH)
add_custom_command(OUTPUT ${TAPASCO_LIBS_DIR}
COMMAND ln;-fs;${LIBSDIR};${TAPASCO_LIBS_DIR})
add_custom_target(install_libs ALL DEPENDS tapasco libtapasco-static ${TAPASCO_LIBS_DIR})
......@@ -34,7 +34,6 @@
#include <platform.h>
#include <platform_errors.h>
#include <platform_info.h>
#include <platform_context.h>
/** Internal device struct implementation. */
struct tapasco_dev_ctx {
......
cmake_minimum_required (VERSION 2.8)
include(ExternalProject)
project (tapasco-debug)
set(ADD_CCFLAGS "-g -Wall -Werror -std=gnu11 -fdiagnostics-color=auto")
set(ADD_CXXFLAGS "-g -Wall -Werror -std=c++11 -fno-rtti -fdiagnostics-color=auto")
set(ADD_LDFLAGS "-flto -static-libstdc++ -static-libgcc")
if ("$ENV{TAPASCO_HOME}" STREQUAL "")
message(FATAL_ERROR "Please set env var TAPASCO_HOME to root directory of Tapasco.")
......@@ -13,21 +10,21 @@ include ("$ENV{TAPASCO_HOME}/cmake/Tapasco.cmake")
set (CMAKE_INSTALL_PREFIX "${TAPASCO_HOME}/bin")
set(CXX_SOURCES tapasco_benchmark.cpp tapasco_debug.cpp json11.cpp)
set(CC_SOURCES ${TAPASCO_HOME}/common/src/gen_queue.c)
set(CC_SOURCES ${TAPASCO_COMMON_DIR}/src/gen_queue.c)
set_source_files_properties(${CXX_SOURCES} PROPERTIES COMPILE_FLAGS ${ADD_CXXFLAGS})
set_source_files_properties(${CC_SOURCES} PROPERTIES COMPILE_FLAGS ${ADD_CCFLAGS})
set_source_files_properties(${CXX_SOURCES} PROPERTIES COMPILE_FLAGS ${TAPASCO_CXXFLAGS})
set_source_files_properties(${CC_SOURCES} PROPERTIES COMPILE_FLAGS ${TAPASCO_CFLAGS})
link_directories(${TAPASCO_HOME}/arch/lib/${TAPASCO_TARGET}/static ${TAPASCO_HOME}/platform/lib/${TAPASCO_TARGET}/static)
include_directories(${TAPASCO_HOME}/common/include ${TAPASCO_HOME}/arch/common/include ${TAPASCO_HOME}/platform/common/include)
link_directories(${TAPASCO_STATICLINKDIRS})
include_directories(${TAPASCO_INCDIRS} "common/include")
add_executable (tapasco-debug tapasco_debug.cpp ${TAPASCO_HOME}/common/src/gen_queue.c)
add_executable (tapasco-debug tapasco_debug.cpp ${TAPASCO_COMMON_DIR}/src/gen_queue.c)
target_link_libraries (tapasco-debug tapasco platform pthread atomic ncurses)
set_target_properties (tapasco-debug PROPERTIES LINK_FLAGS ${ADD_LDFLAGS})
set_target_properties (tapasco-debug PROPERTIES LINK_FLAGS ${TAPASCO_LDFLAGS})
add_executable (tapasco-benchmark tapasco_benchmark.cpp json11.cpp)
target_link_libraries (tapasco-benchmark tapasco platform pthread atomic ncurses)
set_target_properties (tapasco-benchmark PROPERTIES LINK_FLAGS ${ADD_LDFLAGS})
set_target_properties (tapasco-benchmark PROPERTIES LINK_FLAGS ${TAPASCO_LDFLAGS})
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/json11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/json11.hpp
COMMAND rm -rf json11
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment