5

I downloaded GMAT and ran it according to the instructions:

$ ./GMAT-R2018a 
./GMAT-R2018a: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

So I thought libpng was missing. So I downloaded, built and installed libpng 1.6.37 from source.

$ ./GMAT-R2018a 
./GMAT-R2018a: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

So apparently I needed specifically version 1.2 of libpng, which I downloaded, built and installed from source:

$ ./GMAT-R2018a 
./GMAT-R2018a: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

So apparently somehow GMAT couldn't see the file, so I made a symlink:

$ ln -s /usr/local/lib/libpng12.so.0 libpng12.so.0
$ ./GMAT-R2018a 
./GMAT-R2018a: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

So I found a post somewhere saying that I should add a repository:

$ sudo add-apt-repository ppa:linuxuprising/libpng12
$ sudo apt update
$ sudo apt install libpng12-0

So now when I run GMAT, I get a new error:

$ ./GMAT-R2018a 
./GMAT-R2018a: /usr/local/lib/libpng12.so.0: no version information available (required by /home/steen/GMAT/GMAT/R2018a/bin/../lib/libwx_gtk2u_core-3.0.so.0)

And now I'm all out of ideas. Anyone?

N0rbert
  • 97,162
  • 34
  • 239
  • 423
OZ1SEJ
  • 1,175
  • 2
  • 16
  • 30

2 Answers2

6

The main problem here is the libpng12, which is removed from the repositories after 16.04 LTS.
To install it use special PPA:

sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0

Then download and extract GMAT:

cd ~/Downloads
wget https://deac-riga.dl.sourceforge.net/project/gmat/GMAT/GMAT-R2018a/gmat-ubuntu-x64-R2018a.tar.gz
tar -xf gmat-ubuntu-x64-R2018a.tar.gz
cd GMAT/R2018a
./GMAT-R2018a

So you have to remove problematic library with:

sudo rm /usr/local/lib/libpng12.so.0
N0rbert
  • 97,162
  • 34
  • 239
  • 423
  • E: The repository 'https://ppa.launchpadcontent.net/linuxuprising/libpng12/ubuntu jammy Release' does not have a Release file. – Robin Dec 05 '22 at 16:15
0

This does not work in 22.04

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libpng12-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libpng12-dev' has no installation candidate
Robin
  • 129
  • 4