metocean / wavespectra

MIT License
1 stars 1 forks source link

Can we make a plain pip install work without requiring a Fortran compiler? #22

Open aportagain opened 4 years ago

aportagain commented 4 years ago

A plain pip install directly from github like

pip install git+ssh://git@github.com/metocean/wavespectra

fails unless a Fortran compiler is available in the installation environment ("error: extension 'wavespectra.specpart' has Fortran sources but no Fortran compiler found"). If I understand correctly, using the Fortran extension is optional: https://github.com/metocean/wavespectra/blob/8920ac455cad4363006ff9c56f9f6e3df77fbe97/wavespectra/specarray.py#L733 Can we then also make this optional at install / build time? Having a Fortran compiler available is asking a lot for build environments that otherwise are only dealing with Python... especially in cases like ops-mds (https://github.com/metocean/ops-mds/blob/dc9fbc0eef79cdf7f1e6dd68dbd3d8efc0ca34cf/ops_mds/register_api_v1.py#L730-L743) where they don't actually need the specarray / specpart functionality :)

cmichelenstrofer commented 1 year ago

I haven't used it, but my understanding is that building the PyPI package with scikit-build allows you to pre-compile, similar to what conda does, so the user doesn't need to have their own compilers. Just another option to explore.

salicto commented 1 year ago

Hello, has anyone found a solution to this problem? I've been trying to install this library without success, as I don't have a Fortran compiler. I tried installing it with git and then running python setup.py install but I get the same error message: "SystemExit: error: extension 'wavespectra.specpart' has Fortran sources but no Fortran compiler found."

I'm using VS Code and pyhton 3.11.4

Thank you in advance for your help.