You are not logged in.

#1 2010-01-31 02:23:27

darenw
Member
From: Portland Oregon
Registered: 2008-07-04
Posts: 73
Website

VTK build fails - missing PNG function

Uninstalled an old manually compiled version of VTK, replacing it with a proper Arch package.  Quite a lot of it compiled alright, then I got a bunch of errors all saying that png_set_gray_1_2_4_to_8 is missing.   There are no complaints of other PNG symbols missing; I have libpng 1.4.0 installed and apps depending on it are fine.

An actual error line:
/usr/local/src/vtk/src/VTK/IO/vtkPNGReader.cxx:119: error: 'png_set_gray_1_2_4_to_8' was not declared in this scope

png_set_gray_1_2_4_to_8 is supposed to be defined in png.h (or whatever it includes) but vtkPNGReader.cxx isn't seeing it.


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

#2 2010-01-31 02:26:54

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,937
Website

Re: VTK build fails - missing PNG function

you have to patch it as png_set_gray_1_2_4_to_8 was renamed to png_set_expand_gray_1_2_4_to_8.
more about the other changes:

http://libpng.sourceforge.net/ANNOUNCE-1.4.0.txt


Give what you have. To someone, it may be better than you dare to think.
Blog

Offline

#3 2010-01-31 05:15:32

darenw
Member
From: Portland Oregon
Registered: 2008-07-04
Posts: 73
Website

Re: VTK build fails - missing PNG function

Aha, the ol' rename an API function trick.

Thanks, that was the clue I needed. Now it compiles, at least up to the next trouble spot.


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

#4 2010-02-05 13:56:42

domanov
Member
From: Italy
Registered: 2006-11-10
Posts: 44

Re: VTK build fails - missing PNG function

Have you got a working PKBUILD? I replaced the line   

   patch -Np0 -i ./vtk-libpng-1.4.0.patch

with the homebrewed:

  cd $srcdir/VTK
          for i in Utilities/vtkpng/png.h Utilities/vtkpng/vtk_png_mangle.h Utilities/vtkpng/pngrtran.c
             do
                 sed -i 's|png_set_gray_1_2_4_to_8|png_set_expand_gray_1_2_4_to_8|' $i
             done

but no luck. Where do I read the error messages from cmake build?
By the way, the same trick worked fine with paraview.

Last edited by domanov (2010-02-05 13:58:53)

Offline

#5 2010-02-05 22:13:54

darenw
Member
From: Portland Oregon
Registered: 2008-07-04
Posts: 73
Website

Re: VTK build fails - missing PNG function

I did a #define hack redefining the one function as the other, and made some progress, but still the house of cards came a-tumblin' down.  sad

Paraview is on my list of stuff to install and toy around with.  VTK is needed for several other things, though.  Last year I did get VTK to compile and run fine using the official site's tarball, not Arch.  That was fine until recently when now I'm trying Arch's packages for certain apps needing VTK. I'll work on this some more.  If I can't figure out how to fix the VTK PKGBUILD, I'll just hack the apps' PKGBUILDs to not depend on VTK.


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

#6 2010-02-06 00:44:41

leepesjee
Member
Registered: 2008-11-06
Posts: 57

Re: VTK build fails - missing PNG function

Hi darenw and domanov,
Patching the Utilities/vtkpng subtree is of no use if you have -DVTK_USE_SYSTEM_PNG:BOOL=ON, as is in the PKGBUILD in AUR, as it isn't compiled anyway. The patch provided made me compile vtk with the new libpng.
Another way to workaround the problem is setting -DVTK_USE_SYSTEM_PNG:BOOL=OFF. I have not tested this. If you go this way, patching shouldn't be necessary, as vtk will build its own libpng.

Offline

#7 2010-02-07 10:22:34

tzervo
Member
From: Athens
Registered: 2009-04-03
Posts: 86

Re: VTK build fails - missing PNG function

I also had problems with the updated libpng and, leepesjee, your solution worked (paraview was rebuilt and works ok now), thanks a lot.

Offline

Board footer

Powered by FluxBB