From 533a81a14152b0a4216574d816187631f2bbfc1d Mon Sep 17 00:00:00 2001 From: Anthony Aufdenkampe Date: Tue, 23 Apr 2024 15:37:18 -0500 Subject: [PATCH] example-cxx works on Mac! Using the global environment file, I was able to run most of the example and successfully test the BMI down to the end of https://babelizer.readthedocs.io/en/mdpiper-add-cxx-example/example-cxx.html#test-the-bmi. https://github.com/csdms/babelizer/pull/105 --- environment.yml | 11 ++++++--- example-cxx/babel_heatcxx.toml | 41 ++++++++++++++++++++++++++++++++++ example-cxx/test/config.txt | 1 + 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 example-cxx/babel_heatcxx.toml create mode 100644 example-cxx/test/config.txt diff --git a/environment.yml b/environment.yml index cb48863..cdbec29 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,9 @@ name: wrap-all channels: - conda-forge + - nodefaults # Speeds solving env, by limiting the number of options dependencies: + # From examples in https://babelizer.readthedocs.io/en/mdpiper-add-cxx-example/ - python>=3.10 - make - cmake @@ -11,11 +13,13 @@ dependencies: - bmi-c - cxx-compiler - bmi-cxx - # - fortran-compiler - # - bmi-fortran + - fortran-compiler + - bmi-fortran # - babelizer # installs latest release. pip install below for dev - bmi-tester - - pymt>=1.3 + # - pymt>=1.3 # Not installing for now, until it gets updated + + # other dependancies to improve build workflow - gimli.units=0.3.1 # Before reorg (https://github.com/mcflugen/gimli/pull/18) # to prevent import error with pymt=1.3.1 @@ -26,4 +30,5 @@ dependencies: - pip - pip: # - -e git+https://github.com/csdms/babelizer.git@develop # installs head of branch + # install head of `mdpiper/add-cxx-example` branch: - git+https://github.com/csdms/babelizer.git#111ed1b0f62e0a20ba373a465914ccbb5b17adb6 diff --git a/example-cxx/babel_heatcxx.toml b/example-cxx/babel_heatcxx.toml new file mode 100644 index 0000000..c57961d --- /dev/null +++ b/example-cxx/babel_heatcxx.toml @@ -0,0 +1,41 @@ +# See https://babelizer.readthedocs.io/ for more information + +# Describe the library being wrapped. +[library.HeatCxx] +language = "c++" +library = "bmiheatcxx" +header = "bmi_heat.hxx" +entry_point = "BmiHeat" + +# Describe compiler options need to build the library being wrapped. +[build] +undef_macros = [] +define_macros = [] +libraries = [] +library_dirs = [] +include_dirs = [] +extra_compile_args = [] + +# Describe the newly wrapped package. +[package] +name = "pymt_heatcxx" +requirements = [] + +[info] +github_username = "pymt-lab" +package_author = "csdms" +package_author_email = "csdms@colorado.edu" +package_license = "MIT License" +summary = "PyMT component for the C++ heat model" + +[ci] +python_version = [ + "3.10", + "3.11", + "3.12", +] +os = [ + "linux", + "mac", + "windows", +] diff --git a/example-cxx/test/config.txt b/example-cxx/test/config.txt new file mode 100644 index 0000000..fe07de3 --- /dev/null +++ b/example-cxx/test/config.txt @@ -0,0 +1 @@ +1.5, 8.0, 6, 5