Re: [Plplot-devel] Octave status
On Wed, Sep 07, 2011 at 12:46:23PM -0700, Alan Irwin wrote: > On 2011-09-06 11:52+0100 Andrew Ross wrote: > > > > > I've committed a perl script to do this. It would be nicer to do it in > > sed but I'm not sure how. The old octave bindings required perl anyway > > so it is not an extra constraint. I have not yet modified CMakeFiles.txt > > to actually call the script as I'm not sure how to do this neatly to > > integrate with the cmake SWIG support. Alan, do you have any thoughts > > on the best way to do this? > > Before commenting on that, I want to be sure I have the correct > overview of what you are trying to do. My apologies in advance if you > have already covered this overview in previous e-mails, but I have been > distracted by non-PLplot development this summer so I have not been > paying as close attention as usual. > > My understanding is > > #pragma GCC visibility push(default) > > is the same thing as a temporary use of -fvisibility=default for all > the code until > > #pragma GCC visibility pop > > In other words this is just a workaround installed into the source > code for some problem for gcc and Octave with -fvisibility=hidden. > > IIRC, you mentioned in previous e-mails that the issue occurred > because of a problem for one of the octave headers we were using, but > is the proposed fix for that case also a workaround like above, or is > it a real fix? If there is a real fix, why can't we deploy that same > fix ourselves rather than using a workaround? > > Assuming your answer to this overview question is we could deploy the > real fix ourselves, then I suggest that you implement that. Here are two > possible > approaches I am thinking about that make sense from the CMake > perspective. > > (1) From the man page, CMake allows you to > > SET_SOURCE_FILES_PROPERTIES( ${swig_generated_file_fullname} >PROPERTIES COMPILE_FLAGS "-bla") > > So if the real fix for the octave header can be reduced to defining > and undefining a series of macro values with the -D and -U options, > then I suggest this is the way to go. > > (2) Alternatively, if the real fix demands a more complicated octave > header transformation than can be expressed as a series of > preprocessing #define and #undef commands, then I suggest a sed or perl > script is > the right way to go to transform the octave header before we use it. > > The problem with your present proposal (besides it being a workaround) > is that I am not sure how easy it is going to be to modify > swig-generated source code from the CMake level. The relevant CMake > logic appears to be > > # Set up swig + c wrapper. > swig_add_module(plplot_octave octave plplot_octave.i) > swig_link_libraries( >plplot_octave > > But I am virtually certain the first command sets up run-time > generation of the appropriate octave interface code AND the run-time > build of that code into a shared object, while the second simply > modifies how that build is linked. > > To interfere in that process and modify the code after it is generated > at run time but before it is built into a shared object may require a > special version of FindSWIG.cmake and/or UseSwig.cmake that we > maintain from now on. I would prefer to avoid that maintenance burden > if at all possible so I think transforming the octave header in one of > the two alternative ways I mentioned above would be a better way to > go (and also give us access to the real fix if that is known). > What plplot does and what swig also does on the whole is to explicitly mark any function which is to be exported with __attribute__ ( ( visibility( "default" ) ) ) on gcc version > 3. With -fvisibility=hidden then anything not explicitly exported is hidden. We do this through all the PLDLLxxx macros in pldll.h The same macros are defined differently to import / export functions with windows. This makes it easy to write code which will work on multiple systems. Octave also defines an OCTAVE_EXPORT macro in oct-dlldefs.h which does this job on windows, but is not defined at all on gcc. To my mind the best fix would be for octave to define OCTAVE_EXPORT as __attribute__ ( ( visibility( "default" ) ) ) on gcc. Unfortunately the definition of OCTAVE_EXPORT in oct-dlldefs.h is unconditional so there is no way to over-ride it with compiler flags. This rules out option (1) You could try to locate and massage oct-dlldefs.h automatically with cmake using a perl / sed scripti (option 2). The gcc -M option would find the absolute path of the include file, then use sed to replace the definition of OCTAVE_EXPORT. The following should do it. cat "#include " > test.c mkdir -p octave sed -e 's/^#define OCTAVE_EXPORT$/#define OCTAVE_EXPORT __attribute__ ( ( visibility( "default" ) ) )/' `gcc -M test.c |cut -d\ -f 3` > octave/oct-dlldefs.h You'd probably want to add some include path stuff to the gcc options in case the octave headers were in a non-standa
Re: [Plplot-devel] Ocaml bindings broken
On Wed, Sep 7, 2011 at 7:36 AM, Andrew Ross wrote: > > Hez, > > On both my Ubuntu boxes (different versions) the ocaml bindings are > currently broken. I get an error generation plplot.ml > > File "/home/andrew/software/plplot/build/bindings/ocaml/plplot.ml", line 1, > characters 0-1: > Error: The implementation > /home/andrew/software/plplot/build/bindings/ocaml/plplot.ml > does not match the interface plplot.cmi: > Andrew, I get working builds here from a clean checkout and build directory. Could you try from a completely fresh checkout of trunk? Hez -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] Octave status
On 2011-09-08 12:41+0100 Andrew Ross wrote: > On Wed, Sep 07, 2011 at 12:46:23PM -0700, Alan Irwin wrote: >> On 2011-09-06 11:52+0100 Andrew Ross wrote: >> >>> >>> I've committed a perl script to do this. It would be nicer to do it in >>> sed but I'm not sure how. The old octave bindings required perl anyway >>> so it is not an extra constraint. I have not yet modified CMakeFiles.txt >>> to actually call the script as I'm not sure how to do this neatly to >>> integrate with the cmake SWIG support. Alan, do you have any thoughts >>> on the best way to do this? >> >> Before commenting on that, I want to be sure I have the correct >> overview of what you are trying to do. My apologies in advance if you >> have already covered this overview in previous e-mails, but I have been >> distracted by non-PLplot development this summer so I have not been >> paying as close attention as usual. >> >> My understanding is >> >> #pragma GCC visibility push(default) >> >> is the same thing as a temporary use of -fvisibility=default for all >> the code until >> >> #pragma GCC visibility pop >> >> In other words this is just a workaround installed into the source >> code for some problem for gcc and Octave with -fvisibility=hidden. >> >> IIRC, you mentioned in previous e-mails that the issue occurred >> because of a problem for one of the octave headers we were using, but >> is the proposed fix for that case also a workaround like above, or is >> it a real fix? If there is a real fix, why can't we deploy that same >> fix ourselves rather than using a workaround? >> >> Assuming your answer to this overview question is we could deploy the >> real fix ourselves, then I suggest that you implement that. Here are two >> possible >> approaches I am thinking about that make sense from the CMake >> perspective. >> >> (1) From the man page, CMake allows you to >> >> SET_SOURCE_FILES_PROPERTIES( ${swig_generated_file_fullname} >>PROPERTIES COMPILE_FLAGS "-bla") >> >> So if the real fix for the octave header can be reduced to defining >> and undefining a series of macro values with the -D and -U options, >> then I suggest this is the way to go. >> >> (2) Alternatively, if the real fix demands a more complicated octave >> header transformation than can be expressed as a series of >> preprocessing #define and #undef commands, then I suggest a sed or perl >> script is >> the right way to go to transform the octave header before we use it. >> >> The problem with your present proposal (besides it being a workaround) >> is that I am not sure how easy it is going to be to modify >> swig-generated source code from the CMake level. The relevant CMake >> logic appears to be >> >> # Set up swig + c wrapper. >> swig_add_module(plplot_octave octave plplot_octave.i) >> swig_link_libraries( >>plplot_octave >> >> But I am virtually certain the first command sets up run-time >> generation of the appropriate octave interface code AND the run-time >> build of that code into a shared object, while the second simply >> modifies how that build is linked. >> >> To interfere in that process and modify the code after it is generated >> at run time but before it is built into a shared object may require a >> special version of FindSWIG.cmake and/or UseSwig.cmake that we >> maintain from now on. I would prefer to avoid that maintenance burden >> if at all possible so I think transforming the octave header in one of >> the two alternative ways I mentioned above would be a better way to >> go (and also give us access to the real fix if that is known). >> > > What plplot does and what swig also does on the whole is to explicitly > mark any function which is to be exported with > __attribute__ ( ( visibility( "default" ) ) ) > on gcc version > 3. With -fvisibility=hidden then anything not explicitly > exported is hidden. We do this through all the PLDLLxxx macros in pldll.h > The same macros are defined differently to import / export functions with > windows. This makes it easy to write code which will work on multiple > systems. > > Octave also defines an OCTAVE_EXPORT macro in oct-dlldefs.h which does > this job on windows, but is not defined at all on gcc. To my mind the > best fix would be for octave to define OCTAVE_EXPORT as > __attribute__ ( ( visibility( "default" ) ) ) > on gcc. Unfortunately the definition of OCTAVE_EXPORT in oct-dlldefs.h is > unconditional so there is no way to over-ride it with compiler flags. This > rules out option (1) I was thinking along the lines of #including the following header _before_ any other octave header #include #if !defined (_MSC_VER) #undef OCTAVE_EXPORT #define OCTAVE_EXPORT __attribute__ ( ( visibility( "default" ) ) ) #endif (I am oversimplifying here since we would want to check gcc version, etc., but I assume you have already thought of this idea so understand what I am driving at). But when I looked up build_dir/bindings/octave/plplot_octaveOCTAVE_wr
Re: [Plplot-devel] Octave status
On 2011-09-08 08:27-0700 Alan W. Irwin wrote: > I was thinking along the lines of #including the following header > _before_ any other octave header > > #include > #if !defined (_MSC_VER) > #undef OCTAVE_EXPORT > #define OCTAVE_EXPORT __attribute__ ( ( visibility( "default" ) ) ) > #endif > > (I am oversimplifying here since we would want to check gcc version, > etc., but I assume you have already thought of this idea so understand > what I am driving at). > > But when I looked up > build_dir/bindings/octave/plplot_octaveOCTAVE_wrap.cxx > it #included plplotP.h long after all the octave includes. > > Is there a swig directive to force our headers to be #defined > first? After sending off that question to the swig list, I realized there is a gcc option that will help us: -include FILE' Process FILE as if #include "file"' appeared as the first line of the primary source file. Won't that option (set up properly with CMake) serve our needs to #include the above header? 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 __ -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] PDL-Graphics-PLplot 0.56 and plplot 5.9.8
On 09/02/2011 04:59 PM, Doug Hunt wrote: > Hi Orion, all: I've just uploaded a new version of PDL-Graphics-PLplot to CPAN > (v 0.57) which incorporates some fixes recently merged in from the the PDL > source tree and also includes an improved plplot_library_tests.t. > > This test now compiles and runs the C sources > from the plplot examples directory and compares them to the perl equivalent > output instead of using canned C output for comparison. On Fedora, you need to link the C examples against -lm because the example code uses that library. Not sure the best way to add that to your scheme. -- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA/CoRA DivisionFAX: 303-415-9702 3380 Mitchell Lane or...@cora.nwra.com Boulder, CO 80301 http://www.cora.nwra.com -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] PDL-Graphics-PLplot 0.56 and plplot 5.9.8
OK, I'll add -lm by default--I don't think that will hurt anything. I also owe Sisyphus a window compile update. Regards, Doug dh...@ucar.edu Software Engineer UCAR - COSMIC, Tel. (303) 497-2611 On Thu, 8 Sep 2011, Orion Poplawski wrote: > On 09/02/2011 04:59 PM, Doug Hunt wrote: >> Hi Orion, all: I've just uploaded a new version of PDL-Graphics-PLplot to >> CPAN >> (v 0.57) which incorporates some fixes recently merged in from the the PDL >> source tree and also includes an improved plplot_library_tests.t. >> >> This test now compiles and runs the C sources >> from the plplot examples directory and compares them to the perl equivalent >> output instead of using canned C output for comparison. > > On Fedora, you need to link the C examples against -lm because the example > code uses that library. Not sure the best way to add that to your scheme. > > > -- > Orion Poplawski > Technical Manager 303-415-9701 x222 > NWRA/CoRA DivisionFAX: 303-415-9702 > 3380 Mitchell Lane or...@cora.nwra.com > Boulder, CO 80301 http://www.cora.nwra.com > -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] [Perldl] PDL-Graphics-PLplot 0.56 and plplot 5.9.8
Hi Orion: I just uploaded PDL-Graphics-PLplot version 0.59 to CPAN. This includes adding -lm and Sysiphus's Windows compile patch. Regards, Doug dh...@ucar.edu Software Engineer UCAR - COSMIC, Tel. (303) 497-2611 On Thu, 8 Sep 2011, Doug Hunt wrote: > OK, I'll add -lm by default--I don't think that will hurt anything. > > I also owe Sisyphus a window compile update. > > Regards, > > Doug > > dh...@ucar.edu > Software Engineer > UCAR - COSMIC, Tel. (303) 497-2611 > > On Thu, 8 Sep 2011, Orion Poplawski wrote: > >> On 09/02/2011 04:59 PM, Doug Hunt wrote: >>> Hi Orion, all: I've just uploaded a new version of PDL-Graphics-PLplot to >>> CPAN >>> (v 0.57) which incorporates some fixes recently merged in from the the PDL >>> source tree and also includes an improved plplot_library_tests.t. >>> >>> This test now compiles and runs the C sources >>> from the plplot examples directory and compares them to the perl >>> equivalent >>> output instead of using canned C output for comparison. >> >> On Fedora, you need to link the C examples against -lm because the example >> code uses that library. Not sure the best way to add that to your scheme. >> >> >> -- >> Orion Poplawski >> Technical Manager 303-415-9701 x222 >> NWRA/CoRA DivisionFAX: 303-415-9702 >> 3380 Mitchell Lane or...@cora.nwra.com >> Boulder, CO 80301 http://www.cora.nwra.com >> > > ___ > Perldl mailing list > per...@jach.hawaii.edu > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] [Swig-user] How to #include your own header before the #includes that swig generates? (fwd)
Hi Andrew: It looks like the %begin %{...%} swig directive is an even slicker answer than the -include FILE gcc option, see below. 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 __ -- Forwarded message -- Date: Thu, 8 Sep 2011 13:47:42 -0700 (PDT) From: Alan W. Irwin To: Stefan Zager Cc: swig-u...@lists.sourceforge.net Subject: Re: [Swig-user] How to #include your own header before the #includes that swig generates? On 2011-09-08 10:36-0700 Stefan Zager wrote: > This part of the documentation describes how to control where your > code gets injected into the output: > > http://www.swig.org/Doc2.0/SWIG.html#SWIG_nn40 > > Hope that helps. Thanks, Stefan. That helps a lot. We are still using swig-1.3.x, but the same useful code insertion documentation appears at http://www.swig.org/Doc2.0/SWIG.html#SWIG_nn40 To be specific it appears %{ #include "our_header.h" %} will put that #include in the header block (since %{...%} is shorthand for %header %{...%}). That was too late a position in the code, but apparently earlier possibilities for code insertion are available as well with, e.g., %begin %{ #include "our_header.h" %} Note I haven't yet had a chance to try this, but from the documentation it should be perfect for our needs. 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 __ -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] [Perldl] PDL-Graphics-PLplot 0.56 and plplot 5.9.8
On 09/08/2011 01:25 PM, Doug Hunt wrote: > Hi Orion: I just uploaded PDL-Graphics-PLplot version 0.59 to CPAN. This > includes adding -lm and Sysiphus's Windows compile patch. Thanks, that gets farther. Next step is that you are assuming that "." in in the user's path, which is not always the case. The below patch fixes. --- PDL-Graphics-PLplot-0.59/t/plplot_library_tests.t.path 2011-09-08 13:04:57.0 -0600 +++ PDL-Graphics-PLplot-0.59/t/plplot_library_tests.t 2011-09-08 14:51:05.584271634 -0600 @@ -50,7 +50,7 @@ # Run C version my $devnull = File::Spec->devnull(); - system "a.out -dev svg -o x${num}c.svg -fam > $devnull 2>&1"; + system "./a.out -dev svg -o x${num}c.svg -fam > $devnull 2>&1"; ok ($? == 0, "C code $c_code ran successfully"); # Run perl version With that change the tests pass for me. -- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA/CoRA DivisionFAX: 303-415-9702 3380 Mitchell Lane or...@cora.nwra.com Boulder, CO 80301 http://www.cora.nwra.com -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] [Perldl] PDL-Graphics-PLplot 0.56 and plplot 5.9.8
OK! PDL-Graphics-PLplot 0.60 now includes ./a.out --Doug dh...@ucar.edu Software Engineer UCAR - COSMIC, Tel. (303) 497-2611 On Thu, 8 Sep 2011, Orion Poplawski wrote: > On 09/08/2011 01:25 PM, Doug Hunt wrote: >> Hi Orion: I just uploaded PDL-Graphics-PLplot version 0.59 to CPAN. This >> includes adding -lm and Sysiphus's Windows compile patch. > > Thanks, that gets farther. Next step is that you are assuming that "." in in > the user's path, which is not always the case. The below patch fixes. > > --- PDL-Graphics-PLplot-0.59/t/plplot_library_tests.t.path 2011-09-08 > 13:04:57.0 -0600 > +++ PDL-Graphics-PLplot-0.59/t/plplot_library_tests.t 2011-09-08 > 14:51:05.584271634 -0600 > @@ -50,7 +50,7 @@ > > # Run C version > my $devnull = File::Spec->devnull(); > - system "a.out -dev svg -o x${num}c.svg -fam > $devnull 2>&1"; > + system "./a.out -dev svg -o x${num}c.svg -fam > $devnull 2>&1"; > ok ($? == 0, "C code $c_code ran successfully"); > > # Run perl version > > > With that change the tests pass for me. > > -- > Orion Poplawski > Technical Manager 303-415-9701 x222 > NWRA/CoRA DivisionFAX: 303-415-9702 > 3380 Mitchell Lane or...@cora.nwra.com > Boulder, CO 80301 http://www.cora.nwra.com > -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] PDL-Graphics-PLplot 0.56 and plplot 5.9.8
On 2011-09-08 11:46-0600 Doug Hunt wrote: > OK, I'll add -lm by default--I don't think that will hurt anything. Hi Doug: With the PLplot cross-platform build system we specifically exclude -lm for the Windows case because (as I understand it) Windows does not have a separate math library. So my guess is -lm could be an issue for your Windows users. Ignore this comment if PDL-Graphics-PLplot is meant to work only on Unix platforms. 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 __ -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel