diff --git a/components/eamxx/src/python/pyproject.toml b/components/eamxx/src/python/pyproject.toml new file mode 100644 index 00000000000..69a15543983 --- /dev/null +++ b/components/eamxx/src/python/pyproject.toml @@ -0,0 +1,17 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyeamxx" +version = "0.0.1.dev6" +dependencies = ["numpy", "mpi4py"] + +[tool.setuptools.packages.find] +where = ["."] +include = ["pyeamxx", "libpyeamxx"] +exclude = ["build_src", "tests"] +namespaces = true + +[tool.setuptools.package-data] +"libpyeamxx" = ["*.so*"] diff --git a/components/eamxx/src/python/readme b/components/eamxx/src/python/readme index 823ff9c0426..8acf0f60429 100644 --- a/components/eamxx/src/python/readme +++ b/components/eamxx/src/python/readme @@ -1,12 +1,11 @@ INFO: - EAMxx python bindings -- libpyeamxx is where we will house the extensions - pyeamxx is where we will house the python code +- libpyeamxx is where we will house the extensions +- packaging moved to https://github.com/mahf708/experimental-scream-feedstock TODO: - add more python code to organize structures - establish ci pipeline in scream/e3sm repos -- add to cf (or alternatively sync with it) - decide how to deal with versioning - decide archs/pythons/mpis to tgt -- figure out what's tripping cf diff --git a/components/eamxx/src/python/setup.py b/components/eamxx/src/python/setup.py deleted file mode 100644 index 40b62d3c17c..00000000000 --- a/components/eamxx/src/python/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -from setuptools import setup, Distribution - - -class BinaryDistribution(Distribution): - def has_ext_modules(foo): - return True - -setup( - name='pyeamxx', - version='0.0.1.dev5', - author='E3SM SCREAM', - description='EAMxx wrapper', - packages=['', 'pyeamxx'], - package_data={ - '': ['libpyeamxx/*.so*'], - }, - distclass=BinaryDistribution, - zip_safe=False -) diff --git a/components/eamxx/src/python/tools/build.sh b/components/eamxx/src/python/tools/build.sh deleted file mode 100644 index 21757e8206b..00000000000 --- a/components/eamxx/src/python/tools/build.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/env bash - -cd components/eamxx/src/python - -cmake \ - -S ../../ \ - -B build_src \ - -DCMAKE_BUILD_TYPE='Release' \ - -DEAMXX_ENABLE_PYBIND='ON' \ - -DNetcdf_Fortran_PATH=$PREFIX \ - -DNetcdf_C_PATH=$PREFIX \ - -DCMAKE_CXX_FLAGS='-fvisibility-inlines-hidden -fmessage-length=0 -Wno-use-after-free -Wno-unused-variable -Wno-maybe-uninitialized' \ - -DCMAKE_C_FLAGS='' \ - -DCMAKE_Fortran_FLAGS='-Wno-maybe-uninitialized -Wno-unused-dummy-argument' \ - -DCMAKE_CXX_COMPILER=mpic++ \ - -DCMAKE_C_COMPILER=mpicc \ - -DCMAKE_Fortran_COMPILER=mpif90 \ - -DBUILD_SHARED_LIBS=ON \ - -DSCREAM_INPUT_ROOT="build_src" \ - -DSCREAM_ENABLE_BASELINE_TESTS=OFF \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DPYTHON_EXECUTABLE=$PYTHON - -cmake --build build_src/src/python -j${CPU_COUNT:-128} - -find build_src -name "*.so*" | xargs cp -t libpyeamxx/ -for f in libpyeamxx/*.so*; do patchelf --set-rpath '$ORIGIN' --force-rpath $f; done - -$PYTHON -m build -w -n -x - -pip install dist/*.whl -vv diff --git a/components/eamxx/src/python/tools/conda_build_config.yaml b/components/eamxx/src/python/tools/conda_build_config.yaml deleted file mode 100644 index f5f68d8d781..00000000000 --- a/components/eamxx/src/python/tools/conda_build_config.yaml +++ /dev/null @@ -1,6 +0,0 @@ - -# eamxx fails with gcc 13 -c_compiler_version: # [linux] - - 12 # [linux] -cxx_compiler_version: # [linux] - - 12 # [linux] diff --git a/components/eamxx/src/python/tools/meta.yaml b/components/eamxx/src/python/tools/meta.yaml deleted file mode 100644 index 0ee370bbbb5..00000000000 --- a/components/eamxx/src/python/tools/meta.yaml +++ /dev/null @@ -1,53 +0,0 @@ -package: - name: pyeamxx - version: 0.0.1.dev5 - -source: - path: ../../../../../ - -build: - number: 0 - -requirements: - build: - - cmake - # - {{ stdlib('c') }} - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - {{ compiler('fortran') }} - host: - - python - - pybind11 - - setuptools - - build - - spdlog - - fmt - - yaml-cpp - - mpich - - hdf5 *=*mpich* - - libnetcdf - - netcdf-cxx4 - - netcdf-fortran - - python - - numpy - - mpi4py - run: - - {{ pin_compatible('spdlog', max_pin='x.x') }} - - {{ pin_compatible('fmt', max_pin='x.x') }} - - {{ pin_compatible('yaml-cpp', max_pin='x.x') }} - - {{ pin_compatible('mpich', max_pin='x.x') }} - - hdf5 *=*mpich* - - {{ pin_compatible('libnetcdf', max_pin='x.x') }} - - {{ pin_compatible('netcdf-cxx4', max_pin='x.x') }} - - {{ pin_compatible('netcdf-fortran', max_pin='x.x') }} - - python - - {{ pin_compatible('numpy', max_pin='x.x') }} - - mpi4py - -about: - home: https://github.com/E3SM-Project/scream - summary: Python wrapper for EAMxx - -extra: - recipe-maintainers: - - scream-team