Alan, Apologies, this was originally sent from my home personal email account by mistake, hence the bounce. Here it is again. (with a top-post addendum)
While I'm writing, if someone does try to put together a tutorial system/prescription, and even if they don't, a very simple real working example would be a good addition. The various examples shiped with plplot are a really excellent and fairly exhaustive demonstration of the various features and capabilities of plplot, and are the first place for an already-initiated user to go. But a real newbie, just trying to plot a simple graph, will get lost. The plplot documentation has an initial chapter about "Simple use of plplot" which works through the basic interface and simplest api functions, but doesn't actually show a working bit of code. I'd suggest writing x00 that: 1. calculates y=x^2 for x =0,1,2,3,4,5 2. initiates plplot with plinit 3. sets up the plot with plenv 4. plots this as a (default) line with plline 5. plots this as a set of points with plpoin 6. ends (i.e., follows the Simple Use chapter). This is plplot's answer to "Hello World", and a tutorial build should start here to focus on the make, compile, link, run, drivers, etc. machinery. Once this is working for a user, the rest is easy. And, of course, such a user could use the same machinery with any of the other xnn example source code and hack them to do more sophisicated things. Best wishes, Steve On Wed, 2011-10-26 at 01:11 +0100, Steve Schwartz wrote: > Hi Alan, > > Thanks for the email. In this instance, I'm battling with lots of > unknowns (Windows, Visual Studio, etc.) so was looking to avoid another. > Anyway, I followed your recipe and built the examples on their own. I > must confess, trawling through the various CMake files, even with your > guidance, is a daunting task to start from the extensive plplot build > and reach something more compact and transparent. I think if you want to > encourage people to build apps with cmake, it might be helpful to > provide a simple stand-alone template. That is, help people answer the > following question: > > I have a simple plplot file, myprog.cc, that I want to turn into > myprog.exe (or whatever, depending on the system). How do I do this? > > I realise, of course, that this would need to be done in lots of > languages/bindings to satisfy everyone, but if it would be possible to > build such a template system from the plplot cmake project build, that > might be a help. Perhaps you'll tell me that you'd end up with the > equivalent of the top level examples files plus one example in each > language directory. Actually, I have a recollection we've been 'round > this loop before. > > I understand full well why you stick to your cmake approach in terms of > multi-platform and multi-language support. > > Anyway, in the process of digging 'round all the files and folders I > stumbled across the flags.make files. Using the c++ flags invoked there > in my makefile solved my original problem re crash on exit. So my pair > of undergraduate project students should be able to focus now on the > physics of their project and get some plots from their > theoretical/simulational model. They are taught c++ in Visual Studio, so > they might attempt to do all this from within a Visual Studio > project/solution, or fall back to a simple makefile build (which I don't > think they've ever seen before). If I learn anything universal about > plplot within the Visual Studio environment I'll share it. > > Thanks for your encouragement. Perhaps one day I'll bite the bullet and > speak cmake. Of course, another 3rd party software supplier swears by > Scons with nearly the same passion. > > Must run. Keep up the good work... > Steve > > PS In case you want to update the plplot wiki, the vcvars.bat file given > there to set up a command prompt window for plplot is incorrect/out of > date. There is no plplot\data folder for example. Here is mine again, > which seems to work: > > -------cut here---------- > @echo off > > rem setup Visual C++ compiler > call "%VS100COMNTOOLS%"\vsvars32.bat > > rem setup PLplot library > set PLPLOTDIR=C:\programs\plplot\plplot_install > set PLPLOT_LIB=%PLPLOTDIR%\lib > set PATH=%PLPLOTDIR%\bin;%PLPLOTDIR%\lib\plplot5.9.9\driversd;%PATH% > ---------and here------------- > > PPS on an aesthetic note, I'm not fond of burying the drivers dll's > inside a build-version-specific folder. Why can't driversd live inside > the install lib or bin directories? > > On Tue, 2011-10-25 at 11:54 -0700, Alan W. Irwin wrote: > > On 2011-10-25 18:11+0100 Steve Schwartz wrote: > > > > > It's a little confusing since the plplot_install directory has the main > > > dll's in bin, and the drivers somewhere else. I think the problem is > > > somewhere in the compile, because if I open a clean MSDOS commant prompt > > > window, execute my batch script, and run the examples-compiled one it > > > runs fine, whereas the one I compiled separately doesn't. > > > > Hi Steve: > > > > I am pretty sure from previous contacts between us that you would > > prefer to make your own independent system for building your > > PLplot-related applications, but I think I should at least remind > > others here that we already have two recommended methods for > > building PLplot-related applications. > > > > 1. This is called the traditional build system for the installed > > examples. It uses a combination of pkg-config to obtain the necessary > > compilation and link options and bash and make. On Windows, this > > combination only works if you have pkg-config (from the GTK+ stack) > > installed and the MSYS versions of make and bash. > > > > 2. This is called the CMake-based build system for the installed > > examples. You obviously need CMake for this, and whatever tools you > > used to build and install PLplot. So this is much more general > > approach than 1., and for that reason I recommend it. To see how it > > works; (i) install PLplot as usual; (ii) create an empty build > > directory and cd to it (note this is a different directory than the > > one you used to build and install PLplot); (iii) run "cmake" with > > appropriate generator option in that build directory using the > > pathname for the top-level installed examples directory, e.g., > > > > $PREFIX/share/plplot-5.9.9/examples > > > > where $PREFIX is the installation prefix you used when installing > > PLplot; (iv) put $PREFIX/bin on your PATH, and (v) run the build tool > > (nmake in your Windows case) that corresponds to the cmake generator > > that you chose to use to build the examples. > > > > The top-level CMakeLists.txt file that controls this build is > > installed in $PREFIX/share/plplot-5.9.9/examples, and it should be > > completely straightforward for any user to adapt that build system > > (mostly by stripping out unwanted stuff, e.g., examples in various > > languages that you don't care about) to build their own C, C++, > > Fortran, etc., apps against the PLplot libraries or configure > > interactive language (e.g., python, tcl) examples to use the PLplot > > libraries. Of course, to modify that build system for your needs > > requires some knowlege of cmake syntax or a willingness to learn that > > syntax. But that should not be a major barrier to using this method > > since CMake skill is already widespread amongst developers, and if you > > have no knowledge of that syntax to start with, it is an extremely > > easy syntax to pick up (especially if there is a complete example > > in front of you, as in this case.) > > > > Alan > > __________________________ > > Alan W. Irwin > > > > Astronomical research affiliation with Department of Physics and Astronomy, > > University of Victoria (astrowww.phys.uvic.ca). > > > > Programming affiliations with the FreeEOS equation-of-state > > implementation for stellar interiors (freeeos.sf.net); the Time > > Ephemerides project (timeephem.sf.net); PLplot scientific plotting > > software package (plplot.sf.net); the libLASi project > > (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); > > and the Linux Brochure Project (lbproject.sf.net). > > __________________________ > > > > Linux-powered Science > > __________________________ -- +-------------------------------------------------------------------+ Professor Steven J Schwartz Phone: +44-(0)20-7594-7660 Head, Space & Atmospheric Physics Fax: +44-(0)20-7594-7772 The Blackett Laboratory E-mail: s.schwa...@imperial.ac.uk Imperial College London Office: Huxley 6M67A London SW7 2AZ, U.K. Web: www.sp.ph.ic.ac.uk/~sjs +-------------------------------------------------------------------+ ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel