Skip to content

Latest commit

 

History

History
103 lines (70 loc) · 3.04 KB

File metadata and controls

103 lines (70 loc) · 3.04 KB

PyFVS Build Notes

PyFVS now builds using Meson.

Adapted from the SciPy Windows CI builds on GitHub

Setup on Windows

Install RTools 4.0

NOTE: Use of distutils for development, packaging, and distribution, Python packaging is moving to Meson. NOTE: meson=1.0.0 has a bug in LINK_ARGS with a misplaced reference to "msvcrt", so use "ucrt" Add the compiler to the PATH variable > set path=c:\rtools40\ucrt\bin;%PATH%

Create the conda environment (or pyenv/pip equivalent) # FIXME: Maybe pin meson-python version or get from github > conda create -c conda-forge -n=pyfvs310 python=3.10 meson>=1.1.1 meson-python>=0.13.2 ninja numpy pandas click openpyxl nomkl confuse pytest build

# Install meson-python from GitHub (optional)
>  python -m pip install git+https://github.com/mesonbuild/meson-python.git@7e090a7 --no-deps

Clone the Repository

> cd /d c:\workspace
> git clone https://github.com/forest-modeling/PyFVS.git pyfvs-dev
> cd pyfvs-dev
# Pull the FVS submodule
> git submodule update --init
> git checkout build-dev

Development

Create environment and install dependencies Use meson-python for development. As of meson-python >= 0.13.0.rc0 editable installations are available

Generate F90 include files from F77 for inclusion in globals.f90 Repeat for each variant in the configuration. NOTE: This step may be automated in future revision

> python _build_utils\convert_f77.py .\fvs\bin\FVSpn_sourceList.txt api\gen\pn\include

Install development (editable) mode

> python -m pip install --no-build-isolation -e .

To see verbose build progress and output

> python -m pip install --no-build-isolation -v -e . --config-settings editable-verbose=true

## TODO: Figure out how to pass fvsvariants configuration setting

NOTE: In editable mode meson-python calls meson/ninja each time pyfvs is imported

Test

> pushd ~

Build Wheels

> python -m build --no-isolation

##> python -m pip wheel --no-build-isolation -v -w dist --config-settings builddir=build_py310 .

Build

#> python setup.py develop --no-deps -- -DFVS_VARIANTS=pn,wc
#> meson setup build_py310 --prefix=%CD%\build_py310\Lib\site-packages
#> ninja -C build_py310
#> meson install -C build_py310

Test

> cd build_py310
> meson install
> set PYTHONPATH=%CD%\build_py310\Lib\site-packages
> python -m pyfvs run-tests

Folders

fvs: Source code from the Open-FVS project
build_fvs: CMake scripts to build open-fvs
cmake: Scikit-Build CMake scripts
pyfvs: PyFVS package root
api: Fortran modules extending the FVS API
    gen: ** Autogenerated F90 module files for improved F2PY interface

Build On WSL2 Ubuntu 12

> conda create -c conda-forge -n=pyfvs310 python=3.10 numpy ninja
> meson setup build_wsl && cd build_wsl
> meson compile