Skip to main content
All CollectionsGetting started with MeshLibC++
Building MeshLib from source code
Building MeshLib from source code

How to build MeshLib from source code. Example

Updated over a year ago

MeshLib is an open-source SDK that you can use to create algorithms applications for 3D data processing. You can download pre-built binaries (see our GitHub) or compile them yourself. Below is the guide on how to do it.

Building with VS2019 on Windows

Source code

git clone MeshLibgit submodule update –init –recursivecd ..

Third parties

Some third parties are taken from vcpkg, while others (missing in vcpkg) are configured as git submodules.

Cuda

Please install CUDA v11.4 from official site

Vcpkg

Please install vcpkg, and integrate it into Visual Studio (note that vcpkg requires English language pack in Visual Studio, and vcpkg cannot be installed on FAT volumes, only on NTFS):

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git checkout 2022.11.14
.\bootstrap-vcpkg.bat
.\vcpkg integrate install (with admin rights)
cd ..

More details here: vcpkg.

Execute install.bat:

cd vcpkg # or add vcpkg to PATH
../MeshLib/thirdparty/install.bat
cd ..

Open solution file MeshInspector/source/MeshLib.sln in Visual Studio 2019. Build it and run.

Build with VS2022 on Windows

The steps are the same as for VS2019 above. The only exception is that you need to change PlatformToolset from v142 to v143 in MeshLib/source/platform.props after cloning MeshLib.

Build with CMake on Linux

This installation was checked on Ubuntu 20.04.4.

Use automated installation process. It takes ~40 minutes if no required packages are already installed. This approach is useful for new MR developers Install/Build dependencies. Build project. Run Test Application Run the following in terminal:

git clone https://github.com/MeshInspector/MeshLib
cd MeshLib
sudo ./scripts/build_thirdparty.sh # need sudo to check and install dependencies
./scripts/install_thirdparty.sh
./scripts/build_sources.sh
./scripts/distribution.sh
sudo apt install ./distr/meshlib-dev.deb

NOTE: ./scripts/install*.sh scripts could be used as well, but apt install is preferable.

NOTE: ./scripts/install*.sh scripts copy MR files directly to /usr/local/lib. Remove this directory manually if exists before apt install deb package.

NOTE: You could specify build type to Debug by export MESHLIB_BUILD_TYPE=Debug. Release is default.

Build with Emscripten on Linux

This installation was checked on Ubuntu 20.04.4 with emscripten 3.1.23.

Install Emscripten (find more on emscripten official page)

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
optional git pull # optional
./emsdk install 3.1.23 # (or enother version / latest)
./emsdk activate 3.1.23
source ./emsdk_env.sh

Build

cd ~/MeshInspectorCode
./scripts/build_thirdparty.sh # select emscripten in the corresponding question
./scripts/build_sorces.sh # select emscripten in the corresponding question

Run

python3 ./scripts/local_server.py
# open in browser 127.0.0.1:8000

Did this answer your question?