Skip to content

Instantly share code, notes, and snippets.

@dbadrian
Last active August 9, 2019 15:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dbadrian/36d45f5fb9b48af7b3d9be0b78687b73 to your computer and use it in GitHub Desktop.
Save dbadrian/36d45f5fb9b48af7b3d9be0b78687b73 to your computer and use it in GitHub Desktop.
Compile Meshlab on Ubuntu 18.04
#!/bin/bash
#install qt5.9
sudo apt-get install qt5-default qtcreator libqt5xmlpatterns5-dev qtscript5-dev
# install some dependencies
sudo apt-get install libeigen3-dev
#clone repos
git clone --depth 1 https://github.com/cnr-isti-vclab/meshlab.git
git clone --depth 1 https://github.com/cnr-isti-vclab/vcglib.git -b devel
# apply some patch to vcglib
curl https://data.gpo.zugaina.org/gentoo/media-gfx/meshlab/files/2016.12/meshlab-2016.12-remove-header.patch | patch -p1
cd meshlab
#set build flags
# without omp
# QMAKE_FLAGS=('-spec linux-g++' 'CONFIG+=release' 'CONFIG+=qml_release' 'CONFIG+=c++11' 'QMAKE_CXXFLAGS+=-fPIC' 'QMAKE_CXXFLAGS+=-std=c++11' 'QMAKE_CXXFLAGS+=-fpermissive' 'INCLUDEPATH+=/usr/include/eigen3' "LIBS+=-L`pwd`/lib/linux-g++")
# with omp
QMAKE_FLAGS=('-spec' 'linux-g++' 'CONFIG+=release' 'CONFIG+=qml_release' 'CONFIG+=c++11' 'QMAKE_CXXFLAGS+=-fPIC' 'QMAKE_CXXFLAGS+=-fopenmp' 'QMAKE_CXXFLAGS+=-std=c++11' 'QMAKE_CXXFLAGS+=-fpermissive' 'INCLUDEPATH+=/usr/include/eigen3' "LIBS+=-L`pwd`/lib/linux-g++")
MAKE_FLAGS=('-j9')
# building
cd src/external
qmake external.pro ${QMAKE_FLAGS[@]} && make ${MAKE_FLAGS[@]}
cp lib/linux/* lib/linux-g++/ # normally this should not be necessary? some problem i had
cd ../common
qmake common.pro ${QMAKE_FLAGS[@]} && make ${MAKE_FLAGS[@]}
cd ..
qmake meshlab_mini.pro ${QMAKE_FLAGS[@]} && make ${MAKE_FLAGS[@]}
qmake meshlab_full.pro ${QMAKE_FLAGS[@]} && make ${MAKE_FLAGS[@]}
@LogWell
Copy link

LogWell commented Nov 6, 2018

Thanks for your compiling instructions! ^▽^

I have a new question, there's such a remark in /meshlab/src/README.md :

MeshLab has a plugin architecture and therefore all the plugins are compiled separately; some of them are harder to be compiled. Don't worry, if a plugin fails to compile just remove it and you lose just that functionality.

So generally, how to compile and run plugins like /meshlab/src/meshlabplugins/filter_screened_poisson separately?

Thanks for your time and attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment