Menu

#28 ImportError: libgfortran.so.3 missing on Fedora 30

v1.0_(example)
open
nobody
Fedora (1)
1
2019-08-07
2019-07-06
Manuel
No

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?

Discussion

  • ciroki

    ciroki - 2019-07-06

    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

     
    👍
    1
    • Manuel

      Manuel - 2019-07-07

      Thanks!
      Maybe, installing both versions in parallel is possible, but which package would contain libgfortran.so.3?

      I did this...

      [rotton@linux lib64]$ sudo ln -s libgfortran.so.5 libgfortran.so.3
      

      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_3

      Traceback (most recent call last):
        File "tutorial_che_opt_3.py", line 74, in <module>
          from daetools.solvers.trilinos import pyTrilinos
        File "/usr/local/lib/python3.7/site-packages/daetools-1.9.0-py3.7-linux-x86_64.egg/daetools/solvers/trilinos.py", line 14, in <module>
          import pyTrilinos
      ImportError: /lib64/libgfortran.so.5: version `GFORTRAN_1.4' not found (required by /usr/local/lib/python3.7/site-packages/daetools-1.9.0-py3.7-linux-x86_64.egg/daetools/solvers/Linux_x86_64_py37/pyTrilinos.so)
      

      Do I need to recompile DAE Tools from source now? Or install the older libgfortran through unofficial channels?

       
      😕
      1
      • ciroki

        ciroki - 2019-07-18

        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 -lm

        and let me know the outcome.

        Dragan

         
        👍
        1
        • Manuel

          Manuel - 2019-07-19

          Thanks Dragan.
          Today, I could resolve the issue with some hints from this thread.
          The libgfortran I had to softlink to was:
          /usr/lib/gcc/x86_64-redhat-linux/9/libgfortran.so

          So the bash commands are (for future reference):

          cd /usr/lib64
          sudo ln -s /usr/lib/gcc/x86_64-redhat-linux/9/libgfortran.so libgfortran.so.3
          

          Now, everything seems to work. You can mark this ticket as resolved.

           
          • Manuel

            Manuel - 2019-08-02

            Ok, not quite... 🙄
            When I try running tutorials which import pyTrilinos, I get

            Traceback (most recent call last):
              File "daetools-1.9.0/daetools/examples/tutorial_che_opt_2.py", line 64, in <module>
                from daetools.solvers.trilinos import pyTrilinos
              File "/usr/local/lib/python3.7/site-packages/daetools-1.9.0-py3.7-linux-x86_64.egg/daetools/solvers/trilinos.py", line 14, in <module>
                import pyTrilinos
            ImportError: /lib64/libgfortran.so.5: version `GFORTRAN_1.4' not found (required by /usr/local/lib/python3.7/site-packages/daetools-1.9.0-py3.7-linux-x86_64.egg/daetools/solvers/Linux_x86_64_py37/pyTrilinos.so)
            

            Is this Python- or Fortran-related? Why does it look in libgfortran.so.5 when libgfortran.so.3, which should contain the correct gfortran version, is also available? 🤔

             
            • ciroki

              ciroki - 2019-08-07

              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

               
              👍
              1
  • Manuel

    Manuel - 2019-07-17

    Anyone? 🤔

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB