Build system update for the new Coloquinte location

This commit is contained in:
Gabriel Gouvine 2015-04-08 12:06:14 +02:00
parent a0f01a5e00
commit fe8b3fdbd6
6 changed files with 105 additions and 170 deletions

View File

@ -1,16 +1,36 @@
# -*- explicit-buffer-name: "CMakeLists.txt<Coloquinte/src>" -*- # -*- explicit-buffer-name: "CMakeLists.txt<etesian>" -*-
project(Coloquinte) set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(COLOQUINTE)
set(CMAKE_C_FLAGS_DEBUG " -Wall -O2 -g" CACHE STRING "C Compiler Debug options." FORCE) option(BUILD_DOC "Build the documentation (doxygen)" OFF)
set(CMAKE_C_FLAGS_RELEASE " -Wall -O3 -fopenmp" CACHE STRING "C Compiler Release options." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG " -Wall -Og -g" CACHE STRING "C++ Compiler Debug options." FORCE) cmake_minimum_required(VERSION 2.8.9)
set(CMAKE_CXX_FLAGS_RELEASE " -Wall -O3 -fopenmp" CACHE STRING "C++ Compiler Release options." FORCE)
cmake_minimum_required(VERSION 2.4.0) list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/")
find_package(Bootstrap REQUIRED)
add_definitions(-std=c++11) setup_project_paths(CORIOLIS)
setup_qt()
add_subdirectory(cmake_modules)
set_cmake_policies()
set_lib_link_mode()
setup_boost(program_options python regex)
find_package(LibXml2 REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(PythonSitePackages REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(LEFDEF REQUIRED)
find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED)
find_package(Libexecinfo REQUIRED)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(cmake_modules)
if(BUILD_DOC)
find_package(Doxygen)
# if(DOXYGEN_FOUND)
# add_subdirectory(doc)
# endif()
endif()

View File

@ -1,2 +1,2 @@
install ( FILES FindColoquinte.cmake DESTINATION share/cmake/Modules ) install ( FILES FindCOLOQUINTE.cmake DESTINATION share/cmake/Modules )

View File

@ -0,0 +1,37 @@
# - Find the Coloquinte includes and libraries.
# The following variables are set if Coriolis is found. If COLOQUINTE is not
# found, COLOQUINTE_FOUND is set to false.
# COLOQUINTE_FOUND - True when the Coriolis include directory is found.
# COLOQUINTE_INCLUDE_DIR - the path to where the Coriolis include files are.
# COLOQUINTE_LIBRARIES - The path to where the Coriolis library files are.
SET(COLOQUINTE_INCLUDE_PATH_DESCRIPTION "directory containing the Coloquinte include files. E.g /usr/local/include/coriolis or /asim/coriolis/include/coriolis")
SET(COLOQUINTE_DIR_MESSAGE "Set the COLOQUINTE_INCLUDE_DIR cmake cache entry to the ${COLOQUINTE_INCLUDE_PATH_DESCRIPTION}")
# don't even bother under WIN32
IF(UNIX)
#
# Look for an installation.
#
FIND_PATH(COLOQUINTE_INCLUDE_PATH NAMES coloquinte/netlist.hxx PATHS
# Look in other places.
${CORIOLIS_DIR_SEARCH}
PATH_SUFFIXES include/coriolis
# Help the user find it if we cannot.
DOC "The ${COLOQUINTE_INCLUDE_PATH_DESCRIPTION}"
)
FIND_LIBRARY(COLOQUINTE_LIBRARY_PATH
NAMES coloquinte
PATHS ${CORIOLIS_DIR_SEARCH}
PATH_SUFFIXES lib${LIB_SUFFIX}
# Help the user find it if we cannot.
DOC "The ${COLOQUINTE_INCLUDE_PATH_DESCRIPTION}"
)
SET_LIBRARIES_PATH(COLOQUINTE COLOQUINTE)
HURRICANE_CHECK_LIBRARIES(COLOQUINTE)
ENDIF(UNIX)

View File

@ -1,129 +0,0 @@
# - Find the Coloquinte includes and libraries.
# The following variables are set if Coriolis is found. If COLOQUINTE is not
# found, COLOQUINTE_FOUND is set to false.
# COLOQUINTE_FOUND - True when the Coriolis include directory is found.
# COLOQUINTE_INCLUDE_DIR - the path to where the Coriolis include files are.
# COLOQUINTE_LIBRARIES - The path to where the Coriolis library files are.
# =============================================================================
# Duplicated from <bootstrap> as <COLOQUINTE> is standalone.
#
# Setup the <PROJECT>_SEARCH_PATH.
# Where to find includes & libraries.
#
macro(setup_search_dir project)
if( NOT("$ENV{${project}_TOP}" STREQUAL "") )
message("-- ${project}_TOP is set to $ENV{${project}_TOP}")
list(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_TOP}")
endif( NOT("$ENV{${project}_TOP}" STREQUAL "") )
if( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
message("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}")
list(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_USER_TOP}")
endif( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
LIST(REMOVE_DUPLICATES ${project}_DIR_SEARCH)
message("-- Components of ${project}_DIR_SEARCH:")
foreach(PATH ${${project}_DIR_SEARCH})
message("-- ${PATH}")
endforeach(PATH)
endmacro(setup_search_dir project)
#
# Build <PROJECT>_INCLUDE_DIR & <PROJECT>_LIBRARIES and sets up <PROJECT>_FOUND
# Usage: set_library_path(<PROJECT> <library>)
#
# May be used any number of time on the same <PROJECT> to create a list of
# <library>.
#
macro(set_libraries_path configname library)
set(${configname}_FOUND "NOTFOUND")
if(${library}_LIBRARY_PATH)
set(${configname}_FOUND "YES")
set(${configname}_INCLUDE_DIR ${${library}_INCLUDE_PATH})
set(${configname}_LIBRARIES ${${library}_LIBRARY_PATH} ${${configname}_LIBRARIES})
mark_as_advanced(${configname}_INCLUDE_DIR ${configname}_LIBRARIES)
endif(${library}_LIBRARY_PATH)
if(NOT ${library}_INCLUDE_PATH)
set(${configname}_FOUND "NOTFOUND")
endif(NOT ${library}_INCLUDE_PATH)
endmacro ( set_libraries_path )
#
# Checks if a set of libraries has been found, could be blocking or not.
# Usage: hurricane_check_libraries(<PROJECT> <REQUIRED>)
#
# If <REQUIRED> is ommitted, it is guessed from <PROJECT>_FIND_REQUIRED.
#
macro(hurricane_check_libraries)
if(ARGC LESS 2)
set(REQUIRED ${ARGV0}_FIND_REQUIRED)
else(ARGC LESS 2)
set(REQUIRED ${ARGV1})
endif(ARGC LESS 2)
if(${ARGV0}_FOUND)
if(NOT ${ARGV0}_FIND_QUIETLY)
if(${ARGV0}_FOUND)
message(STATUS "Found ${ARGV0}:")
foreach(library ${${ARGV0}_LIBRARIES})
message(STATUS " ${library}")
endforeach(library)
endif(${ARGV0}_FOUND)
endif(NOT ${ARGV0}_FIND_QUIETLY)
else(${ARGV0}_FOUND)
if(REQUIRED)
message(FATAL_ERROR "${ARGV0} was not found. ${${ARGV0}_DIR_MESSAGE}")
endif(REQUIRED)
endif(${ARGV0}_FOUND)
endmacro(hurricane_check_libraries)
# End of <bootstrap> duplication.
# =============================================================================
#find_package(Eigen3 REQUIRED)
set(COLOQUINTE_INCLUDE_PATH_DESCRIPTION "directory containing the Coloquinte include files. E.g /usr/local/include/coloquinte or /soc/coriolis/include/Coloquinte")
set(COLOQUINTE_DIR_MESSAGE "Set the COLOQUINTE_INCLUDE_DIR cmake cache entry to the ${COLOQUINTE_INCLUDE_PATH_DESCRIPTION}")
# don't even bother under WIN32
if(UNIX)
setup_search_dir(IMPORTEDS)
message(STATUS "IMPORTEDS_DIR_SEARCH: ${IMPORTEDS_DIR_SEARCH}")
#
# Look for an installation.
#
find_path(COLOQUINTE_INCLUDE_PATH NAMES coloquinte/circuit.hxx PATHS
# Look in other places.
${IMPORTEDS_DIR_SEARCH}
PATH_SUFFIXES include
# Help the user find it if we cannot.
DOC "The ${COLOQUINTE_INCLUDE_PATH_DESCRIPTION}"
)
find_library(COLOQUINTE_LIBRARY_PATH
NAMES coloquinte
PATHS ${IMPORTEDS_DIR_SEARCH}
PATH_SUFFIXES lib${LIB_SUFFIX}
# Help the user find it if we cannot.
DOC "The ${COLOQUINTE_INCLUDE_PATH_DESCRIPTION}"
)
set(COLOQUINTE_FIND_QUIETLY FALSE)
set_libraries_path(COLOQUINTE COLOQUINTE)
hurricane_check_libraries(COLOQUINTE)
if(COLOQUINTE_FOUND)
add_definitions( -DHAVE_COLOQUINTE )
endif()
message(STATUS "COLOQUINTE_INCLUDE_PATH: ${COLOQUINTE_INCLUDE_PATH}")
message(STATUS "COLOQUINTE_LIBRARY: ${COLOQUINTE_LIBRARY}")
endif(UNIX)

View File

@ -1,35 +1,42 @@
# -*- explicit-buffer-name: "CMakeLists.txt<Coloquinte/src>" -*- # -*- explicit-buffer-name: "CMakeLists.txt<Coloquinte/src>" -*-
set ( includes coloquinte/circuit.hxx include_directories( ${COLOQUINTE_SOURCE_DIR}/src
coloquinte/circuit_helper.hxx ${CORIOLIS_INCLUDE_DIR}
coloquinte/common.hxx ${HURRICANE_INCLUDE_DIR}
coloquinte/netlist.hxx ${CONFIGURATION_INCLUDE_DIR}
coloquinte/solvers.hxx )
coloquinte/rough_legalizers.hxx
coloquinte/legalizer.hxx set ( includes coloquinte/circuit.hxx
coloquinte/detailed.hxx coloquinte/circuit_helper.hxx
coloquinte/topologies.hxx coloquinte/common.hxx
coloquinte/optimization_subproblems.hxx coloquinte/netlist.hxx
coloquinte/piecewise_linear.hxx coloquinte/solvers.hxx
coloquinte/rough_legalizers.hxx
coloquinte/legalizer.hxx
coloquinte/detailed.hxx
coloquinte/topologies.hxx
coloquinte/optimization_subproblems.hxx
coloquinte/piecewise_linear.hxx
) )
set ( cpps circuit.cxx set ( cpps circuit.cxx
checkers.cxx checkers.cxx
rough_legalizers.cxx rough_legalizers.cxx
solvers.cxx solvers.cxx
optimization_subproblems.cxx optimization_subproblems.cxx
piecewise_linear.cxx piecewise_linear.cxx
orientation.cxx orientation.cxx
detailed.cxx detailed.cxx
cell_swapping.cxx cell_swapping.cxx
MCF_opt.cxx MCF_opt.cxx
row_opt.cxx row_opt.cxx
topologies.cxx topologies.cxx
lookup_table.cxx lookup_table.cxx
legalizer.cxx legalizer.cxx
) )
add_library ( coloquinte ${cpps} ) add_library ( coloquinte ${cpps} )
set_target_properties( coloquinte PROPERTIES VERSION 1.0 SOVERSION 1 )
install( TARGETS coloquinte DESTINATION lib${LIB_SUFFIX} ) install( TARGETS coloquinte DESTINATION lib${LIB_SUFFIX} )
install( FILES ${includes} DESTINATION include/coloquinte ) install( FILES ${includes} DESTINATION include/coriolis2/coloquinte )

View File

@ -8,7 +8,6 @@
cmake_minimum_required(VERSION 2.8.9) cmake_minimum_required(VERSION 2.8.9)
list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/")
find_package(Coloquinte REQUIRED)
find_package(Bootstrap REQUIRED) find_package(Bootstrap REQUIRED)
setup_project_paths(CORIOLIS) setup_project_paths(CORIOLIS)
setup_qt() setup_qt()
@ -24,6 +23,7 @@
find_package(LEFDEF REQUIRED) find_package(LEFDEF REQUIRED)
find_package(HURRICANE REQUIRED) find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED) find_package(CORIOLIS REQUIRED)
find_package(COLOQUINTE REQUIRED)
find_package(Libexecinfo REQUIRED) find_package(Libexecinfo REQUIRED)
add_subdirectory(src) add_subdirectory(src)