Skip to content

Instantly share code, notes, and snippets.

@acmiyaguchi
Forked from jeguzzi/Instructions.md
Created February 25, 2024 18:26
Show Gist options
  • Save acmiyaguchi/3bee46afc6b6c065c73285a75b1de926 to your computer and use it in GitHub Desktop.
Save acmiyaguchi/3bee46afc6b6c065c73285a75b1de926 to your computer and use it in GitHub Desktop.
How to compile CoppeliaSim on Linux
repositories:
coppeliaSimClientApplication:
type: git
url: https://github.com/CoppeliaRobotics/coppeliaSimClientApplication.git
version: coppeliasim-v4.4.0-rev0
CoppeliaSimLib:
type: git
url: https://github.com/CoppeliaRobotics/CoppeliaSimLib.git
version: coppeliasim-v4.4.0-rev0
include:
type: git
url: https://github.com/CoppeliaRobotics/include.git
version: coppeliasim-v4.4.0-rev0
simMath:
type: git
url: https://github.com/CoppeliaRobotics/simMath.git
version: coppeliasim-v4.4.0-rev0
libPlugin:
type: git
url: https://github.com/CoppeliaRobotics/libPlugin.git
version: coppeliasim-v4.4.0-rev0
coppeliaGeometricRoutines:
type: git
url: https://github.com/CoppeliaRobotics/coppeliaGeometricRoutines.git
version: coppeliasim-v4.4.0-rev0
coppeliaKinematicsRoutines:
type: git
url: https://github.com/CoppeliaRobotics/coppeliaKinematicsRoutines.git
version: coppeliasim-v4.4.0-rev0
bubbleRobClient:
type: git
url: https://github.com/CoppeliaRobotics/bubbleRobClient.git
version: coppeliasim-v4.4.0-rev0
bubbleRobServer:
type: git
url: https://github.com/CoppeliaRobotics/bubbleRobServer.git
version: coppeliasim-v4.4.0-rev0
bubbleRobZmqServer:
type: git
url: https://github.com/CoppeliaRobotics/bubbleRobZmqServer.git
version: coppeliasim-v4.4.0-rev0
common:
type: git
url: https://github.com/CoppeliaRobotics/common.git
version: coppeliasim-v4.4.0-rev0
helpFiles:
type: git
url: https://github.com/CoppeliaRobotics/helpFiles.git
version: coppeliasim-v4.4.0-rev0
lua:
type: git
url: https://github.com/CoppeliaRobotics/lua.git
version: coppeliasim-v4.4.0-rev0
# models:
# type: git
# url: https://github.com/CoppeliaRobotics/models.git
# version: coppeliasim-v4.4.0-rev0
mtbServer:
type: git
url: https://github.com/CoppeliaRobotics/mtbServer.git
version: coppeliasim-v4.4.0-rev0
python:
type: git
url: https://github.com/CoppeliaRobotics/python.git
version: coppeliasim-v4.4.0-rev0
rcsServer:
type: git
url: https://github.com/CoppeliaRobotics/rcsServer.git
version: coppeliasim-v4.4.0-rev0
# scenes:
# type: git
# url: https://github.com/CoppeliaRobotics/scenes.git
# version: coppeliasim-v4.4.0-rev0
simExtAssimp:
type: git
url: https://github.com/CoppeliaRobotics/simExtAssimp.git
version: coppeliasim-v4.4.0-rev0
simExtBubbleRob:
type: git
url: https://github.com/CoppeliaRobotics/simExtBubbleRob.git
version: coppeliasim-v4.4.0-rev0
simExtCHAI3D:
type: git
url: https://github.com/CoppeliaRobotics/simExtCHAI3D.git
version: coppeliasim-v4.4.0-rev0
simExtCodeEditor:
type: git
url: https://github.com/CoppeliaRobotics/simExtCodeEditor.git
version: coppeliasim-v4.4.0-rev0
simExtCollada:
type: git
url: https://github.com/CoppeliaRobotics/simExtCollada.git
version: coppeliasim-v4.4.0-rev0
simExtConvexDecompose:
type: git
url: https://github.com/CoppeliaRobotics/simExtConvexDecompose.git
version: coppeliasim-v4.4.0-rev0
simExtDataflow:
type: git
url: https://github.com/CoppeliaRobotics/simExtDataflow.git
version: coppeliasim-v4.4.0-rev0
simExtDyn:
type: git
url: https://github.com/CoppeliaRobotics/simExtDyn.git
version: coppeliasim-v4.4.0-rev0
simExtEigen:
type: git
url: https://github.com/CoppeliaRobotics/simExtEigen.git
version: coppeliasim-v4.4.0-rev0
simExtExternalRenderer:
type: git
url: https://github.com/CoppeliaRobotics/simExtExternalRenderer.git
version: coppeliasim-v4.4.0-rev0
simExtGeom:
type: git
url: https://github.com/CoppeliaRobotics/simExtGeom.git
version: coppeliasim-v4.4.0-rev0
simExtGLTF:
type: git
url: https://github.com/CoppeliaRobotics/simExtGLTF.git
version: coppeliasim-v4.4.0-rev0
simExtICP:
type: git
url: https://github.com/CoppeliaRobotics/simExtICP.git
version: coppeliasim-v4.4.0-rev0
simExtIGL:
type: git
url: https://github.com/CoppeliaRobotics/simExtIGL.git
version: coppeliasim-v4.4.0-rev0
simExtIK:
type: git
url: https://github.com/CoppeliaRobotics/simExtIK.git
version: coppeliasim-v4.4.0-rev0
simExtIM:
type: git
url: https://github.com/CoppeliaRobotics/simExtIM.git
version: coppeliasim-v4.4.0-rev0
simExtK3:
type: git
url: https://github.com/CoppeliaRobotics/simExtK3.git
version: coppeliasim-v4.4.0-rev0
simExtLuaCmd:
type: git
url: https://github.com/CoppeliaRobotics/simExtLuaCmd.git
version: coppeliasim-v4.4.0-rev0
simExtLuaParser:
type: git
url: https://github.com/CoppeliaRobotics/simExtLuaParser.git
version: coppeliasim-v4.4.0-rev0
simExtLuaRemoteApiClient:
type: git
url: https://github.com/CoppeliaRobotics/simExtLuaRemoteApiClient.git
version: coppeliasim-v4.4.0-rev0
simExtMTB:
type: git
url: https://github.com/CoppeliaRobotics/simExtMTB.git
version: coppeliasim-v4.4.0-rev0
simExtOctomap:
type: git
url: https://github.com/CoppeliaRobotics/simExtOctomap.git
version: coppeliasim-v4.4.0-rev0
simExtOMPL:
type: git
url: https://github.com/CoppeliaRobotics/simExtOMPL.git
version: coppeliasim-v4.4.0-rev0
simExtOpenGL3Renderer:
type: git
url: https://github.com/CoppeliaRobotics/simExtOpenGL3Renderer.git
version: coppeliasim-v4.4.0-rev0
simExtOpenMesh:
type: git
url: https://github.com/CoppeliaRobotics/simExtOpenMesh.git
version: coppeliasim-v4.4.0-rev0
simExtPovRay:
type: git
url: https://github.com/CoppeliaRobotics/simExtPovRay.git
version: coppeliasim-v4.4.0-rev0
simExtQHull:
type: git
url: https://github.com/CoppeliaRobotics/simExtQHull.git
version: coppeliasim-v4.4.0-rev0
simExtQML:
type: git
url: https://github.com/CoppeliaRobotics/simExtQML.git
version: coppeliasim-v4.4.0-rev0
simExtRemoteApi:
type: git
url: https://github.com/CoppeliaRobotics/simExtRemoteApi.git
version: coppeliasim-v4.4.0-rev0
simExtRML2:
type: git
url: https://github.com/CoppeliaRobotics/simExtRML2.git
version: coppeliasim-v4.4.0-rev0
simExtRRS1:
type: git
url: https://github.com/CoppeliaRobotics/simExtRRS1.git
version: coppeliasim-v4.4.0-rev0
simExtRuckig:
type: git
url: https://github.com/CoppeliaRobotics/simExtRuckig.git
version: coppeliasim-v4.4.0-rev0
simExtSDF:
type: git
url: https://github.com/CoppeliaRobotics/simExtSDF.git
version: coppeliasim-v4.4.0-rev0
simExtSubprocess:
type: git
url: https://github.com/CoppeliaRobotics/simExtSubprocess.git
version: coppeliasim-v4.4.0-rev0
simExtSurfRec:
type: git
url: https://github.com/CoppeliaRobotics/simExtSurfRec.git
version: coppeliasim-v4.4.0-rev0
simExtUI:
type: git
url: https://github.com/CoppeliaRobotics/simExtUI.git
version: coppeliasim-v4.4.0-rev0
simExtURDF:
type: git
url: https://github.com/CoppeliaRobotics/simExtURDF.git
version: coppeliasim-v4.4.0-rev0
simExtURLDrop:
type: git
url: https://github.com/CoppeliaRobotics/simExtURLDrop.git
version: coppeliasim-v4.4.0-rev0
simExtWS:
type: git
url: https://github.com/CoppeliaRobotics/simExtWS.git
version: coppeliasim-v4.4.0-rev0
simExtZMQ:
type: git
url: https://github.com/CoppeliaRobotics/simExtZMQ.git
version: coppeliasim-v4.4.0-rev0
standAloneKinematicsDemo1:
type: git
url: https://github.com/CoppeliaRobotics/standAloneKinematicsDemo1.git
version: coppeliasim-v4.4.0-rev0
standAloneKinematicsDemo2:
type: git
url: https://github.com/CoppeliaRobotics/standAloneKinematicsDemo2.git
version: coppeliasim-v4.4.0-rev0
threejsFrontend:
type: git
url: https://github.com/CoppeliaRobotics/threejsFrontend.git
version: coppeliasim-v4.4.0-rev0
videoRecorder:
type: git
url: https://github.com/CoppeliaRobotics/videoRecorder.git
version: coppeliasim-v4.4.0-rev0
wsRemoteApi:
type: git
url: https://github.com/CoppeliaRobotics/wsRemoteApi.git
version: coppeliasim-v4.4.0-rev0
zmqRemoteApi:
type: git
url: https://github.com/CoppeliaRobotics/zmqRemoteApi.git
version: coppeliasim-v4.4.0-rev0
simMath:
type: git
url: https://github.com/CoppeliaRobotics/simMath.git
version: coppeliasim-v4.4.0-rev0
remoteApi:
type: git
url: https://github.com/CoppeliaRobotics/remoteApi.git
version: coppeliasim-v4.4.0-rev0

How to compile CoppeliaSim (v4.4) from source on Linux

Tested on Ubuntu 22.04 (arm64 and x64)

  1. Install dependicies

  • pip: sudo apt install python3-pip
  • colcon: pip install -U colcon-common-extensions
  • vcs: pip install vcstool
  • git: sudo apt install git
  • cmake: sudo apt install cmake
  • lua5.3: sudo apt install lua5.3 liblua5.3-dev
  • luarocks: sudo apt install luarocks
  • qt@5: sudo apt install qtbase5-dev
  • qscintilla2: sudo apt install libqscintilla2-qt5-dev
  • eigen: sudo apt install libeigen3-dev
  • boost: sudo apt install libboost-all-dev
  • xsltproc: sudo apt install xsltproc
  • xmlschema: pip install xmlschema
  1. Download CoppeliaSim

Get the 4.4 version from https://www.coppeliarobotics.com/downloads

  1. Remove the compiled libraries

This is only needed if you are compiling for a different architecture, like arm.

Also the directories:

  • luar
  • platforms
  • platformthemes

TODO: and some more

  1. Create a workspace where to build

  • create a directory with subdir src
  • download the list of repos wget https://gist.githubusercontent.com/jeguzzi/1b1ed8c495b7cab54ac4b953243fe669/raw/8ea752cb5a0385d6b9f492527321a93df5438fff/coppeliasim.repos
  • import the repos: vcs import src < coppeliasim.repos
  • patch with this: https://github.com/CoppeliaRobotics/CoppeliaSimLib/pull/19/files in case you are installing coppeliaSim <= v4.4
  1. Setup your env

eval $(luarocks path)
export LUA_LIBRARIES=/usr/lib/aarch64-linux-gnu/liblua5.3.so
export LUA_INCLUDE_DIR=/usr/include/lua5.3
export QSCINTILLA_DIR=/usr/include/aarch64-linux-gnu/qt5/Qsci
export QSCINTILLA_LIBS="/usr/lib/libqscintilla2_qt5.so"
export QSCINTILLA_INCLUDEPATH="/usr/include/aarch64-linux-gnu/qt5"
export PATH=$HOME/.local/bin:$PATH

Set the COPPELIASIM_ROOT_DIR to where you saved the original coppeliaSim directory

export COPPELIASIM_ROOT_DIR=<COPPELIASIM_DIR>
  1. Build the coppeliaSim library

colcon build --packages-select coppeliaSim --cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DINSTALL_DIR=$COPPELIASIM_ROOT_DIR \
-DCOPPELIASIM_PROGRAMMING_DIR=$PWD/src \
-DLUA_LIBRARIES=/usr/lib/aarch64-linux-gnu/liblua5.3.so \
-DLUA_INCLUDE_DIR=/usr/include/lua5.3 \
-DQSCINTILLA_DIR=/usr/include/aarch64-linux-gnu/qt5/Qsci \
-DQSCINTILLA_LIBRARY=/usr/lib/libqscintilla2_qt5.so

This may take some minutes.

  1. Build the client application

TODO: patch coppeliaSim/CMakeLists.txt to add target_compile_options(coppeliaSim PRIVATE -fvisibility=hidden) else it won't work on arm64.

colcon build --packages-select simClientApplication --cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DINSTALL_DIR=$COPPELIASIM_ROOT_DIR \
-DCOPPELIASIM_LIBRARY=$COPPELIASIM_ROOT_DIR
  1. Install the rocks

luarocks --tree $COPPELIASIM_ROOT_DIR/luar install lpeg
luarocks --tree $COPPELIASIM_ROOT_DIR/luar install lpeglabel
luarocks --tree $COPPELIASIM_ROOT_DIR/luar install lua-parser
luarocks --tree $COPPELIASIM_ROOT_DIR/luar install luasocket
luarocks --tree $COPPELIASIM_ROOT_DIR/luar install org.conman.cbor
  1. Install the plugins

TODO: add SciLexer.h

colcon build --packages-select simExtCodeEditor --cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DQSCINTILLA_DIR=/usr/include/aarch64-linux-gnu/qt5/Qsci \
-DQSCINTILLA_LIBRARY=/usr/lib/libqscintilla2_qt5.so

TODO: patch simExtDyn/CMakeLists.txt

  • for arm to remove all the sse flags
  • to find LIBCOPPELIASIM_SOURCE_DIR
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DBullet_2_83=OFF -DVortex=OFF  -DMujoco=OFF -DNewton=OFF --packages-select simExtDyn
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-skip-build-finished --packages-select-regex "simExt*" --continue-on-error

Some may fail if you miss dependencies and a few fails anyway on arm64.

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