"Bad Interpreter"

You are running on a file system that does not allow executable files.

"SyntaxError: invalid syntax" when running waf

This likely due to your system Python being too old. If so you may see:

  File "./orch/", line 231
     tgen = ctx(*args, worch = worch, **kw)
 SyntaxError: invalid syntax

For this or other Python compatibility problems install Python from source. Worch provides a script to automate this installation. It can be run like:

$ ./scripts/install-python 2.7.6 ../helpers

Then, clean out any waf files made and from now on you will need to run waf explicitly with this Python you just installed.

$ rm -rf .waf*
$ ../helpers/bin/python waf --version
waf 1.7.13 (daa91dba4b881d86bc25eec90a3745ebaeece835)
$ ../helpers/bin/python waf --prefix=/path/to/install \
   --orch-config=../lbne-beamsim-worch/config/suite-g4lbne.cfg \
     configure build

After installation is complete this "helper" Python may be removed.

Note: yet another version of Python is installed for use with g4lbne.

Various steps necessary for building on OS X Mavericks

  • Make sure you have installed Xcode and Xcode command line tools (run xcode-select --install from a terminal window to install the later)
  • You should use cmake instead of the 2.8.11 that is currently configured, by editing the "version" variable set in the "[package cmake]" section of the file: lbne-beamsim-worch/config/packages.cfg and then repeating the "waf ... configure build" command
  • Fix a bug in the worch/tmp/sources/
    <     ( ( integerCong ^ tausworthe ^ (unsigned int) hurd ) * twoToMinus_32() 
    >     ( ( integerCong ^ tausworthe ^ hurd ) * twoToMinus_32() 
  • Edit your packages.cfg file and in the "[package geant]" section change the line:
     build_target = outputs/library/ 

     build_target = outputs/library/libG4track.{soext} 
  • An error such as this:
    ld: in '/usr/local/lib/libgfortran.3.dylib', file was built for i386 which is no
    t the architecture being linked (x86_64): /usr/local/lib/libgfortran.3.dylib for
     architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Can be solved by installing a new 64 bit version of gfortran and renaming the file /usr/local/lib/libgfortran.3.dylib'.