I want to run a program which requires HDF5 1.8.21 (old ver). Now, I downloaded and compiled HDF5 1.8.21 in a separate folder (/opt/hdf5/hdf5-1.8.21/hdf5/bin). But because my desktop already has HDF5 Version 1.10.1 (new ver), which I can not remove, as it will break some other packages. What is the best way to overcome this problem? Is there a way by which I can safely set a path or environment such that while the above mentioned program is running, older version of HDF is used? Thanks.

Edit 1

Output for 'echo $PATH': /home/aman/anaconda2/bin:/home/aman/anaconda2/condabin:/opt/alps/bin:/home/aman/bin:/home/aman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/hdf5/latest/bin

Output for 'h5cc -showconfig'


General Information:

               HDF5 Version: 1.10.1
              Configured on: Thu Feb 22 01:57:34 UTC 2018
              Configured by: conda@33e6404d1326
                Host system: x86_64-unknown-linux-gnu
          Uname information: Linux 33e6404d1326 4.4.0-96-generic #119~14.04.1-Ubuntu SMP Wed Sep 13 08:40:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
                   Byte sex: little-endian
         Installation point: /home/aman/anaconda2

---- truncated ----

1 Answer 1


The easiest solution:

PATH=/opt/hdf5/hdf5-1.8.21/hdf5/bin:$PATH <your-special-case-program>

Make a shell script or a .desktop file easy launch.

  • Thanks for the suggestion. I tried this but it is not working. It seems that the program I am trying to run calls another program(s)/script(s). Can you please tell me, if I set the PATH as suggested above, should it still work?
    – Aman_X
    Oct 16, 2019 at 8:51
  • @Aman_X, Could you edit question and add output of echo $PATH and the output when you tried the command I gave in my answer.
    – user.dz
    Oct 16, 2019 at 9:09
  • I have edited my question. The output after using the command you gave does not give an error, but the output is same as before. In other words, my program does not detect the new PATH.
    – Aman_X
    Oct 16, 2019 at 9:24
  • @Aman_X, Could you show me what you see when you run your program? Are you compiling and testing a program from source ?
    – user.dz
    Oct 16, 2019 at 9:30
  • HDF5 error: -1 #0 H5D.c line 145 in H5Dcreate2(): unable to create dataset #1 H5Dint.c line 490 in H5D__create_named(): unable to create and link to dataset #2 H5L.c line 1695 in H5L_link_object(): unable to create new link to object #3 H5L.c line 1939 in H5L_create_real(): can't insert link #4 H5Gtraverse.c line 867 in H5G_traverse(): internal path traversal failed #5 H5Gtraverse.c line 639 in H5G_traverse_real(): traversal operator failed #6 H5L.c line 1731 in H5L_link_cb(): name already exists Yes, I am compiling and testing program from a source.
    – Aman_X
    Oct 16, 2019 at 9:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .