|Message: Re: Using Geant4 libraries in Eclipse||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I've been able to use Eclipse for Geant4 work, although it perhaps doesn't use the full capabilities of Eclipse (more experienced Eclipse users may want to comment here). It's also Linux-specific, although it should be possible to adapt the method to Windows. What I did was the following:
1) Create a new Standard Make C++ project in your chosen workspace.
2) In the project, create subdirectories include and src, as per a 'standard' Geant4 project.
3) Create a 'standard' Geant4 makefile for the project as per the examples.
4) Create a shell script in the top level project directory called, say, g4eclipsemake, which contains:
#!/bin/sh source <path to your g4 installation or env scripts>/env.sh G4WORKDIR=`pwd` gmake $1
The change in workdir is optional - I just do that to keep everything together
5) in Project->Properties, go to C/C++ Make Project, and change the build command to
(or whatever you named the script) I -think- that's all I did here.
6) You can now try building - hopefully everything works :).
7) To run the application, I used a similar process, create a shell script in the top level project directory called, say, g4eclipserun, containing
#!/bin/sh source <path to your g4 installation or env scripts>/env.sh G4WORKDIR=`pwd` $G4WORKDIR/bin/$G4SYSTEM/<name of your project executable>
As above, the change in workdir is optional.
8) In Run->Run, choose C/C++ Local Application, and in the Main tab change the the C/C++ Application to
(or whatever you named your script)
You can then run, and Eclipse will run your application, even using the Eclipse terminal. Whilst you can interact with your application here, it's not as fully functional as the standard terminal. To get around this, you could use one of the Geant4 graphical UIs such as G4UIXm, or the script above can be modified to:
#!/bin/sh source <path to your g4 installation or env scripts>/env.sh G4WORKDIR=`pwd` xterm $G4WORKDIR/bin/$G4SYSTEM/<name of your project executable>
which will start the executable in a new xterm...
As I said above, this is a bit of a hack - it's nothing more than a wrapper around the Geant4 build system. More experienced Eclipse users may have better ideas...
One nice thing with the above is that by editing the make/run scripts, you can swap between Geant4 versions quite easily by changing which env.sh file gets sourced - although a make clean is necessary first.
Anyway, hope that is of some help :)
|Inline Depth:||Outline Depth:||Add message:|