- General Prerequisites
- Getting the Source Code
- Building & Running Darwin Studio
- Building from the Command Line
- Running the Tests
- Python Bindings
- Qt Creator Tips
- Windows
- Linux
- macOS
- Qt 5.x and QtCreator 4.x+ (Qt Charts must be selected)
- Python 3 for running the bundled scripts
- Doxygen for generating the API documentation
Qt 6.x is not supported yet
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-submoduleswhen updating the local repository.- Or, you can make it automatic:
git config submodule.recurse true
First, review the platform-specific instructions below.
-
Open the
darwin.proproject in Qt Creator (the first time the project is loaded it will prompt you to select a kit) -
Select the
darwin_studiosubproject (Tip: experiments run much faster with theReleasebuild flavor, althoughDebugprovides a better debugging experience) -
Build / Run(default keyboard shortcut is Ctrl+R)
-
Export
QTDIRto point to the Qt location (ex.export QTDIR=/home/user/Qt/5.14.2/gcc_64) -
Create a build directory and
cdinto it (ex.mkdir .build_release && cd .build_release) -
Invoke Qmake (ex.
$QTDIR/bin/qmake ../darwin.pro CONFIG+=release) -
Invoke Make (ex.
make -j8ornmakeon Windows)
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.
See the dedicated page.
- 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 (
Debugbuilds might hit this), try increasing the value forOptions / Testing / General / Timeout - Don't forget to select the
Releasebuild flavor when running the evolution experiments (TheDebugbuilds 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)
- 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.
- 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)
- Optional (speed up the builds): Set
- If the build fails complaining that
<gl/gl.h>can't be found, trysudo apt install libgl-dev(noticed on Ubuntu 18.04)
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 llvmbrew 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/clangQMAKE_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)
