From: Jennifer A. <jm...@co...> - 2010-10-06 00:02:20
|
Pat, That is a very helpful explanation! I will be more appreciative of my dynamic linker from now on. I will also try linking my test program statically and see what libraries I am going to have to add manually to get it to work. You are correct, we do dynamically link with X11, since we assume that is installed on every system where users are running GrADS. As for cairo, it seems like we should use xlib and not xcb. I am not expecting to have to change a lot of code in gxX.c, but I'll know better when we are done testing with stand-alone programs and are ready to begin integrating cairo into GrADS. --Jennifer On Oct 5, 2010, at 4:36 PM, Patrice Dumas wrote: > On Tue, Oct 05, 2010 at 11:37:27AM -0400, Jennifer Adams wrote: >> will have to figure out how to link statically. That long list of >> dependent libraries is daunting! In my simple test program (rmf.c), >> I am compiling/linking with this command: >> >> gcc -g rmf.c -o rmf -I/opt/local/include/cairo -L/opt/local/lib - >> lcairo -L/usr/X11/lib -lX11 > > Indeed, with gcc, you only need to link dynamically against a > library when you use a symbol from that library. But The library > itself may need more symbols. When linking dynamically, you don't > need > to care, taking care of all the library dynamic dependency is the > dynamic linker job. > > When you link statically, you have to do the job of the dynamic linker > yourself, so that you need to supply all the libraries indirectly > needed. > >> I have some more testing to do with fonts, and so I may have to add >> some more libs to that list, but if my code doesn't require all >> those dependent libs, I don't have to statically link them, do I? > > If the library you use require those dependent libs, you have to > statically link them, even if your conde don't require them... > You can laso link some libraries statically, and other dynamically. > For example, the X libraries may be linked dynamically, even when > most of th eother libraries are statically linked, and, unless I am > wrong it is what is done for grads/opengrads. > >> As for backends, I am planning to use cairo to draw to an X window, >> PNG, Postscript, PDF, and SVG. I do not see why it's necessary to >> add the platform-specific window backends; X has been working fine >> for GrADS all these years. > > Beware that there are 2 X backends: > > * xlib: Uses the Xlib interface to the X Window System. This backend > can target Windows or Pixmaps. The Render extension is used if > available, but is not required. > > * xcb: Provides support similar to the xlib backend, but uses the > XCB interface rather than Xlib. > > I guess that for maximal portability you should use the xlib backend > when compiling cairo, and not the xcb backend. > > -- > Pat > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating > great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Opengrads-devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opengrads-devel -- Jennifer M. Adams IGES/COLA 4041 Powder Mill Road, Suite 302 Calverton, MD 20705 jm...@co... |