From: Andrew R. <ar...@ge...> - 2000-11-16 11:28:29
|
Hi, I was just wondering where the source code for the PNG driver lives ? I have looked through the CVS repository, but can't find it there. If it is somewhere there, I am missing something. If anyone can point me to where it is, I would appreciate it. - Andrew |
From: Dan L. <dle...@ip...> - 2000-11-16 21:16:25
|
Greta plplot installation (with optional png and gif) and linking to greta "One way that works"-ldl 11-16-2000 ------------------------------------------------------------------------- (1) (PNG only) Need libpng.a(so) and libz.a(so). If don't have in /usr/lib, These usually come together and are closely synced in versions. One place to get is: http://www.libpng.org/pub/png/libpng.html and get source libpng-1.0.8.tar.gz http://www.info-zip.org/pub/infozip/zlib/ and get source zlib-1.1.3.tar.gz If you have recent versions of zlib and libpng, you could skip to plplot install. Only problem is libpng needs to be patched for png to not core dump on a png file write. zlib actually is probabably fine at /usr/lib/libz.so and need not be installed. (2) (PNG only) in home directory, gzip -cd libpng-1.0.8.tar.gz | tar -xvf - and gzip -cd zlib-1.1.3.tar.gz | tar -xvf - (3) (PNG only) png only. mv libpng-1.0.8 libpng, and zlib-1.1.3 to zlib (4) (PNG ONLY) To avoid core dumps with png, I also must change in libpng, file pngwio.c, function png_default_write_data, line 51: check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); change to: if (png_ptr->io_ptr) check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); This change is done is conjucntion with 18 below. (5) (PNG only) make these libraries. They are easy, just do ./configure; make and you should now have a libpng.a, libpng.so, libz.so, and libz.a (6) mv $HOME/libpng /usr/lib and mv $HOME/zlib /usr/lib in order to clean things up a bit. (7) Because of problem with default libpng, need to put it in LD_LIBRARY_PATH path, otherwise it finds the one in /usr/lib/libpng.so -------------------End of libpng and libz (if needed----------------------- ------------------Start of plplot------------------------------------------ I can't mess with changing the /usr area yet. Also, modifications to plplot need to be made to add the png and gif drivers. (1) Obtain the latest version of plplot-990122.gz (os at least the one which has code for drivers. I got it through ftp.msfc.nasa.gov via Michael <Mic...@ms...>. I don't see file plplotlib.tar.Z anymore. (2) from home directory, gzip -cd plplotlib.tar.Z | tar -xvf - (3) cd plplot-990122, ./configure (would be ./configure --prefix=/usr/lib/plplot if done for good install) ( as root, mkdir /usr/lib/plplot with rw-rw-rw- on plplot -- again, would be for a true install, which I am not yet able to do ) (4) plplot has a typedef PLFLT which can be a DOULBE or FLOAT. The greta makefile has CFLAGS= -DDOUBLE ..., meaning it has defined PLFLT to be a DOUBLE. Left alone, PLFLT will be a float. Thus, let's be sure its a DOUBLE in all plplot libs: edit line 196 of tmp/plplot.h, adding "#define DOUBLE 1". This will insure that the following macro #if defined(PL_DOUBLE) || defined(DOUBLE) typedef double PLFLT; #else typedef float PLFLT; #endif will always evaluate to typedef double PLFLT;, so no greta/plplot lib conflicts arise. (5) tmp/plDevs.h has many drivers that are not needed. Most can be commented out except #define PLD_null 1 (might not need) #define PLD_xterm 1 (might not need) #define PLD_ps 1 #define PLD_psc 1 #define PLD_lj_hpgl 1 #define PLD_xwin 1 #define PLD_tk 1 (this is very much needed I believe) #define PLD_gif (add for gif only) #define PLD_png (add for png only) note png and gif need to be added. (6) (GIF and PNG only) cd tmp; cp ../Cver2/gd* . This picks up gdgif.{c,h} and gdpng.{c,h} This with bring in gdgif.c and gdpng.c and headers and backups (7) (GIF and PNG only) edit tmp/Makefile, add to the "DRIVERS_C" macro gdgif.c \ gdpng.c (8) (GIF and PNG only) edit tmp/Makefile, add to the "DRIVERS_OBJ" macro gdgif$O \ gdpng$O (9) (GIF and PNG only). Make sure you have libgd.so in /usr/lib or /lib (10) (GIF and PNG only) edit tmp/Makefile, copy the line xwin$O: xwin.c plDevs.h plplotP.h plConfig.h plplot.h plstrm.h pdf.h pldebug.h \ plxwd.h drivers.h plevent.h paste it twice below, then edit xwin twice in each line to be gdgif$0: gdgif.c .. and gdpng$O: gdpng.c (11) (GIF and PNG only) edit tmp/Makefile again, find the macro LDC_LIBS and edit until it looks like: LDC_LIBS=-litk3.0 -ltk8.0 -litcl3.0 -litcl8.0 -L/usr/X11R6/lib -lX11 \ -lgd -lpng -lz -ldl -lm It seems that -litk3.0 -litcl3.0 are not needed, not even installed on some systems -- might try leaving off. (12) png has a tendency to core dump, as do gifs. Only solution I found to date in is in tmp/gdpng.c check for to see if File handle ?->Outfile is not null before closing it. This is done in conjunction with 13 above. It is unfortunate that I have to change libpng. Because of this, I also have to put it in LD_LIBRARY_PATH path, otherwise it finds the one in /usr/lib/libpng.so (13) Now we are ready to make all plplot libs. cd $HOME/plplot-990122; make should not get any warnings. (14) Finally we would want to install, with a "make install". This would populate /usr/lib/plplot/ with lib, include, examples, doc directories. But I currently use /home/dleonard/plplot-990122/tmp as the include and lib directory. --------------------------End of plplot compile/install-------------------------------- --------------------------Start of application compile/install------------------------- Now in our application, linking and compile statements are not aimed at /usr/lib/plplot yet but at /home/dleonard/plplot-990122/tmp: (1) greta COMPILE Flags: OSCFLAGS=-I/home/dleonard/plplot-990122/tmp -DINTEL -DLINUX CFLAGS= -DDOUBLE $(OSCFLAGS) -I$(AXAFPROG)/include -I../ututils with .c.o: cc $(CFLAGS) -c $< (2) greta LINKING: OSLFLAGS=-ldl -L/usr/X11R6/lib -lX11 -ltk -ltcl -lncurses \ -L/home/dleonard/plplot-990122/tmp -lplplotftk -lMatrix -lgd -lpng -lz LFLAGS= $(OSLFLAGS) -L$(AXAFPROG)/lib/$(OSTYPE) -lut -lgzip -lm and type is cc -o decom98 decom98.o plargs.o libgreta.so $(LFLAGS) also have ld -o libgreta.so decom98.o decrelay.o (other deleted) -shared (3) (GIF and PNG) zlib and gzip have two terrible namespace conflicts: they both use "inflate" and "deflate". Best solution I came up with was to rename in gzip.h inflate to inflate_gzip and deflate to deflate_gzip. Then also in src/libgzip-2.4/inflate.c rename function inflate to inflate_gzip, and finally src/libgzip-2.4/deflate.c rename function deflate to deflate_gzip. (4) We must also change in greta src/AX/axtlm.c and axtlm.h functions inflate and deflate to inflate_gzip and deflate_gzip to insure that they link to the gzip library and not libz (5) now we can make greta, cd src/AX; rm *.o; make; make install (6) we are now actually through with plplot-990122, we can hide it with mv plplot-990122 plplot-990122.hide I notice that if I do this libMatrix.so is actually found at /usr/lib/libMatrix.so. libplplotftk I believe is statically linked. (7) (GIF and PNG ) decgui needs to be able to command the new drivers. add lines: $beDevice->insert( 3, "gif" ); $beDevice->insert( 4, "png" ); and change $outfile = $vPSFile.$decname.".ps"; to $outfile = $vPSFile.$decname.".$vDest"; After thoughts: Worst thing here is the need to modify libpng and not be able to use just the default version in /usr/lib Modifying plplot has to be done in this version, would be nice if could handle from here. |
From: Dan L. <dle...@ip...> - 2000-11-16 21:35:36
|
Correction, the contact is a human: Michael <Mic...@ms...> Andrew Roach wrote: > Hi, > I was just wondering where the source code for the PNG driver lives ? I > have looked through the CVS repository, but can't find it there. If it is > somewhere there, I am missing something. If anyone can point me to where it > is, I would appreciate it. > > - Andrew > > _______________________________________________ > Plplot-general mailing list > Plp...@pl... > http://lists.sourceforge.net/mailman/listinfo/plplot-general -- ==================================================== Dan Leonard Computer Specialist (Programmer) Smithsonian Astrophysical Observatory (617) 496-7075 |
From: Dan L. <dle...@ip...> - 2000-11-16 22:38:15
|
http://lists.sourceforge.net/mailman/options/plplot-general/dle...@ip... username:dleonard at ipa.harvard.edu Password: SBgq |
From: Michael <Mic...@ms...> - 2000-11-17 14:39:25
|
Let me be clear. I am not the developer of this code. The fellow that developed the code post the information to the old plplot mail list and I get it from him and tried it out. I just happened to still have a copy of the plplot library that included that code when Dan asked. The fonts were not good enough for the data analysts I write code for and I no longer use it. Geoff seems to know about this code and may recall the author, I've had this stupid laptop crash so many times I have lost all the email and links that I had to him. I just looked and I have not yet deleted the October 11, 96 version of code that includes the required mods to include the png image format. I can tar it and upload it again (TPTB clean that site regularly), but I do not support this code and do not want to include it in the CVS until the author can be found and credited. Michael |
From: Geoffrey F. <fu...@ac...> - 2000-11-17 19:18:31
|
Michael writes: > Let me be clear. I am not the developer of this code. The fellow > that developed the code post the information to the old plplot mail > list and I get it from him and tried it out. I just happened to > still have a copy of the plplot library that included that code > when Dan asked. The fonts were not good enough for the data > analysts I write code for and I no longer use it. > > Geoff seems to know about this code and may recall the author, I've > had this stupid laptop crash so many times I have lost all the > email and links that I had to him. I just looked and I have not > yet deleted the October 11, 96 version of code that includes the > required mods to include the png image format. I can tar it and > upload it again (TPTB clean that site regularly), but I do not > support this code and do not want to include it in the CVS until > the author can be found and credited. The origianl author of the code is Randy Phillips, who has helped out with various things over the years, including these drivers, and also kick starting the www.plplot.org web site (which I think was in turn based on previous work by Noel Gorelick). I have these files somewhere around here, but I don't know exactly where right now. Randy made this contribution somewhat before the "Great PLplot Rehosting", (which shall forever be noted as a time of great tumult and tribulation in the PLplot community), and I have never really gotten back around to working on that and getting them fully checked in. I think the main outstanding issue for me, isn't the drivers themselves, but the work that will be needed on the autoconf system to automate their configuration, as we do for the Tcl and other similar such driver support. Someday I will, but I really cannot make promises about dates here, as I am quite busy at work. If anyone can't wait, they are free to do a cvs checkout, make the mods, and submit a patch. -- Geoffrey Furnish Actel Corporation fu...@ac... Senior Staff Engineer 955 East Arques Ave voice: 408-522-7528 Placement & Routing Sunnyvale, CA 94086-4533 fax: 408-522-8041 |
From: Dan L. <dle...@ip...> - 2000-11-28 15:17:49
Attachments:
greta_plplot.txt
|
Geoffrey Furnish wrote: > Michael writes: > > Let me be clear. I am not the developer of this code. The fellow > > that developed the code post the information to the old plplot mail > > list and I get it from him and tried it out. I just happened to > > still have a copy of the plplot library that included that code > > when Dan asked. The fonts were not good enough for the data > > analysts I write code for and I no longer use it. > > When the image is rotated to an upright "0.0" position, the fonts drastically improve to my mind. Mike claims Imagetick does an even better job. I browsed the net and it seemed like Imagetick was not freeware. Does it cost anything or not? > ...great tumult and tribulation in the PLplot community), and I have > never really gotten back around to working on that and getting them > fully checked in. I think the main outstanding issue for me, isn't > the drivers themselves, but the work that will be needed on the > autoconf system to automate their configuration, as we do for the Tcl > and other similar such driver support. I found on linux you have to just add gif and png here and there and it works (see my latest version of attach notes). However, there is a bug or two that might be fixed in an autoconf program. Right now I have to fix by altering both libpng and plplot. > Someday I will, but I really cannot make promises about dates here, as > I am quite busy at work. If anyone can't wait, they are free to do a > cvs checkout, make the mods, and submit a patch. > > -- > Geoffrey Furnish Actel Corporation fu...@ac... > Senior Staff Engineer 955 East Arques Ave voice: 408-522-7528 > Placement & Routing Sunnyvale, CA 94086-4533 fax: 408-522-8041 > _______________________________________________ > Plplot-general mailing list > Plp...@pl... > http://lists.sourceforge.net/mailman/listinfo/plplot-general -- ==================================================== Dan Leonard Computer Specialist (Programmer) Smithsonian Astrophysical Observatory (617) 496-7075 |