Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Arjen Markus
Alan W. Irwin wrote:

 On 2008-10-08 11:31+0200 Robert Pollak wrote:

 Hi Alan, Arjen,

 Alan wrote:

 Robert, what happens if you add

 #define PLDLLEXPORT
 #define PLDLLIMPORT

 to the #else stanza above?  I predict that will fix your problem with
 the -DBUILD_SHARED_LIBS=OFF case.


 Yes, this fixes the problem in this case (besides some macro
 redefinition warnings).


 I have made the change (also for lib/csa/csaldd.h and lib/nn/nnldd.h) 
 as of
 revision 8864.

 Arjen, could you please implement a more elegant way to do this to get 
 rid
 of all the extra compilation warnings due to the macro redefinitions 
 in the
 present implementation?

Hi Alan,

sure, I should have time this evening - in the worst case, a #undef should
do the trick.

Regards,

Arjen

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Robert Pollak
Alan W. Irwin wrote:
 On 2008-10-08 12:56+0200 Robert Pollak wrote:

 D:\project\PLPlot\drivers\svg.c(341) : error C2143: syntax error :
 missing ';' before 'type'

 This is fixed by simply removing the unused int i; line.
 Can someone please commit this change?

 I have no idea why that declaration was offending your compiler.

Neither do I. But frankly I don't care since the question is now moot.

--Robert


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Werner Smekal
Hi,

sorry, that I (again) kick in late in this discussion, but this change  
was not the right solution. Actually, the macros PLDLLEXPORT/ 
PLDLLIMPORT are not to be used outside pldll.h. Only PLDLLIMPEXP  
should be used in headers and source. This was correctly done for the  
plplot core source, but not for the driver sources. So I changed now  
all PLDLLEXPORT macros to PLDLLIMPEXP and ask anybody if he needs to  
use this macros only to use PLDLLIMPEXP or NNDLLIMPEXP ...

Will commit that soon.

Regards,
Werner

On 08.10.2008, at 20:16, Alan W. Irwin wrote:

 On 2008-10-08 11:31+0200 Robert Pollak wrote:

 Hi Alan, Arjen,

 Alan wrote:
 Robert, what happens if you add

#define PLDLLEXPORT
#define PLDLLIMPORT

 to the #else stanza above?  I predict that will fix your problem  
 with
 the -DBUILD_SHARED_LIBS=OFF case.

 Yes, this fixes the problem in this case (besides some macro
 redefinition warnings).

 I have made the change (also for lib/csa/csaldd.h and lib/nn/ 
 nnldd.h) as of
 revision 8864.

 Arjen, could you please implement a more elegant way to do this to  
 get rid
 of all the extra compilation warnings due to the macro redefinitions  
 in the
 present implementation?

 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); PLplot scientific plotting  
 software
 package (plplot.org); 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
 __

 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's  
 challenge
 Build the coolest Linux based applications with Moblin SDK  win  
 great prizes
 Grand prize is a trip for two to an Open Source event anywhere in  
 the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel

--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Robert Pollak
Alan W. Irwin wrote:

 Could you also confirm you are using ENABLE_DYNDRIVERS=OFF?  (I think
 that result will happen by default since libltdl is not readily
 available on Windows.  You should get a WARNING message from cmake
 about that.)

Yes, In the static build cmake says
WARNING: Shared libraries not built. Setting ENABLE_DYNDRIVERS OFF.
, in the shared build it says
WARNING: libltdl library not found. Setting ENABLE_DYNDRIVERS OFF.
.


 On 2008-10-08 11:31+0200 Robert Pollak wrote:
 
 A build with BUILD_SHARED_LIBS=ON gets problems at the same
 location (in unmodified rev8861):
 
 What happens for revision 8864 for the BUILD_SHARED_LIBS=ON case?

Everything builds and the examples run. (I only tested some with svg.)

(Btw, the library names do not differ between Debug and Release build:
plplotd.*, plplotcxxd.*, csirocsa.*. So the d ending is misleading.)


 [...]Further investigation shows that MAKINGPLDLL is not defined
 when compiling hpgl.c.

 For the ENABLE_DYNDRIVERS=OFF case, the drivers are built as part of
 the source for libplplotd and MAKINGPLDLL should be defined for that
 library build (see src/CMakeLists.txt).  Thus, I am puzzled how you
 got the above result with MAKINGPLDLL not defined.

I still see MAKINGPLDLL and USINGPLDLL undefined in hpgl.c (with the
following patch), but this seems to be ok, since the examples run.
(Isn't devel/CMakeLists.txt the responsible file? But all of it is in an
if(ENABLE_DYNDRIVERS) block.)

= begin patch 
Index: D:/project/PLPlot/drivers/hpgl.c
===
--- D:/project/PLPlot/drivers/hpgl.c(revision 8864)
+++ D:/project/PLPlot/drivers/hpgl.c(working copy)
@@ -36,6 +36,14 @@
 #include string.h
 #include drivers.h

+#ifndef MAKINGPLDLL
+  #pragma message (MAKINGPLDLL undefined)
+#endif
+
+#ifndef USINGPLDLL
+  #pragma message (USINGPLDLL undefined)
+#endif
+
 /* Device info */
 PLDLLEXPORT const char* plD_DEVICE_INFO_hpgl =
 #if defined(PLD_hp7470)
= end patch ==

 Thanks, again, Robert, for your bug reports.
Well, let _me_ thank you for your support!

-- Robert

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Alan W. Irwin
Hi Robert:

Two points of information for you below.

 (Btw, the library names do not differ between Debug and Release build:
 plplotd.*, plplotcxxd.*, csirocsa.*. So the d ending is misleading.)

For PLplot, the d stands for the double-precision version.  You can build
a single-precision version of libplplotot (as opposed to libplplotd) by using
the -DPL_DOUBLE=OFF option.  However, that option is not as well tested as
the default double precision.



 [...]Further investigation shows that MAKINGPLDLL is not defined
 when compiling hpgl.c.

 For the ENABLE_DYNDRIVERS=OFF case, the drivers are built as part of
 the source for libplplotd and MAKINGPLDLL should be defined for that
 library build (see src/CMakeLists.txt).  Thus, I am puzzled how you
 got the above result with MAKINGPLDLL not defined.

 I still see MAKINGPLDLL and USINGPLDLL undefined in hpgl.c (with the
 following patch), but this seems to be ok, since the examples run.
 (Isn't devel/CMakeLists.txt the responsible file? But all of it is in an
 if(ENABLE_DYNDRIVERS) block.)

Exactly.  For ENABLE_DYNDRIVERS=OFF src/CMakeLists.txt is in charge of the
compilation of the drivers into the principle PLplot library, libplplotd.
When I designed that way of doing things, CMake limited variable scope by
not allowing variables set in (say) drivers/CMakeLists.txt to be accessible
from src/CMakeLists.txt.  But now there is a way of communicating CMake
variables between the two subdirectories so after we bump our CMake minimum
version from 2.4.5 to 2.6.x, I may rewrite that CMake logic to handle the
ENABLE_DYNDRIVERS=OFF case by collecting variables (such as a source list)
in drivers/CMakeLists.txt which are then used for the actual libplplotd
build in src/CMakeLists.txt.

 Well, let _me_ thank you for your support!

You are welcome.

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); PLplot scientific plotting software
package (plplot.org); 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
__

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Alan W. Irwin
On 2008-10-09 16:42+0200 Werner Smekal wrote:

 Hi,

 sorry, that I (again) kick in late in this discussion, but this change was 
 not the right solution. Actually, the macros PLDLLEXPORT/PLDLLIMPORT are not 
 to be used outside pldll.h. Only PLDLLIMPEXP should be used in headers and 
 source. This was correctly done for the plplot core source, but not for the 
 driver sources. So I changed now all PLDLLEXPORT macros to PLDLLIMPEXP and 
 ask anybody if he needs to use this macros only to use PLDLLIMPEXP or 
 NNDLLIMPEXP ...

 Will commit that soon.

Thanks, Werner, for looking deeper into this issue and solving the problem
at a more fundamental level.

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); PLplot scientific plotting software
package (plplot.org); 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
__

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Andrew Ross
On Thu, Oct 09, 2008 at 08:44:34AM -0700, Alan Irwin wrote:
 On 2008-10-09 16:42+0200 Werner Smekal wrote:
 
  Hi,
 
  sorry, that I (again) kick in late in this discussion, but this change was 
  not the right solution. Actually, the macros PLDLLEXPORT/PLDLLIMPORT are 
  not 
  to be used outside pldll.h. Only PLDLLIMPEXP should be used in headers and 
  source. This was correctly done for the plplot core source, but not for the 
  driver sources. So I changed now all PLDLLEXPORT macros to PLDLLIMPEXP and 
  ask anybody if he needs to use this macros only to use PLDLLIMPEXP or 
  NNDLLIMPEXP ...
 
  Will commit that soon.
 
 Thanks, Werner, for looking deeper into this issue and solving the problem
 at a more fundamental level.

This may not be quite the right long term solution. Language bindings
for example might be importing some symbols from the core library and
exporting others to the user. Similarly for drivers. 

I'm not quite sure why things work at the moment. I suspect it is
because the import is optional. We should probably try to fix this
though to make it really clear whether we are importing or exporting. 

I did this for the drivers - they use PLDLLEXPORT in the source because 
they only every export symbols to the core library. The imports are
defined elsewhere. 

Andrew

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Werner Smekal
Hi Andrew,


 This may not be quite the right long term solution. Language bindings
 for example might be importing some symbols from the core library and
 exporting others to the user. Similarly for drivers.

Sure. Ok, I rephrase: this is the correct solution as it was initially 
considered, but since plplot is a little more complicated, we need to 
adjust that (in the long term).
 
 I'm not quite sure why things work at the moment. I suspect it is
 because the import is optional. We should probably try to fix this
 though to make it really clear whether we are importing or exporting. 
 
 I did this for the drivers - they use PLDLLEXPORT in the source because 
 they only every export symbols to the core library. The imports are
 defined elsewhere. 

This is something, what should be decided by the cmake and not by the 
source/headers files. So if xxxMAKINGDLL is defined, xxxIMPEXP is 
defined to export symbols, if USINGDLL is defined, xxxIMPEXP is defined 
to import symbols. For the core library its easy, we always export 
(still we should use DLLIMPEXP). For the examples it's also easy we 
always import. For the bindings, it's more complicated since we export 
symbols, but also import symbols from the core. Drivers are also a 
different story.

I suggest that we use the macro cmake defines at compile time for shared 
libraries. if you run make VERBOSE=1 for the shared libraries you will 
see that a macro like -Dplplotd_EXPORT is defined. So we always know, 
what is built in the moment, and set DLLEXPIMP to export. I hope that 
this will also be set for the drivers. We then don't have to worry about 
defining MAKINGDLL at the correct time.

This is something we have to investigate further.

Regards,
Werner

-- 
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
+43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Andrew Ross
On Thu, Oct 09, 2008 at 09:09:47PM +0200, Werner Smekal wrote:
 Hi Andrew,
 
 
  This may not be quite the right long term solution. Language bindings
  for example might be importing some symbols from the core library and
  exporting others to the user. Similarly for drivers.
 
 Sure. Ok, I rephrase: this is the correct solution as it was initially 
 considered, but since plplot is a little more complicated, we need to 
 adjust that (in the long term).
  
  I'm not quite sure why things work at the moment. I suspect it is
  because the import is optional. We should probably try to fix this
  though to make it really clear whether we are importing or exporting. 
  
  I did this for the drivers - they use PLDLLEXPORT in the source because 
  they only every export symbols to the core library. The imports are
  defined elsewhere. 
 
 This is something, what should be decided by the cmake and not by the 
 source/headers files. So if xxxMAKINGDLL is defined, xxxIMPEXP is 
 defined to export symbols, if USINGDLL is defined, xxxIMPEXP is defined 
 to import symbols. For the core library its easy, we always export 
 (still we should use DLLIMPEXP). For the examples it's also easy we 
 always import. For the bindings, it's more complicated since we export 
 symbols, but also import symbols from the core. Drivers are also a 
 different story.
 
 I suggest that we use the macro cmake defines at compile time for shared 
 libraries. if you run make VERBOSE=1 for the shared libraries you will 
 see that a macro like -Dplplotd_EXPORT is defined. So we always know, 
 what is built in the moment, and set DLLEXPIMP to export. I hope that 
 this will also be set for the drivers. We then don't have to worry about 
 defining MAKINGDLL at the correct time.
 
 This is something we have to investigate further.

It's not quite a cmake issue since we need xxxMAKINGDLL for the driver 
source file and xxxUSINGDLL for the core header files included by the 
source file. At the moment these are mutually exclusive so we can't do 
it with just cmake options. It will require some source code changes 
as well, or a change to the way we use the defines. So far as I can see
we only need DLLEXPIMP for the header files which are used both for
making the library and using it. 

Andrew


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Alan W. Irwin
On 2008-10-09 20:39+0100 Andrew Ross wrote:

 It's not quite a cmake issue since we need xxxMAKINGDLL for the driver
 source file and xxxUSINGDLL for the core header files included by the
 source file. At the moment these are mutually exclusive so we can't do
 it with just cmake options. It will require some source code changes
 as well, or a change to the way we use the defines. So far as I can see
 we only need DLLEXPIMP for the header files which are used both for
 making the library and using it.

Andrew, could you please explain further?  I thought the whole point of
DLLEXPIMP was to mean one thing if xxxMAKINGDLL was set by CMake (e.g., in
src/CMakeLists.txt to build libplplot), and another if xxxUSINGDLL was set
by CMake, e.g., in drivers/CMakeLists.txt when building dynamic devices. So
I thought all was well for the dynamic drivers case as changed recently by
Werner.  It appears from your comment that you have spotted some flaw in
that approach.  What am I missing?  Or are you happy with the current
dynamic devices build and thinking about some other build issue?

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); PLplot scientific plotting software
package (plplot.org); 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
__

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-09 Thread Andrew Ross
On Thu, Oct 09, 2008 at 03:17:40PM -0700, Alan Irwin wrote:
 On 2008-10-09 20:39+0100 Andrew Ross wrote:
 
  It's not quite a cmake issue since we need xxxMAKINGDLL for the driver
  source file and xxxUSINGDLL for the core header files included by the
  source file. At the moment these are mutually exclusive so we can't do
  it with just cmake options. It will require some source code changes
  as well, or a change to the way we use the defines. So far as I can see
  we only need DLLEXPIMP for the header files which are used both for
  making the library and using it.
 
 Andrew, could you please explain further?  I thought the whole point of
 DLLEXPIMP was to mean one thing if xxxMAKINGDLL was set by CMake (e.g., in
 src/CMakeLists.txt to build libplplot), and another if xxxUSINGDLL was set
 by CMake, e.g., in drivers/CMakeLists.txt when building dynamic devices. So
 I thought all was well for the dynamic drivers case as changed recently by
 Werner.  It appears from your comment that you have spotted some flaw in
 that approach.  What am I missing?  Or are you happy with the current
 dynamic devices build and thinking about some other build issue?

It is. Setting xxxUSINGDLL for the drivers ensures that all the 
symbols from the core library defined in plplot.h etc are imported into
the driver. This is ok. However, there are some symbols in the driver
files which are exported to the core library (mostly the dispatch_init
function and DEVICE INFO structure. I think these would need
xxxMAKINGDLL defined. Or am I missing something here?

Andrew

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-08 Thread Arjen Markus
Alan W. Irwin wrote:

 Hi Robert:

 Thanks for your report for revision 8861, the latest svn trunk version
 of PLplot.

 Arjen, I have a question for you below.

 On 2008-10-07 17:40+0200 Robert Pollak wrote:


 [...]

 cmake -G NMake Makefiles ^
   -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
   -DCMAKE_INSTALL_PREFIX=install ^
   -DBUILD_SHARED_LIBS=OFF ^
   -DCMAKE_VERBOSE_MAKEFILE=ON ^
   -DBUILD_TEST=ON ^

 ..
 [...]

 This runs up to the following compile error:


 cl   /DWIN32 /D_WINDOWS /W3 /Zm1000 /D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1
 -ID:\project\PLPlot\include -ID:\project\PLPlot\build-vc9-static-Debug
 -ID:\project\PLPlot\build-vc9-static-Debug\include -DHAVE_CONFIG_H
 -D_CRT_SECURE_NO_DEPRECATE /FoCMakeFiles\plplotd.dir\__\drivers\hpgl.obj
 /FdD:\project\PLPlot\build-vc9-static-Debug\src\plplotd.pdb -c
 D:\project\PLPlot\drivers\hpgl.c

 [...]hpgl.c
 D:\project\PLPlot\drivers\hpgl.c(141) : error C2375:
 'plD_dispatch_init_hp7470': redefinition; different linkage
D:\project\PLPlot\include\drivers.h(73) : see declaration of
 'plD_dispatch_init_hp7470'


 When I switch off one affected driver after the other (as with
 -DPLD_hp7470=OFF), I see the error appearing in a lot of drivers.


 Arjen, you are the PLplot expert in this area so this question is
 directed to you:

 The two lines in question are

 drivers/hpgl.c, line 140

 PLDLLEXPORT void plD_dispatch_init_hp7470( PLDispatchTable *pdt )

 and

 include/drivers.h, line 73

 PLDLLIMPEXP void plD_dispatch_init_hp7470   ( PLDispatchTable *pdt );

 So I believe this user found a combination of flags that set PLDLLIMPEXP
 different from PLDLLEXPORT.

 The relevant logic is in include/pldll.h

 #if defined(MAKINGPLDLL)
   #define PLDLLIMPEXP PLDLLEXPORT
   #define PLDLLIMPEXP_DATA(type) PLDLLEXPORT type
 #elif defined(USINGPLDLL)
   #define PLDLLIMPEXP PLDLLIMPORT
   #define PLDLLIMPEXP_DATA(type) PLDLLIMPORT type
 #else
   #define PLDLLIMPEXP
   #define PLDLLIMPEXP_DATA(type) type
 #endif

 I think the key to this issue is this user specified the cmake option
 -DBUILD_SHARED_LIBS=OFF which means MAKINGPLDLL is not defined, in which
 case PLDLLIMPEXP is defined to nothing, but PLDLLEXPORT is still defined
 to something (by the Windows stanzas earlier in include/pldll.h).

 Robert, what happens if you add

 #define PLDLLEXPORT
 #define PLDLLIMPORT

 to the #else stanza above?  I predict that will fix your problem with
 the -DBUILD_SHARED_LIBS=OFF case.

 Arjen, if you agree that is no-brainer fix, please make the commit.  
 (I feel
 intimidated from doing that myself because I have no access to windows
 boxes to even make a superficial test of the change.)

Hi Alan, Robert,

that would indeed seem to be the right thing to do. Mind you, the 
static-library
option (BUILD_SHARED_LIBS=OFF) is a not too well tested configuration
option. You may run into other problems later on, but at least this one 
should
work.

I will make the commit asap, if Robert can confirm that this indeed 
works and
there are no further glitches down the line. Otherwise I will have to 
investigate ;).

Regards,

Arjen



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-08 Thread Arjen Markus

Robert Pollak wrote:


Arjen Markus wrote:
 


Does this mean you can now properly build static libraries?
   



Yes, I can build them with the mentioned svg.c change and with Alan's:

Index: include/pldll.h
===
--- include/pldll.h (revision 8861)
+++ include/pldll.h (working copy)
@@ -37,6 +37,8 @@
  #define PLDLLIMPEXP PLDLLIMPORT
  #define PLDLLIMPEXP_DATA(type) PLDLLIMPORT type
#else
+  #define PLDLLEXPORT
+  #define PLDLLIMPORT
  #define PLDLLIMPEXP
  #define PLDLLIMPEXP_DATA(type) type
#endif

The C and C++ examples work fine.

-- Robert

 


Great, I suspect there won't be much issues left for the other languages,
but we need to check of course.

Regards,

Arjen
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-08 Thread Robert Pollak
Hi Alan, Arjen,

Alan wrote:
 Robert, what happens if you add

 #define PLDLLEXPORT
 #define PLDLLIMPORT

 to the #else stanza above?  I predict that will fix your problem with
 the -DBUILD_SHARED_LIBS=OFF case.

Yes, this fixes the problem in this case (besides some macro
redefinition warnings).

(
Unfortunately, it makes another compile error in svg.c visible:

D:\project\PLPlot\drivers\svg.c(341) : error C2143: syntax error :
missing ';' before 'type'

I'll take a look at that.
)


 I think the key to this issue is this user specified the cmake option
 -DBUILD_SHARED_LIBS=OFF [...]

A build with BUILD_SHARED_LIBS=ON gets problems at the same location (in
unmodified rev8861):

cl   -Dplplotd_EXPORTS  /DWIN32 /D_WINDOWS /W3 /Zm1000 /D_DEBUG /MDd /Zi
 /Ob0 /Od /RTC1 -ID:\project\PLPlot\include
-ID:\project\PLPlot\build-vc9-shared-Debug
-ID:\project\PLPlot\build-vc9-shared-Debug\include -DHAVE_CONFIG_H
-D_CRT_SECURE_NO_DEPRECATE /FoCMakeFiles\plplotd.dir\__\drivers\hpgl.obj
/FdD:\project\PLPlot
\build-vc9-shared-Debug\dll\plplotd.pdb -c D:\project\PLPlot\drivers\hpgl.c

hpgl.c
D:\project\PLPlot\drivers\hpgl.c(141) : error C2375:
'plD_dispatch_init_hp7470': redefinition; different linkage
D:\project\PLPlot\include\drivers.h(73) : see declaration of
'plD_dispatch_init_hp7470'


Adding the snippet

#define STRINGIZE2(x) #x
#define STRINGIZE(x) STRINGIZE2(x)
#pragma message (PLDLLEXPORT STRINGIZE(: PLDLLEXPORT))
#pragma message (PLDLLIMPEXP STRINGIZE(: PLDLLIMPEXP))

to hpgl.c (in otherwise unmodified rev8861) shows that for
BUILD_SHARED_LIBS=ON PLDLLEXPORT expands to __declspec(dllexport), but
PLDLLIMPEXP stays empty.

Further investigation shows that MAKINGPLDLL is not defined when
compiling hpgl.c.

-- Robert

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-08 Thread Alan W. Irwin
On 2008-10-08 12:56+0200 Robert Pollak wrote:

 Hi,

 I wrote:
 Unfortunately, it makes another compile error in svg.c visible:

 D:\project\PLPlot\drivers\svg.c(341) : error C2143: syntax error :
 missing ';' before 'type'

 This is fixed by simply removing the unused int i; line.
 Can someone please commit this change?

I have no idea why that declaration was offending your compiler.  For
example, I checked with od (octal dump) there was no non-printing characters
in there. Perhaps it was the extra blank characters between the int and
i?  That question aside, as you say, the i variable is not used after it
was declared so I removed the declaration. (revision 8863).

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); PLplot scientific plotting software
package (plplot.org); 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
__

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cannot compile drivers with Visual Studio 2008 (msvc9)

2008-10-08 Thread Alan W. Irwin
Hi Robert:

On 2008-10-08 11:31+0200 Robert Pollak wrote:

 A build with BUILD_SHARED_LIBS=ON gets problems at the same location (in
 unmodified rev8861):

What happens for revision 8864 for the BUILD_SHARED_LIBS=ON case?  Could you
also confirm you are using ENABLE_DYNDRIVERS=OFF?  (I think that result will
happen by default since libltdl is not readily available on Windows.  You
should get a WARNING message from cmake about that.)

 [...]Further investigation shows that MAKINGPLDLL is not defined when
 compiling hpgl.c.

For the ENABLE_DYNDRIVERS=ON case, USINGPLDLL is set (see lines 66 and 72 of
drivers/CMakeLists.txt) which is the obviously correct thing to do in that
case where the drivers are compiled as separate plug-ins that are dynamically
loaded by libplplotd.

For the ENABLE_DYNDRIVERS=OFF case, the drivers are built as part of the
source for libplplotd and MAKINGPLDLL should be defined for that library
build (see src/CMakeLists.txt).  Thus, I am puzzled how you got the above
result with MAKINGPLDLL not defined.

Thanks, again, Robert, for your bug reports.  They should be most helpful in
getting this import/export logic straightened out for your particular
platform and chosen build options.

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); PLplot scientific plotting software
package (plplot.org); 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
__

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel