Hi Alan, thanks for the explanation, but I already found the cause (by printing what files and directories were examined): If I build the examples via the VS generator, the function plInBuildTree() fails, because the build directory is reported to be "d:\build-plplot" (or similar) and the current directory is "D:\build-plplot\examples\c\Debug". These two directory names are compared up to the length of the build directory (so "\examples\c\Debug" is ignored - but the difference is in the drive letter: In one case it is uppercase, in the other it is lowercase.
I suppose on Windows we should ignore the case, as the file system is "case preserving", but it was easier to restrict that to the first letter. This change in plInBuildTree() works for me: // On Windows the first character is the drive letter - it is // case-insensitive if ( strncmp( builddir+1, currdir+1, strlen( builddir+1 ) ) == 0 && tolower( builddir[0] ) == tolower( currdir[0] ) ) { inBuildTree = 1; } On Linux (and OSX?) the first character is a /, so that should work fine too. The crash (assertion failure) I mentioned with one particular setting of PLPLOT_DRV_DIR is caused solely by the appearance of files with extension ".rc" in the dll\Debug subdirectory when using Visual Studio. They are related to "manifest files" for the Fortran DLLs. Perhaps we should have a look at the reading procedure for the PLplot .rc files to avoid this crash, but it seems rare enough a condition not to put much emphasis on that. The conclusion: - Use my patch and build PLplot via Visual Studio - Open a DOS-box in the directory containing the examples - Extend the path with the "dll\Debug" directory - Run the examples Regards, Arjen On 2010-11-09 18:57, Alan W. Irwin wrote: > On 2010-11-09 09:14+0100 Arjen Markus wrote: > >> I have been experimenting with the VS generator and the build tree as >> I get it then. I do not understand yet why the sample programs work >> differently then, but here is a receipe for making them work >> nonetheless: >> >> 1. Build the PLplot libraries and examples via the ALL_BUILD project >> 2. Open a DOS box in the Debug directory for any one of these examples >> 3. Set the following environment variables: >> set path=<build>\dll\Debug;%PATH% - <build> for wherever PLplot >> was built >> set PLPLOT_DRV_DIR=<build>\drivers - <build> same value as for the >> path >> set PLPLOT_LIB=<source> - the directory <source>\data >> holds the .pal and .fnt files >> 4. Run the sample program >> >> I have looked at the contents of the various directories for both the >> "NMake" and the "VS" builds but there is nothing obviously wrong. >> >> (As a further remark to the developers - and for me especially: when >> I had set PLPLOT_DRV_DIR to a valid directory but not one containing >> the .rc files, I got an assertion error from the runtime library - >> I will have to investigate that one!) > > Hi Arjen: > > I have moved this part of the plplot-general thread to plplot-devel > under a new subject. > > Setting PLPLOT_DRV_DIR and PLPLOT_LIB was necessary long ago on the > Unix side of things in order to allow the build tree examples to work, > but that is no longer necessary. And from your remarks above it is > only necessary now for the VS Windows build environment but not the nmake > one. To help figure out why there is a difference, here is where > PLPLOT_DRV_DIR and PLPLOT_LIB appear in the source tree: > > softw...@raven> find -type f | grep -v .svn | grep -v '~$' \ > | xargs grep -l PLPLOT_DRV_DIR > ./src/plcore.c > ./doc/docbook/src/deploying.xml > > softw...@raven> find -type f | grep -v .svn | grep -v '~$' \ > | xargs grep -l PLPLOT_LIB > ./examples/perl/README.perldemos > ./src/plctrl.c > ./www/announce/ChangeLog-5.3.1-5.3.2 > ./FAQ > ./doc/docbook/src/deploying.xml > ./doc/plplot_libtool.1 > ./include/plplotP.h > ./bindings/octave/octaverc.in > > src/plcore.c and src/plctrl.c both avoid use of respectively > PLPLOT_DRV_DIR and PLPLOT_LIB if plInBuildTree() returns true. So > Arjen, I suggest you look further at why plInBuildTree is returning a > false result for the VS Windows case. It's possible if you can figure > that issue out, that you will be able to remove the current > requirement to set both PLPLOT_DRV_DIR and PLPLOT_LIB for the VS case. > > Also, from the above find results we probably need to update our > documentation of PLPLOT_DRV_DIR and PLPLOT_LIB to say something about > those environment variables are only used when the build tree > detection (as implemented by plInBuildTree()) fails for some reason. > That may be a good idea, indeed. The use and the expected values for these environment variables is not entirely trivial. Regards, Arjen DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel