gibbonCode / GIBBON

The Geometry and Image-Based Bioengineering add-On for MATLAB
http://gibboncode.org/
GNU Affero General Public License v3.0
191 stars 60 forks source link

Linux: Compiling geogram and tetgen for `ggremesh` and `runTetGen` #144

Open shermanlo77 opened 2 years ago

shermanlo77 commented 2 years ago

Linux users may have problems using the MATLAB functions ggremesh and runTetGen. One of which is discussed in issue #81.

The functions ggremesh and runTetGen will call externally lib_ext/lin64/bin/vorpalite and lib_ext/tetGen/lin64/tetgen which are pre-compiled binaries. A disadvantage of using these binaries is that they may not be compatible with some Linux computers.

For example, for myself, calling ./lib_ext/tetGen/lin64/tetgen caused the error

/lib64/libm.so.6: version `GLIBC_2.29' not found

I would recommend Linux users compile the binaries themselves. Perhaps this could be done automatically when calling installGibbon.m as a feature or option.

vorpalite

Download the source from the GitHub repo. Follow the compilation instructions. This requires cmake and many prerequisites (read the error messages for hints). Replace the GIBBON's version of vorpalite.

git clone https://github.com/alicevision/geogram.git
cd geogram
sh -f configure.sh
cd build/Linux64-gcc-dynamic-Release
make
cp bin/vorpalite <path to GIBBON>/lib_ext/geogram/lin64/bin/vorpalite

tetgen

Download the source from the GitHub repo. Compile and replace the GIBBON's version of tetgen.

git clone https://github.com/libigl/tetgen.git
cd tetgen
make
cp tetgen <path to GIBBON>/lib_ext/tetGen/lin64/tetgen
Kevin-Mattheus-Moerman commented 1 year ago

Thank you so much for posting these instructions @shermanlo77 I used them (the geogram based instructions) just now as well on a new linux computer.

I'll have to see if the same can be achieved to the latest geomgram developments over at: https://github.com/BrunoLevy/geogram.

Kevin-Mattheus-Moerman commented 1 year ago

I can confirm this now also works for the latest geogram (which seems faster) from: https://github.com/BrunoLevy/geogram/wiki/compiling_Linux. Similar instructions:

git clone --recurse-submodules https://github.com/BrunoLevy/geogram.git
cd geogram
./configure.sh
cd build/Linux64-gcc-dynamic-Release
make -j 8
cp bin/vorpalite <path to GIBBON>/lib_ext/geogram/lin64/bin/vorpalite