fortranshared-libraries32bit-64bitgfortranphotogrammetry

error while loading shared libraries: libgfortran.so.1: wrong ELF class: ELFCLASS32


I'm trying to use the Structure From Motion example from here (SFM by Nghiaho). I'm having some problem with the second part of the run process: I've downloaded the PMVS2 (Patch-based Multi-view Stereo Software) from here pmvs2 doc. I've opened the terminal in the /pmvs-2/program/main folder and typed:

./pmvs2 myfolder/options.txt

Where options.txt file was created in the first step of the process. I had this error:

./pmvs2: error while loading shared libraries: libgfortran.so.1: wrong ELF
class: ELFCLASS32

I found out that the problem is because I'm running a 64bit version of the program and gfortran library is compiled for 32bit. I've a file named libgfortran.so.3 in /usr/lib32/ folder and I've created a virtual link with:

ln -s /usr/lib32/libgfortran.so.3 /usr/lib32/libgfortran.so.1

I don't know what I have to do right now.


Solution

  • It looks like the software is closed-source and distributed as binary. Not very good. It also depends on many shared libraries from RedHat Linux 4.1. That is pretty bad and very unprofessional. RedHat 4.1 and modern Ubuntu are NOT binary compatible.

    It will not be very easy to make it work. You have to install all those libraries in the documentation http://www.di.ens.fr/pmvs/documentation.html and you have to install them in those versions that are mentioned there.

    You really cannot just take libgfortran 3 und use it instead of the required libgfortran 1. They are not compatible. The ABI has changed two times between those two versions. If you do manage to run the program with version 3, it will likely crash. You need exactly those versions linked in the documentation. Good luck installing all of them.

    The documentation also mentions some source codes in the package. However I fear they are just some example programs. If they are actually source codes for the whole PMVS2 library, it will be much better to compile it yourself and forget the binary.