OrcaSlicer/doc/How-to-build.md
Dipl.-Ing. Raoul Rubien, BSc 6da7fe62a2
Some checks are pending
Build all / Build All (push) Waiting to run
Build all / Flatpak (push) Waiting to run
Publish docs to Wiki / Publish docs to Wiki (push) Waiting to run
Fixes, refactors and enhances Linux build-scripts (#8269)
* fixes and refactors linux build scripts
 - build_linux.sh: fixes wrong AppImage build folder; refactors script; enhances help text
 - harmonizes names: BuildLinux.sh and BuildLinuxImage.sh
 - fixes file permissions: cmake inherits .in-file permission; removes chmod 755 in scripts
 - linux.d/debian: removes false positive error message
 - updates documentation

* enables ANSI-colored output for GNU or Clang

* build_linux.sh: adds -p flag to disable PCH for boosting ccache hit rate

* Allow compilation on distributions based on Ubuntu/Debian (#8625)

* build_linux.sh: takes over changes from BuildLinux.sh

* CMakeLists.txt: removes leftovers, enables ANSI-colored output

* CMakeLists.txt: fixes issue where FORCE_COLORED_OUTPUT was not respected form environment (introduces -C cli arg)

* merges 5df4275: Make it easy to pass extra build args to deps and orca in BuildLinux.sh (#9648)
2025-06-15 00:41:20 +08:00

4.9 KiB

How to Build

Windows 64-bit

This guide is for building your Visual Studio 2022 solution for OrcaSlicer on Windows 64-bit.

Tools Required

  • Visual Studio 2022 or Visual Studio 2019
    winget install --id=Microsoft.VisualStudio.2022.Professional -e
    
  • CMake (version 3.31)⚠️ version 3.31.x is mandatory
    winget install --id=Kitware.CMake -v "3.31.6" -e
    
  • Strawberry Perl
    winget install --id=StrawberryPerl.StrawberryPerl -e
    
  • Git
    winget install --id=Git.Git -e
    
  • git-lfs
    winget install --id=GitHub.GitLFS -e
    

Tip

GitHub Desktop (optional): A GUI for Git and Git LFS, which already includes both tools.

winget install --id=GitHub.GitHubDesktop -e

Instructions

  1. Clone the repository:
    • If using GitHub Desktop clone the repository from the GUI.
    • If using the command line:
      1. Clone the repository:
      git clone https://github.com/SoftFever/OrcaSlicer
      
      1. Run lfs to download tools on Windows:
      git lfs pull
      
  2. Open the appropriate command prompt:
    • For Visual Studio 2019:
      Open x64 Native Tools Command Prompt for VS 2019 and run:
      build_release.bat
      
    • For Visual Studio 2022:
      Open x64 Native Tools Command Prompt for VS 2022 and run:
      build_release_vs2022.bat
      
  3. If successful, you will find the VS 2022 solution file in:
    build\OrcaSlicer.sln
    

Important

Make sure that CMake version 3.31.x is actually being used. Run cmake --version and verify it returns a 3.31.x version. If you see an older version (e.g. 3.29), it's likely due to another copy in your system's PATH (e.g. from Strawberry Perl). You can run where cmake to check the active paths and rearrange your System Environment Variables > PATH, ensuring the correct CMake (e.g. C:\Program Files\CMake\bin) appears before others like C:\Strawberry\c\bin.

Note

If the build fails, try deleting the build/ and deps/build/ directories to clear any cached build data. Rebuilding after a clean-up is usually sufficient to resolve most issues.

macOS 64-bit

Tools Required

  • Xcode
  • CMake (version 3.31.x is mandatory)
  • Git
  • gettext
  • libtool
  • automake
  • autoconf
  • texinfo

Tip

You can install most of them by running:

brew install gettext libtool automake autoconf texinfo

Homebrew currently only offers the latest version of CMake (e.g. 4.X), which is not compatible. To install the required version 3.31.X, follow these steps:

  1. Download CMake 3.31.7 from: https://cmake.org/download/
  2. Install the application (drag it to /Applications).
  3. Add the following line to your shell configuration file (~/.zshrc or ~/.bash_profile):
export PATH="/Applications/CMake.app/Contents/bin:$PATH"
  1. Restart the terminal and check the version:
cmake --version
  1. Make sure it reports a 3.31.x version.

Important

If you've recently upgraded Xcode, be sure to open Xcode at least once and install the required macOS build support.

Instructions

  1. Clone the repository:
    git clone https://github.com/SoftFever/OrcaSlicer
    cd OrcaSlicer
    
  2. Build the application:
    ./build_release_macos.sh
    
  3. Open the application:
    open build/arm64/OrcaSlicer/OrcaSlicer.app
    

Debugging in Xcode

To build and debug directly in Xcode:

  1. Open the Xcode project:
    open build/arm64/OrcaSlicer.xcodeproj
    
  2. In the menu bar:
    • Product > Scheme > OrcaSlicer
    • Product > Scheme > Edit Scheme...
      • Under Run > Info, set Build Configuration to RelWithDebInfo
      • Under Run > Options, uncheck Allow debugging when browsing versions
    • Product > Run

Linux

Dependencies

  • Docker
  • Git

Instructions

git clone https://github.com/SoftFever/OrcaSlicer && cd OrcaSlicer && ./DockerBuild.sh && ./DockerRun.sh

Note

To troubleshoot common Docker-related errors, refer to the comments in

DockerRun.sh

Ubuntu

Dependencies

All required dependencies will be installed automatically by the provided shell script, including:

  • libmspack-dev
  • libgstreamerd-3-dev
  • libsecret-1-dev
  • libwebkit2gtk-4.0-dev
  • libosmesa6-dev
  • libssl-dev
  • libcurl4-openssl-dev
  • eglexternalplatform-dev
  • libudev-dev
  • libdbus-1-dev
  • extra-cmake-modules
  • libgtk2.0-dev
  • libglew-dev
  • cmake
  • git
  • texinfo

Instructions

`./build_linux.sh -u`      # install dependencies
`./build_linux.sh -disr`    # build OrcaSlicer