Minor fixes to python build

LEFDEF added to compilation
     some cmake variables adjusted to adjust relative paths for python package
     flute LUTs files added to python package
This commit is contained in:
Serge Rabyking 2023-06-11 15:47:43 +01:00
parent 60e7ba1d9b
commit 626766e07c
4 changed files with 23 additions and 15 deletions

View File

@ -22,6 +22,12 @@ project(build_${target})
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development.Module)
set(POETRY TRUE) # this will prevent looking for python site-packages directory
# and next vars will not be overwritten
set(Python_CORIOLISARCH coriolis) # relative to install dir
set(Python_CORIOLISLIB coriolis) # relative to install dir
set(PYTHON_SITE_PACKAGES ..) # python packages directory (relative to coriolis python dir)
if(NOT Python_LIBRARIES)
set(Python_LIBRARIES \"-Wl,--unresolved-symbols=ignore-all\")
endif()
@ -69,7 +75,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${target} ${build_dir})
endif()
endfunction()
build_coriolis_module(lefdef)
build_coriolis_module(coloquinte)
build_coriolis_module(hurricane)
build_coriolis_module(crlcore)
@ -94,24 +100,24 @@ file(GLOB SHARED_LIB_FILES LIST_DIRECTORIES false "${CORIOLIS_TMP_INSTALL_DIR}/l
install(FILES ${SHARED_LIB_FILES} DESTINATION coriolis/libs)
file(GLOB CORIOLIS_PACKAGE_SRCDIR "${CORIOLIS_TMP_INSTALL_DIR}/lib/*/*/coriolis")
function(coriolis_install_all)
foreach(srcdir ${ARGN})
file(GLOB_RECURSE CORIOLIS_PACKAGE_FILES RELATIVE "${srcdir}" "${srcdir}/*.*")
foreach(name ${CORIOLIS_PACKAGE_FILES})
if(NOT IS_DIRECTORY "${srcdir}/${name}")
get_filename_component(dstdir ${name} DIRECTORY)
install(FILES "${srcdir}/${name}" DESTINATION coriolis/${dstdir})
endif()
endforeach()
function(coriolis_install_folder dstdir srcdir)
file(GLOB_RECURSE files RELATIVE "${srcdir}" "${srcdir}/*.*")
foreach(name ${files})
if(NOT IS_DIRECTORY "${srcdir}/${name}")
get_filename_component(subdir ${name} DIRECTORY)
install(FILES "${srcdir}/${name}" DESTINATION ${dstdir}/${subdir})
endif()
endforeach()
endfunction()
coriolis_install_folder(coriolis/share/flute ${CORIOLIS_TMP_INSTALL_DIR}/share/flute)
coriolis_install_folder(coriolis ${CORIOLIS_TMP_INSTALL_DIR}/coriolis)
set(CORIOLIS_EXTRAS_DIR ${CMAKE_BINARY_DIR}/extras)
file(MAKE_DIRECTORY ${CORIOLIS_EXTRAS_DIR})
# Put all extra python things into ${CORIOLIS_EXTRAS_DIR} directory
coriolis_install_all(${CORIOLIS_PACKAGE_SRCDIR} ${CORIOLIS_EXTRAS_DIR})
coriolis_install_folder(coriolis ${CORIOLIS_EXTRAS_DIR})
install(FILES "${CORIOLIS_TMP_INSTALL_DIR}/bin/cgt" DESTINATION coriolis RENAME __main__.py)

View File

@ -38,6 +38,8 @@ if(UNIX AND NOT POETRY)
mark_as_advanced(Python_CORIOLISARCH)
mark_as_advanced(Python_CORIOLISLIB)
mark_as_advanced(Python_SITELIB)
set(PYTHON_SITE_PACKAGES "${Python_SITELIB}")
if(FindPythonSitePackages_FOUND)
if(NOT FindPythonSitePackages_FIND_QUIETLY)

View File

@ -36,7 +36,7 @@
add_definitions ( -DCORIOLIS_TOP="${CORIOLIS_TOP}"
-DSYS_CONF_DIR="${SYS_CONF_DIR}"
-DPYTHON_SITE_PACKAGES="${Python_SITELIB}"
-DPYTHON_SITE_PACKAGES="${PYTHON_SITE_PACKAGES}"
)
set ( includes crlcore/Utilities.h

View File

@ -38,7 +38,7 @@
[project]
name = "coriolis"
version = "2.4.1"
version = "2.4.2"
#dynamic = ["version"]
description = "Place and Route for semiconductors"
authors = [