Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
0

incompatible libgfortran version?

asked 12 years ago

kjlvcxzoiperwq gravatar image

I am using a python code that someone else wrote that links to some fortran libraries. I can get the code to work with my system installation of python (Python 2.7.2+ default, Oct 4 2011, 20:06:09 [GCC 4.6.1] on linux2). My operating system is Ubuntu 11.10. When I try to use the same python code in sage, I get the following error:

OSError: /opt/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by [omitting the full path on this website for privacy reasons]/librefprop.so)

when the

ctypes.cdll.LoadLibrary(u"[omitting the full path on this website for privacy reasons]/librefprop.so")

command is run.

I really don't know anything about fortran or how ctypes works, but it appears as though the sage version that I am using has a different libgfortran version than my operating system used when I created the fortran object files from the fortran code and linked them with the gfortran command. Here is some output from the command "dpkg --list | grep compiler|grep fortran"

ii gfortran 4:4.6.1-2ubuntu5 GNU Fortran 95 compiler ii gfortran-4.6 4.6.1-9ubuntu3 GNU Fortran 95 compiler

Is there some way I can tell sage to use the same libgfortran as my system python distribution? Will updating sage resolve this issue?

Preview: (hide)

Comments

although I would have liked to know the cause of this for future reference, upgrading to the latest version of sage did resolve the issue somehow.

kjlvcxzoiperwq gravatar imagekjlvcxzoiperwq ( 12 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 12 years ago

Volker Braun gravatar image

It seems that Sage built its own gcc/gfortran since your host compilers were deemed inadequate (possibly a version where we ran into compiler bugs). Open a Sage shell (sage -sh) and recompile your module, this will then use the same compiler as Sage.

Preview: (hide)
link

Comments

this didn't work. i checked, and it doesn't appear that sage -sh is causing a different compiler to be used. does this prove it?

kjlvcxzoiperwq gravatar imagekjlvcxzoiperwq ( 12 years ago )

user@user-cfd-workstation:~whichgfortran/usr/bin/gfortranuser@usercfdworkstation:  sage -sh Starting subshell with Sage environment variables set. Be sure to exit when you are done and do not do anything with other copies of Sage! Bypassing shell configuration files ... SAGE_ROOT=/opt/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux (sage subshell) user-cfd-workstation:~ userwhichgfortran/usr/bin/gfortranSAGEROOT=/opt/sage4.8linux64bitubuntu10.04.3ltsx8664Linux(sagesubshell)usercfdworkstation: user

kjlvcxzoiperwq gravatar imagekjlvcxzoiperwq ( 12 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 789 times

Last updated: Mar 30 '13