build(wasm): major progress on gridfire compiling to wasm
This commit is contained in:
0
build-check/CC/meson.build
Normal file
0
build-check/CC/meson.build
Normal file
33
build-check/CPPC/meson.build
Normal file
33
build-check/CPPC/meson.build
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
cppc = meson.get_compiler('cpp')
|
||||||
|
|
||||||
|
if cppc.get_id() == 'clang'
|
||||||
|
message('disabling bitwise-instead-of-logical warnings for clang')
|
||||||
|
add_project_arguments('-Wno-bitwise-instead-of-logical', language: 'cpp')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if cppc.get_id() == 'gcc'
|
||||||
|
message('disabling psabi warnings for gcc')
|
||||||
|
add_project_arguments('-Wno-psabi', language: 'cpp')
|
||||||
|
|
||||||
|
if (cppc.version().version_compare('<14.0'))
|
||||||
|
error('g++ version must be at least 14.0, found ' + cppc.version())
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if not cppc.has_header('print')
|
||||||
|
error('C++ standard library header <print> not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.')
|
||||||
|
endif
|
||||||
|
if not cppc.has_header('format')
|
||||||
|
error('C++ standard library header <format> not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.')
|
||||||
|
endif
|
||||||
|
|
||||||
|
# For Eigen
|
||||||
|
add_project_arguments('-Wno-deprecated-declarations', language: 'cpp')
|
||||||
|
|
||||||
|
if get_option('build_python')
|
||||||
|
message('enabling hidden visibility for C++ symbols when building Python extension. This reduces the size of the resulting shared library.')
|
||||||
|
add_project_arguments('-fvisibility=hidden', language: 'cpp')
|
||||||
|
else
|
||||||
|
message('enabling default visibility for C++ symbols')
|
||||||
|
add_project_arguments('-fvisibility=default', language: 'cpp')
|
||||||
|
endif
|
||||||
15
build-check/FC/meson.build
Normal file
15
build-check/FC/meson.build
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
if get_option('build_fortran')
|
||||||
|
add_languages('fortran', native: true)
|
||||||
|
message('Found FORTRAN compiler: ' + meson.get_compiler('fortran').get_id())
|
||||||
|
message('Fortran standard set to: ' + get_option('fortran_std'))
|
||||||
|
message('Building fortran module (gridfire_mod.mod)')
|
||||||
|
fc = meson.get_compiler('fortran')
|
||||||
|
if not get_option('unsafe_fortran')
|
||||||
|
if fc.get_id() != 'gcc'
|
||||||
|
error('The only supported fortran compiler for GridFire is gfortran (version >= 14.0), found ' + fc + '. GridFire has not been tested with any other compilers. You can disable this check with the -Dunsafe-fortran=true flag to try other compilers')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if (fc.version().version_compare('<14.0'))
|
||||||
|
error('gfortran version must be at least 14.0, found ' + fc.version())
|
||||||
|
endif
|
||||||
|
endif
|
||||||
15
build-check/meson.build
Normal file
15
build-check/meson.build
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
message('Found CXX compiler: ' + meson.get_compiler('cpp').get_id())
|
||||||
|
message('C++ standard set to: ' + get_option('cpp_std'))
|
||||||
|
|
||||||
|
cc = meson.get_compiler('c')
|
||||||
|
|
||||||
|
ignore_unused_args = '-Wno-unused-command-line-argument'
|
||||||
|
|
||||||
|
add_global_arguments(ignore_unused_args, language: 'cpp')
|
||||||
|
add_global_arguments(ignore_unused_args, language: 'c')
|
||||||
|
|
||||||
|
|
||||||
|
subdir('CPPC')
|
||||||
|
subdir('FC')
|
||||||
|
|
||||||
|
|
||||||
@@ -1,17 +1,21 @@
|
|||||||
# bring in all of the fourdst utility repositories
|
# bring in all of the fourdst utility repositories
|
||||||
|
|
||||||
fourdst_build_lib_all = true
|
fourdst_build_lib_all = true
|
||||||
if get_option('unity-safe')
|
if not get_option('plugin_support')
|
||||||
fourdst_build_lib_all=false
|
fourdst_build_lib_all=false
|
||||||
|
message('Disabling fourdst plugin support as per user request.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
fourdst_sp = subproject('fourdst',
|
fourdst_sp = subproject('fourdst',
|
||||||
default_options:
|
default_options:
|
||||||
['build-tests=' + get_option('build-tests').to_string(),
|
['build_tests=' + get_option('build_tests').to_string(),
|
||||||
'build-python=' + get_option('build-python').to_string(),
|
'build_python=' + get_option('build_python').to_string(),
|
||||||
'build-lib-all=' + fourdst_build_lib_all.to_string(),
|
'build_lib_all=' + fourdst_build_lib_all.to_string(),
|
||||||
'pkg-config=' + get_option('pkg-config').to_string(),
|
'build_lib_comp=true',
|
||||||
'build-lib-log=true'
|
'build_lib_config=true',
|
||||||
|
'build_lib_log=true',
|
||||||
|
'build_lib_const=true',
|
||||||
|
'pkg_config=' + get_option('pkg_config').to_string(),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -19,7 +23,8 @@ composition_dep = fourdst_sp.get_variable('composition_dep')
|
|||||||
log_dep = fourdst_sp.get_variable('log_dep')
|
log_dep = fourdst_sp.get_variable('log_dep')
|
||||||
const_dep = fourdst_sp.get_variable('const_dep')
|
const_dep = fourdst_sp.get_variable('const_dep')
|
||||||
config_dep = fourdst_sp.get_variable('config_dep')
|
config_dep = fourdst_sp.get_variable('config_dep')
|
||||||
if not get_option('unity-safe')
|
if get_option('plugin_support')
|
||||||
|
warning('Including plugin library from fourdst. Note this will bring in minizip-ng and openssl, which can cause build issues with cross compilation due to their complexity.')
|
||||||
plugin_dep = fourdst_sp.get_variable('plugin_dep')
|
plugin_dep = fourdst_sp.get_variable('plugin_dep')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -28,6 +33,7 @@ libconst = fourdst_sp.get_variable('libconst')
|
|||||||
libconfig = fourdst_sp.get_variable('libconfig')
|
libconfig = fourdst_sp.get_variable('libconfig')
|
||||||
liblogging = fourdst_sp.get_variable('liblogging')
|
liblogging = fourdst_sp.get_variable('liblogging')
|
||||||
|
|
||||||
if not get_option('unity-safe')
|
if get_option('plugin_support')
|
||||||
|
warning('Including plugin library from fourdst. Note this will bring in minizip-ng and openssl, which can cause build issues with cross compilation due to their complexity.')
|
||||||
libplugin = fourdst_sp.get_variable('libplugin')
|
libplugin = fourdst_sp.get_variable('libplugin')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
cmake = import('cmake')
|
cmake = import('cmake')
|
||||||
|
|
||||||
|
if get_option('build_python')
|
||||||
subdir('python')
|
subdir('python')
|
||||||
|
subdir('pybind')
|
||||||
|
endif
|
||||||
subdir('fourdst')
|
subdir('fourdst')
|
||||||
subdir('sundials')
|
subdir('sundials')
|
||||||
|
|
||||||
@@ -11,6 +13,5 @@ subdir('eigen')
|
|||||||
|
|
||||||
subdir('json')
|
subdir('json')
|
||||||
|
|
||||||
subdir('pybind')
|
|
||||||
|
|
||||||
subdir('CLI11')
|
subdir('CLI11')
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
pybind11_proj = subproject('pybind11')
|
pybind11_proj = subproject('pybind11')
|
||||||
pybind11_dep = pybind11_proj.get_variable('pybind11_dep')
|
pybind11_dep = pybind11_proj.get_variable('pybind11_dep')
|
||||||
python3_dep = dependency('python3')
|
python3_dep = dependency('python3')
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ cvode_cmake_options.add_cmake_defines({
|
|||||||
'CMAKE_C_FLAGS' : '-Wno-deprecated-declarations',
|
'CMAKE_C_FLAGS' : '-Wno-deprecated-declarations',
|
||||||
'BUILD_SHARED_LIBS' : 'OFF',
|
'BUILD_SHARED_LIBS' : 'OFF',
|
||||||
'BUILD_STATIC_LIBS' : 'ON',
|
'BUILD_STATIC_LIBS' : 'ON',
|
||||||
'EXAMPLES_ENABLE_C': 'OFF',
|
'EXAMPLES_ENABLE_C' : 'OFF',
|
||||||
'CMAKE_POSITION_INDEPENDENT_CODE': true
|
'CMAKE_POSITION_INDEPENDENT_CODE': true
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -16,6 +16,15 @@ cvode_cmake_options.add_cmake_defines({
|
|||||||
'CMAKE_INSTALL_INCLUDEDIR': get_option('includedir')
|
'CMAKE_INSTALL_INCLUDEDIR': get_option('includedir')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if meson.is_cross_build() and host_machine.system() == 'emscripten'
|
||||||
|
cvode_cmake_options.add_cmake_defines({
|
||||||
|
'CMAKE_C_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1',
|
||||||
|
'CMAKE_CXX_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1',
|
||||||
|
'CMAKE_SHARED_LINKER_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1',
|
||||||
|
'CMAKE_EXE_LINKER_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1'
|
||||||
|
})
|
||||||
|
endif
|
||||||
|
|
||||||
cvode_sp = cmake.subproject(
|
cvode_sp = cmake.subproject(
|
||||||
'cvode',
|
'cvode',
|
||||||
options: cvode_cmake_options,
|
options: cvode_cmake_options,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
xxhash_dep = declare_dependency(
|
xxhash_dep = declare_dependency(
|
||||||
include_directories: include_directories('include')
|
include_directories: include_directories('include')
|
||||||
)
|
)
|
||||||
|
|||||||
32
build-extra/log-level/meson.build
Normal file
32
build-extra/log-level/meson.build
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
llevel = get_option('log_level')
|
||||||
|
|
||||||
|
logbase='QUILL_COMPILE_ACTIVE_LOG_LEVEL_'
|
||||||
|
|
||||||
|
if (llevel == 'traceL3')
|
||||||
|
message('Setting log level to TRACE_L3')
|
||||||
|
log_argument = logbase + 'TRACE_L3'
|
||||||
|
elif (llevel == 'traceL2')
|
||||||
|
message('Setting log level to TRACE_L2')
|
||||||
|
log_argument = logbase + 'TRACE_L2'
|
||||||
|
elif (llevel == 'traceL1')
|
||||||
|
message('Setting log level to TRACE_L1')
|
||||||
|
log_argument = logbase + 'TRACE_L1'
|
||||||
|
elif (llevel == 'debug')
|
||||||
|
message('Setting log level to DEBUG')
|
||||||
|
log_argument = logbase + 'DEBUG'
|
||||||
|
elif (llevel == 'info')
|
||||||
|
message('Setting log level to INFO')
|
||||||
|
log_argument = logbase + 'INFO'
|
||||||
|
elif (llevel == 'warning')
|
||||||
|
message('Setting log level to WARNING')
|
||||||
|
log_argument = logbase + 'WARNING'
|
||||||
|
elif (llevel == 'error')
|
||||||
|
message('Setting log level to ERROR')
|
||||||
|
log_argument = logbase + 'ERROR'
|
||||||
|
elif (llevel == 'critical')
|
||||||
|
message('Setting log level to CRITICAL')
|
||||||
|
log_argument = logbase + 'CRITICAL'
|
||||||
|
endif
|
||||||
|
|
||||||
|
log_argument = '-DQUILL_COMPILE_ACTIVE_LOG_LEVEL=' + log_argument
|
||||||
|
add_project_arguments(log_argument, language: 'cpp')
|
||||||
19
build-extra/pkg-config/meson.build
Normal file
19
build-extra/pkg-config/meson.build
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
if get_option('pkg_config')
|
||||||
|
message('Generating pkg-config file for GridFire...')
|
||||||
|
pkg = import('pkgconfig')
|
||||||
|
pkg.generate(
|
||||||
|
name: 'gridfire',
|
||||||
|
description: 'GridFire nuclear reaction network solver',
|
||||||
|
version: meson.project_version(),
|
||||||
|
libraries: [
|
||||||
|
libgridfire,
|
||||||
|
libcomposition,
|
||||||
|
libconfig,
|
||||||
|
libconst,
|
||||||
|
liblogging
|
||||||
|
],
|
||||||
|
subdirs: ['gridfire'],
|
||||||
|
filebase: 'gridfire',
|
||||||
|
install_dir: join_paths(get_option('libdir'), 'pkgconfig')
|
||||||
|
)
|
||||||
|
endif
|
||||||
@@ -1,90 +1,95 @@
|
|||||||
|
if get_option('build_python')
|
||||||
|
message('Building Python bindings...')
|
||||||
|
|
||||||
gridfire_py_deps = [
|
gridfire_py_deps = [
|
||||||
py_dep,
|
py_dep,
|
||||||
pybind11_dep,
|
pybind11_dep,
|
||||||
const_dep,
|
const_dep,
|
||||||
config_dep,
|
config_dep,
|
||||||
composition_dep,
|
composition_dep,
|
||||||
gridfire_dep
|
gridfire_dep
|
||||||
]
|
]
|
||||||
|
|
||||||
py_sources = [
|
py_sources = [
|
||||||
meson.project_source_root() + '/src/python/bindings.cpp',
|
meson.project_source_root() + '/src/python/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/types/bindings.cpp',
|
meson.project_source_root() + '/src/python/types/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/partition/bindings.cpp',
|
meson.project_source_root() + '/src/python/partition/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/partition/trampoline/py_partition.cpp',
|
meson.project_source_root() + '/src/python/partition/trampoline/py_partition.cpp',
|
||||||
meson.project_source_root() + '/src/python/reaction/bindings.cpp',
|
meson.project_source_root() + '/src/python/reaction/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/screening/bindings.cpp',
|
meson.project_source_root() + '/src/python/screening/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/screening/trampoline/py_screening.cpp',
|
meson.project_source_root() + '/src/python/screening/trampoline/py_screening.cpp',
|
||||||
meson.project_source_root() + '/src/python/io/bindings.cpp',
|
meson.project_source_root() + '/src/python/io/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/io/trampoline/py_io.cpp',
|
meson.project_source_root() + '/src/python/io/trampoline/py_io.cpp',
|
||||||
meson.project_source_root() + '/src/python/exceptions/bindings.cpp',
|
meson.project_source_root() + '/src/python/exceptions/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/engine/bindings.cpp',
|
meson.project_source_root() + '/src/python/engine/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/engine/trampoline/py_engine.cpp',
|
meson.project_source_root() + '/src/python/engine/trampoline/py_engine.cpp',
|
||||||
meson.project_source_root() + '/src/python/solver/bindings.cpp',
|
meson.project_source_root() + '/src/python/solver/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/solver/trampoline/py_solver.cpp',
|
meson.project_source_root() + '/src/python/solver/trampoline/py_solver.cpp',
|
||||||
meson.project_source_root() + '/src/python/policy/bindings.cpp',
|
meson.project_source_root() + '/src/python/policy/bindings.cpp',
|
||||||
meson.project_source_root() + '/src/python/policy/trampoline/py_policy.cpp',
|
meson.project_source_root() + '/src/python/policy/trampoline/py_policy.cpp',
|
||||||
meson.project_source_root() + '/src/python/utils/bindings.cpp',
|
meson.project_source_root() + '/src/python/utils/bindings.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
if meson.is_cross_build() and host_machine.system() == 'darwin'
|
if meson.is_cross_build() and host_machine.system() == 'darwin'
|
||||||
py_mod = shared_module(
|
py_mod = shared_module(
|
||||||
'_gridfire',
|
'_gridfire',
|
||||||
sources: py_sources,
|
|
||||||
dependencies: gridfire_py_deps,
|
|
||||||
name_prefix: '',
|
|
||||||
name_suffix: 'so',
|
|
||||||
install: true,
|
|
||||||
install_dir: py_installation.get_install_dir() + '/gridfire'
|
|
||||||
)
|
|
||||||
else
|
|
||||||
py_mod = py_installation.extension_module(
|
|
||||||
'_gridfire', # Name of the generated .so/.pyd file (without extension)
|
|
||||||
sources: py_sources,
|
sources: py_sources,
|
||||||
dependencies : gridfire_py_deps,
|
dependencies: gridfire_py_deps,
|
||||||
install : true,
|
name_prefix: '',
|
||||||
|
name_suffix: 'so',
|
||||||
|
install: true,
|
||||||
|
install_dir: py_installation.get_install_dir() + '/gridfire'
|
||||||
|
)
|
||||||
|
else
|
||||||
|
py_mod = py_installation.extension_module(
|
||||||
|
'_gridfire', # Name of the generated .so/.pyd file (without extension)
|
||||||
|
sources: py_sources,
|
||||||
|
dependencies : gridfire_py_deps,
|
||||||
|
install : true,
|
||||||
|
subdir: 'gridfire',
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
py_installation.install_sources(
|
||||||
|
files(
|
||||||
|
meson.project_source_root() + '/src/python/gridfire/__init__.py',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/__init__.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/exceptions.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/partition.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/reaction.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/screening.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/io.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/solver.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/policy.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/type.pyi'
|
||||||
|
),
|
||||||
subdir: 'gridfire',
|
subdir: 'gridfire',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
py_installation.install_sources(
|
||||||
|
files(
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/__init__.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/diagnostics.pyi',
|
||||||
|
),
|
||||||
|
subdir: 'gridfire/engine',
|
||||||
|
)
|
||||||
|
|
||||||
|
py_installation.install_sources(
|
||||||
|
files(
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/__init__.pyi',
|
||||||
|
),
|
||||||
|
subdir: 'gridfire/utils',
|
||||||
|
)
|
||||||
|
|
||||||
|
py_installation.install_sources(
|
||||||
|
files(
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/__init__.pyi',
|
||||||
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/reaction.pyi',
|
||||||
|
),
|
||||||
|
subdir: 'gridfire/utils/hashing',
|
||||||
|
)
|
||||||
|
else
|
||||||
|
message('Python bindings disabled')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
py_installation.install_sources(
|
|
||||||
files(
|
|
||||||
meson.project_source_root() + '/src/python/gridfire/__init__.py',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/__init__.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/exceptions.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/partition.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/reaction.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/screening.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/io.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/solver.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/policy.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/type.pyi'
|
|
||||||
),
|
|
||||||
subdir: 'gridfire',
|
|
||||||
)
|
|
||||||
|
|
||||||
py_installation.install_sources(
|
|
||||||
files(
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/__init__.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/diagnostics.pyi',
|
|
||||||
),
|
|
||||||
subdir: 'gridfire/engine',
|
|
||||||
)
|
|
||||||
|
|
||||||
py_installation.install_sources(
|
|
||||||
files(
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/__init__.pyi',
|
|
||||||
),
|
|
||||||
subdir: 'gridfire/utils',
|
|
||||||
)
|
|
||||||
|
|
||||||
py_installation.install_sources(
|
|
||||||
files(
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/__init__.pyi',
|
|
||||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/reaction.pyi',
|
|
||||||
),
|
|
||||||
subdir: 'gridfire/utils/hashing',
|
|
||||||
)
|
|
||||||
|
|||||||
23
cross/wasm.ini
Normal file
23
cross/wasm.ini
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
[binaries]
|
||||||
|
c = 'emcc'
|
||||||
|
cpp = 'em++'
|
||||||
|
ar = 'emar'
|
||||||
|
strip = 'emstrip'
|
||||||
|
|
||||||
|
exec_wrapper = 'node'
|
||||||
|
|
||||||
|
[built-in options]
|
||||||
|
c_args = ['-Dpkg_config=false', '-Dbuild_tests=false', '-Dbuild_examples=true', '-Dbuild_fortran=falase', '-Dplugin_support=false', '-s', 'MEMORY64=1', '-pthread', '-DQUILL_NO_THREAD_NAME_SUPPORT', '-DQUILL_IMMEDIATE_FLUSH']
|
||||||
|
cpp_args = ['-Dpkg_config=false', '-Dbuild_tests=false', '-Dbuild_examples=true', '-Dbuild_fortran=falase', '-Dplugin_support=false', '-s', 'MEMORY64=1', '-pthread', '-DQUILL_NO_THREAD_NAME_SUPPORT', '-DQUILL_IMMEDIATE_FLUSH']
|
||||||
|
c_link_args = ['-s', 'WASM=1', '-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'MEMORY64=1', '-fwasm-exceptions', '-pthread', '-s', 'EXPORTED_RUNTIME_METHODS=["FS", "callMain"]', '-s', 'STACK_SIZE=10485760']
|
||||||
|
cpp_link_args = ['-s', 'WASM=1', '-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'MEMORY64=1', '-fwasm-exceptions', '-pthread', '-s', 'EXPORTED_RUNTIME_METHODS=["FS", "callMain"]', '-s', 'STACK_SIZE=10485760']
|
||||||
|
|
||||||
|
[host_machine]
|
||||||
|
system = 'emscripten'
|
||||||
|
cpu_family = 'wasm64'
|
||||||
|
cpu = 'wasm64'
|
||||||
|
endian = 'little'
|
||||||
|
|
||||||
|
[properties]
|
||||||
|
cmake_toolchain_file = '/home/tboudreaux/Programming/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake'
|
||||||
|
|
||||||
142
meson.build
142
meson.build
@@ -20,141 +20,25 @@
|
|||||||
# *********************************************************************** #
|
# *********************************************************************** #
|
||||||
project('GridFire', ['c', 'cpp'], version: 'v0.7.4_rc2', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
|
project('GridFire', ['c', 'cpp'], version: 'v0.7.4_rc2', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
|
||||||
|
|
||||||
if get_option('build-python')
|
# Start by running the code which validates the build environment
|
||||||
add_project_arguments('-fvisibility=hidden', language: 'cpp')
|
subdir('build-check')
|
||||||
else
|
|
||||||
add_project_arguments('-fvisibility=default', language: 'cpp')
|
|
||||||
endif
|
|
||||||
|
|
||||||
message('Found CXX compiler: ' + meson.get_compiler('cpp').get_id())
|
# Configure the logging level
|
||||||
message('C++ standard set to: ' + get_option('cpp_std'))
|
subdir('build-extra/log-level')
|
||||||
|
|
||||||
cppc = meson.get_compiler('cpp')
|
|
||||||
cc = meson.get_compiler('c')
|
|
||||||
|
|
||||||
|
|
||||||
if cppc.get_id() == 'clang'
|
|
||||||
message('disabling bitwise-instead-of-logical warnings for clang')
|
|
||||||
add_project_arguments('-Wno-bitwise-instead-of-logical', language: 'cpp')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if cppc.get_id() == 'gcc'
|
|
||||||
message('disabling psabi warnings for gcc')
|
|
||||||
add_project_arguments('-Wno-psabi', language: 'cpp')
|
|
||||||
|
|
||||||
if (cppc.version().version_compare('<14.0'))
|
|
||||||
error('g++ version must be at least 14.0, found ' + cppc.version())
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
build_fortran = get_option('build-fortran')
|
|
||||||
if (build_fortran)
|
|
||||||
add_languages('fortran', native: true)
|
|
||||||
message('Found FORTRAN compiler: ' + meson.get_compiler('fortran').get_id())
|
|
||||||
message('Fortran standard set to: ' + get_option('fortran_std'))
|
|
||||||
message('Building fortran module (gridfire_mod.mod)')
|
|
||||||
fc = meson.get_compiler('fortran')
|
|
||||||
if not get_option('unsafe-fortran')
|
|
||||||
if fc.get_id() != 'gcc'
|
|
||||||
error('The only supported fortran compiler for GridFire is gfortran (version >= 14.0), found ' + fc + '. GridFire has not been tested with any other compilers. You can disable this check with the -Dunsafe-fortran=true flag to try other compilers')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if (fc.version().version_compare('<14.0'))
|
|
||||||
error('gfortran version must be at least 14.0, found ' + fc.version())
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
if not cppc.has_header('print')
|
|
||||||
error('C++ standard library header <print> not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.')
|
|
||||||
endif
|
|
||||||
if not cppc.has_header('format')
|
|
||||||
error('C++ standard library header <format> not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.')
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ignore_unused_args = '-Wno-unused-command-line-argument'
|
|
||||||
|
|
||||||
add_global_arguments(ignore_unused_args, language: 'cpp')
|
|
||||||
add_global_arguments(ignore_unused_args, language: 'c')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# For Eigen
|
|
||||||
add_project_arguments('-Wno-deprecated-declarations', language: 'cpp')
|
|
||||||
|
|
||||||
llevel = get_option('log-level')
|
|
||||||
|
|
||||||
logbase='QUILL_COMPILE_ACTIVE_LOG_LEVEL_'
|
|
||||||
|
|
||||||
if (llevel == 'traceL3')
|
|
||||||
message('Setting log level to TRACE_L3')
|
|
||||||
log_argument = logbase + 'TRACE_L3'
|
|
||||||
elif (llevel == 'traceL2')
|
|
||||||
message('Setting log level to TRACE_L2')
|
|
||||||
log_argument = logbase + 'TRACE_L2'
|
|
||||||
elif (llevel == 'traceL1')
|
|
||||||
message('Setting log level to TRACE_L1')
|
|
||||||
log_argument = logbase + 'TRACE_L1'
|
|
||||||
elif (llevel == 'debug')
|
|
||||||
message('Setting log level to DEBUG')
|
|
||||||
log_argument = logbase + 'DEBUG'
|
|
||||||
elif (llevel == 'info')
|
|
||||||
message('Setting log level to INFO')
|
|
||||||
log_argument = logbase + 'INFO'
|
|
||||||
elif (llevel == 'warning')
|
|
||||||
message('Setting log level to WARNING')
|
|
||||||
log_argument = logbase + 'WARNING'
|
|
||||||
elif (llevel == 'error')
|
|
||||||
message('Setting log level to ERROR')
|
|
||||||
log_argument = logbase + 'ERROR'
|
|
||||||
elif (llevel == 'critical')
|
|
||||||
message('Setting log level to CRITICAL')
|
|
||||||
log_argument = logbase + 'CRITICAL'
|
|
||||||
endif
|
|
||||||
|
|
||||||
log_argument = '-DQUILL_COMPILE_ACTIVE_LOG_LEVEL=' + log_argument
|
|
||||||
add_project_arguments(log_argument, language: 'cpp')
|
|
||||||
|
|
||||||
cpp = meson.get_compiler('cpp')
|
|
||||||
|
|
||||||
|
# Then build the external dependencies
|
||||||
subdir('build-config')
|
subdir('build-config')
|
||||||
|
|
||||||
|
# Build the main source code
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
|
||||||
if get_option('build-python')
|
# Build the Python bindings
|
||||||
message('Configuring Python bindings...')
|
subdir('build-python')
|
||||||
subdir('build-python')
|
|
||||||
else
|
|
||||||
message('Skipping Python bindings...')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if get_option('build-tests')
|
# Buil the test suite
|
||||||
message('Setting up tests for GridFire...')
|
subdir('tests')
|
||||||
subdir('tests')
|
|
||||||
else
|
# Build the pkg-config file
|
||||||
message('Skipping tests for GridFire...')
|
subdir('build-extra/pkg-config')
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
if get_option('pkg-config')
|
|
||||||
message('Generating pkg-config file for GridFire...')
|
|
||||||
pkg = import('pkgconfig')
|
|
||||||
pkg.generate(
|
|
||||||
name: 'gridfire',
|
|
||||||
description: 'GridFire nuclear reaction network solver',
|
|
||||||
version: meson.project_version(),
|
|
||||||
libraries: [
|
|
||||||
libgridfire,
|
|
||||||
libcomposition,
|
|
||||||
libconfig,
|
|
||||||
libconst,
|
|
||||||
liblogging
|
|
||||||
],
|
|
||||||
subdirs: ['gridfire'],
|
|
||||||
filebase: 'gridfire',
|
|
||||||
install_dir: join_paths(get_option('libdir'), 'pkgconfig')
|
|
||||||
)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
option('log-level', type: 'combo', choices: ['traceL3', 'traceL2', 'traceL1', 'debug', 'info', 'warning', 'error', 'critial'], value: 'info', description: 'Set the log level for the GridFire library')
|
option('log_level', type: 'combo', choices: ['traceL3', 'traceL2', 'traceL1', 'debug', 'info', 'warning', 'error', 'critial'], value: 'info', description: 'Set the log level for the GridFire library')
|
||||||
option('pkg-config', type: 'boolean', value: true, description: 'generate pkg-config file for GridFire (gridfire.pc)')
|
option('pkg_config', type: 'boolean', value: true, description: 'generate pkg-config file for GridFire (gridfire.pc)')
|
||||||
option('build-python', type: 'boolean', value: false, description: 'build the python bindings so you can use GridFire from python')
|
option('build_python', type: 'boolean', value: false, description: 'build the python bindings so you can use GridFire from python')
|
||||||
option('build-tests', type: 'boolean', value: true, description: 'build the test suite')
|
option('build_tests', type: 'boolean', value: true, description: 'build the test suite')
|
||||||
option('build-fortran', type: 'boolean', value: false, description: 'build fortran module support')
|
option('build_examples', type: 'boolean', value: true, description: 'build example code')
|
||||||
option('unsafe-fortran', type: 'boolean', value: false, description: 'Allow untested fortran compilers (compilers other than gfortran)')
|
option('build_fortran', type: 'boolean', value: false, description: 'build fortran module support')
|
||||||
option('unity-safe', type: 'boolean', value: false, description: 'Enable safe unity builds for better compatibility across different compilers and platforms')
|
option('unsafe_fortran', type: 'boolean', value: false, description: 'Allow untested fortran compilers (compilers other than gfortran)')
|
||||||
option('python-target-version', type: 'string', value: '3.13', description: 'Target version for python compilation, only used for cross compilation')
|
option('plugin_support', type: 'boolean', value: false, description: 'Enable support for libplugin plugins')
|
||||||
|
option('python_target_version', type: 'string', value: '3.13', description: 'Target version for python compilation, only used for cross compilation')
|
||||||
|
option('build_c_api', type: 'boolean', value: true, description: 'compile the C API')
|
||||||
|
|||||||
2
src/extern/meson.build
vendored
2
src/extern/meson.build
vendored
@@ -23,7 +23,7 @@ gridfire_extern_dep = declare_dependency(
|
|||||||
|
|
||||||
install_subdir('include/gridfire', install_dir: get_option('includedir'))
|
install_subdir('include/gridfire', install_dir: get_option('includedir'))
|
||||||
|
|
||||||
if get_option('build-fortran')
|
if get_option('build_fortran')
|
||||||
message('Configuring Fortran bindings...')
|
message('Configuring Fortran bindings...')
|
||||||
subdir('fortran')
|
subdir('fortran')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ gridfire_build_dependencies = [
|
|||||||
json_dep,
|
json_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
if not get_option('unity-safe')
|
if get_option('plugin_support')
|
||||||
gridfire_build_dependencies += [plugin_dep]
|
gridfire_build_dependencies += [plugin_dep]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -63,12 +63,11 @@ gridfire_dep = declare_dependency(
|
|||||||
|
|
||||||
install_subdir('include/gridfire', install_dir: get_option('includedir'))
|
install_subdir('include/gridfire', install_dir: get_option('includedir'))
|
||||||
|
|
||||||
message('Configuring C API...')
|
|
||||||
subdir('extern')
|
if not get_option('build_c_api') and get_option('build_fortran')
|
||||||
#
|
error('Cannot build fortran without C API. Set -Dbuild-c-api=true and -Dbuild-fortran=true')
|
||||||
#if get_option('build-python')
|
endif
|
||||||
# message('Configuring Python bindings...')
|
if get_option('build_c_api')
|
||||||
# subdir('python')
|
message('Configuring C API...')
|
||||||
#else
|
subdir('extern')
|
||||||
# message('Skipping Python bindings...')
|
endif
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[wrap-git]
|
[wrap-git]
|
||||||
url = https://github.com/4D-STAR/fourdst
|
url = https://github.com/4D-STAR/fourdst
|
||||||
revision = v0.9.11
|
revision = v0.9.13
|
||||||
depth = 1
|
depth = 1
|
||||||
|
|||||||
6
tests/extern/meson.build
vendored
6
tests/extern/meson.build
vendored
@@ -1,5 +1,7 @@
|
|||||||
subdir('C')
|
if get_option('build_c_api')
|
||||||
|
subdir('C')
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('build-fortran')
|
if get_option('build_fortran')
|
||||||
subdir('fortran')
|
subdir('fortran')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Google Test dependency
|
# Google Test dependency
|
||||||
gtest_dep = dependency('gtest', main: true, required : true)
|
#gtest_dep = dependency('gtest', main: true, required : true)
|
||||||
gtest_main = dependency('gtest_main', required: true)
|
#gtest_main = dependency('gtest_main', required: true)
|
||||||
gtest_nomain_dep = dependency('gtest', main: false, required : true)
|
#gtest_nomain_dep = dependency('gtest', main: false, required : true)
|
||||||
|
|
||||||
# Subdirectories for unit and integration tests
|
# Subdirectories for unit and integration tests
|
||||||
subdir('graphnet_sandbox')
|
subdir('graphnet_sandbox')
|
||||||
|
|||||||
Reference in New Issue
Block a user