Skip to content

Latest commit

 

History

History
106 lines (90 loc) · 3.06 KB

osx.md

File metadata and controls

106 lines (90 loc) · 3.06 KB

Build on OSX

Pre-requisites

Brew

Install brew on OSX.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

wget

After installing brew, we can use brew to install wget (so you can download files from the command-line):

brew install wget

CMake

We need cmake to configure and build OpenMesh and MeshMonk. We're copying here the installation instructions from this page:

  1. Download the latest binary distribution for Mac OSX from the Downloads page
  2. Open the resulting .dmg-file you just downloaded
  3. Drag and drop the CMake icon to the Applications folder icon.
  4. Launch CMake (from you Applications folder, for example)
  5. Add CMake to your path so you can call it from command-line:
sudo mkdir -p /usr/local/bin
sudo /Applications/CMake.app/Contents/bin/cmake-gui --install=/usr/local/bin
  1. Verify your installation (you might have to close and open a new Terminal):
cmake --version

Install libraries

1. Install eigen

  1. Use brew to install eigen
brew install eigen

or upgrade:

brew upgrade eigen
  1. Make a symlink to the main 'Eigen' folder from /usr/local/include/ so that you can include Eigen in your projects.
ln -s /usr/local/Cellar/eigen/3.3.7/include/eigen3/Eigen /usr/local/include/Eigen

2. (optional) 'Install' nanoflann

Like Eigen, nanoflann is also a header-only library. There is only one header file you need, so we deliver that in the meshmonk repository under '/vendor' directory. So all that's left is to copy that to /usr/local/include:

sudo cp /home/user/projects/meshmonk/vendor/nanoflann.hpp /usr/local/include/

3. Install OpenMesh

cd /Users/user/Downloads/
wget http://www.openmesh.org/media/Releases/6.3/OpenMesh-6.3.zip
unzip OpenMesh-6.3.zip
cd OpenMesh-6.3
mkdir build
cd build
cmake ..
make

Copy/paste the .dylib files:

sudo sudo cp Build/lib/*.* /usr/local/lib/

Copy/paste the header files

cp -R /Users/user/Downloads/OpenMesh-6.3/src/OpenMesh /usr/local/include/

MeshMonk

Compile

Make a 'projects' folder in your home directory and go into it(or go into a directory you are already using for GitHub projects):

cd
mkdir projects
cd projects

Clone the online MeshMonk repository

git clone https://github.com/TheWebMonks/meshmonk.git

Enter the subfolder with the c++ sourcecode and use make to compile it. As an alternative to this step, you may use the precompiled version of 'libmeshmonk.dylib' in the 'builds' folder of the meshmonk download.

cd meshmonk
make

From the meshmonk folder, copy the shared library object libmeshmonk.dylib to /usr/local/lib

cp libmeshmonk.dylib /usr/local/lib

Copy the header files to /usr/local/include/

(cd /Users/user/projects/meshmonk/ && find . -name '*.hpp' -print | tar --create --files-from -) | (cd /usr/local/include/ && sudo tar xvfp -)