Hi!
 
I have set out below my attempt at building PLplot-5.2.1 under
i686-pc-cygwin:
 
   Windows 98 ( 2nd Edition )
   Pentium III Processor
   Cygwin ( Version 1.3.22 )
   XFree86 ( Version 4.2.0 )
   gcc ( Version 3.2-3 )
 
As Cygwin is still under development, this cannot be regarded as a bug
report. However, I had managed to build the PLplot-5.1.0 libraries and
examples without much trouble earlier. The present version threw up some
challenges which made building the library quite interesting. In short,
 
(1) The configure script could avoid building dynamic drivers if
    --enable-shared=no is specified.
 
(2) The JPEG and PNG libraries are not included even though these
    drivers are chosen.
 
(3) The Fortran wrapper gives some trouble while linking a Fortran source.
    I may be able to patch up plplot_libtool to set this right. Right now,
    a simple script appears to suffice.
 
I hope that the report will be of use to you.
 
With Best Regards
 
U.D.Kini
( Bangalore, India )
 
Trying to build PLplot-5.2.1
----------------------------
 
   ./configure
   make
 
This results in error as shared libraries cannot be built.
 
Next try,
 
   ./configure --prefix=/usr/local/plplot --without-shlib
   make
 
Again problem with shared libraries. Try the following:
 
   ./configure --prefix=/usr/local/plplot --enable-shared=no \
   --enable-static=yes --without-csa --disable-tcl --disable-itcl \
   --disable-octave --without-freetype
   make
 
Error.
-----
/bin/bash ../libtool --mode=link gcc -g -O2 -o get-drv-info.exe get_drv_info
-get-drv-info.o ../libltdl/libltdlc.la
gcc -g -O2 -o get-drv-info.exe get_drv_info-get-drv-info.o ../libltdl/.libs/lib
ltdlc.a -ldl
./get-drv-info `echo cgm.la | sed 's/.la//'` > cgm.rc
Could not open driver module cgm
libltdl error: no symbols defined
make[2]: *** [cgm.rc] Error 1
make[2]: Leaving directory `/usr/src/plplot-5.2.1/drivers'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/plplot-5.2.1'
make: *** [all] Error 2
 
Solution?:Try Removing cgm driver:
---------
 
   ./configure --prefix=/usr/local/plplot --enable-shared=no \
   --enable-static=yes --without-csa --disable-tcl --disable-itcl \
   --disable-octave --disable-cgm --disable-dg300 --disable-lj_hpgl \
   --disable-imp --disable-ljii --disable-ljiip --disable-mem \
   --disable-tek4010f --disable-tek4107f --disable-tek4010 --disable-tek4107
   make
 
Error.
-----
/bin/bash ../libtool --mode=link gcc  -g -O2   -o get-drv-info.exe  get_drv_info
-get-drv-info.o ../libltdl/libltdlc.la
gcc -g -O2 -o get-drv-info.exe get_drv_info-get-drv-info.o  ../libltdl/.libs/lib
ltdlc.a -ldl
./get-drv-info `echo gd.la | sed 's/.la//'` > gd.rc
Could not open driver module gd
libltdl error: no symbols defined
make[2]: *** [gd.rc] Error 1
make[2]: Leaving directory `/usr/src/plplot-5.2.1/drivers'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/plplot-5.2.1'
make: *** [all] Error 2
 
Solution?
---------
The problem is with dynamic drivers and not cgm in particular. Try the following
to disable dynamic drivers:
 
   ./configure --prefix=/usr/local/plplot --enable-shared=no \
   --enable-static=yes --without-csa --disable-tcl --disable-itcl \
   --disable-octave --disable-dg300 --disable-lj_hpgl --disable-dyndrivers \
   --disable-imp --disable-ljii --disable-ljiip --disable-mem \
   --disable-tek4010f --disable-tek4107f --disable-tek4010 --disable-tek4107
   make
 
Error.
-----
The libraries are made as well as pltek.exe but plrender is not built. To find
out what is happening, do
 
   cd utils
   make plrender.exe
 
Error.
-----
/bin/bash ../libtool --mode=link gcc  -g -O2   -o plrender.exe -rpath \
/usr/local/plplot/lib -no-undefined plrender.o ../src/libplplotd.la
gcc -g -O2 -o plrender.exe plrender.o  ../src/.libs/libplplotd.a \
-L/usr/local/lib -ldl -lcd -lgd /usr/local/lib/libfreetype.a \
-L/usr/X11R6/lib -lX11 -Wl,--rpath -Wl,/usr/local/plplot/lib
/usr/local/lib/libgd.a(gd_jpeg.o)(.text+0xfa):gd_jpeg.c:
undefined reference to `_jpeg_destroy'
/usr/local/lib/libgd.a(gd_jpeg.o)(.text+0x342):gd_jpeg.c:
undefined reference to ....
 
( And many more )
 
/usr/local/lib/libgd.a(gd_png.o)(.text+0x129):gd_png.c:
undefined reference to `_png_get_error_ptr'
 
( And many more )
 
collect2: ld returned 1 exit status
 
Solution?
---------
Could be because the PNG and JPEG libraries are missing from the list of libs.
Define LIBS = -L/usr/local/lib -ljpeg -lpng in utils/Makefile. From Top
Directory,
 
   make
 
This compiles plrender.exe. Looks like no errors and nothing more to be done.
 
   make install
 
   export PATH=/usr/local/plplot/bin:$PATH
   # set PATH so that plplot_libtool is found
   cd /usr/local/plplot/lib/plplot5.2.1/examples/c
   make -f Makefile.examples
 
Error.
-----
As before because PNG and JPEG libs are not taken.
 
Solution?
---------
Edit Makefile.examples to include -L/usr/local/lib -ljpeg -lpng after
$(INCLUDEANDLIB) in the rule.
 
   make -f Makefile.examples
 
This builds the programs x01c.exe to x21c.exe
 
   startxwin.sh # start XFree86
   ./x01c
 
The devices that work are: xwin, plmeta ( use plrender to get it on X-Window )
    ps ( use gs to view x01c.ps ),  psc ( use gs to view x01c.ps ),
    xfig ( use xfig to view x01c.fig ), pbm ( use IrfanView to view x01c.pbm ),
    png ( use IrfanView to view x01c.png ),
    jpeg ( use IrfanView to view x01c.jpg ),
    null ( no output ), cgm ( x01c.cgm made but not tested )
The device xterm does not work properly ( the display freezes and the
program has to be killed from the original Cygwin window )
 
Rest of examples all work except a few. Comments:
 
x04c ( two pages. Try plmeta and view with plrender; seems alright )
x14c ( needs Tk driver; not built )
x17c ( strip chart demo; appears to have animation )
x20c ( Set and Drag on Lena's image causes some error )
x21c ( Needs qhull; Not present )
 
   cd /usr/local/plplot/lib/plplot5.2.1/examples/c++
 
Precaution
----------
Edit Makefile to put -L/usr/local/lib -ljpeg -lpng just after
$(INCLUDEANDLIB)
 
   make
   ./x01cc
 
Seems to work.
 
   cd /usr/local/plplot/lib/plplot5.2.1/examples/f77
 
Precaution
----------
Edit Makefile.examples to put -L/usr/local/lib -ljpeg -lpng just after
$(INCLUDEANDLIB)
 
   make -f Makefile.examples
 
Error.
-----
plplot_libtool --mode=link g77 x01f.f -I/usr/local/plplot/include/plplot \
-L/usr/local/plplot/lib -lplplotf77d -L/usr/local/lib -ljpeg -lpng  -o x01f
g77 x01f.f -I/usr/local/plplot/include/plplot -o x01f.exe  \
-L/usr/local/plplot/lib /usr/local/plplot/lib/libplplotf77d.a \
/usr/local/plplot/lib/libplplotd.a -L/usr/local/lib -ldl -lcd -lgd \
/usr/local/lib/libfreetype.a -L/usr/X11R6/lib -lX11 \
/usr/local/lib/libjpeg.a -lpng
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libdl.a(libcmain.o)(.text+0x7c):
undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
make: *** [x01f] Error 1
 
Solution?
--------
Looks like the Fortran binding does not work. Explore the following
possibility:
When Cygwin is installed, certain links are not established. For instance,
libdl.a is not present. As per suggestions of experts ( see documentation on
building qt3 on the sourceforge kde-cygwin page ), we place a softlink in
/usr/lib so that libdl.a points to libcygwin.a. This appears to suffice for
most cases. When PLplot is being configured, there are a number of questions
about dl.h which is also not present in the distribution. A grep-search in
/usr/include reveals that dlfcn.h has definitions of dlopen etc. Hence, in
/usr/include copy dlfcn.h into dl.h. Now try ( removing some unwanted
drivers)
 
   ./configure --prefix=/usr/local/plplot --enable-shared=no \
   --enable-static=yes --without-csa --disable-tcl --disable-itcl \
   --disable-octave --disable-dg300 --disable-lj_hpgl --disable-dyndrivers \
   --disable-imp --disable-ljii --disable-ljiip --disable-mem \
   --disable-tek4010f --disable-tek4107f --disable-tek4010 --disable-tek4107 \
   --disable-mskermit --disable-versaterm --disable-vlt --disable-conex
   make
 
( Overcome glitches as before and make C and C++ examples )
  
   make install
   cd /usr/local/plplot/lib/plplot5.2.1/examples/f77
 
( Patch up Makefile.examples )
 
   make -f Makefile.examples
 
Error.
-----
Again, the FDEMOS do not build due to the same problem.  Looks like my ploy
to provide dl.h to the configure script did not work.
 
Solution?
---------
The problem seems to be with libdl.a. Suppose we remove -ldl from the
compilation rule? Run the following script:
 
   g77 x01f.f -I/usr/local/plplot/include/plplot -o x01f.exe \
   -L/usr/local/plplot/lib -lplplotf77d -lplplotd -L/usr/local/lib \
   -lcd -lgd -lfreetype -L/usr/X11R6/lib -lX11 -ljpeg -lpng
 
x01f.exe compiles. Start XFree86 and test x01f.exe. The devices that work for
x01c.exe also work here. The other programs are compiled using similar
commands; they too appear to work.
 
------------End of Message------------------