Compare commits
11 Commits
devel
...
poetry-pac
Author | SHA1 | Date |
---|---|---|
|
7825ae9eb3 | |
|
08fe3a10fd | |
|
e55484b101 | |
|
24aeffd8f0 | |
|
a2236debb9 | |
|
aa60c8c9af | |
|
d60a2603dd | |
|
f511097298 | |
|
d93d76d5e7 | |
|
bc69b3f013 | |
|
fe0057149a |
|
@ -0,0 +1,33 @@
|
|||
#This is needed for poetry to recognise the top level module
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
#TODO not PEP302 complient -probably a big porting job
|
||||
coriolis_package_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
os.environ["CORIOLIS_TOP"] = coriolis_package_dir
|
||||
CORIOLIS_DATA = os.path.join(os.path.dirname(__file__), 'data')
|
||||
CORIOLIS_BIN = os.path.join(CORIOLIS_DATA,"bin")
|
||||
|
||||
def _program(name, args):
|
||||
return subprocess.call([os.path.join(CORIOLIS_BIN, name)] + args, close_fds=False)
|
||||
|
||||
def blif2vst():
|
||||
raise SystemExit(_program("blif2vst.py", sys.argv[1:]))
|
||||
|
||||
def cx2y():
|
||||
raise SystemExit(_program("cx2y", sys.argv[1:]))
|
||||
|
||||
def cyclop():
|
||||
raise SystemExit(_program("cyclop", sys.argv[1:]))
|
||||
|
||||
def tutorial():
|
||||
raise SystemExit(_program("tutorial", sys.argv[1:]))
|
||||
|
||||
def unittests():
|
||||
raise SystemExit(_program("unittests", sys.argv[1:]))
|
||||
|
||||
def yosys_coriolis():
|
||||
raise SystemExit(_program("yosys.py", sys.argv[1:]))
|
||||
|
|
@ -7,6 +7,9 @@
|
|||
if(COMMAND CMAKE_POLICY)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
cmake_policy(SET CMP0005 NEW)
|
||||
cmake_policy(SET CMP0079 NEW)
|
||||
cmake_policy(SET CMP0022 NEW)
|
||||
cmake_policy(SET CMP0060 NEW)
|
||||
#if(NOT (CMAKE_VERSION VERSION_LESS 2.8.0))
|
||||
# cmake_policy(SET CMP0014 OLD)
|
||||
#endif()
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
if(UNIX)
|
||||
if(UNIX AND NOT POETRY)
|
||||
if(NOT Python_FOUND)
|
||||
message(FATAL_ERROR "Python has not been found, maybe forgot to call find_package(Python). ")
|
||||
endif()
|
||||
|
@ -46,4 +45,4 @@ if(UNIX)
|
|||
else(FindPythonSitePackages_FOUND)
|
||||
message ( FATAL_ERROR "Python site packages directory was not found (pythonV.R/site-packages/)." )
|
||||
endif(FindPythonSitePackages_FOUND)
|
||||
endif(UNIX)
|
||||
endif(UNIX AND NOT POETRY)
|
||||
|
|
|
@ -119,7 +119,7 @@ Development files for the Coriolis 2 package.
|
|||
%dir %{coriolisTop}/%{_lib}
|
||||
%dir %{coriolisTop}/%{python_sitedir}
|
||||
%dir %{coriolisTop}/%{python_sitedir}/crlcore
|
||||
%dir %{coriolisTop}/%{python_sitedir}/crlcore/helpers
|
||||
%dir %{coriolisTop}/%{python_sitedir}/helpers
|
||||
%dir %{coriolisTop}/%{python_sitedir}/cumulus
|
||||
%dir %{coriolisTop}/%{python_sitedir}/stratus
|
||||
%{coriolisTop}/bin/*
|
||||
|
@ -130,7 +130,7 @@ Development files for the Coriolis 2 package.
|
|||
%{coriolisTop}/%{python_sitedir}/cumulus/plugins/*/*.py*
|
||||
%{coriolisTop}/%{python_sitedir}/stratus/*.py*
|
||||
%{coriolisTop}/%{python_sitedir}/crlcore/*.py*
|
||||
%{coriolisTop}/%{python_sitedir}/crlcore/helpers/*.py*
|
||||
%{coriolisTop}/%{python_sitedir}/helpers/*.py*
|
||||
%{coriolisTop}/%{python_sitedir}/kite/*.py*
|
||||
%{coriolisTop}/%{python_sitedir}/unicorn/*.py*
|
||||
%{_sysconfdir}/coriolis2/*.py
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
import os
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import sysconfig
|
||||
from distutils.version import LooseVersion
|
||||
from distutils.dir_util import copy_tree, remove_tree
|
||||
from typing import Any, Dict
|
||||
|
||||
from setuptools.command.build_ext import build_ext
|
||||
from setuptools.extension import Extension
|
||||
|
||||
|
||||
class CMakeExtension(Extension):
|
||||
name: str # exists, even though IDE doesn't find it
|
||||
|
||||
def __init__(self, name: str, sourcedir: str="") -> None:
|
||||
super().__init__(name, sources=[])
|
||||
self.sourcedir = os.path.abspath(sourcedir)
|
||||
self.sourcedir_rel = sourcedir
|
||||
|
||||
|
||||
class ExtensionBuilder(build_ext):
|
||||
def run(self) -> None:
|
||||
self.validate_cmake()
|
||||
super().run()
|
||||
|
||||
def build_extension(self, ext: Extension) -> None:
|
||||
if isinstance(ext, CMakeExtension):
|
||||
self.build_cmake_extension(ext)
|
||||
else:
|
||||
super().build_extension(ext)
|
||||
|
||||
def validate_cmake(self) -> None:
|
||||
cmake_extensions = [x for x in self.extensions if isinstance(x, CMakeExtension)]
|
||||
if len(cmake_extensions) > 0:
|
||||
try:
|
||||
out = subprocess.check_output(["cmake", "--version"])
|
||||
except OSError:
|
||||
raise RuntimeError(
|
||||
"CMake must be installed to build the following extensions: "
|
||||
+ ", ".join(e.name for e in cmake_extensions)
|
||||
)
|
||||
if platform.system() == "Windows":
|
||||
cmake_version = LooseVersion(re.search(r"version\s*([\d.]+)", out.decode()).group(1)) # type: ignore
|
||||
if cmake_version < "3.1.0":
|
||||
raise RuntimeError("CMake >= 3.1.0 is required on Windows")
|
||||
|
||||
def build_cmake_extension(self, ext: CMakeExtension) -> None:
|
||||
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
|
||||
cmake_args = []
|
||||
|
||||
cfg = "Debug" if self.debug else "Release"
|
||||
# cfg = 'Debug'
|
||||
build_args = ["--config", cfg]
|
||||
install_args = ["--config", cfg]
|
||||
|
||||
if platform.system() == "Windows":
|
||||
if sys.maxsize > 2 ** 32:
|
||||
cmake_args += ["-A", "x64"]
|
||||
build_args += ["--", "/m"]
|
||||
else:
|
||||
cmake_args += ["-DCMAKE_BUILD_TYPE=" + cfg]
|
||||
build_args += ["--", "-j4", "VERBOSE=1"]
|
||||
cmake_args += ["-DPYTHON_INCLUDE_DIR={}".format(sysconfig.get_path("include"))]
|
||||
|
||||
env = os.environ.copy()
|
||||
env["CXXFLAGS"] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get("CXXFLAGS", ""), self.distribution.get_version())
|
||||
|
||||
build_dir = os.path.join(self.build_temp, ext.sourcedir_rel)
|
||||
os.makedirs(build_dir,exist_ok=True)
|
||||
|
||||
cmake_args += [f"-DCMAKE_MODULE_PATH={os.path.abspath('bootstrap/cmake_modules')};"
|
||||
f"{os.path.join(extdir, 'share/cmake/Modules')}"]
|
||||
cmake_args += [f"-DCMAKE_INSTALL_PREFIX={extdir}"]
|
||||
cmake_args += [f"-DPython_CORIOLISLIB={extdir}"]
|
||||
cmake_args += [f"-DPython_CORIOLISARCH={extdir}"]
|
||||
cmake_args += [f"-DSYS_CONF_DIR={extdir}"]
|
||||
cmake_args += [f"-DCORIOLIS_TOP={extdir}"]
|
||||
cmake_args += [f"-DCORIOLIS_USER_TOP={extdir}"]
|
||||
cmake_args += [f"-DPOETRY=1"]
|
||||
cmake_args += [f"-DWITH_QT5=1"]
|
||||
cmake_args += [f"-DCMAKE_BUILD_RPATH_USE_ORIGIN=1"]
|
||||
cmake_args += ["-DCMAKE_SKIP_BUILD_RPATH=FALSE"]
|
||||
cmake_args += ["-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"]
|
||||
cmake_args += ["-DCMAKE_INSTALL_RPATH=\${ORIGIN}/lib"]
|
||||
cmake_args += ["-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"]
|
||||
|
||||
subprocess.check_call(["cmake", "--debug-find", "--trace-redirect=build.cmake.trace", "--trace-expand", ext.sourcedir] + cmake_args, cwd=build_dir, env=env)
|
||||
subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=build_dir)
|
||||
subprocess.check_call(["cmake", "--install", ".", "--prefix", extdir] + install_args, cwd=build_dir)
|
||||
if os.path.exists(os.path.join(extdir, "bin")):
|
||||
copy_tree(os.path.join(extdir, "bin"), os.path.join(extdir,"data/bin"))
|
||||
remove_tree(os.path.join(extdir, "bin"))
|
||||
|
||||
|
||||
def build(setup_kwargs: Dict[str, Any]) -> None:
|
||||
cmake_modules = [
|
||||
CMakeExtension("coloquinte", sourcedir="coloquinte"),
|
||||
CMakeExtension("Hurricane", sourcedir="hurricane"),
|
||||
CMakeExtension("crlcore", sourcedir="crlcore"),
|
||||
CMakeExtension("flute", sourcedir="flute"),
|
||||
CMakeExtension("etesian", sourcedir="etesian"),
|
||||
CMakeExtension("anabatic", sourcedir="anabatic"),
|
||||
CMakeExtension("katana", sourcedir="katana"),
|
||||
CMakeExtension("equinox", sourcedir="equinox"),
|
||||
CMakeExtension("solstice", sourcedir="solstice"),
|
||||
CMakeExtension("oroshi", sourcedir="oroshi"),
|
||||
CMakeExtension("bora", sourcedir="bora"),
|
||||
CMakeExtension("karakaze", sourcedir="karakaze"),
|
||||
#CMakeExtension("knik", sourcedir="knik"),
|
||||
#CMakeExtension("unicorn", sourcedir="unicorn"),
|
||||
CMakeExtension("tutorial", sourcedir="tutorial"),
|
||||
CMakeExtension("cumulus", sourcedir="cumulus"),
|
||||
CMakeExtension("stratus1", sourcedir="stratus1"),
|
||||
CMakeExtension("documentation", sourcedir="documentation"),
|
||||
CMakeExtension("unittests", sourcedir="unittests")
|
||||
]
|
||||
|
||||
ext_modules = cmake_modules
|
||||
setup_kwargs.update(
|
||||
{
|
||||
"ext_modules": ext_modules,
|
||||
"cmdclass": dict(build_ext=ExtensionBuilder),
|
||||
"zip_safe": False,
|
||||
}
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
install( FILES helpers/__init__.py DESTINATION ${Python_CORIOLISLIB}/crlcore/helpers )
|
||||
install( FILES helpers/io.py DESTINATION ${Python_CORIOLISLIB}/crlcore/helpers )
|
||||
install( FILES helpers/utils.py DESTINATION ${Python_CORIOLISLIB}/crlcore/helpers )
|
||||
install( FILES helpers/overlay.py DESTINATION ${Python_CORIOLISLIB}/crlcore/helpers )
|
||||
install( FILES helpers/analogtechno.py DESTINATION ${Python_CORIOLISLIB}/crlcore/helpers )
|
||||
install( FILES helpers/technology.py DESTINATION ${Python_CORIOLISLIB}/crlcore/helpers )
|
||||
install( FILES helpers/__init__.py DESTINATION ${Python_CORIOLISLIB}/helpers )
|
||||
install( FILES helpers/io.py DESTINATION ${Python_CORIOLISLIB}/helpers )
|
||||
install( FILES helpers/utils.py DESTINATION ${Python_CORIOLISLIB}/helpers )
|
||||
install( FILES helpers/overlay.py DESTINATION ${Python_CORIOLISLIB}/helpers )
|
||||
install( FILES helpers/analogtechno.py DESTINATION ${Python_CORIOLISLIB}/helpers )
|
||||
install( FILES helpers/technology.py DESTINATION ${Python_CORIOLISLIB}/helpers )
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
# ${QtX_LIBRARIES}
|
||||
# ${Boost_LIBRARIES}
|
||||
# ${LIBXML2_LIBRARIES}
|
||||
# ${PYTHON_LIBRARIES} -lutil
|
||||
# ${Python_LIBRARIES} -lutil
|
||||
# )
|
||||
|
||||
install( TARGETS libmanager DESTINATION lib${LIB_SUFFIX} )
|
||||
|
|
|
@ -303,18 +303,18 @@
|
|||
${openaccess_cpps}
|
||||
)
|
||||
set_target_properties ( crlcore PROPERTIES VERSION 1.0 SOVERSION 1 )
|
||||
# target_link_libraries ( crlcore ${HURRICANE_PYTHON_NEW_LIBRARIES}
|
||||
# ${HURRICANE_PYTHON_LIBRARIES}
|
||||
# ${HURRICANE_GRAPHICAL_LIBRARIES}
|
||||
# ${HURRICANE_LIBRARIES}
|
||||
# ${BOOKSHELF_LIBRARY}
|
||||
# ${LEFDEF_LIBRARIES}
|
||||
# ${OA_LIBRARIES}
|
||||
# ${QtX_LIBRARIES}
|
||||
# ${Boost_LIBRARIES}
|
||||
# ${LIBXML2_LIBRARIES}
|
||||
# ${PYTHON_LIBRARIES} -lutil
|
||||
# )
|
||||
target_link_libraries ( crlcore ${HURRICANE_PYTHON_NEW_LIBRARIES}
|
||||
${HURRICANE_PYTHON_LIBRARIES}
|
||||
${HURRICANE_GRAPHICAL_LIBRARIES}
|
||||
${HURRICANE_LIBRARIES}
|
||||
${BOOKSHELF_LIBRARY}
|
||||
${LEFDEF_LIBRARIES}
|
||||
${OA_LIBRARIES}
|
||||
${QtX_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${LIBXML2_LIBRARIES}
|
||||
${Python_LIBRARIES} -lutil
|
||||
)
|
||||
|
||||
install ( TARGETS crlcore DESTINATION lib${LIB_SUFFIX} )
|
||||
install ( FILES ${includes} ${mocincludes} DESTINATION include/coriolis2/crlcore )
|
||||
|
|
|
@ -21,6 +21,17 @@
|
|||
${Boost_INCLUDE_DIR}
|
||||
${QtX_INCLUDE_DIRS}
|
||||
)
|
||||
set (LINK_LIBS ${HURRICANE_PYTHON_NEW_LIBRARIES}
|
||||
${HURRICANE_PYTHON_LIBRARIES}
|
||||
${HURRICANE_GRAPHICAL_LIBRARIES}
|
||||
${HURRICANE_LIBRARIES}
|
||||
${BOOKSHELF_LIBRARY}
|
||||
${OA_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${LIBXML2_LIBRARIES}
|
||||
${Python_LIBRARIES} -lutil
|
||||
)
|
||||
|
||||
|
||||
add_definitions( -DCORIOLIS_TOP="${CORIOLIS_TOP}"
|
||||
-DSYS_CONF_DIR="${SYS_CONF_DIR}"
|
||||
|
@ -77,16 +88,7 @@
|
|||
crlcore/PyLefExport.h
|
||||
crlcore/PyDefExport.h
|
||||
)
|
||||
# target_link_libraries ( crlcore ${HURRICANE_PYTHON_NEW_LIBRARIES}
|
||||
# ${HURRICANE_PYTHON_LIBRARIES}
|
||||
# ${HURRICANE_GRAPHICAL_LIBRARIES}
|
||||
# ${HURRICANE_LIBRARIES}
|
||||
# ${BOOKSHELF_LIBRARY}
|
||||
# ${OA_LIBRARIES}
|
||||
# ${Boost_LIBRARIES}
|
||||
# ${LIBXML2_LIBRARIES}
|
||||
# ${PYTHON_LIBRARIES} -lutil
|
||||
# )
|
||||
target_link_libraries ( crlcore ${LINK_LIBS} )
|
||||
|
||||
set( depLibs crlcore
|
||||
${HURRICANE_GRAPHICAL_LIBRARIES}
|
||||
|
@ -94,7 +96,7 @@
|
|||
${HURRICANE_PYTHON_LIBRARIES}
|
||||
${HURRICANE_LIBRARIES}
|
||||
${LEFDEF_LIBRARIES}
|
||||
${PYTHON_LIBRARIES}
|
||||
${Python_LIBRARIES}
|
||||
${QtX_LIBRARIES}
|
||||
-lutil
|
||||
)
|
||||
|
@ -106,6 +108,7 @@
|
|||
"${depLibs}"
|
||||
include/coriolis2/crlcore
|
||||
)
|
||||
|
||||
add_python_module( "${pyConstCpps}"
|
||||
"crlcore/PyRoutingLayerGauge.h"
|
||||
"pycrlconst;1.0;1"
|
||||
|
@ -113,3 +116,4 @@
|
|||
"${depLibs}"
|
||||
include/coriolis2/crlcore
|
||||
)
|
||||
|
||||
|
|
|
@ -26,6 +26,5 @@
|
|||
${BZIP2_LIBRARIES}
|
||||
${LIBEXECINFO_LIBRARIES}
|
||||
${LIBBFD_LIBRARIES}
|
||||
z
|
||||
)
|
||||
install ( TARGETS cx2y DESTINATION bin )
|
||||
|
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 676 B |
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |