Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit ca0b154c authored by Valentin Touzeau's avatar Valentin Touzeau Committed by EXT Valentin Touzeau
Browse files

Fix cudd and libextra compilation

parent 76e7afa8
......@@ -20,7 +20,8 @@ set(SOURCES "src/exactlru.cpp"
)
add_subdirectory(ddlib)
add_subdirectory(cudd)
add_subdirectory(extra)
# script
project(${PLUGIN})
......@@ -43,6 +44,10 @@ include_directories("${CMAKE_SOURCE_DIR}" "include")
add_library(${PLUGIN} SHARED ${SOURCES})
set_property(TARGET ${PLUGIN} PROPERTY PREFIX "")
set_property(TARGET ${PLUGIN} PROPERTY COMPILE_FLAGS "${OTAWA_CFLAGS} --std=c++11 -g -Wall -Wextra -pedantic")
add_dependencies(${PLUGIN} compile_cudd)
add_dependencies(${PLUGIN} compile_extra)
target_link_libraries(${PLUGIN} PUBLIC "${OTAWA_LDFLAGS}" cudd_core cudd_epd cudd_st cudd_util extra)
# installation
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
set(HEADERS_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/include)
# Note: This folder is created when Cudd Makefile is executed.
# Because set_target_properties would fail if the file is not present, Cudd is compiled on cmake invocation, and not at build time.
# It is however not possible to build an empty include directory to delay Cudd compilation because Cudd needs this folder not to exist when running make.
execute_process(
add_custom_target(
compile_cudd
COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
execute_process(
COMMAND patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1.patch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
execute_process(
COMMAND make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/
COMMAND cd cudd-2.3.1 && rm -r include
COMMAND cd cudd-2.3.1 && ./setup.sh
COMMAND make -C cudd-2.3.1
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/extra/)
set(HEADERS_FOLDER ${CMAKE_CURRENT_BINARY_DIR}/cudd-2.3.1/include)
file(MAKE_DIRECTORY ${HEADERS_FOLDER})
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/extra20a.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
execute_process(
COMMAND patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/extra20.patch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# CUDD
set(CUDD_LIB_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/cudd/libcudd.a)
set(EPD_LIB_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/epd/libepd.a)
set(ST_LIB_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/st/libst.a)
set(UTIL_LIB_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/util/libutil.a)
set(CUDD_LIB_FILE ${CMAKE_CURRENT_BINARY_DIR}/cudd-2.3.1/cudd/libcudd.a)
set(EPD_LIB_FILE ${CMAKE_CURRENT_BINARY_DIR}/cudd-2.3.1/epd/libepd.a)
set(ST_LIB_FILE ${CMAKE_CURRENT_BINARY_DIR}/cudd-2.3.1/st/libst.a)
set(UTIL_LIB_FILE ${CMAKE_CURRENT_BINARY_DIR}/cudd-2.3.1/util/libutil.a)
add_library(cudd_core STATIC IMPORTED GLOBAL)
add_library(cudd_epd STATIC IMPORTED GLOBAL)
......@@ -65,24 +45,3 @@ set_target_properties(cudd_util
INTERFACE_INCLUDE_DIRECTORIES ${HEADERS_FOLDER}
)
# EXTRA
set(EXTRA_LIB_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cudd-2.3.1/extra/libextra.a)
add_custom_command(
OUTPUT ${EXTRA_LIB_FILE}
COMMAND make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/extra20/
)
add_custom_target(extra_target DEPENDS ${EXTRA_LIB_FILE})
add_dependencies(extra_target cudd_core)
add_library(extra STATIC IMPORTED GLOBAL)
add_dependencies(extra extra_target)
set_target_properties(extra
PROPERTIES
IMPORTED_LOCATION ${EXTRA_LIB_FILE}
INTERFACE_INCLUDE_DIRECTORIES ${HEADERS_FOLDER}
)
add_custom_target(
compile_extra
COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/extra20a.tar.gz
COMMAND patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/extra20.patch
COMMAND make -C extra20
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
)
add_dependencies(compile_extra compile_cudd)
set(HEADERS_FOLDER ${CMAKE_CURRENT_BINARY_DIR}/extra20/)
file(MAKE_DIRECTORY ${HEADERS_FOLDER})
set(EXTRA_LIB_FILE ${CMAKE_CURRENT_BINARY_DIR}/extra20/libextra.a)
add_library(extra STATIC IMPORTED GLOBAL)
set_target_properties(extra
PROPERTIES
IMPORTED_LOCATION ${EXTRA_LIB_FILE}
INTERFACE_INCLUDE_DIRECTORIES ${HEADERS_FOLDER}
)
......@@ -15,8 +15,8 @@ diff -r -c extra20/Makefile extra20/Makefile
.SILENT:
# modify these macros to point to your include and lib directory
! INCDIR = ../cudd-2.3.1/include/
! LIBDIR = ../cudd-2.3.1/extra/
! INCDIR = ../../cudd/cudd-2.3.1/include/
! LIBDIR = /tmp/
# modify this line to compile with compilers other than g++
CC = gcc
......
Markdown is supported
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