Skip to content

Assimp compilation

David Mansolino edited this page Mar 23, 2020 · 21 revisions

This page explains how to recompile the Assimp dependency on every platforms. Assimp is used internally in Webots to import mesh assets.

Windows

On Windows, assimp is provided as a MSYS2 pacman package and is automatically installed when installing the msys dependencies.

Linux

Compilation of the latest Assimp version

git clone https://github.com/assimp/assimp
cd assimp
git checkout v5.0.1
mkdir build
cd build
cmake -DASSIMP_NO_EXPORT=ON -DCMAKE_BUILD_TYPE=RELEASE -DASSIMP_BUILD_TESTS=OFF -DASSIMP_BUILD_STATIC_LIB=OFF ..
make -j4

Mac

Compilation of the latest Assimp version

Download Assimp

cd ~/software
git clone https://github.com/assimp/assimp.git
cd assimp
mkdir build
cd build
cmake -DASSIMP_NO_EXPORT=ON -DCMAKE_BUILD_TYPE=RELEASE -DASSIMP_BUILD_TESTS=OFF -DASSIMP_BUILD_STATIC_LIB=OFF ..

# Copy the generated lib files (they are in `build/code`) into `~/webots/lib`, for example, on macOS:
cp code/libassimp.dylib ~/webots/lib

make assimp -j X

On macOS you will need to add to cmake:

-DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
install_name_tool -id @rpath/lib/libassimp.dylib dependencies/assimp/build/code/libassimp.dylib

Create the package

tar -cvjSf assimp.tar.bz2 assimp/include/assimp assimp/build/include/assimp/config.h assimp/build/code/*dylib
Clone this wiki locally