From 626766e07cca0fcf4e47750b1b616711b3c44b14 Mon Sep 17 00:00:00 2001 From: Serge Rabyking Date: Sun, 11 Jun 2023 15:47:43 +0100 Subject: [PATCH] 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 --- CMakeLists.txt | 32 +++++++++++-------- .../FindPythonSitePackages.cmake | 2 ++ crlcore/src/ccore/CMakeLists.txt | 2 +- pyproject.toml | 2 +- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3716e7fe..6fc19f13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/bootstrap/cmake_modules/FindPythonSitePackages.cmake b/bootstrap/cmake_modules/FindPythonSitePackages.cmake index a7e6dcf7..75466f14 100644 --- a/bootstrap/cmake_modules/FindPythonSitePackages.cmake +++ b/bootstrap/cmake_modules/FindPythonSitePackages.cmake @@ -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) diff --git a/crlcore/src/ccore/CMakeLists.txt b/crlcore/src/ccore/CMakeLists.txt index 4c05f2b4..969d9dca 100644 --- a/crlcore/src/ccore/CMakeLists.txt +++ b/crlcore/src/ccore/CMakeLists.txt @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 1ba01d8d..a12581a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ [project] name = "coriolis" -version = "2.4.1" +version = "2.4.2" #dynamic = ["version"] description = "Place and Route for semiconductors" authors = [