afni: error while loading shared libraries: libpng15.so.15

Hello,
I was recently given a new VM server space using RHEL and I'm trying to set up afni on it. I've been able to troubleshoot many errors thanks to the helpful info on this board. However, I have become stuck with this error pertaining to library libpng15.so.15. Below is the output of afni_system_check.py. Any help would be greatly appreciated!

architecture: 64bit ELF
cpu type: x86_64
system: Linux
release: 5.14.0-503.15.1.el9_5.x86_64
version: #1 SMP PREEMPT_DYNAMIC Thu Nov 14 15:45:31 EST 2024
distribution: rhel 9.5 Plow
number of CPUs: 8
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/jcisler/abin/afni
afni version : afni: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
:
AFNI_version.txt : AFNI_24.3.08, linux_centos_7_64, Dec 06 2024, official
which python : /usr/bin/python
python version : 3.9.19
which R : /usr/bin/R
R version : R version 4.4.2 (x86_64-redhat-linux-gnu)

instances of various programs found in PATH:
afni : 1 (/home/jcisler/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python3.9)
python2 : 0
python3 : 1 (/usr/bin/python3.9)

testing ability to start various programs...
afni : FAILURE
afni: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
suma : FAILURE
suma: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
3dSkullStrip : FAILURE
3dSkullStrip: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
3dAllineate : FAILURE
3dAllineate: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
3dRSFC : FAILURE
3dRSFC: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
SurfMesh : FAILURE
SurfMesh: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
3dClustSim : FAILURE
3dClustSim: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
uber_subject.py : success
3dMVM : FAILURE
Error in dyn.load(ll) :
unable to load shared object '/home/jcisler/abin/R_io.so':
libpng15.so.15: cannot open shared object file: No such file or directory
Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
Execution halted

** missing 2 binary libraries across 7 programs
** missing binary library 'libpng15.so.15' in program R_io.so

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh : /usr/local/bin/tcsh
tcsh version : 6.24.10
which Xvfb : /usr/bin/Xvfb

checking for R packages...
rPkgsInstall -pkgs ALL -check : FAILURE
Error in dyn.load(ll) :
unable to load shared object '/home/jcisler/abin/R_io.so':
libpng15.so.15: cannot open shared object file: No such file or directory
Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
Execution halted

R RHOME : /usr/lib64/R

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
module file : /usr/lib64/python3.9/site-packages/matplotlib/pyplot.py
matplotlib version : 3.4.3

++ module loaded: flask
module file : /usr/lib/python3.9/site-packages/flask/init.py
flask version : 2.0.3

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH = /home/jcisler/.local/bin:/home/jcisler/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/jcisler/abin

PYTHONPATH =
R_LIBS = /home/jcisler/R
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL =
CONDA_DEFAULT_ENV =
CC =

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

.afnirc                   : found
.sumarc                   : missing
.afni/help/all_progs.COMP : found

--------- shell startup files ----------

-- good: .tcshrc seems to contain 'source .cshrc'
-- considered operations: path, apsearch

-- note: followers should not need edits, so edit flags should be 0
(have 1 follower(s), which can be ignored)

dot file test : want 1 modifications across 3 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .cshrc           0     0        1               0     
  .tcshrc          0     0        0               1     
  .bashrc          0     0        0               0     

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /home/jcisler/abin

------------------------------ OS specific -------------------------------
which dnf : /usr/bin/dnf
dnf version : 4.14.0
which yum : /usr/bin/yum
yum version : 4.14.0

========================= summary, please fix: =========================

  • just be aware: login shell 'bash', but our code examples use 'tcsh'
  • AFNI programs show FAILURE
  • missing binary library: libpng15.so.15
  • missing binary library: libgsl.so.0
  • missing R packages (see rPkgsInstall)
  • please run: "suma -update_env" for .sumarc
  • dot file test : want 1 modifications across 3 files:
  • insufficient data for AFNI bootcamp
    (see "Prepare for Bootcamp" on install pages)

To be sure, what version of libpng do you have?

ls -l /lib64/libpng*.so.??

-rick

this is the results:

lrwxrwxrwx. 1 root root 19 Aug 10 2021 /lib64/libpng16.so.16 -> libpng16.so.16.37.0

I managed to get libpng15.so.15 in the correct location. The result of afni_system_check is now as follows:

architecture: 64bit ELF
cpu type: x86_64
system: Linux
release: 5.14.0-503.15.1.el9_5.x86_64
version: #1 SMP PREEMPT_DYNAMIC Thu Nov 14 15:45:31 EST 2024
distribution: rhel 9.5 Plow
number of CPUs: 8
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/jcisler/abin/afni
afni version : Precompiled binary linux_centos_7_64: Dec 6 2024
: AFNI_24.3.08 'Elagabalus'
AFNI_version.txt : AFNI_24.3.08, linux_centos_7_64, Dec 06 2024, official
which python : /usr/bin/python
python version : 3.9.19
which R : /usr/bin/R
R version : R version 4.4.2 (x86_64-redhat-linux-gnu)

instances of various programs found in PATH:
afni : 1 (/home/jcisler/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python3.9)
python2 : 0
python3 : 1 (/usr/bin/python3.9)

testing ability to start various programs...
afni : success
suma : success
3dSkullStrip : FAILURE
3dSkullStrip: error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory
3dAllineate : success
3dRSFC : FAILURE
3dRSFC: error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory
SurfMesh : success
3dClustSim : success
uber_subject.py : success
3dMVM : success

** missing binary library 'libgsl.so.0' across 2 programs

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh : /usr/local/bin/tcsh
tcsh version : 6.24.10
which Xvfb : /usr/bin/Xvfb

checking for R packages...
rPkgsInstall -pkgs ALL -check : FAILURE

    oo Warning: 
       These packages are not installed on the computer: afex!
    These packages are not installed on the computer: phia!
    These packages are not installed on the computer: lme4!
    These packages are not installed on the computer: lmerTest!
    These packages are not installed on the computer: gamm4!

R RHOME : /usr/lib64/R

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
module file : /usr/lib64/python3.9/site-packages/matplotlib/pyplot.py
matplotlib version : 3.4.3

++ module loaded: flask
module file : /usr/lib/python3.9/site-packages/flask/init.py
flask version : 2.0.3

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH = /home/jcisler/.local/bin:/home/jcisler/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/jcisler/abin

PYTHONPATH =
R_LIBS = /home/jcisler/R
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL =
CONDA_DEFAULT_ENV =
CC =

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

.afnirc                   : found
.sumarc                   : missing
.afni/help/all_progs.COMP : found

--------- shell startup files ----------

-- good: .tcshrc seems to contain 'source .cshrc'
-- considered operations: path, apsearch

-- note: followers should not need edits, so edit flags should be 0
(have 1 follower(s), which can be ignored)

dot file test : want 1 modifications across 3 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .cshrc           0     0        1               0     
  .tcshrc          0     0        0               1     
  .bashrc          0     0        0               0     

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /home/jcisler/abin

------------------------------ OS specific -------------------------------
which dnf : /usr/bin/dnf
dnf version : 4.14.0
which yum : /usr/bin/yum
yum version : 4.14.0

========================= summary, please fix: =========================

  • just be aware: login shell 'bash', but our code examples use 'tcsh'
  • AFNI programs show FAILURE
  • missing binary library: libgsl.so.0
  • missing R packages (see rPkgsInstall)
  • please run: "suma -update_env" for .sumarc
  • dot file test : want 1 modifications across 3 files:
  • insufficient data for AFNI bootcamp
    (see "Prepare for Bootcamp" on install pages)

Thanks!

Well, instead of trying to get libpng 15, I was going to suggest changing your package to a somewhat more suitable rocky 8. But now we might as well check the gsl version, too.

ls -l /usr/lib64/libgsl.so.*

Either way, I expect to suggest switching to Rocky 8, which uses gsl version 23.

@update.afni.binaries -package linux_rocky_8

-rick

Thanks Rick! I used:
@update.afni.binaries -package linux_rocky_8

the result of afni_system_check -check_all is pasted below. I did attempt to change this systems gsl to gsl 2.3 by downloading gsl 2.3 and using the configure and make commands, but not 100% certain I did this correctly. Any additional help from you is greatly appreciated.

-------------------------------- general ---------------------------------
architecture: 64bit ELF
cpu type: x86_64
system: Linux
release: 5.14.0-503.16.1.el9_5.x86_64
version: #1 SMP PREEMPT_DYNAMIC Thu Nov 21 07:26:21 EST 2024
distribution: rhel 9.5 Plow
number of CPUs: 24
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /usr/local/afni/abin/afni
afni version : Precompiled binary linux_rocky_8: Dec 17 2024
: AFNI_24.3.10 'Elagabalus'
AFNI_version.txt : AFNI_24.3.10, linux_rocky_8, Dec 17 2024, official
which python : /usr/bin/python
python version : 3.9.21
which R : /usr/bin/R
R version : R version 4.4.2 (x86_64-redhat-linux-gnu)

instances of various programs found in PATH:
afni : 1 (/usr/local/afni/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python3.9)
python2 : 0
python3 : 1 (/usr/bin/python3.9)

testing ability to start various programs...
afni : success
suma : success
3dSkullStrip : FAILURE
3dSkullStrip: error while loading shared libraries: libgsl.so.23: cannot open shared object file: No such file or directory
3dAllineate : success
3dRSFC : FAILURE
3dRSFC: error while loading shared libraries: libgsl.so.23: cannot open shared object file: No such file or directory
SurfMesh : success
3dClustSim : success
uber_subject.py : success
3dMVM : success

** missing binary library 'libgsl.so.23' across 2 programs

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh : /usr/local/bin/tcsh
tcsh version : 6.24.10
which Xvfb : /usr/bin/Xvfb

checking for R packages...
rPkgsInstall -pkgs ALL -check : success

R RHOME : /usr/lib64/R

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
module file : /usr/lib64/python3.9/site-packages/matplotlib/pyplot.py
matplotlib version : 3.4.3

++ module loaded: flask
module file : /usr/lib/python3.9/site-packages/flask/init.py
flask version : 2.0.3

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH = /home/jcisler/.local/bin:/home/jcisler/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/afni/abin:/home/jcisler/abin

PYTHONPATH =
R_LIBS = /home/jcisler/R
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL =
CONDA_DEFAULT_ENV =
CC =

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

.afnirc                   : found
.sumarc                   : found
.afni/help/all_progs.COMP : found

--------- shell startup files ----------

-- good: .tcshrc seems to contain 'source .cshrc'
-- considered operations: path, apsearch

-- note: followers should not need edits, so edit flags should be 0
(have 1 follower(s), which can be ignored)

dot file test : want 1 modifications across 3 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .cshrc           0     0        1               0     
  .tcshrc          0     0        0               1     
  .bashrc          0     0        0               0     

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /usr/local/afni/abin

------------------------------ OS specific -------------------------------
which dnf : /usr/bin/dnf
dnf version : 4.14.0
which yum : /usr/bin/yum
yum version : 4.14.0

========================= summary, please fix: =========================

  • just be aware: login shell 'bash', but our code examples use 'tcsh'
  • AFNI programs show FAILURE
  • missing binary library: libgsl.so.23
  • dot file test : want 1 modifications across 3 files:
  • insufficient data for AFNI bootcamp
    (see "Prepare for Bootcamp" on install pages)

Hello again, I attempted to install gsl 2.3 a few more times, and eventually one of the installs created the libgsl.so.23 file, and I was able to create a symbolic link to that file in /lib64. The result of afni_system_check now says success to everyone.
Thanks much

That's great! Though actually I thought that we were now distributing those libraries with the package. To be sure what does this show?

ls -l /usr/local/afni/abin/libgsl*

Thanks,

-rick

It didn't find anything see last command below. I included listing the MNI* below just so you know its looking in the right directory.

[jcisler@mdsc-psych-v01 023]$ ls -l /usr/local/afni/abin/MNI*
-rw-r--r--. 1 jcisler jcisler  2878302 Dec 17 16:23 /usr/local/afni/abin/MNI152_2009_template.nii.gz
-rw-r--r--. 1 jcisler jcisler 14187441 Dec 17 16:23 /usr/local/afni/abin/MNI152_2009_template_SSW.nii.gz
-rw-r--r--. 1 jcisler jcisler  3657483 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_gw_18+tlrc.BRIK.gz
-rw-r--r--. 1 jcisler jcisler     3353 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_gw_18+tlrc.HEAD
-rw-r--r--. 1 jcisler jcisler   166760 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_lr_18+tlrc.BRIK.gz
-rw-r--r--. 1 jcisler jcisler     3466 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_lr_18+tlrc.HEAD
-rw-r--r--. 1 jcisler jcisler  4371752 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_ml_18+tlrc.BRIK
-rw-r--r--. 1 jcisler jcisler   146946 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_ml_18+tlrc.BRIK.gz
-rw-r--r--. 1 jcisler jcisler    20572 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_ml_18+tlrc.HEAD
-rw-r--r--. 1 jcisler jcisler   240756 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_mpm_22+tlrc.BRIK.gz
-rw-r--r--. 1 jcisler jcisler    18534 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_mpm_22+tlrc.HEAD
-rwxr-xr-x. 1 jcisler jcisler  1726099 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_N27+tlrc.BRIK.gz
-rwxr-xr-x. 1 jcisler jcisler     2957 Dec 17 16:23 /usr/local/afni/abin/MNI_caez_N27+tlrc.HEAD
-rw-r--r--. 1 jcisler jcisler   324980 Dec 17 16:23 /usr/local/afni/abin/MNI_Glasser_HCP_v1.0.nii.gz
[jcisler@mdsc-psych-v01 023]$ 
[jcisler@mdsc-psych-v01 023]$ ls -l /usr/local/afni/abin/libgsl*
ls: cannot access '/usr/local/afni/abin/libgsl*': No such file or directory
[jcisler@mdsc-psych-v01 023]$

Interesting, maybe I tested them directly in bin, but neglected to get them into the tgz package. In any case, we will distribute those 2 gsl files now to avoid this in the future. Sorry for the trouble.

-rick