Skip to content

Latest commit

 

History

History
136 lines (98 loc) · 5 KB

setup.md

File metadata and controls

136 lines (98 loc) · 5 KB

Setup Instructions

General Prerequisites

Qt 6.x is not supported yet

Getting the Source Code

Darwin source tree uses Git submodules so add --recursive to git clone:

git clone --recursive <Darwin repository>

Or, the submodules can be initialized after a regular clone:

git submodule init
git submodule update

Submodules may change. To avoid having to repeatedly run git submodule update:

  • Use git pull --recurse-submodules when updating the local repository.
  • Or, you can make it automatic: git config submodule.recurse true

Building & Running Darwin Studio

First, review the platform-specific instructions below.

  1. Open the darwin.pro project in Qt Creator (the first time the project is loaded it will prompt you to select a kit)

  2. Select the darwin_studio subproject (Tip: experiments run much faster with the Release build flavor, although Debug provides a better debugging experience)

    Select Project

  3. Build / Run (default keyboard shortcut is Ctrl+R)

Building from the Command Line

  1. Export QTDIR to point to the Qt location (ex. export QTDIR=/home/user/Qt/5.14.2/gcc_64)

  2. Create a build directory and cd into it (ex. mkdir .build_release && cd .build_release)

  3. Invoke Qmake (ex. $QTDIR/bin/qmake ../darwin.pro CONFIG+=release)

  4. Invoke Make (ex. make -j8 or nmake on Windows)

Running the Tests

The recommended way to run Darwin tests is from Qt Creator: Tools / Tests / Run All Tests or from the Test Results pane.

For more information see the official Qt Creator's Autotests documentation.

Python Bindings

See the dedicated page.

Qt Creator Tips

  • Use the included code_style.xml. See the Coding style notes.
  • The default code model diagnostics can be overly noisy. The workaround is to change C++ / Code Model = Clang-only checks for questionable constructs
  • If any of the tests timeout (Debug builds might hit this), try increasing the value for Options / Testing / General / Timeout
  • Don't forget to select the Release build flavor when running the evolution experiments (The Debug builds provide a better debugging experience but they are much slower)
  • If something fails to compile or run, in a bizarre way, run qmake + rebuild (Always run qmake on root project after changing Qt forms or signals/slots)
  • For selecting a custom build output location, change the default build directory under Tools / Options / Build & Run (before selecting the kit)

Windows

  • The recommended toolchain is MSVC (Microsoft Visual C++), included with Visual Studio 2017 or newer. The free Community Edition will suffice.

NOTE: Darwin should build fine with MinGW 7.x+, although this configuration is not currently supported (and does not work). MinGW ships with a broken std::random_device implementation, which is critical for stochastic algorithms like Neuroevolution.

Linux

  • Requires GCC 6.x+
  • In Qt Creator, under Projects / Build / Build Steps (note that you need to do this for every build flavor):
    • Optional (speed up the builds): Set make / Make arguments += -jN (where N is the number of available CPU cores)
  • If the build fails complaining that <gl/gl.h> can't be found, try sudo apt install libgl-dev (noticed on Ubuntu 18.04)

macOS

The C++ toolchain included with the current Xcode (10.0) is lacking some of the required C++ 17 features and/or libraries. One workaround is to manually install Clang 7.x+:

  • Install Homebrew
  • brew install llvm
  • brew install doxygen (Optional, used to build the reference documentation)
  • In Qt Creator, under Projects / Build / Build Steps (note that you need to do this for every build flavor):
    • qmake / Additional arguments +=
      QMAKE_CXX=/usr/local/opt/llvm/bin/clang++ QMAKE_CC=/usr/local/opt/llvm/bin/clang QMAKE_LIBDIR=/usr/local/opt/llvm/lib
    • Optional (speed up the builds): Set make / Make arguments += -jN (where N is the number of available CPU cores)