Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:atom: Meson #1991

Draft
wants to merge 47 commits into
base: master
Choose a base branch
from
Draft

:atom: Meson #1991

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
cb3658e
wip
bcumming Apr 4, 2019
29f8b99
ring benchmark compiles and runs, but mechanism catalogue is borked
bcumming Apr 4, 2019
f6866fc
fix mech catalogue
bcumming Apr 4, 2019
5a362c9
fix bad commit
bcumming Apr 5, 2019
d04c905
use custom target to generate mechanism sources
bcumming Apr 15, 2019
d763f58
Merge branch 'master' into meson
bcumming May 6, 2019
b3f0ce1
Merge branch 'master' into meson
bcumming Aug 22, 2019
e0c1d28
merge master
bcumming Aug 22, 2019
3404e58
Merge branch 'master' into meson
bcumming Aug 22, 2019
6bdee6b
consistent naming of generators and bench example source code
bcumming Aug 22, 2019
d6c3a1b
uncomplicated brunel
bcumming Aug 22, 2019
3ab44a0
remove final headers from examples
bcumming Aug 22, 2019
15b4e34
example wip
bcumming Aug 22, 2019
5063819
Merge remote-tracking branch 'bcumming/fix-unify-examples' into meson
bcumming Aug 22, 2019
7f3d505
merged master
bcumming Nov 30, 2021
78b1738
wip
bcumming Dec 3, 2021
c672007
Merge branch 'master' into meson
bcumming Dec 5, 2021
2707943
version header and libarbor build; still mising default_catalogue
bcumming Dec 5, 2021
29450bc
default catalogue builds and links
bcumming Dec 6, 2021
2bdc736
all catalogues build
bcumming Dec 6, 2021
d444d92
examples build
bcumming Dec 6, 2021
4b4eeb3
things install; faster builds; pybind11 not quite working
bcumming Dec 8, 2021
1d46028
improved python build
bcumming Dec 10, 2021
dbad9a3
unit tests up and runnig
bcumming Dec 14, 2021
99bd3e6
Merge branch 'master' into meson
bcumming Dec 14, 2021
1b7de95
architecture flags, lmorpho and profiling
bcumming Dec 20, 2021
80e3b5e
work on gpu
bcumming Dec 20, 2021
d55e859
cuda works
bcumming Dec 30, 2021
92f0b98
Merge branch 'master' into meson
bcumming Dec 30, 2021
7f8796c
clean up configurations
bcumming Jan 3, 2022
1b7dfd8
at cuda tests to unit tests
bcumming Jan 3, 2022
a26b8dd
Merge branch 'master' into meson
bcumming Jan 3, 2022
86fd932
make private assertions... private
bcumming Jan 7, 2022
d385c3d
Merge branch 'master' into meson
bcumming Jan 7, 2022
9fe98ed
wip
bcumming Jan 18, 2022
11ef3aa
pkgconfig does not like empty variable definitions
bcumming Jan 27, 2022
ca9b635
Merge branch 'master' into meson
bcumming Jan 27, 2022
cc0e857
fix warnings in most recent meson versions
bcumming Jan 27, 2022
87dce8d
wip external catalogue workflow
bcumming Jan 28, 2022
4183a3d
Merge.
thorstenhater Sep 9, 2022
1d70246
Merge.
thorstenhater Sep 27, 2022
1d93390
Start fixing the merge fallout.
thorstenhater Sep 27, 2022
650d76c
Arbor installs now.
thorstenhater Sep 27, 2022
f443eea
Missing files.
thorstenhater Sep 27, 2022
45d8f88
Everything builds now.
thorstenhater Sep 28, 2022
3a47b5e
Dummy is back.
thorstenhater Sep 28, 2022
0e1f2ce
merge master
bcumming Dec 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ python/example/*.csv
# build/compile caches
_skbuild
.ccls-cache

# meson subprojects download a lot of artifacts
# to add a dependency do something like `git add subprojects/gtest.wrap --force`
subprojects
2 changes: 1 addition & 1 deletion arbor/iexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ iexpr iexpr::named(std::string name) {
return iexpr(iexpr_type::named, std::make_tuple(std::move(name)));
}

iexpr_ptr thingify(const iexpr& expr, const mprovider& m) {
ARB_ARBOR_API iexpr_ptr thingify(const iexpr& expr, const mprovider& m) {
switch (expr.type()) {
case iexpr_type::scalar:
return iexpr_ptr(new iexpr_impl::scalar(
Expand Down
1 change: 1 addition & 0 deletions arbor/include/arbor/mechcat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class ARB_ARBOR_API mechanism_catalogue {
void register_impl(arb_backend_kind, const std::string&, mechanism_ptr);
};

// References to global mechanism catalogues.
ARB_ARBOR_API const mechanism_catalogue& global_default_catalogue();
ARB_ARBOR_API const mechanism_catalogue& global_allen_catalogue();
ARB_ARBOR_API const mechanism_catalogue& global_bbp_catalogue();
Expand Down
66 changes: 66 additions & 0 deletions arbor/include/arbor/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# generate the headers:
# * include/arbor/version.hpp
# * include/arbor/assert_macro.hpp

fs = import('fs')

# The headers are not regenerated if they already exist, otherwise they would be
# regenerated every time a change is made to any meson.build file in the
# project, which in turn would force all of their dependencies to be rebuilt.
# If a change is made to the meson build description or configuration that
# would generate a different header, the headers must first be deleted.

assert_macro_path=meson.current_build_dir()+'/assert_macro.hpp'
if not fs.is_file(assert_macro_path)
if arb_with_assertions
run_command('cp', 'assert_macro.hpp.enabled', assert_macro_path, check: true)
else
run_command('cp', 'assert_macro.hpp.disabled', assert_macro_path, check: true)
endif
endif

version_path=meson.current_build_dir()+'/version.hpp'
if not fs.is_file(version_path)
conf = configuration_data()

conf.set('version', arb_version)
conf.set('version_major', arb_version_major)
conf.set('version_minor', arb_version_minor)
conf.set('version_patch', arb_version_patch)
conf.set('version_dev', arb_version_dev)

# set all of the #defined values
foreach opt: arb_configurations
conf.set(f'ARB_@opt@_ENABLED', true)
endforeach
conf.set('ARB_VERSION_MAJOR', arb_version_major)
conf.set('ARB_VERSION_MINOR', arb_version_minor)
conf.set('ARB_VERSION_PATCH', arb_version_patch)
conf.set_quoted('ARB_VERSION_DEV', arb_version_dev)

gitlog = run_command('../gitlog', check: true).stdout().strip()
buildtype = get_option('buildtype').to_upper()
configstring = ';'.join(arb_configurations)
conf.set_quoted('ARB_VERSION', arb_version)
conf.set_quoted('ARB_SOURCE_ID', gitlog)
conf.set_quoted('ARB_ARCH', arb_arch)
conf.set_quoted('ARB_BUILD_CONFIG', buildtype)
build_id = f'source_id=@gitlog@;version=@arb_version@;arch=@arb_arch@;config=@buildtype@;@configstring@'
conf.set_quoted('ARB_FULL_BUILD_ID', build_id)

configure_file(input : 'version.hpp.in',
output : 'version.hpp',
configuration : conf)
endif

configure_file(input: meson.global_source_root() + '/cmake/export.hpp.in',
output: 'export.hpp',
configuration: {
'target_short_NAME': 'ARBOR',
'target': 'arbor',
'target_name': 'arbor',
'target_type': f'@arb_build_type@_LIBRARY',
})

install_headers([assert_macro_path, version_path], install_dir: 'include/arbor')

32 changes: 32 additions & 0 deletions arbor/include/arbor/version.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once

namespace arb {
extern const char* source_id;
extern const char* arch;
extern const char* build_config;
extern const char* version;
extern const char* full_build_id;
constexpr int version_major = @version_major@;
constexpr int version_minor = @version_minor@;
constexpr int version_patch = @version_patch@;
extern const char* version_dev;
}

#mesondefine ARB_SOURCE_ID
#mesondefine ARB_FULL_BUILD_ID
#mesondefine ARB_BUILD_CONFIG

#mesondefine ARB_VERSION
#mesondefine ARB_VERSION_MAJOR
#mesondefine ARB_VERSION_MINOR
#mesondefine ARB_VERSION_PATCH
#mesondefine ARB_VERSION_DEV

#mesondefine ARB_ARCH

#mesondefine ARB_VECTORIZE_ENABLED
#mesondefine ARB_ASSERT_ENABLED
#mesondefine ARB_MPI_ENABLED
#mesondefine ARB_GPU_ENABLED
#mesondefine ARB_NEUROML_ENABLED
#mesondefine ARB_PROFILE_ENABLED
9 changes: 9 additions & 0 deletions arbor/include/gitlog
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

if gitlog=$(git log -1 --pretty=format:'%cI %H' 2>/dev/null); then
git diff --quiet HEAD 2>/dev/null || gitlog="${gitlog} modified"
else
gitlog='unknown commit'
fi

echo "$gitlog"
127 changes: 127 additions & 0 deletions arbor/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
arb_src = [
'arbexcept.cpp',
'assert.cpp',
'backends/multicore/shared_state.cpp',
'backends/multicore/rand.cpp',
'communication/communicator.cpp',
'communication/dry_run_context.cpp',
'benchmark_cell_group.cpp',
'cable_cell.cpp',
'cable_cell_param.cpp',
'cell_group_factory.cpp',
'common_types_io.cpp',
'cv_policy.cpp',
'domdecexcept.cpp',
'domain_decomposition.cpp',
'execution_context.cpp',
'gpu_context.cpp',
'event_binner.cpp',
'fvm_layout.cpp',
'fvm_lowered_cell_impl.cpp',
'hardware/memory.cpp',
'hardware/power.cpp',
'iexpr.cpp',
'io/locked_ostream.cpp',
'io/serialize_hex.cpp',
'label_resolution.cpp',
'lif_cell_group.cpp',
'mc_cell_group.cpp',
'mechcat.cpp',
'mechinfo.cpp',
'memory/gpu_wrappers.cpp',
'memory/util.cpp',
'morph/cv_data.cpp',
'morph/embed_pwlin.cpp',
'morph/label_dict.cpp',
'morph/locset.cpp',
'morph/morphexcept.cpp',
'morph/morphology.cpp',
'morph/mprovider.cpp',
'morph/place_pwlin.cpp',
'morph/primitives.cpp',
'morph/region.cpp',
'morph/segment_tree.cpp',
'morph/stitch.cpp',
'merge_events.cpp',
'simulation.cpp',
'partition_load_balance.cpp',
'profile/clock.cpp',
'profile/memory_meter.cpp',
'profile/meter_manager.cpp',
'profile/power_meter.cpp',
'profile/profiler.cpp',
'schedule.cpp',
'spike_event_io.cpp',
'spike_source_cell_group.cpp',
's_expr.cpp',
'symmetric_recipe.cpp',
'threading/threading.cpp',
'thread_private_spike_store.cpp',
'tree.cpp',
'util/dylib.cpp',
'util/hostname.cpp',
'util/unwind.cpp',
'version.cpp',
]

mpi_src = [
'communication/mpi.cpp',
'communication/mpi_error.cpp',
'communication/mpi_context.cpp',
]

gpu_src = [
'backends/gpu/forest.cpp',
'backends/gpu/matrix_assemble.cu',
'backends/gpu/matrix_fine.cu',
'backends/gpu/matrix_solve.cu',
'backends/gpu/multi_event_stream.cpp',
'backends/gpu/multi_event_stream.cu',
'backends/gpu/shared_state.cu',
'backends/gpu/shared_state.cpp',
'backends/gpu/stimulus.cu',
'backends/gpu/stimulus.cu',
'backends/gpu/threshold_watcher.cu',
'memory/fill.cu',
]

if arb_with_mpi
arb_src += mpi_src
endif
if arb_with_gpu
arb_src += gpu_src
endif

# generate version.hpp header
subdir('include/arbor')

# set dependencies for libarbor
dep_arb_internal = [dep_threads, dep_random123, dep_dl]
if arb_with_mpi
dep_arb_internal += dep_mpi
endif
if arb_with_gpu
dep_arb_internal += dep_cuda
endif

lib_arb = library('arbor',
sources: [arb_src, default_cat, allen_cat, bbp_cat],
include_directories: [inc_arb_public, inc_arb_private],
cpp_args: arbor_private_args,
cuda_args: arbor_cuda_private_args,
dependencies: [dep_arb_internal],
install: true)

install_subdir('include/arbor',
install_dir: 'include',
exclude_files: [
'arb_types.inc',
'assert_macro.hpp.disabled',
'assert_macro.hpp.enabled',
'meson.build',
'version.hpp.in'])

dep_arb = declare_dependency(
include_directories: [inc_arb_public],
link_with: lib_arb,
dependencies: dep_arb_internal)
9 changes: 9 additions & 0 deletions arborenv/include/arborenv/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name = 'arborenv'

env_export = configure_file(input: meson.global_source_root() + '/cmake/export.hpp.in',
output: 'export.hpp',
configuration: {
'target_short_NAME': name.to_upper(),
'target': name,
'target_name': name,
'target_type': f'@arb_build_type@_LIBRARY',})
25 changes: 25 additions & 0 deletions arborenv/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
arborenv_src = [
'affinity.cpp',
'arbenvexcept.cpp',
'concurrency.cpp',
'default_env.cpp',
'read_envvar.cpp']

if arb_with_gpu
arborenv_src += ['gpu_uuid.cpp', 'private_gpu.cpp']
endif

lib_arborenv = library('arborenv',
sources: arborenv_src,
include_directories: 'include',
dependencies: [dep_arb],
cpp_args : arbor_private_args,
install: true)

subdir('include/arborenv')
install_subdir('include/arborenv', install_dir: 'include')

dep_arborenv = declare_dependency(
include_directories: ['include'],
link_with: lib_arborenv,
dependencies: [])
9 changes: 9 additions & 0 deletions arborio/include/arborio/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name = 'arborio'

env_export = configure_file(input: meson.global_source_root() + '/cmake/export.hpp.in',
output: 'export.hpp',
configuration: {
'target_short_NAME': name.to_upper(),
'target': name,
'target_name': name,
'target_type': f'@arb_build_type@_LIBRARY',})
30 changes: 30 additions & 0 deletions arborio/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
arborio_src = [
'asc_lexer.cpp',
'neurolucida.cpp',
'swcio.cpp',
'cableio.cpp',
'cv_policy_parse.cpp',
'label_parse.cpp']

dep_arborio_internal = []

if arb_with_neuroml
arborio_src += ['neuroml.cpp', 'nml_parse_morphology.cpp', 'xml.cpp', 'xmlwrap.cpp']
dep_arborio_internal += [dep_libxml2]
endif

lib_arborio = library('arborio',
sources: arborio_src,
include_directories: 'include',
dependencies : [dep_arb, dep_arborio_internal],
cpp_args : arbor_private_args,
install: true)

subdir('include/arborio')

install_subdir('include/arborio', install_dir: 'include')

dep_arborio = declare_dependency(
include_directories: ['include'],
link_with: lib_arborio,
dependencies: dep_arborio_internal)
1 change: 0 additions & 1 deletion arborio/neurolucida.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@ ARB_ARBORIO_API asc_morphology parse_asc_string(const char* input) {
return {stree, std::move(morphology), std::move(labels)};
}


inline std::string read_file(std::string filename) {
std::ifstream fid(filename);

Expand Down
6 changes: 6 additions & 0 deletions example/bench/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bench = executable('bench',
sources: 'bench.cpp',
dependencies: [dep_arb, dep_arborsup, dep_arborenv],
build_by_default: false,
install: false)

5 changes: 5 additions & 0 deletions example/brunel/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
brunel = executable('brunel',
sources: 'brunel.cpp',
dependencies: [dep_arb, dep_arborsup, dep_arborenv, dep_tinyopt],
build_by_default: false,
install: false)
5 changes: 5 additions & 0 deletions example/diffusion/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
diffusion = executable('diffusion',
sources: 'diffusion.cpp',
dependencies: [dep_arb, dep_arborsup, dep_arborio, dep_arborenv, dep_tinyopt],
build_by_default: false,
install: false)
5 changes: 5 additions & 0 deletions example/drybench/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
drybench = executable('drybench',
sources: 'drybench.cpp',
dependencies: [dep_arb, dep_arborsup, dep_arborenv],
build_by_default: false,
install: false)
5 changes: 5 additions & 0 deletions example/dryrun/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dryrun = executable('dryrun',
sources: 'dryrun.cpp',
dependencies: [dep_arb, dep_arborio, dep_arborsup, dep_arborenv],
build_by_default: false,
install: false)
7 changes: 7 additions & 0 deletions example/gap_junctions/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gap_junctions = executable('gap_junctions',
sources: 'gap_junctions.cpp',
dependencies: [dep_arb, dep_arborio, dep_arborsup, dep_arborenv],
build_by_default: false,
install: false)


6 changes: 6 additions & 0 deletions example/generators/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generators = executable('generators',
sources: 'generators.cpp',
dependencies: [dep_arb, dep_arborio, dep_arborsup, dep_arborenv],
build_by_default: false,
install: false)

5 changes: 5 additions & 0 deletions example/lfp/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lfp = executable('lfp',
sources: 'lfp.cpp',
dependencies: [dep_arb, dep_arborio, dep_arborsup, dep_arborenv],
build_by_default: false,
install: false)
Loading