From 608cf4990e047d92b5f3d8bcabd6422cdb00b548 Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Fri, 25 Aug 2023 00:59:41 +0100 Subject: [PATCH] Initial test meson build --- _build_utils/version.py | 15 ++++ hurricane/meson.build | 6 ++ hurricane/src/configuration/meson.build | 40 ++++++++++ hurricane/src/hurricane/meson.build | 97 +++++++++++++++++++++++++ hurricane/src/meson.build | 4 + meson.build | 29 ++++++++ pyproject.toml | 47 ++---------- 7 files changed, 198 insertions(+), 40 deletions(-) create mode 100644 _build_utils/version.py create mode 100644 hurricane/meson.build create mode 100644 hurricane/src/configuration/meson.build create mode 100644 hurricane/src/hurricane/meson.build create mode 100644 hurricane/src/meson.build create mode 100644 meson.build diff --git a/_build_utils/version.py b/_build_utils/version.py new file mode 100644 index 00000000..93dafa96 --- /dev/null +++ b/_build_utils/version.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +""" Extract version number from __init__.py +""" + +import os + + +ski_init = os.path.join(os.path.dirname(__file__), '../__init__.py') + +data = open(ski_init).readlines() +version_line = next(line for line in data if line.startswith('__version__')) + +version = version_line.strip().split(' = ')[1].replace('"', '').replace("'", '') + +print(version) diff --git a/hurricane/meson.build b/hurricane/meson.build new file mode 100644 index 00000000..50e220ea --- /dev/null +++ b/hurricane/meson.build @@ -0,0 +1,6 @@ +bzip2_dep = cc.find_library('bz2', required: true) +rapidjson = dependency('RapidJSON', required: true) +flex = find_program('flex', required: true) +bison = find_program('bison', required: true) +subdir('src') + diff --git a/hurricane/src/configuration/meson.build b/hurricane/src/configuration/meson.build new file mode 100644 index 00000000..22488cf6 --- /dev/null +++ b/hurricane/src/configuration/meson.build @@ -0,0 +1,40 @@ + +mocs = qt.compile_moc( + headers: [ + 'hurricane/configuration/ConfigurationDialog.h', + 'hurricane/configuration/ParameterWidget.h', + 'hurricane/configuration/ConfTabWidget.h', + 'hurricane/configuration/LogWidget.h', + 'hurricane/configuration/ConfigurationWidget.h', + 'hurricane/configuration/ConfEditorWidget.h' ], + include_directories: includes +) + +resources = qt.compile_resources( + sources: 'Configuration.qrc' +) +configuration = library( + 'configuration', + 'Parameter.cpp', + 'LayoutDescription.cpp', + 'Configuration.cpp', + 'ParameterWidget.cpp', + 'ConfTabWidget.cpp', + 'LogWidget.cpp', + 'ConfigurationWidget.cpp', + 'ConfigurationDialog.cpp', + 'ConfEditorWidget.cpp', + mocs, + resources, + dependencies: [qt_deps, boost], + include_directories: includes +) + +pytypemanager = library( + 'pytypemanager', + 'ProxyProperty.cpp', + 'PyTypeManager.cpp', + dependencies: [qt_deps, boost, py_deps], + include_directories: includes +) + diff --git a/hurricane/src/hurricane/meson.build b/hurricane/src/hurricane/meson.build new file mode 100644 index 00000000..1ec1bb3f --- /dev/null +++ b/hurricane/src/hurricane/meson.build @@ -0,0 +1,97 @@ +shared_library( + 'hurricane', + 'Record.cpp', + 'Slot.cpp', + 'Initializer.cpp', + 'Commons.cpp', + 'Flags.cpp', + 'Backtrace.cpp', + 'FileReadGzStream.cpp', + 'FileWriteGzStream.cpp', + 'JsonWriter.cpp', + 'JsonObject.cpp', + 'JsonReader.cpp', + 'Signature.cpp', + 'Exception.cpp', + 'Bug.cpp', + 'Error.cpp', + 'Breakpoint.cpp', + 'DRCError.cpp', + 'Warning.cpp', + 'Interruption.cpp', + 'Tabulation.cpp', + 'DebugSession.cpp', + 'Observer.cpp', + 'DbU.cpp', + 'Point.cpp', + 'Box.cpp', + 'Torus.cpp', + 'Interval.cpp', + 'Transformation.cpp', + 'Name.cpp', + 'DBo.cpp', + 'DataBase.cpp', + 'Technology.cpp', + 'Layer.cpp', + 'BasicLayer.cpp', + 'RegularLayer.cpp', + 'ViaLayer.cpp', + 'ContactLayer.cpp', + 'DiffusionLayer.cpp', + 'TransistorLayer.cpp', + 'Library.cpp', + 'Entity.cpp', + 'Cell.cpp', + 'CellCollections.cpp', + 'CellsSort.cpp', + 'NetAlias.cpp', + 'Net.cpp', + 'DeepNet.cpp', + 'HyperNet.cpp', + 'Go.cpp', + 'ExtensionGo.cpp', + 'Hook.cpp', + 'Instance.cpp', + 'Component.cpp', + 'Plug.cpp', + 'Contact.cpp', + 'Pin.cpp', + 'Segment.cpp', + 'Vertical.cpp', + 'Horizontal.cpp', + 'Pad.cpp', + 'RoutingPad.cpp', + 'Diagonal.cpp', + 'Rectilinear.cpp', + 'Polygon.cpp', + 'NetExternalComponents.cpp', + 'NetRoutingProperty.cpp', + 'Reference.cpp', + 'Rubber.cpp', + 'Quark.cpp', + 'Property.cpp', + 'Relation.cpp', + 'SharedName.cpp', + 'SharedPath.cpp', + 'Path.cpp', + 'Occurrence.cpp', + 'Occurrences.cpp', + 'QuadTree.cpp', + 'Slice.cpp', + 'ExtensionSlice.cpp', + 'UpdateSession.cpp', + 'Region.cpp', + 'Query.cpp', + 'Marker.cpp', + 'Timer.cpp', + 'TextTranslator.cpp', + 'DeviceDescriptor.cpp', + 'Rule.cpp', + 'UnitRule.cpp', + 'PhysicalRule.cpp', + 'TwoLayersPhysicalRule.cpp', + + dependencies: [qt_deps, boost, rapidjson], + include_directories: includes +) + diff --git a/hurricane/src/meson.build b/hurricane/src/meson.build new file mode 100644 index 00000000..a267b036 --- /dev/null +++ b/hurricane/src/meson.build @@ -0,0 +1,4 @@ + +includes = include_directories('utilities', 'hurricane', 'analog', 'viewer', 'isobar') +subdir('hurricane') +subdir('configuration') diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..09ca25a9 --- /dev/null +++ b/meson.build @@ -0,0 +1,29 @@ +project( + 'coriolis-eda', + 'c','cpp', + version: '2.5.5', + meson_version: '>= 0.63.0', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=c99', + 'cpp_std=c++17', + ], +) + +cc = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +add_project_arguments( + '-Wno-deprecated-declarations', + '-Wno-unused-function', + '-Wno-unused-private-field', + language: ['c','cpp'] +) + +py = import('python').find_installation() +py_deps = dependency('python3') +qt = import('qt5') +qt_deps = dependency('qt5', modules: ['Core', 'Gui', 'Widgets']) +boost = dependency('boost') + +subdir('hurricane') diff --git a/pyproject.toml b/pyproject.toml index 47260b1e..bca07dbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ -[tool.poetry] +[project] name = "coriolis-eda" -version = "0.0.0" +version = "2.5.5" description = "Place and Route for semiconductors" authors = ["Jean-Paul Chaput "] readme = "README.rst" @@ -32,7 +32,7 @@ include = [ "katana", "lefdef", "oroshi", - "poetry.lock", + "pdm.lock", "pyproject.toml", "solstice", "stratus1", @@ -41,45 +41,12 @@ include = [ "unicorn", "unittests", ] - -[tool.poetry-dynamic-versioning] -enable = true -vcs = "git" -style = "pep440" -format-jinja = """ - {%- if distance == 0 -%} - {{ serialize_pep440(base, stage, revision) }} - {%- else -%} - {{ serialize_pep440(bump_version(base), stage="a", revision=distance) }} - {%- endif -%} -""" - -[tool.poetry.dependencies] -python = "^3.8" -find-libpython = "^0.3.0" -patchelf = "^0" - -[tool.poetry.dev-dependencies] -cmake = ">=3" -ninja = "^1.11.1" - -[tool.poetry.group.doc.dependencies] -pelican = ">= 4.5.0" - -[tool.poetry.build] -script = "builder.py" -generate-setup-file = true - -[tool.poetry.scripts] -blif2vst = 'coriolis:blif2vst' -tutorial = 'coriolis:tutorial' -unittests = 'coriolis:unittests' -yosys_coriolis = 'coriolis:yosys_coriolis' -cgt = 'coriolis:cgt' +[tool.pdm.dev-dependencies] +doc = ["pelican", "doxygen"] [build-system] -requires = ["poetry-core", "setuptools", "cmake", "ninja", "poetry-dynamic-versioning"] -build-backend = "poetry_dynamic_versioning.backend" +requires = ["setuptools", "pdm-backend", "meson @ git+https://github.com/robtaylor/meson@mac-homebrew", "ninja", "meson-python == 0.13.2"] +build-backend = "mesonpy" [tool.cibuildwheel.linux] skip = ["cp36-*", "cp37-*", "pp*"]