Skip to content

Building CuraEngine From Source

Remco Burema edited this page Nov 23, 2022 · 19 revisions

Note:
We are currently in the process of switch our builds and pipelines to an approach which uses Conan and pip to manage our dependencies, which are stored on our JFrog Artifactory server and in the pypi.org. At the moment not everything is fully ported yet, so bear with us.

System Requirements

Windows

  • Python 3.10 or higher
  • Ninja 1.10 or higher
  • VS2022 or higher
  • CMake 3.23 or higher
  • nmake

MacOs

  • Python 3.10 or higher
  • Ninja 1.10 or higher
  • apply clang 11 or higher
  • CMake 3.23 or higher
  • make

Linux

  • Python 3.10 or higher
  • Ninja 1.10 or higher
  • gcc 12 or higher
  • CMake 3.23 or higher
  • make

Installation

We are using conan to manage our dependencies and build configuration. If you have never used Conan read their documentation which is quite extensive and well maintained.

1. Configure Conan

Before you start, if you use conan for other (big) projects as well, it's a good idea to either switch conan-home and/or backup your existing conan configuration(s).

pip install conan --upgrade
conan config install https://github.com/ultimaker/conan-config.git
conan profile new default --detect --force

Community developers would have to remove the Conan cura repository because it requires credentials (conan remote remove cura).

Ultimaker developers need to request an account for our JFrog Artifactory server at IT

conan remote cura

2. Clone CuraEngine

git clone https://github.com/Ultimaker/CuraEngine.git
cd CuraEngine

3. Install & Build CuraEngine (Release OR Debug)

Release

conan install . --build=missing --update
# optional for a specific version: conan install . curaengine/<version>@<user>/<channel> --build=missing --update
cmake --preset release
cmake --build --preset release

Debug

conan install . --build=missing --update -s build_type=Debug
cmake --preset debug
cmake --build --preset debug

4. Activate Conan Run Environment

# For Linux/MacOS
source build/generators/conanrun.sh
# For Windows (Powershell)
.\build\generators\conanrun.sh

5. Connecting to Cura

If you run cura_app.py with the option --external-backend, Cura will wait for an external backend when hitting the slice button.

You can slice using your development environment by running the following command.

./build/Debug/CuraEngine connect 127.0.0.1:49674
OR
./build/Release/CuraEngine connect 127.0.0.1:49674

If a slice fails you will need to increment the port number the next time you run this command.

Troubleshooting

Some error messages and their potential causes:

  • [Could not find a package configuration file provided by "rapidjson" (requested version 1.1.0)](https://www.google.com/search?q=Could+not+find+a+package+configuration+file+provided+by+%22rapidjson%22+%28requested+version+1.1.0%29+with+any+of+the+following+names) – this error has been encountered when trying to build a version prior to 5.2. Try again on version 5.2 or later.
  • Make Error: Could not read presets from : Unrecognized "version" field – Make sure that you're using CMake 3.23 or later (the version bundled with Ubuntu 22.04 is not new enough).
  • Errors contacting jfrog.artifactory.com or similar – make sure you've run conan remote remove cura.

Running

You can run CuraEngine using a frontend, such as Cura. It is also possible to run CuraEngine from the command line. For that you need a settings JSON file, which can be found in the Ultimaker/Cura repository.

Run CuraEngine help for a general description of how to use the CuraEngine tool.

Set the environment variable CURA_ENGINE_SEARCH_PATH to the appropriate paths, delimited by a colon e.g.

CURA_ENGINE_SEARCH_PATH=/path/to/Cura/resources/definitions:/user/defined/path