From 29341abf9bd8d13eb2f464c2fa237b13c43d8bce Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Mon, 11 Sep 2023 12:10:27 +0200 Subject: [PATCH 1/3] Attempt at a Meson build --- meson.build | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..bccb2518 --- /dev/null +++ b/meson.build @@ -0,0 +1,44 @@ + +project('coloquinte', 'cpp', + version : '0.3.1', + license : 'MIT', + default_options: [ + 'cpp_std=c++17', + ], +) + +coloquinte_includes = include_directories('src') +boost_dep = dependency('boost', required: true) +lemon_dep = dependency('lemon', method : 'cmake') +eigen_dep = dependency('eigen3', required: true) +thread_dep = dependency('threads', required: true) + +sources = [ + 'src/coloquinte.cpp', + 'src/parameters.cpp', + 'src/place_global/net_model.cpp', + 'src/place_global/density_legalizer.cpp', + 'src/place_global/density_grid.cpp', + 'src/place_global/place_global.cpp', + 'src/place_detailed/legalizer.cpp', + 'src/place_detailed/abacus_legalizer.cpp', + 'src/place_detailed/tetris_legalizer.cpp', + 'src/place_detailed/row_legalizer.cpp', + 'src/place_detailed/place_detailed.cpp', + 'src/place_detailed/detailed_placement.cpp', + 'src/place_detailed/incr_net_model.cpp', + 'src/place_detailed/row_neighbourhood.cpp', + 'src/place_global/transportation.cpp', + 'src/place_global/transportation_1d.cpp', +] + +libcoloquinte = shared_library('coloquinte', + sources, + include_directories : coloquinte_includes, + dependencies : [boost_dep, lemon_dep, eigen_dep, thread_dep], + install : true) + +install_headers('src/coloquinte.hpp') + +coloquinte_dep = declare_dependency(link_with : libcoloquinte, include_directories: coloquinte_includes) + From b09555eee1a65782157afb5fb1250496c9682f9d Mon Sep 17 00:00:00 2001 From: Robert Taylor Date: Wed, 20 Sep 2023 17:50:13 +0200 Subject: [PATCH 2/3] Lemon as meson subproject --- .gitmodules | 3 +++ meson.build | 7 ++++++- subprojects/lemon-1.3.1 | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 160000 subprojects/lemon-1.3.1 diff --git a/.gitmodules b/.gitmodules index 812e14ec..a7eeee54 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "thirdparty/pybind11/pybind11"] path = thirdparty/pybind11/pybind11 url = https://github.com/pybind/pybind11.git +[submodule "subprojects/lemon-1.3.1"] + path = subprojects/lemon-1.3.1 + url = https://github.com/Coloquinte/lemon diff --git a/meson.build b/meson.build index bccb2518..da1d331f 100644 --- a/meson.build +++ b/meson.build @@ -9,10 +9,15 @@ project('coloquinte', 'cpp', coloquinte_includes = include_directories('src') boost_dep = dependency('boost', required: true) -lemon_dep = dependency('lemon', method : 'cmake') eigen_dep = dependency('eigen3', required: true) thread_dep = dependency('threads', required: true) +cmake =import('cmake') +cmake_opts = cmake.subproject_options() +cmake_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': true}) +lemon = cmake.subproject('lemon-1.3.1', options: cmake_opts) +lemon_dep = lemon.dependency('lemon') + sources = [ 'src/coloquinte.cpp', 'src/parameters.cpp', diff --git a/subprojects/lemon-1.3.1 b/subprojects/lemon-1.3.1 new file mode 160000 index 00000000..50252652 --- /dev/null +++ b/subprojects/lemon-1.3.1 @@ -0,0 +1 @@ +Subproject commit 50252652bcbcd10932b2bb4d6dab3b62bf54a400 From afa06f4446a5e52c732b5b77ea0dbb0549e7899d Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Wed, 20 Sep 2023 18:05:21 +0100 Subject: [PATCH 3/3] Make lemon a submodule, and don't install it --- .gitmodules | 4 ++-- meson.build | 3 ++- subprojects/{lemon-1.3.1 => lemon} | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename subprojects/{lemon-1.3.1 => lemon} (100%) diff --git a/.gitmodules b/.gitmodules index a7eeee54..7a887ecb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "thirdparty/pybind11/pybind11"] path = thirdparty/pybind11/pybind11 url = https://github.com/pybind/pybind11.git -[submodule "subprojects/lemon-1.3.1"] - path = subprojects/lemon-1.3.1 +[submodule "subprojects/lemon"] + path = subprojects/lemon url = https://github.com/Coloquinte/lemon diff --git a/meson.build b/meson.build index da1d331f..818bd505 100644 --- a/meson.build +++ b/meson.build @@ -15,7 +15,8 @@ thread_dep = dependency('threads', required: true) cmake =import('cmake') cmake_opts = cmake.subproject_options() cmake_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': true}) -lemon = cmake.subproject('lemon-1.3.1', options: cmake_opts) +cmake_opts.set_install(false) +lemon = cmake.subproject('lemon', options: cmake_opts) lemon_dep = lemon.dependency('lemon') sources = [ diff --git a/subprojects/lemon-1.3.1 b/subprojects/lemon similarity index 100% rename from subprojects/lemon-1.3.1 rename to subprojects/lemon