Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Luter 345 Experiments
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Geant4 Installation
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Get shortened URL
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Building and Installing on Windows Platforms=== Unpack the Geant4 source package, geant4_10_00.zip to a location of your choice. This directory will be referred to as the ''source directory''. For simplicity's sake, let's assume that the source directory is named C:\Users\Ben\Documents\geant4\. This way, the Geant4 source package resides in a subdirectory called C:\Users\Ben\Documents\geant4\geant4_10_00. While CMake can be used from the Windows cmd program, you may also use the CMake GUI for configuring the build. The steps required to use CMake GUI and Visual Studio to build and install Geant4 are described below: # Open the CMake (cmake-gui) executable, and click on the ''Browse Source...'' button in the top right hand corner of the window. Use the file browser popup to locate the Geant4 source directory, and click ''OK''. # Next you will create a directory in which to create the Visual Studio project files and hold the build products. This directory should not be the same as or inside of the source directory. Here you will create this ''build directory'' alongside the source directory. Click on the ''Browse Build...'' button in the top right hand side of the CMake GUI window. Use the file browser popup to browse back to C:\Users\Ben\Documents\geant4\, and click on the ''Make New Folder'' button. Rename the created folder to ''geant4.10.0-build'', and click on the ''OK'' button. The two text entries at the top of the GUI should now contain C:/Users/Ben/Documents/geant4/geant4_10_00 and C:/Users/Ben/Documents/geant4/geant4.10.0-build respectively. (Note: CMake always represents Windows paths with forward slashes). # Click on the ''Configure'' button on the bottom left hand side of the GUI. In the popup window, select ''Visual Studio 2010''. Ensure only the ''Use default native compilers'' radio box is checked. Then click on the ''Finish'' button. # CMake will then run to check features and provide an initial configuration. All being well, you will see red highlighted entries in the main options window including ''CMAKE'' and ''GEANT4'' entries. Note that the red highlighting means CMake has not fully resolved all configuration variables yet, no that there has been an error. On Express editions of Visual Studio, you may see a warning about missing system runtime libraries in the logging window at the bottom of the GUI, but this can be ignored for a standard install. On the latest versions of CMake, you may also see warnings relating to LINK_INTERFACE_LIBRARIES and these can be ignored. Any other errors will be reported in this logging window. # By default, CMake will configure the build to install Geant4 under C:/Program Files/Geant4. If you do not wish to use this directory, or do not have permission to install there, you can change the installation location. Click on the arrow next to the ''CMAKE'' entry in the central options display to expand all CMake specific configuration options. Scroll down to locate the CMAKE_INSTALL_PREFIX entry. Click on the entry and edit the path directly or via the file browser popup. In this example we will modify this install directory to C:/Users/Ben/Documents/geant4/geant4.10.0-install. # If you need to activate extra components of Geant4, click on the expansion arrow next to the ''GEANT4'' entry in the central options display to expand all Geant4 specific configuration options. Simply click on the tick box next to an option to select it if you require. # Once you have adjusted any options, click on the ''Configure'' button again. After this has finished, all the options listed in the central option display should be white. If you still have entries in red, click ''Configure'' to reconfigure until all entries are white. # Now click on the ''Generate'' button to generate the Visual Studio project. If everything is correct, CMake will generate the solution files and report ''Configuring done, Generating done'' in the logging window at the bottom of the GUI. You can now close the CMake GUI. # Now start up Visual Studio and choose ''Open Project.'' Browse to the build directory and open the Geant4.sln Microsoft Visual Studio Solution file. Note that it may take some time to fully configure, open and parse all files in the solution. # By default, the Visual Studio solution builds the Debug Configuration, so if you want an optimized build, you should select the ''Release'' option from the drop down ''Solutions Configurations'' menu in the toolbar Visual Studio 2010). # In the Solution Explorer, right click on the ''INSTALL'' solution and select ''Build'' from the popup menu. The solution will now build and install to the directory you chose for CMAKE_INSTALL_PREFIX earlier. If you wish to build a different configuration (''Release'' if you built ''Debug'' first, for example), then simply change the solution configuration as described in the previous paragraph, and build the ''INSTALL'' solution again. # If you see a successful build, you can exit Visual Studio.
Summary:
Please note that all contributions to Luter 345 Experiments may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Luter 345 Experiments:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)