Compare commits
9 Commits
e73daf88b3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ab0d21ba1 | |||
| 917d416ce2 | |||
| 1cdd2d92e0 | |||
| 4423d7594c | |||
| 087926728a | |||
| df09564c9a | |||
| 0bf3ae625b | |||
| 5c1714410a | |||
| e6a9d8c5bb |
@@ -33,7 +33,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('openmp_support')
|
if get_option('openmp_support')
|
||||||
add_project_arguments('-DGF_USE_OPENMP', language: 'cpp')
|
gridfire_args += ['-DGF_USE_OPENMP']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('asan') and get_option('buildtype') != 'debug' and get_option('buildtype') != 'debugoptimized'
|
if get_option('asan') and get_option('buildtype') != 'debug' and get_option('buildtype') != 'debugoptimized'
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ cc = meson.get_compiler('c')
|
|||||||
|
|
||||||
ignore_unused_args = '-Wno-unused-command-line-argument'
|
ignore_unused_args = '-Wno-unused-command-line-argument'
|
||||||
|
|
||||||
add_global_arguments(ignore_unused_args, language: 'cpp')
|
if not meson.is_subproject()
|
||||||
add_global_arguments(ignore_unused_args, language: 'c')
|
add_global_arguments(ignore_unused_args, language: 'cpp')
|
||||||
|
add_global_arguments(ignore_unused_args, language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
subdir('CPPC')
|
subdir('CPPC')
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
#cppad_inc = include_directories('include', is_system: true)
|
|
||||||
#cppad_dep = declare_dependency(
|
|
||||||
# include_directories: cppad_inc,
|
|
||||||
#)
|
|
||||||
#
|
|
||||||
#message('Registering CppAD headers for installation...')
|
|
||||||
#install_subdir('include/cppad', install_dir: get_option('includedir'))
|
|
||||||
#message('Done registering CppAD headers for installation!')
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
cppad_cmake_options = cmake.subproject_options()
|
cppad_cmake_options = cmake.subproject_options()
|
||||||
|
|
||||||
cppad_cmake_options.add_cmake_defines({
|
cppad_cmake_options.add_cmake_defines({
|
||||||
'cppad_static_lib': 'true',
|
'cppad_static_lib': 'true',
|
||||||
'cpp_mas_num_threads': '10',
|
'cpp_mas_num_threads': '10',
|
||||||
'cppad_debug_and_release': 'false',
|
'cppad_debug_and_release': 'false',
|
||||||
'include_doc': 'false'
|
'include_doc': 'false',
|
||||||
|
'CMAKE_POSITION_INDEPENDENT_CODE': true
|
||||||
})
|
})
|
||||||
|
|
||||||
cppad_cmake_options.set_install(false)
|
cppad_cmake_options.set_install(false)
|
||||||
@@ -25,4 +15,29 @@ cppad_sp = cmake.subproject(
|
|||||||
options: cppad_cmake_options,
|
options: cppad_cmake_options,
|
||||||
)
|
)
|
||||||
|
|
||||||
cppad_dep = cppad_sp.dependency('cppad_lib').as_system()
|
cppad_target = cppad_sp.target('cppad_lib')
|
||||||
|
cppad_objs = [cppad_target.extract_all_objects(recursive: true)]
|
||||||
|
cppad_incs = cppad_sp.include_directories('cppad_lib')
|
||||||
|
|
||||||
|
empty_cppad_file = configure_file(output: 'cppad_dummy_ar.cpp', command: ['echo'], capture: true)
|
||||||
|
|
||||||
|
libcppad_static = static_library(
|
||||||
|
'cppad-static',
|
||||||
|
empty_cppad_file,
|
||||||
|
objects: cppad_objs,
|
||||||
|
include_directories: cppad_incs,
|
||||||
|
pic: true,
|
||||||
|
install: false
|
||||||
|
)
|
||||||
|
|
||||||
|
cppad_dep = declare_dependency(
|
||||||
|
link_with: libcppad_static,
|
||||||
|
include_directories: cppad_incs
|
||||||
|
)
|
||||||
|
|
||||||
|
message('Installing CppAD headers to ' + get_option('includedir'))
|
||||||
|
install_subdir(
|
||||||
|
'subprojects/CppAD-20250000.2/include',
|
||||||
|
install_dir: get_option('includedir'),
|
||||||
|
strip_directory: true
|
||||||
|
)
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ elif (llevel == 'critical')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
log_argument = '-DQUILL_COMPILE_ACTIVE_LOG_LEVEL=' + log_argument
|
log_argument = '-DQUILL_COMPILE_ACTIVE_LOG_LEVEL=' + log_argument
|
||||||
add_project_arguments(log_argument, language: 'cpp')
|
gridfire_args += [log_argument]
|
||||||
|
|||||||
@@ -9,7 +9,11 @@ if get_option('pkg_config')
|
|||||||
libgridfire,
|
libgridfire,
|
||||||
libcomposition,
|
libcomposition,
|
||||||
libconst,
|
libconst,
|
||||||
liblogging
|
liblogging,
|
||||||
|
libcppad_static,
|
||||||
|
libcvode_static,
|
||||||
|
libkinsol_static
|
||||||
|
|
||||||
],
|
],
|
||||||
subdirs: ['gridfire'],
|
subdirs: ['gridfire'],
|
||||||
filebase: 'gridfire',
|
filebase: 'gridfire',
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
# *********************************************************************** #
|
# *********************************************************************** #
|
||||||
project('GridFire', ['c', 'cpp'], version: 'v0.7.5rc3', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
|
project('GridFire', ['c', 'cpp'], version: 'v0.7.6rc3.4', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
|
||||||
|
|
||||||
|
gridfire_args = []
|
||||||
|
|
||||||
# Start by running the code which validates the build environment
|
# Start by running the code which validates the build environment
|
||||||
subdir('build-check')
|
subdir('build-check')
|
||||||
|
|||||||
@@ -359,7 +359,6 @@ namespace gridfire::engine {
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using LogManager = LogManager;
|
|
||||||
Config<config::GridFireConfig> m_config;
|
Config<config::GridFireConfig> m_config;
|
||||||
|
|
||||||
quill::Logger* m_logger = LogManager::getInstance().getLogger("log");
|
quill::Logger* m_logger = LogManager::getInstance().getLogger("log");
|
||||||
|
|||||||
26
src/include/gridfire/utils/config.h.in
Normal file
26
src/include/gridfire/utils/config.h.in
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <format>
|
||||||
|
|
||||||
|
namespace gridfire {
|
||||||
|
struct version {
|
||||||
|
static constexpr int major = #STRINGIFY(GF_VERSION_MAJOR);
|
||||||
|
static constexpr int minor = #STRINGIFY(GF_VERSION_MINOR);
|
||||||
|
static constexpr int patch = #STRINGIFY(GF_VERSION_PATCH);
|
||||||
|
|
||||||
|
static constexpr const char* tag = #STRINGIFY(GF_VERSION_TAG);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct std::formatter<gridfire::version> : std::formatter<std::string> {
|
||||||
|
auto format(const gridfire::version& v, auto& ctx) {
|
||||||
|
std::string versionStr = std::to_string(v.major) + "." +
|
||||||
|
std::to_string(v.minor) + "." +
|
||||||
|
std::to_string(v.patch);
|
||||||
|
if (std::string(v.tag) != "") {
|
||||||
|
versionStr += "-" + std::string(v.tag);
|
||||||
|
}
|
||||||
|
return std::formatter<std::string>::format(versionStr, ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
0
src/include/gridfire/utils/meson.build
Normal file
0
src/include/gridfire/utils/meson.build
Normal file
@@ -415,29 +415,6 @@ namespace gridfire::engine {
|
|||||||
}
|
}
|
||||||
state->active_reactions.add_reaction(*reaction);
|
state->active_reactions.add_reaction(*reaction);
|
||||||
}
|
}
|
||||||
LOG_TRACE_L3(m_logger, "DefinedEngineView built with {} active species and {} active reactions.", m_activeSpecies.size(), m_activeReactions.size());
|
|
||||||
LOG_TRACE_L3(m_logger, "Active species: {}", [this]() -> std::string {
|
|
||||||
std::string result;
|
|
||||||
for (const auto& species : m_activeSpecies) {
|
|
||||||
result += std::string(species.name()) + ", ";
|
|
||||||
}
|
|
||||||
if (!result.empty()) {
|
|
||||||
result.pop_back(); // Remove last space
|
|
||||||
result.pop_back(); // Remove last comma
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}());
|
|
||||||
LOG_TRACE_L3(m_logger, "Active reactions: {}", [this]() -> std::string {
|
|
||||||
std::string result;
|
|
||||||
for (const auto& reaction : m_activeReactions) {
|
|
||||||
result += std::string(reaction->id()) + ", ";
|
|
||||||
}
|
|
||||||
if (!result.empty()) {
|
|
||||||
result.pop_back(); // Remove last space
|
|
||||||
result.pop_back(); // Remove last comma
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}());
|
|
||||||
state->species_index_map = constructSpeciesIndexMap(ctx);
|
state->species_index_map = constructSpeciesIndexMap(ctx);
|
||||||
state->reaction_index_map = constructReactionIndexMap(ctx);
|
state->reaction_index_map = constructReactionIndexMap(ctx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# Define the library
|
# Define the library
|
||||||
|
subdir('include/gridfire/utils') # Generate the version header file first
|
||||||
|
|
||||||
gridfire_sources = files(
|
gridfire_sources = files(
|
||||||
'lib/engine/engine_graph.cpp',
|
'lib/engine/engine_graph.cpp',
|
||||||
'lib/engine/views/engine_adaptive.cpp',
|
'lib/engine/views/engine_adaptive.cpp',
|
||||||
@@ -63,6 +65,7 @@ if get_option('build_python')
|
|||||||
gridfire_sources,
|
gridfire_sources,
|
||||||
include_directories: include_directories('include'),
|
include_directories: include_directories('include'),
|
||||||
dependencies: gridfire_build_dependencies,
|
dependencies: gridfire_build_dependencies,
|
||||||
|
cpp_args: gridfire_args,
|
||||||
objects: [cvode_objs, kinsol_objs],
|
objects: [cvode_objs, kinsol_objs],
|
||||||
install : false)
|
install : false)
|
||||||
else
|
else
|
||||||
@@ -71,6 +74,7 @@ else
|
|||||||
include_directories: include_directories('include'),
|
include_directories: include_directories('include'),
|
||||||
dependencies: gridfire_build_dependencies,
|
dependencies: gridfire_build_dependencies,
|
||||||
objects: [cvode_objs, kinsol_objs],
|
objects: [cvode_objs, kinsol_objs],
|
||||||
|
cpp_args: gridfire_args,
|
||||||
install : true)
|
install : true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -79,6 +83,7 @@ gridfire_dep = declare_dependency(
|
|||||||
link_with: libgridfire,
|
link_with: libgridfire,
|
||||||
sources: gridfire_sources,
|
sources: gridfire_sources,
|
||||||
dependencies: gridfire_build_dependencies,
|
dependencies: gridfire_build_dependencies,
|
||||||
|
compile_args: gridfire_args,
|
||||||
)
|
)
|
||||||
|
|
||||||
install_subdir('include/gridfire', install_dir: get_option('includedir'))
|
install_subdir('include/gridfire', install_dir: get_option('includedir'))
|
||||||
|
|||||||
@@ -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.18
|
revision = v0.9.19
|
||||||
depth = 1
|
depth = 1
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ int main() {
|
|||||||
std::array<NetIn, nZones> netIns;
|
std::array<NetIn, nZones> netIns;
|
||||||
for (size_t zone = 0; zone < nZones; ++zone) {
|
for (size_t zone = 0; zone < nZones; ++zone) {
|
||||||
netIns[zone] = netIn;
|
netIns[zone] = netIn;
|
||||||
netIns[zone].temperature = 1.0e7;
|
netIns[zone].temperature = 1.5e7;
|
||||||
}
|
}
|
||||||
|
|
||||||
const solver::PointSolver localSolver(engine);
|
const solver::PointSolver localSolver(engine);
|
||||||
|
|||||||
@@ -346,25 +346,15 @@ int main(int argc, char** argv) {
|
|||||||
double temp = 1.5e7;
|
double temp = 1.5e7;
|
||||||
double rho = 1.5e2;
|
double rho = 1.5e2;
|
||||||
double tMax = 3.1536e+16;
|
double tMax = 3.1536e+16;
|
||||||
double X = 0.7;
|
|
||||||
double Z = 0.02;
|
|
||||||
|
|
||||||
|
|
||||||
CLI::App app("GridFire Quick CLI Test");
|
CLI::App app("GridFire Quick CLI Test");
|
||||||
// Add temp, rho, and tMax as options if desired
|
|
||||||
app.add_option("--temp", temp, "Initial Temperature")->default_val(std::format("{:5.2E}", temp));
|
app.add_option("--temp", temp, "Initial Temperature")->default_val(std::format("{:5.2E}", temp));
|
||||||
app.add_option("--rho", rho, "Initial Density")->default_val(std::format("{:5.2E}", rho));
|
app.add_option("--rho", rho, "Initial Density")->default_val(std::format("{:5.2E}", rho));
|
||||||
app.add_option("--tmax", tMax, "Maximum Time")->default_val(std::format("{:5.2E}", tMax));
|
app.add_option("--tmax", tMax, "Maximum Time")->default_val(std::format("{:5.2E}", tMax));
|
||||||
// app.add_option("--X", X, "Target Hydrogen Mass Fraction")->default_val(std::format("{:5.2f}", X));
|
|
||||||
// app.add_option("--Z", Z, "Target Metal Mass Fraction")->default_val(std::format("{:5.2f}", Z));
|
|
||||||
|
|
||||||
CLI11_PARSE(app, argc, argv);
|
CLI11_PARSE(app, argc, argv);
|
||||||
NetIn netIn = init(temp, rho, tMax);
|
NetIn netIn = init(temp, rho, tMax);
|
||||||
for (const auto& [sp, y] : netIn.composition) {
|
|
||||||
std::println("Species: {}, Abundance: {}", sp.name(), y);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
// netIn.composition = rescale(netIn.composition, X, Z);
|
|
||||||
|
|
||||||
policy::MainSequencePolicy stellarPolicy(netIn.composition);
|
policy::MainSequencePolicy stellarPolicy(netIn.composition);
|
||||||
auto [engine, ctx_template] = stellarPolicy.construct();
|
auto [engine, ctx_template] = stellarPolicy.construct();
|
||||||
|
|||||||
@@ -52,7 +52,11 @@ for PY_VERSION in "${PYTHON_VERSIONS[@]}"; do
|
|||||||
echo "----------------------------------------------------------------"
|
echo "----------------------------------------------------------------"
|
||||||
|
|
||||||
# Install build deps explicitly so we can skip build isolation
|
# Install build deps explicitly so we can skip build isolation
|
||||||
"$PY" -m pip install --upgrade pip setuptools wheel meson meson-python delocate
|
"$PY" -m pip install --upgrade pip setuptools wheel meson-python delocate
|
||||||
|
"$PY" -m pip install meson==1.9.1
|
||||||
|
|
||||||
|
echo "➤ Building wheel with ccache enabled"
|
||||||
|
echo "➤ Found meson version $(meson --version)"
|
||||||
|
|
||||||
# for every single build, saving significant I/O and network time.
|
# for every single build, saving significant I/O and network time.
|
||||||
CC="ccache clang" CXX="ccache clang++" "$PY" -m pip wheel . --no-build-isolation -w "${WHEEL_DIR}" -v
|
CC="ccache clang" CXX="ccache clang++" "$PY" -m pip wheel . --no-build-isolation -w "${WHEEL_DIR}" -v
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ for WHEEL_PATH in "$WHEEL_DIR"/*.whl; do
|
|||||||
done < <(find "$TEMP_DIR" -name "*.so" -print0)
|
done < <(find "$TEMP_DIR" -name "*.so" -print0)
|
||||||
|
|
||||||
echo -e "${GREEN}Step 4: Repackaging wheel...${NC}"
|
echo -e "${GREEN}Step 4: Repackaging wheel...${NC}"
|
||||||
python -m wheel pack "$TEMP_DIR/gridfire-0.7.4rc2" -d "$REPAIRED_WHEELS_DIR"
|
python -m wheel pack "$TEMP_DIR/gridfire-0.7.5rc3" -d "$REPAIRED_WHEELS_DIR"
|
||||||
|
|
||||||
REPAIRED_WHEEL_PATH="${REPAIRED_WHEELS_DIR}/${WHEEL_NAME}"
|
REPAIRED_WHEEL_PATH="${REPAIRED_WHEELS_DIR}/${WHEEL_NAME}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user