Linking error while compiling ASImage with libpng not in default dir, a bug?

Hi There:
I am installing ROOT 6.06.08 at a Scientific linux machine. I am not administration, several prerequisites are installed in my own directory. (GCC, CMAKE, libpng(For unknown reason, the libpng in /usr/local/lib was missing), etc. ).
For the cmake to correctly find these dependency, I have changed the environment variables accordingly, (PATH, LD_LIBRARY_PATH, CMAKE_PREFIX_PATH). After running cmake , the output looks good, it finds the correct in the correct directory, And checking the CMakeCache.txt file, every line related to libpng is leading to correct directory.
However, when compiling, it returns:

c++ -fPIC  -pipe -m64 -Wall -W -Woverloaded-virtual -fsigned-char -fPIC -pthread -std=c++11 -Wno-deprecated-declarations -O2 -g -DNDEBUG  -Wl,--no-undefined -shared -Wl,-soname, -o ../../lib/ CMakeFiles/ASImage.dir/G__ASImage.cxx.o CMakeFiles/ASImage.dir/src/TASImage.cxx.o CMakeFiles/ASImage.dir/src/TASPluginGS.cxx.o -Wl,-rpath,/files1/home/ycwu/Workings/ROOT-Package/6.06.08-build/lib: ../../lib/libAfterImage.a -lfreetype -lpng -lz -lSM -lICE -lX11 -lXext -lz ../../lib/ -lSM -lICE -lX11 -lXext ../../lib/ ../../lib/ ../../lib/ ../../lib/ ../../lib/ ../../lib/
../../lib/libAfterImage.a(export.o): In function `ASImage2png_int':
export.c:(.text+0x10c): undefined reference to `png_set_longjmp_fn'

But in the correct png lib, this function is defined. It seems while linking with -lpng, the compiler didn’t use the correct lib.
Thus I add an option -L/path-to-libpng to the above command. With this modification, I can successfully compile the ROOT.

However, when I run the root, it gives the error: compile with libpng version 1.5.xx while running with version 1.6.32 (such kind error, not so exactly)

Is this a bug or I miss doing something while configure the ROOT?

I find this page which also indicate such kind conflict. The configure script for ASImage/libAfterImage is not so good I guess?


6.06 is a bit bit but I guess it should work. Have you tried with a more recent version ? Using the default cmake options ?

This does look like a configuration problem of LibAfterImage or a problem in the linking order on the command line. Also, if you change LD_LIBRARY_PATH when you build ROOT and it’s different when you run it, it may pick up some other library version when you run, so you may have to set the same LD_LIBRARY_PATH as when you built ROOT. Unless you must use 6.06, I would also recommend you to use the latest 6.10 or 6.11 releases, as many fixes have been applied to the latest versions.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.