Message: Steps to install Geant4 (9.1.p01) under FreeBSD (6.2-RELEASE-p4, gcc 3.4.6) Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Steps to install Geant4 (9.1.p01) under FreeBSD (6.2-RELEASE-p4, gcc 3.4.6) 

Keywords: unsupported install FreeBSD
Forum: Installation and Configuration
Date: 04 Apr, 2008
From: Mark Looper <Mark Looper>


This post is just to collect in one (Google-able) place what I've learned from a couple of previous queries, so that anybody trying to install Geant4 under FreeBSD (which is not officially supported) can find it easily. Many thanks to Ben Morgan, John Allison, and Gabriele Cosmo for their help!

Specifically, I now have Geant4 version 9.1.p01 installed under FreeBSD version 6.2-RELEASE-p4, with gcc version 3.4.6, and I have successfully compiled and run a few user codes. The codes actually run on a cluster, but I have not done anything with the MPI interface; instead, I just send off hundreds or thousands of single-processor jobs with individual sets of parameters and random-number-generator seeds. My starting point has been the excellent set of instructions here for installing version 9.0; apart from version numbers (e.g., CLHEP version is rather than, I found no differences necessitated by working with version 9.1.p01 instead of 9.0. I also do not remember having any difficulty installing CLHEP. The following, then, are simply the changes to the instructions that I found I had to make in order to install and use Geant4 on this system:

(1) In $G4INSTALL/source/GNUmakefile there are a lot of statements starting with $(ECHO). This construct expands to /bin/echo -e, but apparently there is no -e switch in the FreeBSD version of echo. This results in a lot of echoed lines starting with "-e", which causes the libmap section of the installation script to choke as described here. If you're savvier than I am about UN*X scripting, you can fix whatever is causing $(ECHO) to get expanded this way; however, I found I could work around it by just replacing it with a hardcoded /bin/echo in the libmap section of $G4INSTALL/source/GNUmakefile (lines 73-103). (Other occurrences of $(ECHO) simply result in uglification of the script's log output, but you could fix them too if you like.)

(2) When running ./Configure -build, the defaults for the question about "OS" and "compiler" will be blank, since this is not a supported system. Replace the blank defaults with "Linux" and "g++"; you'll get a scary message about a mismatch between what you've entered and what the script found, but hey, that's the price of doing an unsupported install...

(3) When given the option of building global or granular libraries while running ./Configure -build, choose global and not also granular. Otherwise the Geant4 system will install properly, but user code compilations will crash at the link stage as described here. I haven't a clue as to what the difference is (did I mention I'm not too savvy with this stuff?), but this has worked for me on several user codes so far.

(4) After placing the statement

source $HOME/geant4.9.1.p01/.config/bin/Linux-g++/env.csh

in my .cshrc file, I found that it was necessary to add the lines


below it manually, as the LD_LIBRARY_PATH did not appear to be set by the env.csh script. This step may not be necessary for you; you can check by issuing echo $LD_LIBRARY_PATH and seeing if it includes these two additions. (My user code compilations crashed at the link stage if I didn't put this in the .cshrc manually.)

That's it! As far as I have found, anyway; since this is all running on a remote cluster, without even OGLX available to me, I have done zilch with regard to the visualization parts of the code, for example. Once again, many thanks to those who helped me get to this point; if anybody sees a "duh" in the above (like how to fix the $(ECHO) problem at the source, rather than with a hard-coding kludge), please add that info here.

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

1 None: Re: Steps to install Geant4 (9.1.p01) under FreeBSD (6.2-RELEASE-p4, gcc 3.4.6)   (Ben Morgan - 07 Apr, 2008)
 Add Message Add Message
to: "Steps to install Geant4 (9.1.p01) under FreeBSD (6.2-RELEASE-p4, gcc 3.4.6)"

 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 ]