xgcm / aerobulk-python

A python wrapper for aerobulk (https://github.com/brodeau/aerobulk)
GNU General Public License v3.0
14 stars 4 forks source link

Setting up the package internals #3

Closed jbusecke closed 2 years ago

jbusecke commented 2 years ago

This is very much a work in progress rn.

I am trying to transfer @rabernat s work to a clean repo, and eventually make it pip and conda installable.

rabernat commented 2 years ago

I would but the submodule inside a subdirectory called src. In src, we will also include the wrapper fortran file and the signature file. So

src/wrapper.f90
src/wrapper.pyf
src/aerobulk/...
jbusecke commented 2 years ago

Ok I can do that.

How do you think is the best way of linking the files in aerobulk/src: Softlink them into the aerobulk-python/src directory?

rabernat commented 2 years ago

No links are necessary. We just provide the appropriate paths to f2py / distutils. So something like src/aerobulk/src/mod_*.f90.

jbusecke commented 2 years ago

Ok so with the current state of this PR I was able to get the package to work manually: I followed these steps and then modified the last step (how do we call the final compile/build? for f2py?) like this:

python -m numpy.f2py --verbose -c --f90flags="-fdefault-real-8 -ffree-line-length-200 --std=gnu" -I./aerobulk/mod mod_aerobulk_wrap.pyf  mod_aerobulk_wrap.f90 aerobulk/src/mod_*.f90

in the command line.

I am not thinking/testing how/if I could get this to work within the setup.py file.