Building OVJ on OS X

Building OVJ on OS X

This has been tested using gcc5.2 from

If you just want to use openVnmrJ on OS X, please just download and install the pre-built package. Only those interested in modifying or exploring the core of VnmrJ need to down and build from source.

If you want to change macros, UI or pulse sequences, see the relevent README.

To build from source:

  1. Install Xcode 7 for OS X 10.10.5 Yosemite or OS X10.11 El Capitan or Xcode 6 on OS X 10.9.5 Mavericks from or
  2. Install javaformac.dmg available at a. This might overwrite a newer copy of Java in /usr/bin/ b. I have not tested this with a newer version of Java (like Java 8)
  3. Download and install SConstruct from
      curl -sO ''
      tar -xzvf scons-2.4.0.tar.gz
      cd scons-2.4.0
      sudo python install
  4. Download and install gcc and gfortran curl -O sudo tar jxf gcc5.2-osx-usrlocal.tar.bz2 -C / a. This will be replaced by gcc4.9 in /vnmr/gcc later (since Linux version uses gcc 4.9); need to include a Darwin scons file

  5. Set up the build environment
export PATH=/usr/local/bin:${PATH} # if not on path already
export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
# Make vjbudatastaionild directory and put ovj into it
mkdir ~/Documents/vjbuild
cd ~/Documents/vjbuild/ 
cd ovjTools
# Link to the java in ovjTools (remove the java link already present)
rm java
ln -s /Library/Java/JavaVirtualMachines/1.6.0.jdk .
cd ..; mkdir bin; cd bin
cp -a ../git-repo/src/scripts/makeovj .
cp -a ./git-repo/src/scripts/buildovj .
# patch git-repo/src/DOSY/SConstruct.dosy and git-repo/src/vnmrbg/SConstruct
# TODO SConstruct.dosy comment out link to libg2c
# TODO vnmrbg/SConstruct remove -rdynamic at link stage

# Edit buildovj to point to the reight directory
  1. If the build is successful, dvdimageOVJ will have:
 ls -l dvdimageOVJ/
total 0
drwxr-xr-x  3 timburrow  staff  102  5 Oct 10:21 Package_contents
drwxr-xr-x  4 timburrow  staff  136  5 Oct 10:21 install_resources


  1. Some solidspack pulse sequences are different in case only; some macros and .c and .xml files will be overwritten when expanding the zip archive. Use a case-sensitive volume when using an HFS disk.

Build OVJ

Building OVJ on OS X (El Capitan)

This is the buildovj file I used

#! /bin/sh
#  Script to build an OVJ release.
#  Make a directory and put this file (buildovj) and the makeovj
#  script in a bin subdirectory
#  Set the following 2 global parameters.
#  ovjBuildDir defines where the git-repo will be built.
#  workspacedir used by ovjdvd and defines where the DVD images will be built.
#  dvdBuildName1 defines the name of the OVJ image
#  dvdBuildName2 defines the name of the MI image
#  dvdCopyDir1 defines where a copy of the OpenVnmrJ DVD image will be put.
#  dvdCopyDir2 defines where a copy of the OpenVnmrJ MI DVD image will be put.
#  set cdBuildDir[1,2] to null string to avoid the final copy
#  dvdCopyName1 defines the name of the OVJ copy
#  dvdCopyName2 defines the name of the MI copy
#  buildOVJ specifies whether the OVJ DVD image will be made
#  buildOVJMI specifies whether the OVJMI DVD image will be made
#  set doScons=yes to run scons
#  set doScons=no to not run scons. This also avoids removing directories
#              and does not change the git repo.
#              Use this if you are just making a DVD from pre-built files
#  set doGitClone=yes to get a new repo.
#  set doGitClone=rebuild to do a new checkout of "src"
#  set doGitClone=pull to pull recent changes to the repo and do a new checkout of "src"
#  set doGitClone=no to leave the current repo alone
#  set mail_list to addresses to email status of the build
#  set gitUSER to user name and address for git repo.
#  ovjAppName is only used by mac version to name /Applications/ovjAppName
#  sconsJoption helps speed up the process. Typical value is #CPUs+1



shortDate=`date +%F`


# Potential optional set of values
# doGitClone=rebuild
# doGitClone=pull
# mail_list=""
# gitUSER=dan@
# doScons=no
# buildOVJ=no
# buildOVJMI=no
# sconsJoption=5

date=`date +%F_%T`
if [ ! -d $ovjBuildDir/logs ]
   mkdir -p $ovjBuildDir/logs
cd $ovjBuildDir
export ovjBuildDir workspacedir OVJ_TOOLS dvdCopyDir1 dvdCopyDir2 dvdBuildName1 dvdBuildName2 dvdCopyName1 dvdCopyName2 ovjLogFile doScons doGitClone mail_list gitUSER ovjAppName buildOVJ buildOVJMI sconsJoption
$ovjBuildDir/bin/makeovj > $ovjLogFile 2>&1