Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Fortran and supplied build #1

Open
lmillard79 opened this issue May 6, 2024 · 0 comments
Open

Compiling Fortran and supplied build #1

lmillard79 opened this issue May 6, 2024 · 0 comments

Comments

@lmillard79
Copy link

Refering to the example usage guide - Daily Rainfall.

I initially followed the steps to try and compile the Fortran daily rainfall version for my Python Environment (3.11.6)
I then tried to just build a Python Environment (3.8.5) on Windows 10 to match that suggested and use the supplied compiled version of Daily Rainfall.

First concern was that pyraingen.get_for_path would not return the path string so I was unable to follow along with the instruction.

I downloaded and installed:
https://github.com/msys2/msys2-installer/releases/download/2024-01-13/msys2-x86_64-20240113.exe
I added it to system environment path

f2py -c regionalised_dailyT.for -m regionalised_daily --fcompiler=gnu95 --compiler=migw32 --verbose --build-dir e:\Repositories\pyraingen\fortran_daily\

BuildDirectory = r'C:\ProgramData\anaconda3\envs\pyraingen385\Lib\site-packages\pyraingen\fortran_daily/'
FortranFile = r"C:\ProgramData\anaconda3\envs\pyraingen385\Lib\site-packages\pyraingen\fortran_daily\regionalised_dailyT.for"
with open(fortranFile) as sourcefile:
sourcecode = sourcefile.read()
f2py.compile(sourcecode, modulename='regionalised_dailyT', extra_args={'build':buildDirectory})

I was able to build src.win-amd64-3.11 folder which contained a fotranobject.c and .h and regionalised_dailymodule.c however the init.py did not seem work, and I am not sure I was able to follow supplied instructions as I haven't compiled a fortran module before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant