Message: Re: XCode - Compiling and Running programs Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: XCode - Compiling and Running programs 

Forum: Installation and Configuration
Re: Question XCode - Compiling and Running programs (Joe Westlake)
Date: 21 Aug, 2012
From: Ben Morgan <Ben Morgan>

Hi Joe,

On Tue, 21 Aug 2012 13:18:15 GMT, Joe Westlake wrote:
> I have followed the directions here:
> for using XCode as a development environment with Geant4. Does anyone
> have an example, or could give me instructions on how to compile some of
> the examples using this installation. I have successfully built the
> targets and dyld files in the .xcodeproj file. I'm just having troubles
> setting up compilation targets/makefiles for the examples such that they
> will compile and run in XCode. Any help would be appreciated!

If you are happy to use CMake to configure projects, then, taking exampleB1 and version 9.5.1 you can do:

mkdir exampleB1-build
cd exampleB1-build
cmake -G Xcode -DGeant4_DIR=/yourinstallprefix/lib/Geant4-9.5.1 /path/to/exampleB1sourcecode

That should generate an Xcode project for exampleB1 under exampleB1-build. I've used the command line as that's easiest to demonstrate, but the same procedure can be followed using the CMake GUI.

I'm not an Xcode expert by any means, so I'm not sure of the details of setting things up if you don't want to use CMake. If there is a 'use this makefile' functionality, then you could use the GNUmakefile(s) that are supplied with the examples. The only proviso with these it that you need to have sourced the script that was installed in CMAKE_INSTALL_PREFIX/share/Geant4-9.5.1/geant4make. You could wrap both steps in a general script as well if Xcode can call a general script, e.g.

cd /path/to/exampleB1sourcecode
. /yourinstallprefix/share/Geant4-9.5.1/geant4make/

Hope that's of some help!



Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: XCode - Compiling and Running programs   (Joe Westlake - 22 Aug, 2012)
(_ Question: Re: XCode - Compiling and Running programs   (matthew - 25 Jul, 2014)
(_ None: Re: XCode - Compiling and Running programs   (garnier - 26 Jul, 2014)
 Add Message Add Message
to: "Re: XCode - Compiling and Running programs"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]