Installation guide for Linux (compiling)

282 views
Skip to first unread message

19yc93

unread,
Jun 6, 2018, 2:00:35 PM6/6/18
to ProjectChrono
Hello,

because the installation guide is not really intended for Linux users and I had my difficulties installing Chrono, I thought I would share with you my solution.

I will follow the steps described in the official installation guide but I will add or change some details. It was tested on KDE Neon, which is based on Ubuntu 16.04 LTS. If you think I could change something than give me a hint.
Maybe a admin can add this to the official installation guide.

1. Check/Install a C++ compiler
  • Check if GNU C++ compiler is installed on your system by searching for G++ in your package manager
2. Install CMake
You have 2 options to install the following packages: 
    • Open your package manager and install the following packages: cmake; cmake-data; cmake-qt-gui; extra-cmake-modules
OR
    • Open your Terminal and type:
      sudo apt-get install cmake cmake-data cmake-qt-gui extra-cmake-module

3. Install a GIT client
You have 2 options to install the following packages: 
    • Open your package manager and install the following packages: git; git-gui
OR
    • Open your Terminal and type:
      sudo apt-get install git git-gui

4. Download the project by cloning the Git repository
  • Open your Terminal and type:
    sudo git gui

  • Click on Clone Existing Repository
  • Enter at Source Location the following:
  • Enter at Target directory: you can choose the directory of your choice. I recommend to do it at:
    /opt/chrono/source
    To create this directory, change to the Terminal and enter:
    sudo mkdir /opt/chrono && sudo mkdir /opt/chrono/source

  • Enable Recursively clone submodules too
  • Click on Clone

5. Download the Irrlicht library
  • Click here for the direct download of the release v.1.8.2 of Irrlicht
    This release is tested to be stable and working well with Chrono. This is the recommended release.
    Release v.1.8.4 should work perfectly as well.
  • Unzip it in a directory of your choice. For example, here I suppose that you unzipped it in /home/YOURUSER/Downloads
  • I suppose that you unzipped in the above directory. You can choose a target directory of your choice for your Irrlicht library, but I recommend it to do it in /opt. Type in  the Terminal (change YOURUSER and IRRLICHT_FOLDER!):
    sudo mv /home/YOURUSER/Downloads/IRRLICHT_FOLDER /opt/

    cd /opt/IRRLICHT_FOLDER/source/Irrlicht

    sudo make sharedlib

    sudo make install

6. Run CMake
  • Open a new Terminal window and type: sudo cmake-gui
  • Where is the source code: /opt/chrono/source
  • Where to build the binaries: /opt/chrono/build
  • Click Configure
  • Click Configure
  • Choose Use default native compilers
  • Click on Finish
  • Enable all the boxes like in the upper picture:

  • Click again Configure
  • Now nothing should be with a red background and there should be no error messages in the lower window
  • Click on Generate
7. Compile the project
  • You have 2 options to install the following packages: 
    • Open your package manager and install the following packages: freeglut3 and freeglut3-dev
      OR
    • Open your Terminal and type:sudo apt-get install freeglut3 freeglut3-dev
  • In the terminal go to the build directory (which you specified in step 6):
    cd /opt/chrono/build

    sudo make

8. Take the demos for a ride!

  • Go to /opt/chrono/build/bin/ an double-click for example demo_IRR_crank and check if everythink works
Message has been deleted

Conlain Kelly

unread,
Sep 17, 2018, 2:05:26 PM9/17/18
to ProjectChrono
Hello 19yc93,

We appreciate your providing information for the chrono community. 
That said, we do not recommend cloning chrono to a root prefix. You do not need root to build chrono -- this is unnecessary and unsafe. 
As a general, you should never need to build or clone a repository with root privileges. 
You may need to use sudo to install dependencies with your package manager, but this is really the only place.

I'm currently working on such a documentation for the chrono website and will notify this forum when it is available.

Thank you,
Conlain Kelly

Reply all
Reply to author
Forward
0 new messages