From: Herng-Jeng J. <hj...@qu...> - 2003-10-15 13:39:33
|
Hi, I compiled PLplot CVS 20031004 ok on RedHat Linux 7.3 with gcc/g++ 2.96. The x01.cc example works fine as compiled with dynamic linkage. When I tried to link it statically, the executable runs with an empty plotting window (black background) and with no plot in it. Jou ======================================= Herng-Jeng Jou QuesTek Innovations, LLC 1820 Ridge Avenue Evanston, IL 60201 (Tel) 847.425.8221 (Fax) 847.328.5855 hj...@qu... |
From: Andrew R. <an...@co...> - 2003-10-15 14:03:00
|
Hi Jou, How exactly are you compiling the examples statically? Do you mean that you are compiling the whole library statically? There have been some API changes in the C++ bindings so you are now required to call plstream::init() explicitly. Is it possible that you are linking against an old version of the library which might explain your problem? Do you get the same problems with all the C++ examples? Cheers Andrew On Wed, Oct 15, 2003 at 08:38:54AM -0500, Herng-Jeng Jou wrote: > Hi, > I compiled PLplot CVS 20031004 ok on RedHat Linux 7.3 with gcc/g++ 2.96. > The x01.cc example works fine as compiled with dynamic linkage. When I tried > to link it statically, the executable runs with an empty plotting window > (black > background) and with no plot in it. > Jou > > ======================================= > Herng-Jeng Jou > QuesTek Innovations, LLC > 1820 Ridge Avenue > Evanston, IL 60201 > (Tel) 847.425.8221 > (Fax) 847.328.5855 > hj...@qu... > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > Plplot-general mailing list > Plp...@li... > https://lists.sourceforge.net/lists/listinfo/plplot-general |
From: Herng-Jeng J. <hj...@qu...> - 2003-10-15 14:38:11
|
Thanks Andrew for your quick response. Since I don't quite understand the build process, so it is very likely that I screwed up. This is how x01 was built with the supplied Makefile in examples/c++ directory: $ make x01 /bin/sh ../../libtool --mode=link g++ -g -O2 -o x01 x01.o ../../bindings/c++/libplplotcxxd.la $ g++ -g -O2 -o .libs/x01 x01.o ../../bindings/c++/.libs/libplplotcxxd.so /afs/hjjou/archives/plplot-5.2.1.cvs.20031004/src/.libs/libplplotd.so /usr/lib/libfreetype.so /afs/hjjou/archives/plplot-5.2.1.cvs.20031004/lib/csa/.libs/libcsirocsa.so -ldl -Wl,--rpath -Wl,/usr/local/plplot/lib creating x01 and that makes a executable .libs/x01 and x01 script and it works fine. After I install PLplot into "/usr/local/plplot" directory, then I was trying to compile a standalone x01 without dynamic linkage at all to PLplot, and this is what I did: $ g++ -I/usr/local/plplot/include/plplot -c x01.cc $ g++ -g -O2 -o x01 x01.o /usr/local/plplot/lib/libplplotcxxd.a /usr/local/plplot/lib/libplplotd.a /usr/lib/libfreetype.so /usr/local/plplot/lib/libcsirocsa.a -ldl $ ldd x01 libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40023000) libdl.so.2 => /lib/libdl.so.2 (0x40063000) libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x40066000) libm.so.6 => /lib/i686/libm.so.6 (0x400a9000) libc.so.6 => /lib/i686/libc.so.6 (0x42000000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) looks like this x01 executable has correct linkage. But when I run it, I got a empty page with it. Same problem as x02 if I try compiling this way. All of these (lib,example source, etc) were done using CVS 20031004 snapshot. The library was configured with --prefix==/usr/local/plplot --with-double flag. Thanks for your help. Jou At 03:02 PM 10/15/2003 +0100, Andrew Ross wrote: >Hi Jou, > >How exactly are you compiling the examples statically? Do you mean >that you are compiling the whole library statically? > >There have been some API changes in the C++ bindings so you are now >required to call plstream::init() explicitly. Is it possible that you >are linking against an old version of the library which might explain >your problem? > >Do you get the same problems with all the C++ examples? > >Cheers > >Andrew > >On Wed, Oct 15, 2003 at 08:38:54AM -0500, Herng-Jeng Jou wrote: > > Hi, > > I compiled PLplot CVS 20031004 ok on RedHat Linux 7.3 with gcc/g++ 2.96. > > The x01.cc example works fine as compiled with dynamic linkage. When I > tried > > to link it statically, the executable runs with an empty plotting window > > (black > > background) and with no plot in it. > > Jou > > > > ======================================= > > Herng-Jeng Jou > > QuesTek Innovations, LLC > > 1820 Ridge Avenue > > Evanston, IL 60201 > > (Tel) 847.425.8221 > > (Fax) 847.328.5855 > > hj...@qu... > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > SourceForge.net hosts over 70,000 Open Source Projects. > > See the people who have HELPED US provide better services: > > Click here: http://sourceforge.net/supporters.php > > _______________________________________________ > > Plplot-general mailing list > > Plp...@li... > > https://lists.sourceforge.net/lists/listinfo/plplot-general > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >SourceForge.net hosts over 70,000 Open Source Projects. >See the people who have HELPED US provide better services: >Click here: http://sourceforge.net/supporters.php >_______________________________________________ >Plplot-general mailing list >Plp...@li... >https://lists.sourceforge.net/lists/listinfo/plplot-general ======================================= Herng-Jeng Jou QuesTek Innovations, LLC 1820 Ridge Avenue Evanston, IL 60201 (Tel) 847.425.8221 (Fax) 847.328.5855 hj...@qu... |
From: Andrew R. <an...@co...> - 2003-10-15 16:27:47
|
OK. I've reproduced the problem with my setup. Firstly it's not a C++ problem - the same thing occurs with the C drivers. I wondered if it is related to the dynamic drivers however the drivers appear to load ok. It also occurs with postscript and xwin drivers for me so it's not specific to a driver. Running the examples with the -debug option doesn't reveal any differences between the dynamic and static cases. In the case of the postscript driver the statically linked output is not empty - there are a whole series of drawing commands in the output file, however the coordinates are all the same. Maybe one of the developers can throw some light on this. Andrew P.S. Given that you have (I presume) compiled with dynamic drivers is there any particular reason you want to statically link in the plplot library? To use the program on another machine you would also need to distrubute the drivers in plplot/lib/plplot/driversd/. On Wed, Oct 15, 2003 at 09:37:29AM -0500, Herng-Jeng Jou wrote: > Thanks Andrew for your quick response. > Since I don't quite understand the build process, so it is very likely that > directory: > $ make x01 > /bin/sh ../../libtool --mode=link g++ -g -O2 -o x01 x01.o > ../../bindings/c++/libplplotcxxd.la > $ g++ -g -O2 -o .libs/x01 x01.o ../../bindings/c++/.libs/libplplotcxxd.so > /afs/hjjou/archives/plplot-5.2.1.cvs.20031004/src/.libs/libplplotd.so > /usr/lib/libfreetype.so > /afs/hjjou/archives/plplot-5.2.1.cvs.20031004/lib/csa/.libs/libcsirocsa.so > -ldl -Wl,--rpath -Wl,/usr/local/plplot/lib > creating x01 > > and that makes a executable .libs/x01 and x01 script and it works fine. > > After I install PLplot into "/usr/local/plplot" directory, > then I was trying to compile a standalone x01 without dynamic linkage at > all to PLplot, and > this is what I did: > $ g++ -I/usr/local/plplot/include/plplot -c x01.cc > $ g++ -g -O2 -o x01 x01.o /usr/local/plplot/lib/libplplotcxxd.a > /usr/local/plplot/lib/libplplotd.a /usr/lib/libfreetype.so > /usr/local/plplot/lib/libcsirocsa.a -ldl > > $ ldd x01 > libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40023000) > libdl.so.2 => /lib/libdl.so.2 (0x40063000) > libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 > (0x40066000) > libm.so.6 => /lib/i686/libm.so.6 (0x400a9000) > libc.so.6 => /lib/i686/libc.so.6 (0x42000000) > /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) > > looks like this x01 executable has correct linkage. But when I run it, I > got a empty > page with it. Same problem as x02 if I try compiling this way. > All of these (lib,example source, etc) were done using CVS 20031004 > snapshot. > The library was configured with --prefix==/usr/local/plplot --with-double > flag. > Thanks for your help. > Jou > > At 03:02 PM 10/15/2003 +0100, Andrew Ross wrote: > > >Hi Jou, > > > >How exactly are you compiling the examples statically? Do you mean > >that you are compiling the whole library statically? > > > >There have been some API changes in the C++ bindings so you are now > >required to call plstream::init() explicitly. Is it possible that you > >are linking against an old version of the library which might explain > >your problem? > > > >Do you get the same problems with all the C++ examples? > > > >Cheers > > > >Andrew > > > >On Wed, Oct 15, 2003 at 08:38:54AM -0500, Herng-Jeng Jou wrote: > >> Hi, > >> I compiled PLplot CVS 20031004 ok on RedHat Linux 7.3 with gcc/g++ 2.96. > >> The x01.cc example works fine as compiled with dynamic linkage. When I > >tried > >> to link it statically, the executable runs with an empty plotting window > >> (black > >> background) and with no plot in it. > >> Jou > >> > >> ======================================= > >> Herng-Jeng Jou > >> QuesTek Innovations, LLC > >> 1820 Ridge Avenue > >> Evanston, IL 60201 > >> (Tel) 847.425.8221 > >> (Fax) 847.328.5855 > >> hj...@qu... > >> > >> > > > >> ------------------------------------------------------- > >> This SF.net email is sponsored by: SF.net Giveback Program. > >> SourceForge.net hosts over 70,000 Open Source Projects. > >> See the people who have HELPED US provide better services: > >> Click here: http://sourceforge.net/supporters.php > >> _______________________________________________ > >> Plplot-general mailing list > >> Plp...@li... > >> https://lists.sourceforge.net/lists/listinfo/plplot-general > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: SF.net Giveback Program. > >SourceForge.net hosts over 70,000 Open Source Projects. > >See the people who have HELPED US provide better services: > >Click here: http://sourceforge.net/supporters.php > >_______________________________________________ > >Plplot-general mailing list > >Plp...@li... > >https://lists.sourceforge.net/lists/listinfo/plplot-general > > ======================================= > Herng-Jeng Jou > QuesTek Innovations, LLC > 1820 Ridge Avenue > Evanston, IL 60201 > (Tel) 847.425.8221 > (Fax) 847.328.5855 > hj...@qu... |
From: Alan W. I. <ai...@us...> - 2003-10-15 18:56:51
|
On 2003-10-15 09:37-0500 Herng-Jeng Jou wrote: > After I install PLplot into "/usr/local/plplot" directory, > then I was trying to compile a standalone x01 without dynamic linkage at > all to PLplot, and > this is what I did: > $ g++ -I/usr/local/plplot/include/plplot -c x01.cc > $ g++ -g -O2 -o x01 x01.o /usr/local/plplot/lib/libplplotcxxd.a > /usr/local/plplot/lib/libplplotd.a /usr/lib/libfreetype.so > /usr/local/plplot/lib/libcsirocsa.a -ldl You should use plplot_libtool to solve the problem of making statically linked versions of executables. Here is what to do: Adjust the line below for your prefix, but if I build plplot-5.2.1.cvs.20031004 using --prefix=/usr/local/plplot_at --disable-dyndrivers Note the --disable-dyndrivers is essential because the combination of static libraries (what you are ultimately trying to use) and dyndrivers does not currently work. plplot_libtool --mode=link g++ -all-static x01.cc \ -I/usr/local/plplot_at/include/plplot -L/usr/local/plplot_at/lib \ -lplplotcxxd -o x01 -ldl then I get good results. Herng-Jeng and Andrew, will you please confirm this also works well on your systems? Note the resulting executable is statically linked: file x01 x01: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped Also, the size of the executable is enormous ls -l x01 -rwxr-xr-x 1 software software 4760851 Oct 15 11:36 x01* But ./x01 -dev xwin, for example, works fine. I tried the same thing in the c directory, and again no problems. Also, I tried ordinary builds using make (which invokes plplot_libtool without the -all-static and -ldl options) and they worked fine as well. So plplot_libtool is your friend for sorting out various linking cases. (Rafael is working on a replacement to plplot_libtool which should be able to do the same thing in a simpler way, but until that works, use plplot_libtool.) What is going on here is that by default, both dynamic and static versions of the plplot library are built. And the plplot_libtool -all-static flag (see info libtool for documentation on how to invoke libtool, and therefore its locally configured copy for your system, plplot_libtool) forces use of the static libraries. On my system, the above plplot_libtool command generates the following good compile/build commmand and executes it: g++ -static x01.cc -I/usr/local/plplot_at/include/plplot -o x01 -L/usr/local/plplot_at/lib /usr/local/plplot_at/lib/libplplotcxxd.a /usr/local/plplot_at/lib/libplplotd.a /usr/local/plplot_at/lib/libcsirocsa.a /usr/local/plplot_at/lib/libcsironn.a -lqhull -lcd -lgd -lpng /usr/lib/libjpeg.a -lz -litk3.1 -ltk8.3 -litcl3.1 -ltcl8.3 /usr/lib/libfreetype.a -L/usr/X11R6/lib -lX11 -ldl So you could adjust your own g++ invocation to mimic this, but I think it is much better to use plplot_libtool directly. BTW, the reason I knew what to do with plplot_libtool was I pretty much (except for the -all-static option and -ldl on the end) followed what was done for the examples to build them. I have already discussed why -all-static is necessary. I found that the -ldl flag was necessary for the --all-static case because /usr/lib/libtcl8.3.a refers to dlopen and friends, and you have to resolve those reference with an explicit -ldl option. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Herng-Jeng J. <hj...@qu...> - 2003-10-16 20:46:16
|
<html> <font size=3>Hi Alan,<br> Thanks for the useful explanation.<br> I did what you explained with the CVS 20031004 by:<br> $ ./configure --prefix=/usr/local/plplot_at --disable-dyndrivers --with-double<br> $ make<br> $ su<br> # make install <br> # exit<br> $ cd example/c++<br> $ /usr/local/plplot_at/bin/plplot_libtool --mode=link g++ -all-static x01.cc \<br> -I/usr/local/plplot_at/include/plplot -L/usr/local/plplot_at/lib \<br> -lplplotcxxd -o x01 -ldl<br> on my system, it complaints that -ltk8.3 cannot be found. I think it is because<br> I only have /usr/lib/libtk8.3.so, no .a in it.<br> Jou<br> <br> At 11:56 AM 10/15/2003 -0700, Alan W. Irwin wrote:<br> <blockquote type=cite cite>On 2003-10-15 09:37-0500 Herng-Jeng Jou wrote:<br> <br> > After I install PLplot into "/usr/local/plplot" directory,<br> > then I was trying to compile a standalone x01 without dynamic linkage at<br> > all to PLplot, and<br> > this is what I did:<br> > $ g++ -I/usr/local/plplot/include/plplot -c x01.cc<br> > $ g++ -g -O2 -o x01 x01.o /usr/local/plplot/lib/libplplotcxxd.a<br> > /usr/local/plplot/lib/libplplotd.a /usr/lib/libfreetype.so<br> > /usr/local/plplot/lib/libcsirocsa.a -ldl<br> <br> You should use plplot_libtool to solve the problem of making statically<br> linked versions of executables.<br> <br> Here is what to do:<br> <br> Adjust the line below for your prefix, but if I build<br> plplot-5.2.1.cvs.20031004 using<br> <br> --prefix=/usr/local/plplot_at --disable-dyndrivers<br> <br> Note the --disable-dyndrivers is essential because the combination of static<br> libraries (what you are ultimately trying to use) and dyndrivers does not<br> currently work.<br> <br> plplot_libtool --mode=link g++ -all-static x01.cc \<br> -I/usr/local/plplot_at/include/plplot -L/usr/local/plplot_at/lib \<br> -lplplotcxxd -o x01 -ldl<br> <br> then I get good results.<br> <br> Herng-Jeng and Andrew, will you please confirm this also works well on your<br> systems?<br> <br> Note the resulting executable is statically linked:<br> <br> file x01<br> x01: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically<br> linked, not stripped<br> <br> Also, the size of the executable is enormous<br> <br> ls -l x01<br> -rwxr-xr-x 1 software software 4760851 Oct 15 11:36 x01*<br> <br> But ./x01 -dev xwin, for example, works fine.<br> <br> I tried the same thing in the c directory, and again no problems.<br> <br> Also, I tried ordinary builds using make (which invokes plplot_libtool<br> without the -all-static and -ldl options) and they worked fine as well.<br> <br> So plplot_libtool is your friend for sorting out various linking cases.<br> (Rafael is working on a replacement to plplot_libtool which should be<br> able to do the same thing in a simpler way, but until that works,<br> use plplot_libtool.)<br> <br> What is going on here is that by default, both dynamic and static versions<br> of the plplot library are built. And the plplot_libtool -all-static flag<br> (see info libtool for documentation on how to invoke libtool, and therefore<br> its locally configured copy for your system, plplot_libtool) forces use of<br> the static libraries. On my system, the above plplot_libtool command<br> generates the following good compile/build commmand and executes it:<br> <br> g++ -static x01.cc -I/usr/local/plplot_at/include/plplot -o x01<br> -L/usr/local/plplot_at/lib /usr/local/plplot_at/lib/libplplotcxxd.a<br> /usr/local/plplot_at/lib/libplplotd.a /usr/local/plplot_at/lib/libcsirocsa.a<br> /usr/local/plplot_at/lib/libcsironn.a -lqhull -lcd -lgd -lpng<br> /usr/lib/libjpeg.a -lz -litk3.1 -ltk8.3 -litcl3.1 -ltcl8.3<br> /usr/lib/libfreetype.a -L/usr/X11R6/lib -lX11 -ldl<br> <br> So you could adjust your own g++ invocation to mimic this, but I think it is<br> much better to use plplot_libtool directly.<br> <br> BTW, the reason I knew what to do with plplot_libtool was I pretty much<br> (except for the -all-static option and -ldl on the end) followed what was<br> done for the examples to build them. I have already discussed why<br> -all-static is necessary. I found that the -ldl flag was necessary for the<br> --all-static case because /usr/lib/libtcl8.3.a refers to dlopen and friends,<br> and you have to resolve those reference with an explicit -ldl option.<br> <br> Alan<br> __________________________<br> Alan W. Irwin<br> email: ir...@be...<br> phone: 250-727-2902<br> <br> Astronomical research affiliation with Department of Physics and Astronomy,<br> University of Victoria (astrowww.phys.uvic.ca).<br> <br> Programming affiliations with the PLplot scientific plotting software<br> package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the<br> Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project<br> (lbproject.sf.net).<br> __________________________<br> <br> Linux-powered Science<br> __________________________<br> <br> <br> -------------------------------------------------------<br> This SF.net email is sponsored by: SF.net Giveback Program.<br> SourceForge.net hosts over 70,000 Open Source Projects.<br> See the people who have HELPED US provide better services:<br> Click here: <a href="http://sourceforge.net/supporters.php" eudora="autourl">http://sourceforge.net/supporters.php</a><br> _______________________________________________<br> Plplot-general mailing list<br> Plp...@li...<br> <a href="https://lists.sourceforge.net/lists/listinfo/plplot-general" eudora="autourl">https://lists.sourceforge.net/lists/listinfo/plplot-general</a> </font></blockquote><br> </html> |
From: Alan W. I. <ai...@us...> - 2003-10-16 22:21:44
|
On 2003-10-16 15:43-0500 Herng-Jeng Jou wrote: > Hi Alan, > Thanks for the useful explanation. > I did what you explained with the CVS 20031004 by: > $ ./configure --prefix=/usr/local/plplot_at --disable-dyndrivers > --with-double > $ make > $ su > # make install > # exit > $ cd example/c++ > $ /usr/local/plplot_at/bin/plplot_libtool --mode=link g++ -all-static > x01.cc \ > -I/usr/local/plplot_at/include/plplot -L/usr/local/plplot_at/lib \ > -lplplotcxxd -o x01 -ldl > on my system, it complaints that -ltk8.3 cannot be found. I think it is > because > I only have /usr/lib/libtk8.3.so, no .a in it. > Jou That kills your dream of having an all-static result for your present system. But if your system is Linux (I have forgotten) it is a simple matter to install the static versions of all libraries. They are usually in the development rpm. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Herng-Jeng J. <hj...@qu...> - 2003-10-15 15:40:38
|
Hi Andrew, I have another question in the C++ binding, hope you don't mind. Is it possible to save the output to a file while the plot is currently being viewed? I think it is possible as that has been achieved in the tk driver. But I could not figure out how to do that in C++/PLplot. Can you help? Thanks, Jou At 03:02 PM 10/15/2003 +0100, Andrew Ross wrote: >Hi Jou, > >How exactly are you compiling the examples statically? Do you mean >that you are compiling the whole library statically? > >There have been some API changes in the C++ bindings so you are now >required to call plstream::init() explicitly. Is it possible that you >are linking against an old version of the library which might explain >your problem? > >Do you get the same problems with all the C++ examples? > >Cheers > >Andrew > >On Wed, Oct 15, 2003 at 08:38:54AM -0500, Herng-Jeng Jou wrote: > > Hi, > > I compiled PLplot CVS 20031004 ok on RedHat Linux 7.3 with gcc/g++ 2.96. > > The x01.cc example works fine as compiled with dynamic linkage. When I > tried > > to link it statically, the executable runs with an empty plotting window > > (black > > background) and with no plot in it. > > Jou > > > > ======================================= > > Herng-Jeng Jou > > QuesTek Innovations, LLC > > 1820 Ridge Avenue > > Evanston, IL 60201 > > (Tel) 847.425.8221 > > (Fax) 847.328.5855 > > hj...@qu... > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > SourceForge.net hosts over 70,000 Open Source Projects. > > See the people who have HELPED US provide better services: > > Click here: http://sourceforge.net/supporters.php > > _______________________________________________ > > Plplot-general mailing list > > Plp...@li... > > https://lists.sourceforge.net/lists/listinfo/plplot-general > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >SourceForge.net hosts over 70,000 Open Source Projects. >See the people who have HELPED US provide better services: >Click here: http://sourceforge.net/supporters.php >_______________________________________________ >Plplot-general mailing list >Plp...@li... >https://lists.sourceforge.net/lists/listinfo/plplot-general ======================================= Herng-Jeng Jou QuesTek Innovations, LLC 1820 Ridge Avenue Evanston, IL 60201 (Tel) 847.425.8221 (Fax) 847.328.5855 hj...@qu... |
From: Andrew R. <an...@co...> - 2003-10-15 16:05:02
|
Hi Jou, I'm afraid there is no GUI option in C++ to save the current plot like there is with the tk examples. You can do it in your own programs though. Look at example x20 which allows you to save a plot by replicating a stream using cpstrm, changing the device and then replotting. This should do what you want. Same goes for C. Andrew On Wed, Oct 15, 2003 at 10:39:51AM -0500, Herng-Jeng Jou wrote: > Hi Andrew, > > I have another question in the C++ binding, hope you don't mind. > Is it possible to save the output to a file while the plot is currently > being > viewed? I think it is possible as that has been achieved in the tk driver. > But I could not figure out how to do that in C++/PLplot. > Can you help? > Thanks, > > Jou > > At 03:02 PM 10/15/2003 +0100, Andrew Ross wrote: > > >Hi Jou, > > > >How exactly are you compiling the examples statically? Do you mean > >that you are compiling the whole library statically? > > > >There have been some API changes in the C++ bindings so you are now > >required to call plstream::init() explicitly. Is it possible that you > >are linking against an old version of the library which might explain > >your problem? > > > >Do you get the same problems with all the C++ examples? > > > >Cheers > > > >Andrew > > > >On Wed, Oct 15, 2003 at 08:38:54AM -0500, Herng-Jeng Jou wrote: > >> Hi, > >> I compiled PLplot CVS 20031004 ok on RedHat Linux 7.3 with gcc/g++ 2.96. > >> The x01.cc example works fine as compiled with dynamic linkage. When I > >tried > >> to link it statically, the executable runs with an empty plotting window > >> (black > >> background) and with no plot in it. > >> Jou > >> > >> ======================================= > >> Herng-Jeng Jou > >> QuesTek Innovations, LLC > >> 1820 Ridge Avenue > >> Evanston, IL 60201 > >> (Tel) 847.425.8221 > >> (Fax) 847.328.5855 > >> hj...@qu... > >> > >> > > > >> ------------------------------------------------------- > >> This SF.net email is sponsored by: SF.net Giveback Program. > >> SourceForge.net hosts over 70,000 Open Source Projects. > >> See the people who have HELPED US provide better services: > >> Click here: http://sourceforge.net/supporters.php > >> _______________________________________________ > >> Plplot-general mailing list > >> Plp...@li... > >> https://lists.sourceforge.net/lists/listinfo/plplot-general > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: SF.net Giveback Program. > >SourceForge.net hosts over 70,000 Open Source Projects. > >See the people who have HELPED US provide better services: > >Click here: http://sourceforge.net/supporters.php > >_______________________________________________ > >Plplot-general mailing list > >Plp...@li... > >https://lists.sourceforge.net/lists/listinfo/plplot-general > > ======================================= > Herng-Jeng Jou > QuesTek Innovations, LLC > 1820 Ridge Avenue > Evanston, IL 60201 > (Tel) 847.425.8221 > (Fax) 847.328.5855 > hj...@qu... |
From: <jc...@fe...> - 2003-10-15 16:29:28
|
On Wednesday 15 October 2003 15:37, Herng-Jeng Jou wrote: | Thanks Andrew for your quick response. | Since I don't quite understand the build process, so it is very | likely that I screwed up. | This is how x01 was built with the supplied Makefile in examples/c++ | directory: $ make x01 | /bin/sh ../../libtool --mode=link g++ -g -O2 -o x01 x01.o | ../../bindings/c++/libplplotcxxd.la | $ g++ -g -O2 -o .libs/x01 x01.o | ../../bindings/c++/.libs/libplplotcxxd.so | /afs/hjjou/archives/plplot-5.2.1.cvs.20031004/src/.libs/libplplotd.so | /usr/lib/libfreetype.so | /afs/hjjou/archives/plplot-5.2.1.cvs.20031004/lib/csa/.libs/libcsiroc |sa.so -ldl -Wl,--rpath -Wl,/usr/local/plplot/lib | creating x01 | | and that makes a executable .libs/x01 and x01 script and it works | fine. | | After I install PLplot into "/usr/local/plplot" directory, | then I was trying to compile a standalone x01 without dynamic linkage | at all to PLplot, and | this is what I did: | $ g++ -I/usr/local/plplot/include/plplot -c x01.cc | $ g++ -g -O2 -o x01 x01.o /usr/local/plplot/lib/libplplotcxxd.a | /usr/local/plplot/lib/libplplotd.a /usr/lib/libfreetype.so | /usr/local/plplot/lib/libcsirocsa.a -ldl | | $ ldd x01 | libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40023000) | libdl.so.2 => /lib/libdl.so.2 (0x40063000) | libstdc++-libc6.2-2.so.3 => | /usr/lib/libstdc++-libc6.2-2.so.3 (0x40066000) | libm.so.6 => /lib/i686/libm.so.6 (0x400a9000) | libc.so.6 => /lib/i686/libc.so.6 (0x42000000) | /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) | | looks like this x01 executable has correct linkage. But when I run | it, I got a empty | page with it. I kind-of confirm this with current CVS and x01c.c. Of course we don't expect users to do what Herng-Jeng Jou did, but users migh want to generate a static executable to, say, sent id to a friend? And this raises another shared/static question: if plplot_libtool or pkg_config don't support both kinds of linking, we should disable static if shared is allowed. Or I'm missing something? Joao |
From: Alan W. I. <ai...@us...> - 2003-10-15 19:01:52
|
On 2003-10-15 17:27+0100 Jo=E3o Cardoso wrote: > Of course we don't expect users to do what Herng-Jeng Jou did, but users > migh want to generate a static executable to, say, sent id to a friend? Yes, it is certainly worthwhile to be able to link both with the shared and static versions of libplplot. These options are provided by libtool (and therefore plplot_libtool). More details in a post I just sent off to plplot-general to answer Herng-Jeng directly. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |