Copyright © 2007-2017 The OpenMx Project
Compiling OpenMx requires that you have installed in R the other packages to which we link, or depend. It will be useful to also install suggested packages. As of May 2016, these were:
Nb: It pays to update these prior to building OpenMx to ensure you have the latest versions... Also, note that you need to install Open MPI so that the R package Rmpi will install. You can get openmpi from https://www.open-mpi.org - root permission will be needed for the installation but it should go smoothly.
install.packages("Rcpp") install.packages("RcppEigen") install.packages("StanHeaders") install.packages("BH") install.packages("rpf")
install.packages("R") install.packages("digest") install.packages("MASS") install.packages("methods") install.packages("Matrix") install.packages("Rcpp") install.packages("parallel")
install.packages("mvtnorm") install.packages("numDeriv") install.packages("roxygen2") install.packages("Rmpi") install.packages("rpf") install.packages("snowfall") install.packages("lme4")
You can install all the packages in R with the following code (change or delete repos argument as needed):
pkglist=as.vector(c("RcppEigen","StanHeaders","BH","rpf","R","digest" ,"MASS" ,"methods" ,"Matrix" ,"Rcpp" ,"parallel" ,"mvtnorm","numDeriv","roxygen2","Rmpi","rpf","snowfall","lme4"),mode=character) install.packages(pkglist,repos="http://R.research.att.com/")
Be careful with the roxygen package, which we found will work at version 5.0.0 but not at 6.0.0 due to the disappearance of roxygen_devtools
OpenMx should compile under any Unix with the GNU compiler (See above for instructions on installing this if necessary). First you need to get the source.
OpenMx source code is available on github . Development takes place on the 'master' branch. Once change sets on the master branch are 100% passing on our nightly test suite, changes are merged to the 'stable' branch. Any other branches are for work-in-progress and we can offer no stability guarantees.
cd (change directory) to the top directory, and make install
git clone firstname.lastname@example.org:OpenMx/OpenMx.git cd OpenMx/ make install
Options for the make process are as follows:
make build # build a binary release of the OpenMx library for export. make install # create the OpenMx library and tries to install it as an R library. make check # create the OpenMx library and runs the R library checker. make html # create the Sphinx documentation in the docs/build/html directory. You will need to have the Sphinx package installed. make pdf # create a pdf file in the build directory of the OpenMx documentation. make clean # clean out the build subdirectory. Sometimes you may need to run "make clean" if you get error messages with the other make build. make test # run all the models in the demo and models/passing subdirectories. The number of errors found will be reported (should be 0).
cd ~/OpenMx/ git fetch origin git reset --hard origin/master # or origin/stable
returns /usr/bin/R, and
ls -l /usr/bin/R
returns /usr/bin/R@ -> /Library/Frameworks/R.framework/Resources/bin/R it would be necessary to fix this with
sudo unlink /usr/bin/R sudo ln -s /Library/Frameworks/R.framework/Resources/bin/R64 /usr/bin/R
Otherwise, you may encounter cryptic messages such as
Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/2.14/Resources/library/OpenMx/libs/i386/OpenMx.so': dlopen(/Library/Frameworks/R.framework/Versions/2.14/Resources/library/OpenMx/libs/i386/OpenMx.so, 6): Symbol not found: _GOMP_parallel_end Referenced from: /Library/Frameworks/R.framework/Versions/2.14/Resources/library/OpenMx/libs/i386/OpenMx.so Expected in: dynamic lookup
The command line is used just this first time: The app store will update it thereafter.
git clone git://github.com/OpenMx/OpenMx.git cd OpenMx
sudo tar -xvf gcc-4.9-bin.tar -C /
git fetch origin git reset --hard origin/master
~/.R/Makevarsso that it contains the following lines. If there's other stuff in the file, put these lines at the end of it.
CC = /usr/local/bin/gcc CXX = /usr/local/bin/g++ CXX1X = /usr/local/bin/g++ FC = /usr/local/bin/gfortran F77 = /usr/local/bin/gfortran
make install, which will likely fail, but look for the line that says something like "Change default C/C++ compiler and default compile flags by editing /SomeLongPathToADirectory/Makeconf", and add the above lines to that file.
This must be moved to the correct location for the compiler to find it. By default this will be
Again, from the top directory, simply run
make install Other options for building (like check) are described in full in the unix section above and work for Mac too.
Validate the installation by running
make test - it takes some time to complete.
The above steps have been tested on a newly (Aug 5 2014) purchased OS X 10.9.2 system. For subsequent rebuilds from source the procedure is much easier:
cd OpenMx git fetch origin git reset --hard origin/master make install
A prerequisite for compiling OpenMx on Windows platforms is the Rtools Windows toolset. Download the latest version of Rtools from their website  and run the installer. The Rtools installer does not add the R directory to your PATH environment variable. See here  for help on setting the path in Windows 2000/XP. See here  for help on setting the path in Windows Vista. The default R directory is placed in C:\Program Files\R\R-2.X.X\bin.
TortoiseSVN  is a subversion graphical user interface that you may find helpful. Some tips: We recommend checking out the OpenMx repository into a folder that does not contain any spaces in its absolute path. If you receive a permission denied error when running "make install", follow the instructions on the R FAQ for Windows: I don't have permission to write to the R library directory .
In R 2.9.x and earlier, you need Microsoft's HTML Help Workshop  in order to create R help files under Windows. After you have installed the software, add C:\Program Files\HTML Help Workshop to your PATH environment variable.
Now follow the instructions for the Unix installation.
Commits to the source repository are automatically tested by our buildbot .