Skip to content

Assimp compilation

David Mansolino edited this page Nov 7, 2018 · 21 revisions

This page explains how to recompile the OIS dependency on every platforms.

Windows

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

Linux

On Linux, assimp is also provided as a package called libassimp-dev and is automatically installed when installing the required packages.

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 \
-D ASSIMP_BUILD_AMF_IMPORTER=OFF \
-D ASSIMP_BUILD_3DS_IMPORTER=OFF \
-D ASSIMP_BUILD_AC_IMPORTER=OFF \
-D ASSIMP_BUILD_ASE_IMPORTER=OFF \
-D ASSIMP_BUILD_ASSBIN_IMPORTER=OFF \
-D ASSIMP_BUILD_ASSXML_IMPORTER=OFF \
-D ASSIMP_BUILD_B3D_IMPORTER=OFF \
-D ASSIMP_BUILD_BVH_IMPORTER=OFF \
-D ASSIMP_BUILD_COLLADA_IMPORTER=OFF \
-D ASSIMP_BUILD_DXF_IMPORTER=OFF \
-D ASSIMP_BUILD_CSM_IMPORTER=OFF \
-D ASSIMP_BUILD_HMP_IMPORTER=OFF \
-D ASSIMP_BUILD_IRRMESH_IMPORTER=OFF \
-D ASSIMP_BUILD_IRR_IMPORTER=OFF \
-D ASSIMP_BUILD_LWO_IMPORTER=OFF \
-D ASSIMP_BUILD_LWS_IMPORTER=OFF \
-D ASSIMP_BUILD_MD2_IMPORTER=OFF \
-D ASSIMP_BUILD_MD3_IMPORTER=OFF \
-D ASSIMP_BUILD_MD5_IMPORTER=OFF \
-D ASSIMP_BUILD_MDC_IMPORTER=OFF \
-D ASSIMP_BUILD_MDL_IMPORTER=OFF \
-D ASSIMP_BUILD_NFF_IMPORTER=OFF \
-D ASSIMP_BUILD_NDO_IMPORTER=OFF \
-D ASSIMP_BUILD_OFF_IMPORTER=OFF \
-D ASSIMP_BUILD_OBJ_IMPORTER=OFF \
-D ASSIMP_BUILD_OPENGEX_IMPORTER=OFF \
-D ASSIMP_BUILD_PLY_IMPORTER=OFF \
-D ASSIMP_BUILD_MS3D_IMPORTER=OFF \
-D ASSIMP_BUILD_COB_IMPORTER=OFF \
-D ASSIMP_BUILD_IFC_IMPORTER=OFF \
-D ASSIMP_BUILD_XGL_IMPORTER=OFF \
-D ASSIMP_BUILD_Q3D_IMPORTER=OFF \
-D ASSIMP_BUILD_Q3BSP_IMPORTER=OFF \
-D ASSIMP_BUILD_RAW_IMPORTER=OFF \
-D ASSIMP_BUILD_SIB_IMPORTER=OFF \
-D ASSIMP_BUILD_SMD_IMPORTER=OFF \
-D ASSIMP_BUILD_STL_IMPORTER=OFF \
-D ASSIMP_BUILD_TERRAGEN_IMPORTER=OFF \
-D ASSIMP_BUILD_3D_IMPORTER=OFF \
-D ASSIMP_BUILD_X_IMPORTER=OFF \
-D ASSIMP_BUILD_X3D_IMPORTER=OFF \
-D ASSIMP_BUILD_GLTF_IMPORTER=OFF \
-D ASSIMP_BUILD_3MF_IMPORTER=OFF \
-D ASSIMP_BUILD_MMD_IMPORTER=OFF \
-D ASSIMP_BUILD_MMD_IMPORTER=OFF \
-D ASSIMP_BUILD_BLEND_IMPORTER=OFF \
-D ASSIMP_BUILD_ASSIMP_TOOLS=OFF \
-D ASSIMP_BUILD_TESTS=OFF \
-D ASSIMP_NO_EXPORT=ON \
.. -G <your build environment>

# Copy the generated lib files (they are in `build/code`) into `~/develop/webots/lib`, for example, on macOS:
cp code/libassimp.dylib ~/develop/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

and change RPATH once copied in Webots:

cd ~/develop/webots
install_name_tool -id @rpath/lib/libassimp.dylib lib/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