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 libpng.so in the correct directory, And checking the CMakeCache.txt file, every line related to libpng is leading to correct directory.
However, when compiling ASImage.so, 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,libASImage.so -o ../../lib/libASImage.so 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/libGraf.so -lSM -lICE -lX11 -lXext ../../lib/libHist.so ../../lib/libMatrix.so ../../lib/libMathCore.so ../../lib/libRIO.so ../../lib/libThread.so ../../lib/libCore.so ../../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 https://root-forum.cern.ch/t/libpng-conflict/17066/9 which also indicate such kind conflict. The configure script for ASImage/libAfterImage is not so good I guess?