You are here

Revision of HOWTO build OpenMx from the source repository from Tue, 04/09/2013 - 08:24

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

OS X installation

  1. If you have not already, download the latest Xcode development system from Apple and install the compiler software. It's free in the app store!
  2. Command line tools are no longer installed by default in XCode 4.4+. Go to Preferences, then select command line tools from the Downloads pane.
  3. The gfortran compiler no longer comes with the Xcode package. You'll need to download it separately. The R developers have a webpage with many, many versions of the gfortran software. Make sure to scroll all the way to the bottom of the page and then select the gfortran library that matches your OS and Xcode versions.
  4. Alternatively, use macports and install gcc
Now follow the instructions for the Unix installation. 
<h2 id="Windowsinstallation">Windows installation</h2> 

    A prerequisite for compiling OpenMx on Windows platforms is the Rtools Windows toolset.  Download the latest version of Rtools from their <a class="ext-link" href="http://www.murdoch-sutherland.com/Rtools/"> website</a> and run the installer.  The Rtools installer does not add the R directory to your PATH environment variable.  See <a class="ext-link" href="http://www.computerhope.com/issues/ch000549.htm"> here</a> for help on setting the path in Windows 2000/XP. See <a class="ext-link" href="http://www.brightrev.com/how-to/windows/35-add-a-utilities-directory-to-your-pc.html?start=1"> here</a> 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. 


    <a class="ext-link" href="http://tortoisesvn.tigris.org/"> TortoiseSVN</a> 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: <a class="ext-link" href="http://cran.r-project.org/bin/windows/base/rw-FAQ.html#I-don_0027t-have-permission-to-write-to-the-R_002d2_002e9_002e0_005clibrary-directory"> I don't have permission to write to the R library directory</a>. 


    In R 2.9.x and earlier, you need <a class="ext-link" href="http://msdn.microsoft.com/en-us/library/ms669985.aspx"> Microsoft's HTML Help Workshop</a> 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.

<h2 id="Unixinstallation">Unix installation</h2> 

    OpenMx should compile under any Unix with the GNU C compiler (See above for instructions on installing this if necessary). First you need to get the source.

<h4 id="SVNSourceArchive">SVN Source Archive</h4> 

    To install OpenMx, download the source using <a class="ext-link" href="http://svnbook.red-bean.com/"> SVN</a>. 

<ol>
    <li>You will want to check out the repository to a local working copy, placed wherever you like, probably a directory such as <pre>"~/Applications/bin"</pre> or <pre>"~/local/"</pre></li>
    <li>Next "Check out" the repository creating the local directory OpenMx if necessary:<pre>cd ~/Applications/bin/</pre><pre>svn checkout --username   "http://openmx.psyc.virginia.edu/svn"   OpenMx</pre>
        If don't have an account, leave out the --username argument.
    </li>
    <li>After you have downloaded an initial working copy, SVN can keep this up to date with svn update.
            <pre class="wiki">  tinkerbell:OpenMx tim$ svn update
                A    trunk/docs/source/Factor1.png
                U    trunk/docs/source/FactorModelPath.rst
                D    trunk/models/passing/bivSat3.R
            </pre>
             A = Added, U = Updated, D = Deleted 
            You can also check the status of your working copy 
            <pre class="wiki">    cd ~/Applications/bin/
                svn status OpenMx  # learn if any changes have been made, including new files
            </pre>

                * For a list of recent changes check out the ChangeLog file in the most recent distribution.

            Learn more with man svn or a <a href="http://www.abbeyworkshop.com/howto/misc/svn01/">tutorial site</a>.
    </li>
    </ol>
    <h4>GIT Source Archive</h4>
    Equivalently, there is a real-time mirror of the OpenMx subversion trunk located at <a class="ext-link" href="https://gitorious.org/openmx/openmx">Gitorius</a>. To retrieve a read-only clone of the trunk, use:
    <pre class="wiki">git clone git://gitorious.org/openmx/openmx.git</pre>

Building and Installing OpenMx from the downloaded source

cd (change directory) to the trunk directory, and make install

cd  ~/OpenMx/trunk/
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).

Problems With make

  1. Try make clean
  2. Ensure your copy of the source is up-to-date (to your local copy's trunk directory, and update):
    cd ~/OpenMx/trunk/ svn update
  3. Checkout the repository again.
  4. Make sure that you are building from the trunk directory.
  5. Make sure you have all the R dependencies installed.

Buildbot

Commits to the source repository are automatically tested by our buildbot.

Comments

You can also check the status of your working copy

The build instructions for Windows are extremely out-of-date...