2

I had to update some Anaconda/Python packages on my Linux (Ubuntu 15.10), and as a result I get now the following error message which I have never seen before:

OSError: /usr/lib/x86_64-linux-gnu/libnetcdff.so.6: undefined symbol:nc_rename_grp

The error occurs when calling a Fortran-based programme in a Python script. When running the very same program without Python however, everything works perfectly fine...

I also re-compiled the program after the updates, but nothing changed.

Does anyone have a clue what's going on here?

Jannis
  • 173
  • 2
  • 6
  • I think anaconda provides its own netcdf library version somewhere within it's directory structure. Perhaps you are working with a dynamically linked object that when run from within anaconda is expecting to use the anaconda lib version (which may have extra symbols) but your `LD_LIBRARY_PATH` or similar means it is picking up the system version (or vice versa). Could you elaborate slightly on what the "fortran based" program is and how you run it, i.e. are you just using a system call in python to run an executable? If so can you do `ldd myExecutable` from python and from outside python. – d_1999 Nov 09 '16 at 16:30
  • In British English, program refers to computer programs and their programming, and programme is used for all other senses of the word. – Vladimir F Героям слава Nov 09 '16 at 17:42

2 Answers2

0

The symbol nc_rename_grp is defined in libnetcdf.so . If you are running the FORTRAN code using subprocess then you will have to declare the env as follows:

env["LD_LIBRARY_PATH"] = "/usr/lib/x86_64-linux-gnu"
h = subprocess.Popen(cmd,env=env)
BChow
  • 471
  • 2
  • 7
0

Thanks all for your help. The issue was caused by a wrongly set path to the netcdf-libraries in ./bashrc and hence the programme (that is a computer programme/model) did not work properly. Everything's solved now and programme/model is up and running!

Jannis
  • 173
  • 2
  • 6