简体   繁体   中英

32-bit Fortran on 64-bit Server

I have a 32-bit Fortran application that I need to run on a 64-bit ubuntu server. I have verified the application on a 32-bit ubuntu machine and it runs fine; however, I get the following error when I run in on the 64-bit server:

error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory

Doing some research on this, I've tried the following with no joy:

  • sudo apt-get install libgfortran3:i386 which can't locate the package
  • Manually install a 32-bit .deb package of libgfortran (failed with error about incorrect architecture)
  • Install getlibs and have it determine what the dependencies are
  • Run ldconfig -v which finds libgfortran.so.3 -> libgfortran.so.3.0.0 under /usr/lib/x86_64-linux-gnu: ...
  • ... and then try to change the path to LD_LIBRARY_PATH to that, which did nothing (though I have to say that my knowledge gets very sparce once we start talking about library paths...)
  • Check if ia32-libs are installed, which they are
  • removed and re-installed libgfortran, then ran dpkg --configure --pending and dpkg --path-include=/usr/lib/x86_64-linux-gnu .

I'd like to stay away from creating a 32-bit chroot if at all possible but at this point I don't if there is anything else to do that could keep me from having to do so...

Do any of you have an idea as to something else I could do? Thank you.

Try to install the package lib32gfortran3 , as that would install the 32 bit version of the libgfortran library. Before starting the program, you may eventually need to set LD_LIBRARY_PATH="/usr/lib32:" but probably it will run also without this.

I'm not sure if this was an oversight on my part or something else; but here are the two steps that fixed it all:

  1. Run sudo apt-get install gfortran on a 64-bit machine which will install the GNU Fortran Compiler
  2. Recompile the application, on the 64-bit machine, using gfortran.

The strange part was that at this point I was still not able to just copy/paste the application file to other 64-bit machines and run it. Rather, I first had to separately install gfortran on each machine, even if I wasn't planning on compiling anything. Once gfortran was installed, the application would run, no matter where it was compiled... I presume that the libgfortran3 must have been some dependency...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM