wtorek, 13 marca 2012

Compile sam2p on Fedora 16 64 bit

sam2p is a program for converting various types of graphics. Apparently very good.
Unfortunately not in Fedora distribution. Only Debian/Ubuntu.
First download he codes from google code page:
http://code.google.com/p/sam2p/downloads/list

you'll need tif22pnm-0.14.tar.gz
and
sam2p-0.49.1.tar.gz

unpack and untar tif22pnm and run:
./configure

two statuses should be announced at the end:
status tif22pnm: to be build
status png22pnm: to be build

if the second one is skipped, you need to install (with yum) libpng-devel.
now execute:
./do.sh compile   (they don't like to use make... hm)
and if you lucky you have both executables so copy them to /usr/bin or so.

If you are not lucky, you can have error message:
/usr/bin/ld: png22pnm.o: undefined reference to symbol 'pow@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pow@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line


Do what the linker tells you to do.
Open cc_help.sh in your favourite editor and add -lm, for instance to line with LIBS_PNG

execute again ./do.sh compile
if it worked copy both executables to /usr/bin or where you like.

some links concerning sam2p use:
http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/

Some remarks on use of sam2p:
  • if you get error addAlpha: too many colors, transparency impossible
 you can open the image in gimp  and re-save it with option Save color values from transparent pixels unticked.