Steven,

Thank you for your help. I used the make in Netbeans to create the
executable, then I exited from Netbeans, and put the dll's from the PLplot
sourceforge download into the same directory as the executable. Opening a
cmd window I was then able to run the executable by just typing the name of
the programme. The menu window came up for the type of plot, then the plot
example was displayed, so no problems there. 

However, when I try running the program using Netbeans 'configuration'
either 'debug' or release, the only way I can get the program to display the
menu is to run the debugger (button to the right of the green arrow). If I
just run the program (green arrow) then it just hangs and does not display
the menu. When I try running this same program under Linux from Netbeans,
then it runs properly, ie displays the menu, then the graph. I conclude
therefore that it is some quirk associated with Netbeans on Windows. 

A response from the Netbeans forum on this last issues suggested that no
window appears because Netbeans thinks there is already a window open, which
of course there is not. So I'll probe further to solve this.

Many thanks,
Neil 

-----Original Message-----
From: Schwartz, Steven J [mailto:[email protected]] 
Sent: 01 April 2014 15:05
To: neil; [email protected]
Subject: Re: PLplot running in Netbeans IDE on 64-bit Windows

Neil et al.

I had replied to your followup-query on this topic, but I see that my
message bounced from our mailserver because I sent you a batch script. So
here's a re-work of that email, and a zip file of the original attachments.
I also copy the text from that message, as I composed this one before I
realized the first bounced.
 
My program runs fine in the netbeans external console (which I think is an
ordinary windows cmd console). I'd try to get this working with a simple
hello world program. Note: I understand the difference between the netbeans
run button (green arrow) and the debugger, and I use the run button. It then
pops open a console , in which I get the standard plplot list of devices
from which to choose. The wingcc one works fine for me.


So firstly I'd write a hello world netbeans project and get that to run via
an external console.

Secondly, I think most problems are path-related. If you can get the plplot
examples to compile and run from a mingw console and build via the plplot
prescription in the plplot examples directory, your next action should be to
copy the source to one of your own directories and get it to build via a
simple makefile. I attach again an edit copy of x00c (edited to pick up the
generic plplot headers) and makefile. If the plplot dll and driversd
directories are in your PATH this should produce an executable that runs in
your mingw console.

Now you need to gte this to run in a windows cmd console. This requires
either that you put the plplot dll and driversd directories in your windows
PATH or that you run it from a batch script that sets up the necessary path.
I give an example of such a bat script.

Next you need to get netbeans to do this. I was unsuccessful in setting
environment variable within netbeans so I changed the Run Command there to
be my batch script.


If netbeans points to the same mingw installation you use from a mingw
console then I don't see why a 32bit installation shouldn't work fine. 

Finally if all the above doesn't result in success for you then you need to
give others more detail about what you've done (eg with real example files),
what messages you get from the console or windows popup error box, etc. 

And finally finally , hitting reply all to a message from the sourceforge
plplot list should send your message to that list (you obviously succeeded
in sending a message once).

I'm afraid I think I've now run out of ideas and expertise.

Good luck
Steve

Previous attempt and your query:
-----------------------------------------

Hi Neil,

First a health warning: I am neither a netbeans expert nor a mingw one.

Secondly, it might be easier if you gave a bit more information about what
you are doing exactly, what console messages you get, etc.

I have managed to get a simple build of plplot x00c.c building and running
both from a mingw console and from within netbeans. I attach

a) a version of x00c.c that has the #includes changed from plcdemos.h to the
plplot generic includes plConfig.h and plplot.h

b) a Makefile to build it

c) a batch file to run it from a windows cmd console instead of from a mingw
command line. Double clicking on the .bat file from Windows Explorer also
works fine. 

Put these in a folder on its own and then follow my logic/actions below.

For your info I run 

netbeans 7.4
Mingw x86_64-mingw32  (which is the 64-bit version) - gcc 4.7.2) a matching
msys build (from mingwbuilds) plplot 5.9.9 windows 7 64-bit computer. 

I don't really think any of the above are particularly critical as along as
they are consistent, i.e., built with roughly the same version of gcc. Most
of the problems are in getting the PATH set up properly, both in the build
stages and also at runtime.

> Well in Netbeans under File, Project Properties, Run you can set the 
> Console Type to External Terminal. However, this only works when you 
> run the debugger, I'm trying to find out how to run it just normally.

This is NOT my experience. In fact, I can't run anything in the netbeans
"internal console" so I select the external one, which runs in a standard
windows cmd console.as far as I can tell.

Msys/Mingw build
============
1  ensure the plplot dll's and driversd are in your PATH. My .profile has:

export PATH=<plplot install dir>/bin:${PATH} export PATH=<plplot install
dir>/lib/plplot5.9.9/driversd:${PATH}

where you need to put the path to the plplot install directory instead of
the <...>. It would be tidier to define an environment variable
PLPLOT_INSTALL_DIR and then use ${PLPLOT_INSTALL_DIR} in the above.

2  Edit the Makefile likewise to point to your plplot installation.
Actually, if you defined a shell environment variable as I suggest above you
could rely on that in the Makefile.

3  make

4  x00

This will pop open a console, give you a list of plplot devices, etc.

Netbeans
======
This caused me more grief, because I couldn't figure out how to convince
netbeans to search the relevant libraries nor get sense out of its console
messages. I tried adding the PATH specification to the Environment Variables
in Project Properties -> Run, but that didn't work. I also tried invoking a
"set" command in the "Run command", e.g.,

set PATH=... & ${OUTPUT_PATH}

but that didn't help. In the end, I wrote the attached batch script to set
the environment variables and then execute x00 and put that x00.bat as the
"Run Command". This works fine for me and again throws up a console querying
which device I want to use.

You could add the plplot libs and driversd permanently to your Windows PATH
environment, but I tend not to do it because I have easier control this way,
and try alternate versions without constantly changing the windows PATH,
etc.

> Just another question, do you use Mingw or Mingw-w64? I'm on a 64-bit 
> Windows 7 OS, and until now I've used Mingw successfully, which I 
> believe has a 32bit compiler, and have the bin directory set in PATH.
> I'm just wondering if moving to Mingw-w64 might make this run better for
PLplot.
> Could Mingw and Mingw-w64 work together, or would I have to uninstall 
> Mingw, to get Mingw-w64 working properly?

I doubt this is the source of whatever problems you're having as long as
your build of plplot was made using the same toolchain. I think it's
perfectly ok to have more than one version of mingw (I have two different
vintages sitting on my machine, one based on gcc 4.4.0 and a second with
4.7.2. I use the latter and have my paths set accordingly. I didn't install
these, nor msys, using an automated installation, but simply unpacked them
from mingwbuilds (which you can find under the mingw-w64 sourceforge pages
as "personal builds". I do this to fetch their matching Qt builds.

HTH as I'm running off the end of my expertise.

Best wishes
Steve

--------------------------------------------------------------------
Steven J Schwartz                  Phone:  +44 (0)207 594 7660
Professor of Space Physics         Fax:    +44 (0)207 594 7772
Director, Imperial Space Lab       www.imperial.ac.uk/spacelab
The Blackett Laboratory            Email:  [email protected]
Imperial College London            Office: Huxley 6M67A
London SW7 2AZ, UK                 Web:    www.sp.ph.ic.ac.uk/~sjs
--------------------------------------------------------------------



------------------------------------------------------------------------------
_______________________________________________
Plplot-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to