CNES / aviso-fes

FES is the last version of the FES (Finite Element Solution) tide model.
https://cnes.github.io/aviso-fes
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

Bug / issue with import fes test #2

Closed nicholasmetherall closed 1 year ago

nicholasmetherall commented 2 years ago

https://bitbucket.org/cnes_aviso/fes/issues/3/advice-on-installing-python-package

Thank you @Killian Vos, @fbriol and others for the support on this. I am having some issues with the testing step ‘import pyfes’

ImportError: libnetcdf.so.15: cannot open shared object file: No such file or directory

Yet the directory does seem to exist as it has been saved on the python directory and on the desktop and is readable in the same notebook:

dir ('/common/tidal_models')

Any advice about how to progress to the next step would be much appreciated.

tovogt commented 2 years ago

This is addressed in this issue: https://bitbucket.org/cnes_aviso/fes/issues/15/netcdf-dependency-issue-for-anaconda

The problem is that the conda-package doesn't specify any specific version for the dependency libnetcdf, but the binary has been built with libnetcdf.so.15 so it will only work with that version of libnetcdf: https://github.com/CNES/aviso-fes/blob/d18454146a776e7caca46dc814622f0ee1a26afd/conda/meta.yaml#L24

@fbriol The fix for this project would be to specify libnetcdf=4.7.3 as a requirement. But it would of course be much better if it worked with more recent versions of libnetcdf, e.g. by releasing more up-to-date builds on your conda channel.

A quick fix for you @nicholasmetherall to get it running is to conda install libnetcdf=4.7.3 in the environment where you installed pyfes. However, if you would like to install pyfes to an existing environment with a version of libnetcdf that is already available (because you don't want to downgrade your libnetcdf version), you have to do the following:

$ conda install pip libnetcdf make cmake cxx-compiler numpy -c conda-forge
$ git clone https://github.com/CNES/aviso-fes
$ pip install -e aviso-fes

This will create a source directory aviso-fes in your current location that you may not remove, so be sure to execute those commands in a location where the directory can stay.

fbriol commented 1 year ago

This package is an old compilation that I had made for my needs. It is not up to date anymore. You have to compile a new version on your computer. To generate the Conda package, you just have to install conda-build and type at the root of the project conda build conda/.

I have generated three packages for python 3.8, 3.9 and 3.10 for Linux on my Anaconda account.