MrMesh Compile

From VISTA LAB WIKI

Jump to: navigation, search

This page will (hopefully) help you download and install Mesh related utilities, including mrMeshSrv (mrMesh server), buildMesh and pnet. We have compiled versions of these mex-files in the Vistasoft repository and we offer static builds available for download via SVN.

Should one of the compiled versions not work for your OS this page will help you compile on Linux, OSX or Windows.

  • On Linux you must be running a video card with proprietary 3D accelerated graphics drivers installed and running. mrMesh will not work properly with opensource 3D drivers!
  • MATLAB NOTE: We have compiled and tested mrMesh on Matlab r2008a and newer. If you are having problems on older versions you should consider getting a more up-to-date version of Matlab.


Contents

[edit] Vistasoft

There are compiled executables present in the current distribution of Vistasoft for Windows, OSX and Linux. These executables can be found in $vistarootpath/vistasoft/trunk/mrAnatomy/mrMesh.

You should fisrst check to see if you can run the version in the vistasoft repo:
In Matlab type:

 >> mrmStart
  • If you get an error and the window does not appear, go on to the next section to download and try one of the compiled packages.

[edit] Download Compiled Executables

You can download the repository which has the compiled executables here: VISTASRC

If you have SVN installed on your machine you can quickly checkout the compiled packages with one simple command:

 svn checkout https://white.stanford.edu/repos/vistasrc/mrMesh/packages


* If you don't have, or would rather just not use SVN, you can use WGET (see step 2.b for that option in Linux and OSX)

  • It's helpful if you make a directory first (e.g., mkdir mrMesh), where you'll issue the above command.

[edit] Ubuntu Linux

To get mrMeshSrv going on a linux machine:

1. In a terminal make a directory where you will store the packages folder

 mkdir mrMeshCompiled

2a. Download the packages via svn

 svn checkout https://white.stanford.edu/repos/vistasrc/mrMesh/packages

2b. OR Download packages via wget

 wget -r -nH --cut-dirs=2 -np --no-check-certificate --reject index.html  https://white.stanford.edu/repos/vistasrc/mrMesh/packages/LinuxUbuntu11.04/; rm -f robots.txt;

3. Change the permissions of the executable so you can run it:

 chmod -R 775 packages

4. Navigate to mrMesh/packages/LinuxUbuntu11.04/ and run the executable

 ./mrMeshSrv
  • If you get an error message that says something like that below - Then you're missing some required libraries. You can either try installing those libraries or move on to the next section and compile the program for your specific OS.
 ./mrMeshSrv: error while loading shared libraries: *someLib*: cannot open shared object file: No such file or directory
  • To figure out which libraries you're missing, try:
 ldd ./mrMeshSrv

[edit] OSX

To get mrMeshSrv going on an OSX machine:

1. In a terminal make a directory where you will store the packages folder:

 mkdir mrMeshCompiled

2. Download the packages via svn:

 svn checkout https://white.stanford.edu/repos/vistasrc/mrMesh/packages

2b. OR Download packages via wget

 wget -r -nH --cut-dirs=2 -np --no-check-certificate --reject index.html  https://white.stanford.edu/repos/vistasrc/mrMesh/packages/MacOSX10.6/; rm -f robots.txt  

3. Change the permissions of the executable so you can run it:

 chmod -R 775 packages

4. Run the mrMeshMac.app through the FINDER or in the terminal by navigating to the OSX... folder and running:

 open mrMeshMac.app
  • If you get an error message that says something like below - Then you're missing some required libraries. You can either try installing those libs or move on to the next section and compile the program for your specific OS.
 ./mrMeshSrv: error while loading shared libraries: *someLib*: cannot open shared object file: No such file or directory
  • To figure out which libraries you're missing, try:
 ldd ./mrMeshSrv


[edit] Windows

To get mrMesh and related mex files going on a WIN7 machine:

1. Make a directory where you will store the packages folder:

 mkdir mrMeshCompiled

2. Download the packages via Tortoise svn:

 https://white.stanford.edu/repos/vistasrc/mrMesh/packages 

3. Run the mrMeshSrv.exe from within the packages/Windows7 folder by double-clicking on it.

  • If you get an error message that says something like the following - Then you're missing some required libraries. You can either try installing those libs or move on to the next section and compile the program for your specific OS.
 ./mrMeshSrv: error while loading shared libraries: *someLib*: cannot open shared object file: No such file or directory

Here is a list of Matlab supported compilers for creating mex-files with recent versions of Matlab. Just google matlab supported compilers for other versions.

The free stuff Wandell installed is Visual Studio 2010 C++ and the .NET SDK Windows 7 framekwork. Apparently both are required for mex creation.

Be aware: There is a known problem when installing Visual Studio 2010.

To fix this bug you must apply this patch.

[edit] Compile mrMeshSrv

If you're trying to run mrMeshSrv, but having issues, and you've determined that you need to compile the program yourself this section is here to help you do just that.

So far we've compile mrMeshSrv on Fedora (FC12 & FC14), CentOS and UBUNTU.

Are there instructions for compiling under Windows? Michael Perry? Michael Bennett? Bob?


[edit] Compile Instructions

To compile mrMeshSrv:

  1. Download the mrMesh code repository to a directory you want to use for the build.
  2. Read the install.txt file for build instructions.
 svn checkout https://white.stanford.edu/repos/vistasrc/mrMesh

[edit] BuildMesh

If you're trying to build meshes, but having issues, and you've determined that you need to compile the program yourself this section is here to help you do just that.

So far we've compiled buildMesh on Fedora (FC12 & FC14) and UBUNTU.

NOTE: You must edit the compilebuildmesh.sh script to point to your matlab mexopts.sh file and to reflect your version of matlab as well as the options you use to launch it. See lines:

 matlab_version="r2009b"
 matlab_options="-nodesktop -nosplash -nojvm -r"
 matlab_mexopts=/white/scr1/matlab/$matlab_version/bin/mexopts.sh

[edit] Compile Instructions

To compile buildMesh:

  1. Download the compilebuildmesh.sh file to a directory you want to use for the build.
  2. Make sure the file is executable.
  3. Edit the compilebuildmesh.sh file to indicate your version of Matlab and the path to your specific mexopts.sh file.
  4. Execute the file.
 Like this: 
 wget https://white.stanford.edu/repos/vistasoft/trunk/mrAnatomy/mrMesh/BuildMesh/compilebuildmesh.sh --no-check-certificate
 chmod 775 compilebuildmesh.sh
 ./compilebuildmesh.sh

Hopefully in a matter of minutes you'll have the executables, which you can move somewhere matlab can see them.

[edit] Linux Build Notes

[edit] Required Packages and Libs

Certain packages and libraries will be useful for you to have, some required for certain compile scripts.

Using Synaptics (or apt-get) you will need to have these packages installed on Ubuntu to build QUENCH. The terms below are not exact - the version numbers can change and sometimes there will be a -dev attached to the name (to indicate development version). But you will need these packages in some form.

Required Software Packages:
  • Subversion (svn)
  • gcc
  • g++
  • autoconf
  • git
  • make
  • cmake
Libs:
  • libvtk
  • libwxgtk (-dev)
  • libvtk-qt4
  • vtk-tcl
  • python-vtk
  • libgtk+2
  • libgtk (-dev)

[edit] Ubuntu

Packages can be installed using Synaptic or a command like:

 sudo apt-get install packageName

If the package name comes back as not found try:

 apt-cache search packageName

[edit] Fedora

Use yum:

 sudo yum install packageName
 sudo yum search packageName
Personal tools