Invalid conversion from ‘char**’ to ‘png_byte**’

Hello!

I am trying to do a Cellprofiler installation on the Linux cluster Kalkyl at the computing center UPPMAX at Uppsala University, see uppmax.uu.se

I have followed the instructions at cellprofiler.org/wiki/index.php/CP2.0_on_Linux and modified Makefile.CP2 to update the version numbers PNGVERSION, HDF5VERSION, PYQTVERSION, SIPVERSION. Now there is a compilation problem:

================================================
make[3]: Entering directory /scratch/1494078/vigra-1.7.1' 5%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/bmp.cxx.o 11%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/byteorder.cxx.o 16%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/codecmanager.cxx.o 22%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/gif.cxx.o 27%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/hdr.cxx.o 33%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/hdf5impex.cxx.o 38%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/hdf5_rf_impex.cxx.o 44%] Building C object src/impex/CMakeFiles/vigraimpex.dir/iccjpeg.c.o 50%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/imageinfo.cxx.o 55%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/jpeg.cxx.o 61%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/png.cxx.o /scratch/1494078/vigra-1.7.1/src/impex/png.cxx: In member function ‘void vigra::PngDecoderImpl::init()’: /scratch/1494078/vigra-1.7.1/src/impex/png.cxx:326:89: error: invalid conversion from ‘char**’ to ‘png_byte**’ /scratch/1494078/vigra-1.7.1/src/impex/png.cxx:326:89: error: initializing argument 5 of ‘png_uint_32 png_get_iCCP(const png_struct*, const png_info*, char**, int*, png_byte**, png_uint_32*)’ /scratch/1494078/vigra-1.7.1/src/impex/png.cxx: In member function ‘void vigra::PngEncoderImpl::finalize()’: /scratch/1494078/vigra-1.7.1/src/impex/png.cxx:595:87: error: invalid conversion from ‘char*’ to ‘const png_byte*’ /scratch/1494078/vigra-1.7.1/src/impex/png.cxx:595:87: error: initializing argument 5 of ‘void png_set_iCCP(png_struct*, png_info*, const char*, int, const png_byte*, png_uint_32)’ make[3]: *** [src/impex/CMakeFiles/vigraimpex.dir/png.cxx.o] Error 1 make[3]: Leaving directory/scratch/1494078/vigra-1.7.1’
make[2]: *** [src/impex/CMakeFiles/vigraimpex.dir/all] Error 2
make[2]: Leaving directory /scratch/1494078/vigra-1.7.1' make[1]: *** [all] Error 2 make[1]: Leaving directory/scratch/1494078/vigra-1.7.1’
make: *** [/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/lib/python2.6/site-packages/vigra/vigranumpycore.so] Error 2
[eliasr@q331 cellprofiler20111019]$

It seems possible to get around this by adding casts to (png_byte**) and (png_byte*) on lines 326 and 595, respectively, in the file vigra-1.7.1/src/impex/png.cxx, but I am not sure if that is safe, or if it could lead to crashes and/or incorrect results later, when running the program.

Compiler info: gcc version 4.5.3.

I tried compiling vigra alone in a separate directory, and then it compiled fine. So I guess the problem appears only when using some specific configuration options used by Cellprofiler. Is it possible to install Cellprofiler without vigra, or is there some other workaround?

Elias
UPPMAX

Now that I tried building again using the new Makefile.CP2 posted by LeeKamentsky here


the problem with “invalid conversion from ‘char**’ to ‘png_byte**’” did not appear. So perhaps it was just a result of using a bad/old makefile.
/ Elias

/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1’
3%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/bmp.cxx.o
6%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/byteorder.cxx.o
9%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/codecmanager.cxx.o
12%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/gif.cxx.o
15%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/hdr.cxx.o
18%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/hdf5impex.cxx.o
18%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/hdf5_rf_impex.cxx.o
21%] Building C object src/impex/CMakeFiles/vigraimpex.dir/iccjpeg.c.o
24%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/imageinfo.cxx.o
27%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/jpeg.cxx.o
30%] Building CXX object src/impex/CMakeFiles/vigraimpex.dir/png.cxx.o
/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1/src/impex/png.cxx: In member function ‘void vigra::PngDecoderImpl::init()’:
/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1/src/impex/png.cxx:326: error: invalid conversion from ‘char**’ to ‘png_byte**’
/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1/src/impex/png.cxx:326: error: initializing argument 5 of ‘png_uint_32 png_get_iCCP(const png_struct*, const png_info*, char**, int*, png_byte**, png_uint_32*)’
/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1/src/impex/png.cxx: In member function ‘void vigra::PngEncoderImpl::finalize()’:
/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1/src/impex/png.cxx:595: error: invalid conversion from ‘char*’ to ‘const png_byte*’
/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1/src/impex/png.cxx:595: error: initializing argument 5 of 'void png_set_iCCP(png_struct*, png_info*, const char*, int, const png_byte*, png_uint_32)'
make[3]: *** [src/impex/CMakeFiles/vigraimpex.dir/png.cxx.o] Error 1
make[3]: Leaving directory /home/hazards/COMPILE3/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1' make[2]: *** [src/impex/CMakeFiles/vigraimpex.dir/all] Error 2 make[2]: Leaving directory/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1’
make[1]: *** [all] Error 2
make[1]: Leaving directory `/CP2/CellProfiler-CellProfiler-3115b3f/tmp/vigra-1.7.1’
make: *** [/shared/app/cp2/lib/python2.6/site-packages/vigra/vigranumpycore.so] Error 2

As you can see I am getting the same error as Elias. I do not wish to use arbitrary casts and the svn Makefile.CP2 is annoyingly out of date; its where I started on Friday in fact. Elias says the “new” Makefile.CP2 worked for him but its not working for me. Are there any other solutions? Does any one have a truly up-to-date Makefile.CP2 I could try?

Placing a link to the continuing discussion of the makefile issue.