ImportError: libgfortran.so.3 missing on Fedora 30
Object-oriented equation-based modelling and optimisation software
Brought to you by:
ciroki
When I tried to run a DAE Tools simulation on my new Fedora 30 install, I get the following error:
[rotton@linux Python-Scripts]$ python3 mySimulation.py console
Traceback (most recent call last):
File "mySimulation.py", line 18, in <module>
from daetools.pyDAE import *
File "/usr/local/lib/python3.7/site-packages/daetools-1.9.0-py3.7-linux-x86_64.egg/daetools/pyDAE/__init__.py", line 23, in <module>
import pyIDAS
ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory
It seems libgfortran.so.3 is not present in the system (although there is libgfortran.so.5 and libgfortran.so.1), and it is not available via package management either... How can I fix this?
Anonymous
Hi,
True, there could be problems on new versions. DAE Tools is compiled against libgfortran 3 which is the only version available on old systems. On new versions typically there is an option to install libgfortran.so.3 along side with 5. It seems this is not the case for Fedora.
Perhaps try creating a symlink named libgfortran.so.3 that points to libgfortran.so.5?
Dragan
Thanks!
Maybe, installing both versions in parallel is possible, but which package would contain
libgfortran.so.3?I did this...
And now, my simulation runs like a charm (although I didn't check the results yet). However, other scripts are not to be fooled that easily, e.g.,
tutorial_che_opt_3Do I need to recompile DAE Tools from source now? Or install the older
libgfortranthrough unofficial channels?Hi Manuel,
Good that it works now.
On the other hand, there might be a problem with fortran in linux. Good that you brought it to attention. The problem with the optimisation is that it uses a library with the compiled fortran code using a different fortran than what is specified in dae.pri config file. That needs to be resolved in the future version.
Please first try to install version 3. Usually it is available in most distributions.
Then it would be good to compile it from source. In the latter case please change the line 418 in dae.pri file to the following:
linux-g++::BLAS_LAPACK_LIBS = $${BLAS_LAPACK_LIBDIR}/liblapack.a $${BLAS_LAPACK_LIBDIR}/libblas.a -lgfortran -lmand let me know the outcome.
Dragan
Thanks Dragan.
Today, I could resolve the issue with some hints from this thread.
The
libgfortranI had to softlink to was:/usr/lib/gcc/x86_64-redhat-linux/9/libgfortran.soSo the bash commands are (for future reference):
Now, everything seems to work. You can mark this ticket as resolved.
Ok, not quite... 🙄
When I try running tutorials which
import pyTrilinos, I getIs this Python- or Fortran-related? Why does it look in
libgfortran.so.5whenlibgfortran.so.3, which should contain the correctgfortranversion, is also available? 🤔That's a problem in daetools. libgfortran.so.3 is set only for core modules not for solver libraries; hence, CMake picks up the default fortran version. I'll fix that in the next release.
Dragan
Anyone? 🤔