mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-05 00:24:30 +03:00
Compare commits
2 Commits
feat/plugi
...
v2.3.2-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd5c8f2ad0 | ||
|
|
2d0a0568e7 |
@@ -5,7 +5,7 @@ Language: Cpp
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignConsecutiveDeclarations: true
|
||||
AlignEscapedNewlines: DontAlign
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"PLATFORM": "linux/amd64",
|
||||
"BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04"
|
||||
"BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-22.04"
|
||||
},
|
||||
"options": ["--platform=linux/amd64"]
|
||||
},
|
||||
|
||||
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -11,15 +11,6 @@ body:
|
||||
For this, please use the [Feature request](https://github.com/OrcaSlicer/OrcaSlicer/issues/new?assignees=&labels=&projects=&template=feature_request.yml) issue type or you can discuss your idea on our [Discord server](https://discord.gg/P4VE9UY9gJ) with others.
|
||||
|
||||
Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is this issue reproducible in the latest nightly build?
|
||||
description: >
|
||||
Please verify this issue still happens in the latest nightly build first. It may already be fixed there:
|
||||
[Nightly builds](https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/nightly-builds).
|
||||
options:
|
||||
- label: I have checked the latest nightly build and the issue is still reproducible
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this problem?
|
||||
|
||||
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
@@ -19,9 +19,3 @@
|
||||
<!--
|
||||
> Please describe the tests that you have conducted to verify the changes made in this PR.
|
||||
-->
|
||||
|
||||
<!--
|
||||
> A guide for users on how to download the artifacts from this PR.
|
||||
-->
|
||||
|
||||
[How to Download Pull Requests Artifacts for Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
|
||||
|
||||
2
.github/workflows/auto-close-duplicates.yml
vendored
2
.github/workflows/auto-close-duplicates.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
144
.github/workflows/build_all.yml
vendored
144
.github/workflows/build_all.yml
vendored
@@ -5,7 +5,6 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- release/*
|
||||
- belt-printer
|
||||
paths:
|
||||
- 'deps/**'
|
||||
- 'src/**'
|
||||
@@ -15,8 +14,6 @@ on:
|
||||
- 'resources/**'
|
||||
- ".github/workflows/build_*.yml"
|
||||
- 'scripts/flatpak/**'
|
||||
- 'scripts/msix/**'
|
||||
- 'tests/**'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
@@ -30,12 +27,9 @@ on:
|
||||
- 'version.inc'
|
||||
- ".github/workflows/build_*.yml"
|
||||
- 'build_linux.sh'
|
||||
- 'build_release_vs.bat'
|
||||
- 'build_release_vs2022.bat'
|
||||
- 'build_release_macos.sh'
|
||||
- 'scripts/flatpak/**'
|
||||
- 'scripts/msix/**'
|
||||
- 'tests/**'
|
||||
|
||||
|
||||
schedule:
|
||||
@@ -55,19 +49,25 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
name: Build Linux
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
os: ubuntu-24.04
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
secrets: inherit
|
||||
build_all:
|
||||
name: Build Non-Linux
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# Build both arches on every event (PRs included), through the same
|
||||
# build_check_cache -> build_deps -> build_orca chain (the AppImage).
|
||||
# aarch64 always uses the GitHub-hosted arm runner (there is no arm
|
||||
# self-hosted server). amd64's empty arch is load-bearing: it keeps the
|
||||
# historical 'linux-clang' deps cache key and the unsuffixed asset names.
|
||||
matrix:
|
||||
include:
|
||||
- arch: ""
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
|
||||
- arch: "aarch64"
|
||||
os: ubuntu-24.04-arm
|
||||
- os: windows-latest
|
||||
- os: orca-macos-arm64
|
||||
arch: arm64
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
@@ -75,87 +75,37 @@ jobs:
|
||||
os: ${{ matrix.os }}
|
||||
arch: ${{ matrix.arch }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
secrets: inherit
|
||||
build_windows:
|
||||
name: Build Windows ${{ matrix.arch }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x64
|
||||
os: windows-latest
|
||||
- arch: arm64
|
||||
os: windows-11-arm
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
# Self-hosted runner is x64-only; ARM64 always uses the GitHub-hosted runner.
|
||||
os: ${{ (matrix.arch == 'x64' && vars.SELF_HOSTED) && 'orca-win-server' || matrix.os }}
|
||||
arch: ${{ matrix.arch }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
force-build: ${{ github.event_name == 'schedule' }}
|
||||
secrets: inherit
|
||||
build_macos_arch:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch:
|
||||
- arm64
|
||||
- x86_64
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
|
||||
arch: ${{ matrix.arch }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
force-build: ${{ github.event_name == 'schedule' }}
|
||||
secrets: inherit
|
||||
build_macos_universal:
|
||||
name: Build macOS Universal
|
||||
needs: build_macos_arch
|
||||
if: ${{ !cancelled() && needs.build_macos_arch.result == 'success' && !inputs.build-deps-only && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_orca.yml
|
||||
with:
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
|
||||
arch: universal
|
||||
macos-combine-only: true
|
||||
secrets: inherit
|
||||
unit_tests:
|
||||
name: Unit Tests
|
||||
# Tests are built on the aarch64 leg by default (faster GitHub arm runner),
|
||||
# so run them there; self-hosted builds them on the amd64 server instead.
|
||||
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04-arm' }}
|
||||
runs-on: ubuntu-24.04
|
||||
needs: build_linux
|
||||
if: ${{ !cancelled() && success() }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github
|
||||
scripts
|
||||
tests
|
||||
- name: Apt-Install Dependencies
|
||||
if: ${{ !vars.SELF_HOSTED }}
|
||||
uses: ./.github/actions/apt-install-deps
|
||||
- name: Restore Test Artifact
|
||||
uses: actions/download-artifact@v8
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: ${{ github.sha }}-tests
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
|
||||
useLocalCache: true # <--= Use the local cache (default is 'false').
|
||||
useCloudCache: true
|
||||
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
||||
- name: Unpackage and Run Unit Tests
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
tar -xvf build_tests.tar
|
||||
scripts/run_unit_tests.sh
|
||||
- name: Upload Test Logs
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@v6
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: unit-test-logs
|
||||
@@ -165,15 +115,10 @@ jobs:
|
||||
uses: EnricoMi/publish-unit-test-result-action@v2
|
||||
with:
|
||||
files: "ctest_results.xml"
|
||||
- name: Delete Test Artifact
|
||||
if: success()
|
||||
uses: geekyeggo/delete-artifact@v6
|
||||
with:
|
||||
name: ${{ github.sha }}-tests
|
||||
flatpak:
|
||||
name: "Flatpak"
|
||||
container:
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
|
||||
options: --privileged
|
||||
volumes:
|
||||
- /usr/local/lib/android:/usr/local/lib/android
|
||||
@@ -189,22 +134,18 @@ jobs:
|
||||
runner: ubuntu-24.04
|
||||
- arch: aarch64
|
||||
runner: ubuntu-24.04-arm
|
||||
# Don't run scheduled builds on forks; skip entirely on self-hosted runners
|
||||
if: ${{ !cancelled() && !vars.SELF_HOSTED && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
runs-on: ${{ matrix.variant.runner }}
|
||||
env:
|
||||
date:
|
||||
ver:
|
||||
ver_pure:
|
||||
# Belt-printer nightlies share the main nightly release but carry a `_belt`
|
||||
# suffix so they never overwrite the main assets.
|
||||
nightly_suffix: ${{ github.ref == 'refs/heads/belt-printer' && '_belt' || '' }}
|
||||
steps:
|
||||
- name: "Remove unneeded stuff to free disk space"
|
||||
run:
|
||||
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/*
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Get the version and date
|
||||
run: |
|
||||
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
@@ -213,57 +154,32 @@ jobs:
|
||||
git_commit_hash="${{ github.event.pull_request.head.sha }}"
|
||||
else
|
||||
ver=V$ver_pure
|
||||
git_commit_hash="${{ github.sha }}"
|
||||
git_commit_hash=""
|
||||
fi
|
||||
echo "ver=$ver" >> $GITHUB_ENV
|
||||
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
# Manage flatpak-builder cache externally so PRs restore but never upload
|
||||
- name: Restore flatpak-builder cache
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/cache/restore@v6
|
||||
with:
|
||||
path: .flatpak-builder
|
||||
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.event.pull_request.base.sha }}
|
||||
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
|
||||
- name: Save/restore flatpak-builder cache
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .flatpak-builder
|
||||
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.sha }}
|
||||
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
|
||||
- name: Disable debug info for faster CI builds
|
||||
run: |
|
||||
sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \
|
||||
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
||||
shell: bash
|
||||
- name: Inject git commit hash into Flatpak manifest
|
||||
run: |
|
||||
sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n build-options:\n env:\n git_commit_hash: \"$git_commit_hash\"|}" \
|
||||
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
||||
shell: bash
|
||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
|
||||
with:
|
||||
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
||||
manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
||||
cache: false
|
||||
manifest-path: scripts/flatpak/io.github.softfever.OrcaSlicer.yml
|
||||
cache: true
|
||||
arch: ${{ matrix.variant.arch }}
|
||||
upload-artifact: false
|
||||
- name: Upload artifacts Flatpak
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
||||
path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak'
|
||||
- name: Deploy Flatpak to nightly release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/belt-printer')
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
||||
asset_name: OrcaSlicer-Linux-flatpak_nightly${{ env.nightly_suffix }}_${{ matrix.variant.arch }}.flatpak
|
||||
asset_name: OrcaSlicer-Linux-flatpak_nightly_${{ matrix.variant.arch }}.flatpak
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
|
||||
17
.github/workflows/build_check_cache.yml
vendored
17
.github/workflows/build_check_cache.yml
vendored
@@ -26,27 +26,22 @@ jobs:
|
||||
valid-cache: ${{ steps.cache_deps.outputs.cache-hit }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
lfs: 'false'
|
||||
lfs: 'true'
|
||||
|
||||
- name: set outputs
|
||||
id: set_outputs
|
||||
env:
|
||||
# Keep macOS/Windows cache keys architecture-specific. amd64 Linux passes
|
||||
# no arch (key stays 'linux-clang', preserving the existing cache);
|
||||
# aarch64 gets its own 'linux-clang-aarch64' key.
|
||||
cache-os: ${{ runner.os == 'macOS' && format('macos-{0}', inputs.arch) || (runner.os == 'Windows' && format('windows-{0}', inputs.arch) || format('linux-clang{0}', inputs.arch && format('-{0}', inputs.arch) || '')) }}
|
||||
# ARM64 builds use the build-arm64 tree (see build_release_vs.bat); x64/other use build.
|
||||
dep-folder-name: ${{ runner.os == 'macOS' && format('/{0}', inputs.arch) || (runner.os == 'Windows' && inputs.arch == 'arm64') && '-arm64/OrcaSlicer_dep' || '/OrcaSlicer_dep' }}
|
||||
output-cmd: ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
|
||||
dep-folder-name: ${{ inputs.os != 'orca-macos-arm64' && '/OrcaSlicer_dep' || '' }}
|
||||
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
|
||||
run: |
|
||||
echo cache-key=${{ env.cache-os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
|
||||
echo cache-key=${{ inputs.os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
|
||||
echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }}
|
||||
|
||||
- name: load cache
|
||||
id: cache_deps
|
||||
uses: actions/cache@v6
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.set_outputs.outputs.cache-path }}
|
||||
key: ${{ steps.set_outputs.outputs.cache-key }}
|
||||
|
||||
150
.github/workflows/build_deps.yml
vendored
150
.github/workflows/build_deps.yml
vendored
@@ -34,165 +34,97 @@ jobs:
|
||||
|
||||
# Setup the environment
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
lfs: 'false'
|
||||
lfs: 'true'
|
||||
|
||||
- name: load cached deps
|
||||
uses: actions/cache@v6
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ inputs.cache-path }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
|
||||
- uses: lukka/get-cmake@latest
|
||||
# The windows-11-arm runner needs CMake <= 3.31 (handled in the next step).
|
||||
if: ${{ !(runner.os == 'Windows' && inputs.arch == 'arm64') }}
|
||||
with:
|
||||
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
|
||||
useLocalCache: true # <--= Use the local cache (default is 'false').
|
||||
useCloudCache: true
|
||||
|
||||
- name: Install CMake 3.31.x (Windows ARM64)
|
||||
# windows-11-arm ships CMake 4.x, which removed pre-3.5 policy
|
||||
# compatibility AND has incomplete ASM_ARMASM linker modules
|
||||
# (breaks Boost.Context on ARM64). Pin to the last 3.x release.
|
||||
if: runner.os == 'Windows' && inputs.arch == 'arm64'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ver = "3.31.6"
|
||||
$url = "https://github.com/Kitware/CMake/releases/download/v$ver/cmake-$ver-windows-arm64.zip"
|
||||
Invoke-WebRequest -Uri $url -OutFile "$env:RUNNER_TEMP\cmake.zip"
|
||||
Expand-Archive -Path "$env:RUNNER_TEMP\cmake.zip" -DestinationPath "$env:RUNNER_TEMP\cmake" -Force
|
||||
$cmakeBin = "$env:RUNNER_TEMP\cmake\cmake-$ver-windows-arm64\bin"
|
||||
if (-not (Test-Path "$cmakeBin\cmake.exe")) { throw "cmake.exe not found at $cmakeBin" }
|
||||
Add-Content -Path $env:GITHUB_PATH -Value $cmakeBin
|
||||
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
||||
|
||||
- name: setup dev on Windows
|
||||
if: runner.os == 'Windows'
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Get the date on Ubuntu and macOS
|
||||
if: runner.os != 'Windows'
|
||||
if: inputs.os != 'windows-latest'
|
||||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Get the date on Windows
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
shell: pwsh
|
||||
|
||||
|
||||
- name: Install MSYS2 (clangarm64) with GMP/MPFR and LLVM tools
|
||||
if: runner.os == 'Windows' && inputs.arch == 'arm64'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: CLANGARM64
|
||||
update: true
|
||||
install: >-
|
||||
mingw-w64-clang-aarch64-gmp
|
||||
mingw-w64-clang-aarch64-mpfr
|
||||
mingw-w64-clang-aarch64-llvm
|
||||
|
||||
- name: Stage ARM64 GMP/MPFR (no prebuilt blobs exist for win-arm64)
|
||||
# GMP/MPFR ship prebuilt x64/x86 blobs in-tree but none for ARM64.
|
||||
# Pull them from MSYS2 clangarm64 and generate MSVC import libs via
|
||||
# llvm-dlltool, then stage into deps/{GMP,MPFR}/.../win-arm64 where the
|
||||
# MSVC branch of GMP.cmake/MPFR.cmake copies them into the dep prefix.
|
||||
if: runner.os == 'Windows' && inputs.arch == 'arm64'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
BIN=/clangarm64/bin
|
||||
REPO=$(cygpath -u "$GITHUB_WORKSPACE")
|
||||
|
||||
make_import_lib() {
|
||||
local dll="$1"; local lib="$2"; local def="/tmp/${dll%.dll}.def"
|
||||
echo "EXPORTS" > "$def"
|
||||
llvm-readobj --coff-exports "$BIN/$dll" | awk '/Name: /{print $2}' >> "$def"
|
||||
llvm-dlltool -m arm64 -D "$dll" -d "$def" -l "$BIN/$lib"
|
||||
}
|
||||
|
||||
make_import_lib libgmp-10.dll libgmp-10.lib
|
||||
|
||||
# MPFR 4.x ships as libmpfr-6.dll; rename to libmpfr-4 BEFORE generating
|
||||
# the import lib so the baked-in runtime DLL name is correct.
|
||||
MPFR_DLL=$(ls $BIN/libmpfr-*.dll | head -1 | xargs basename)
|
||||
if [ "$MPFR_DLL" != "libmpfr-4.dll" ]; then cp "$BIN/$MPFR_DLL" "$BIN/libmpfr-4.dll"; fi
|
||||
make_import_lib libmpfr-4.dll libmpfr-4.lib
|
||||
|
||||
mkdir -p $REPO/deps/GMP/gmp/lib/win-arm64 $REPO/deps/MPFR/mpfr/lib/win-arm64
|
||||
cp $BIN/libgmp-10.dll $BIN/libgmp-10.lib $REPO/deps/GMP/gmp/lib/win-arm64/
|
||||
cp $BIN/libmpfr-4.dll $BIN/libmpfr-4.lib $REPO/deps/MPFR/mpfr/lib/win-arm64/
|
||||
cp /clangarm64/include/gmp.h $REPO/deps/GMP/gmp/include/
|
||||
cp /clangarm64/include/mpfr.h $REPO/deps/MPFR/mpfr/include/ || true
|
||||
|
||||
# Build Dependencies
|
||||
- name: Build on Windows
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
if (-not "${{ vars.SELF_HOSTED }}") {
|
||||
choco install strawberryperl
|
||||
}
|
||||
$arch = "${{ inputs.arch }}"
|
||||
if ($arch -eq "arm64") {
|
||||
.\build_release_vs.bat deps arm64
|
||||
.\build_release_vs.bat pack arm64
|
||||
} else {
|
||||
.\build_release_vs.bat deps
|
||||
.\build_release_vs.bat pack
|
||||
}
|
||||
shell: pwsh
|
||||
choco install strawberryperl
|
||||
.\build_release_vs.bat deps
|
||||
.\build_release_vs.bat pack
|
||||
cd ${{ github.workspace }}/deps/build
|
||||
|
||||
- name: Build on Mac ${{ inputs.arch }}
|
||||
if: runner.os == 'macOS'
|
||||
if: inputs.os == 'orca-macos-arm64'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
if [ -z "${{ vars.SELF_HOSTED }}" ]; then
|
||||
brew install automake texinfo libtool
|
||||
fi
|
||||
./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15
|
||||
(cd "${{ github.workspace }}/deps/build/${{ inputs.arch }}" && \
|
||||
find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +)
|
||||
# brew install automake texinfo libtool
|
||||
# brew list
|
||||
# brew uninstall --ignore-dependencies zstd
|
||||
./build_release_macos.sh -dx -a universal -t 10.15
|
||||
for arch in arm64 x86_64; do
|
||||
(cd "${{ github.workspace }}/deps/build/${arch}" && \
|
||||
find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +)
|
||||
done
|
||||
# brew install zstd
|
||||
|
||||
|
||||
- name: Apt-Install Dependencies
|
||||
if: runner.os == 'Linux' && !vars.SELF_HOSTED
|
||||
if: inputs.os == 'ubuntu-24.04'
|
||||
uses: ./.github/actions/apt-install-deps
|
||||
|
||||
- name: Build on Ubuntu
|
||||
if: runner.os == 'Linux'
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/deps/build/destdir
|
||||
./build_linux.sh -drlL
|
||||
./build_linux.sh -dr
|
||||
cd deps/build
|
||||
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
|
||||
|
||||
|
||||
# Upload Artifacts
|
||||
# - name: Upload Mac ${{ inputs.arch }} artifacts
|
||||
# if: runner.os == 'macOS'
|
||||
# if: inputs.os == 'orca-macos-arm64'
|
||||
# uses: actions/upload-artifact@v6
|
||||
# with:
|
||||
# name: OrcaSlicer_dep_mac_${{ env.date }}
|
||||
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz
|
||||
|
||||
# - name: Upload Windows artifacts
|
||||
# if: runner.os == 'Windows'
|
||||
# uses: actions/upload-artifact@v6
|
||||
# with:
|
||||
# name: OrcaSlicer_dep_win64_${{ env.date }}
|
||||
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
|
||||
- name: Upload Windows artifacts
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_dep_win64_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
|
||||
|
||||
# - name: Upload Ubuntu artifacts
|
||||
# if: runner.os == 'Linux' && !env.ACT
|
||||
# env:
|
||||
# ubuntu-ver: '2404'
|
||||
# uses: actions/upload-artifact@v6
|
||||
# with:
|
||||
# name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }}
|
||||
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
|
||||
- name: Upload Ubuntu artifacts
|
||||
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
|
||||
env:
|
||||
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
|
||||
|
||||
build_orca:
|
||||
name: Build OrcaSlicer
|
||||
|
||||
340
.github/workflows/build_orca.yml
vendored
340
.github/workflows/build_orca.yml
vendored
@@ -2,10 +2,10 @@ on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
cache-key:
|
||||
required: false
|
||||
required: true
|
||||
type: string
|
||||
cache-path:
|
||||
required: false
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: true
|
||||
@@ -13,10 +13,6 @@ on:
|
||||
arch:
|
||||
required: false
|
||||
type: string
|
||||
macos-combine-only:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_orca:
|
||||
@@ -26,54 +22,27 @@ jobs:
|
||||
date:
|
||||
ver:
|
||||
ver_pure:
|
||||
ubuntu-ver: '2404'
|
||||
ubuntu-ver-str: '_Ubuntu2404'
|
||||
ORCA_UPDATER_SIG_KEY: ${{ secrets.ORCA_UPDATER_SIG_KEY }}
|
||||
# Branches whose builds are published to the nightly release. The
|
||||
# belt-printer branch ships alongside main but its assets carry a `_belt`
|
||||
# suffix (nightly_suffix) so they never overwrite the main nightly assets.
|
||||
deploy_nightly: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/belt-printer' }}
|
||||
nightly_suffix: ${{ github.ref == 'refs/heads/belt-printer' && '_belt' || '' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
lfs: 'false'
|
||||
lfs: 'true'
|
||||
|
||||
- name: load cached deps
|
||||
if: ${{ !(runner.os == 'macOS' && inputs.macos-combine-only) }}
|
||||
uses: actions/cache@v6
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ inputs.cache-path }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- uses: lukka/get-cmake@latest
|
||||
# The windows-11-arm runner needs CMake <= 3.31 (handled in the next step).
|
||||
if: ${{ !(runner.os == 'Windows' && inputs.arch == 'arm64') }}
|
||||
with:
|
||||
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
|
||||
useLocalCache: true # <--= Use the local cache (default is 'false').
|
||||
useCloudCache: true
|
||||
|
||||
- name: Install CMake 3.31.x (Windows ARM64)
|
||||
# windows-11-arm ships CMake 4.x, which removed pre-3.5 policy
|
||||
# compatibility AND has incomplete ASM_ARMASM linker modules
|
||||
# (breaks Boost.Context on ARM64). Pin to the last 3.x release.
|
||||
if: runner.os == 'Windows' && inputs.arch == 'arm64'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ver = "3.31.6"
|
||||
$url = "https://github.com/Kitware/CMake/releases/download/v$ver/cmake-$ver-windows-arm64.zip"
|
||||
Invoke-WebRequest -Uri $url -OutFile "$env:RUNNER_TEMP\cmake.zip"
|
||||
Expand-Archive -Path "$env:RUNNER_TEMP\cmake.zip" -DestinationPath "$env:RUNNER_TEMP\cmake" -Force
|
||||
$cmakeBin = "$env:RUNNER_TEMP\cmake\cmake-$ver-windows-arm64\bin"
|
||||
if (-not (Test-Path "$cmakeBin\cmake.exe")) { throw "cmake.exe not found at $cmakeBin" }
|
||||
Add-Content -Path $env:GITHUB_PATH -Value $cmakeBin
|
||||
|
||||
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
||||
|
||||
- name: Get the version and date on Ubuntu and macOS
|
||||
if: runner.os != 'Windows'
|
||||
if: inputs.os != 'windows-latest'
|
||||
run: |
|
||||
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
@@ -87,15 +56,10 @@ jobs:
|
||||
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
|
||||
# Per-arch Linux AppImage naming: amd64 keeps the historical unsuffixed
|
||||
# name (arch_suffix empty). Unused on macOS/Windows.
|
||||
if [ '${{ inputs.arch }}' = 'aarch64' ]; then
|
||||
echo "arch_suffix=_aarch64" >> $GITHUB_ENV
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Get the version and date on Windows
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: |
|
||||
$date = Get-Date -Format 'yyyyMMdd'
|
||||
$ref = "${{ github.ref }}"
|
||||
@@ -122,67 +86,29 @@ jobs:
|
||||
|
||||
# Mac
|
||||
- name: Install tools mac
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
if: inputs.os == 'orca-macos-arm64'
|
||||
run: |
|
||||
if [ -z "${{ vars.SELF_HOSTED }}" ]; then
|
||||
brew install libtool
|
||||
brew list
|
||||
fi
|
||||
mkdir -p ${{ github.workspace }}/deps/build/${{ inputs.arch }}
|
||||
# brew install libtool
|
||||
# brew list
|
||||
mkdir -p ${{ github.workspace }}/deps/build
|
||||
|
||||
- name: Free disk space
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
run: |
|
||||
df -hI /dev/disk3s1s1
|
||||
sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} +
|
||||
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
|
||||
df -hI /dev/disk3s1s1
|
||||
# - name: Free disk space
|
||||
# if: inputs.os == 'orca-macos-arm64'
|
||||
# run: |
|
||||
# df -hI /dev/disk3s1s1
|
||||
# sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} +
|
||||
# sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
|
||||
# df -hI /dev/disk3s1s1
|
||||
|
||||
- name: Build slicer mac
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
if: inputs.os == 'orca-macos-arm64'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
./build_release_macos.sh -s -n -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15
|
||||
|
||||
- name: Pack macOS app bundle ${{ inputs.arch }}
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
tar -czvf OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}.tar.gz -C build/${{ inputs.arch }} OrcaSlicer
|
||||
|
||||
- name: Upload macOS app bundle ${{ inputs.arch }}
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}.tar.gz
|
||||
|
||||
- name: Download macOS app bundles
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: OrcaSlicer_Mac_bundle_*_${{ github.sha }}
|
||||
path: ${{ github.workspace }}/mac_bundles
|
||||
|
||||
- name: Extract macOS app bundles
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
mkdir -p build/arm64 build/x86_64
|
||||
arm_bundle=$(find "${{ github.workspace }}/mac_bundles/OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}" -name '*.tar.gz' -print -quit)
|
||||
x86_bundle=$(find "${{ github.workspace }}/mac_bundles/OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}" -name '*.tar.gz' -print -quit)
|
||||
tar -xzvf "$arm_bundle" -C "${{ github.workspace }}/build/arm64"
|
||||
tar -xzvf "$x86_bundle" -C "${{ github.workspace }}/build/x86_64"
|
||||
|
||||
- name: Build universal mac app bundle
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
./build_release_macos.sh -u -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a universal -t 10.15
|
||||
./build_release_macos.sh -s -n -x -a universal -t 10.15
|
||||
|
||||
# Thanks to RaySajuuk, it's working now
|
||||
- name: Sign app and notary
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/belt-printer' || startsWith(github.ref, 'refs/heads/release/')) && runner.os == 'macOS' && inputs.macos-combine-only
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'orca-macos-arm64'
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||
@@ -190,8 +116,6 @@ jobs:
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
CERTIFICATE_ID: ${{ secrets.MACOS_CERTIFICATE_ID }}
|
||||
run: |
|
||||
# Load the `retry` helper (retries flaky commands such as `hdiutil create`).
|
||||
source ${{ github.workspace }}/scripts/retry.sh
|
||||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
|
||||
@@ -204,14 +128,9 @@ jobs:
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app
|
||||
# --deep is deprecated and signing/sealing can fail or skip files in
|
||||
# non-standard layouts (python/bin, python/lib/**, tools/uv). Verify
|
||||
# here so coverage gaps fail at CI time rather than at notarization.
|
||||
codesign --verify --deep --strict --verbose=2 ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app
|
||||
# Sign OrcaSlicer_profile_validator.app if it exists
|
||||
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app
|
||||
codesign --verify --deep --strict --verbose=2 ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app
|
||||
fi
|
||||
|
||||
# Create main OrcaSlicer DMG without the profile validator helper
|
||||
@@ -219,7 +138,7 @@ jobs:
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/Applications
|
||||
retry hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
|
||||
# Create separate OrcaSlicer_profile_validator DMG if the app exists
|
||||
@@ -228,7 +147,7 @@ jobs:
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
|
||||
retry hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
fi
|
||||
|
||||
@@ -243,16 +162,14 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Create DMG without notary
|
||||
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/belt-printer' && runner.os == 'macOS' && inputs.macos-combine-only
|
||||
if: github.ref != 'refs/heads/main' && inputs.os == 'orca-macos-arm64'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
# Load the `retry` helper (retries flaky commands such as `hdiutil create`).
|
||||
source ${{ github.workspace }}/scripts/retry.sh
|
||||
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_dmg
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/Applications
|
||||
retry hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
|
||||
# Create separate OrcaSlicer_profile_validator DMG if the app exists
|
||||
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
@@ -260,47 +177,37 @@ jobs:
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
|
||||
retry hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
fi
|
||||
|
||||
# Delete the per-arch bundles only after signing/DMG creation succeeded, so a
|
||||
# failed run keeps them available for a re-run instead of forcing a full rebuild.
|
||||
- name: Delete intermediate per-arch artifacts
|
||||
if: success() && runner.os == 'macOS' && inputs.macos-combine-only
|
||||
uses: geekyeggo/delete-artifact@v6
|
||||
with:
|
||||
name: |
|
||||
OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}
|
||||
OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}
|
||||
|
||||
- name: Upload artifacts mac
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'orca-macos-arm64'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_Mac_universal_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
|
||||
- name: Upload OrcaSlicer_profile_validator DMG mac
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'orca-macos-arm64'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_profile_validator_Mac_universal_DMG_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Deploy Mac release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && env.deploy_nightly == 'true' && runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && inputs.os == 'orca-macos-arm64'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
asset_name: OrcaSlicer_Mac_universal_nightly${{ env.nightly_suffix }}.dmg
|
||||
asset_name: OrcaSlicer_Mac_universal_nightly.dmg
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
|
||||
- name: Deploy Mac OrcaSlicer_profile_validator DMG release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && inputs.os == 'orca-macos-arm64'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
@@ -311,112 +218,94 @@ jobs:
|
||||
max_releases: 1
|
||||
|
||||
# Windows
|
||||
- name: Set Windows build variables
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
if ("${{ inputs.arch }}" -eq "arm64") {
|
||||
"BUILD_DIR=build-arm64" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
"ARCH_SUFFIX=_arm64" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
} else {
|
||||
"BUILD_DIR=build" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
"ARCH_SUFFIX=_x64" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
}
|
||||
|
||||
- name: setup MSVC
|
||||
if: runner.os == 'Windows'
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Install nsis
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: |
|
||||
dir "C:/Program Files (x86)/Windows Kits/10/Include"
|
||||
choco install nsis
|
||||
|
||||
- name: Build slicer Win
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}
|
||||
# Orca: Removed Netfabb STL fixing service support in favor of CGAL.
|
||||
# env:
|
||||
# WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
|
||||
# WindowsSDKVersion: '10.0.26100.0\'
|
||||
run: |
|
||||
$arch = "${{ inputs.arch }}"
|
||||
if ($arch -eq "arm64") { .\build_release_vs.bat slicer arm64 } else { .\build_release_vs.bat slicer }
|
||||
shell: pwsh
|
||||
env:
|
||||
WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
|
||||
WindowsSDKVersion: '10.0.26100.0\'
|
||||
run: .\build_release_vs.bat slicer
|
||||
|
||||
# NSIS is x86-only; it runs (and the installer it emits runs) under ARM64's
|
||||
# x86 emulation, packaging the native arm64 payload from build-arm64.
|
||||
- name: Create installer Win
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
run: |
|
||||
cpack -G NSIS
|
||||
|
||||
- name: Pack app
|
||||
if: runner.os == 'Windows'
|
||||
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
shell: cmd
|
||||
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable.zip ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer'
|
||||
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_${{ env.ver }}_portable.zip ${{ github.workspace }}/build/OrcaSlicer'
|
||||
|
||||
- name: Pack PDB
|
||||
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED
|
||||
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}/src/Release
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build/src/Release
|
||||
shell: cmd
|
||||
run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
|
||||
|
||||
- name: Upload artifacts Win zip
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable
|
||||
path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}_portable
|
||||
path: ${{ github.workspace }}/build/OrcaSlicer
|
||||
|
||||
- name: Upload artifacts Win installer
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}
|
||||
path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer*.exe
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/build/OrcaSlicer*.exe
|
||||
|
||||
- name: Upload artifacts Win PDB
|
||||
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: PDB
|
||||
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
|
||||
|
||||
- name: Upload OrcaSlicer_profile_validator Win
|
||||
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
|
||||
|
||||
- name: Deploy Windows release portable
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && env.deploy_nightly == 'true' && runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable.zip
|
||||
asset_name: OrcaSlicer_Windows${{ env.ARCH_SUFFIX }}_nightly${{ env.nightly_suffix }}_portable.zip
|
||||
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
|
||||
asset_name: OrcaSlicer_Windows_nightly_portable.zip
|
||||
asset_content_type: application/x-zip-compressed
|
||||
max_releases: 1
|
||||
|
||||
- name: Deploy Windows release installer
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && env.deploy_nightly == 'true' && runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_Installer_${{ env.ver }}${{ env.ARCH_SUFFIX }}.exe
|
||||
asset_name: OrcaSlicer_Windows_Installer${{ env.ARCH_SUFFIX }}_nightly${{ env.nightly_suffix }}.exe
|
||||
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
|
||||
asset_name: OrcaSlicer_Windows_Installer_nightly.exe
|
||||
asset_content_type: application/x-msdownload
|
||||
max_releases: 1
|
||||
|
||||
- name: Deploy Windows OrcaSlicer_profile_validator release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
@@ -426,55 +315,29 @@ jobs:
|
||||
asset_content_type: application/x-msdownload
|
||||
max_releases: 1
|
||||
|
||||
- name: Build MSIX Store package Win
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
working-directory: ${{ github.workspace }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
./scripts/msix/build_msix.ps1 `
|
||||
-InstallDir "${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer" `
|
||||
-OutputPath "${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_MSIX_${{ env.ver }}${{ env.ARCH_SUFFIX }}.msix" `
|
||||
-Architecture "${{ inputs.arch }}" `
|
||||
-IdentityName "${{ vars.ORCA_MSIX_IDENTITY_NAME || 'OrcaSlicer.OrcaSlicer' }}" `
|
||||
-Publisher "${{ vars.ORCA_MSIX_PUBLISHER || 'CN=38F7EA55-C73B-4072-B3B2-C8E0EA15BB82' }}" `
|
||||
-PublisherDisplayName "${{ vars.ORCA_MSIX_PUBLISHER_DISPLAY_NAME || 'OrcaSlicer' }}"
|
||||
|
||||
- name: Upload artifacts Win MSIX
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OrcaSlicer_Windows_MSIX_${{ env.ver }}${{ env.ARCH_SUFFIX }}
|
||||
path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_MSIX_${{ env.ver }}${{ env.ARCH_SUFFIX }}.msix
|
||||
|
||||
# Ubuntu
|
||||
- name: Apt-Install Dependencies
|
||||
if: runner.os == 'Linux' && !vars.SELF_HOSTED
|
||||
if: inputs.os == 'ubuntu-24.04'
|
||||
uses: ./.github/actions/apt-install-deps
|
||||
|
||||
# Tests must built at the same time as the slicer;
|
||||
# if you untangle them feel free to separate them here too
|
||||
- name: Build slicer and tests
|
||||
if: runner.os == 'Linux'
|
||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
||||
shell: bash
|
||||
env:
|
||||
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
|
||||
run: |
|
||||
# Build + tar the unit tests (-t) only on the leg that runs them: the
|
||||
# aarch64 leg by default (faster GitHub arm runner), or amd64 when using
|
||||
# self-hosted runners (no arm self-hosted server). unit_tests downloads
|
||||
# this tarball. The profile validator is built with -s, so amd64 keeps it.
|
||||
tests=${{ (!vars.SELF_HOSTED && inputs.arch == 'aarch64') || (vars.SELF_HOSTED && inputs.arch != 'aarch64') }}
|
||||
if $tests; then flags=-istrlL; else flags=-isrlL; fi
|
||||
./build_linux.sh "$flags"
|
||||
./scripts/check_appimage_libs.sh ./build/package ./build/package/bin/orca-slicer
|
||||
appimage=./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_${{ env.ver }}.AppImage
|
||||
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage "$appimage"
|
||||
chmod +x "$appimage"
|
||||
if $tests; then tar -cvpf build_tests.tar build/tests; fi
|
||||
./build_linux.sh -istr
|
||||
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
chmod +x ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
tar -cvpf build_tests.tar build/tests
|
||||
|
||||
# Use tar because upload-artifacts won't always preserve directory structure
|
||||
# and doesn't preserve file permissions
|
||||
- name: Upload Test Artifact
|
||||
if: runner.os == 'Linux' && ((!vars.SELF_HOSTED && inputs.arch == 'aarch64') || (vars.SELF_HOSTED && inputs.arch != 'aarch64'))
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'ubuntu-24.04'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ github.sha }}-tests
|
||||
overwrite: true
|
||||
@@ -482,18 +345,8 @@ jobs:
|
||||
retention-days: 5
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Run external slicer regression tests
|
||||
if: runner.os == 'Linux' && inputs.arch != 'aarch64'
|
||||
timeout-minutes: 20
|
||||
shell: bash
|
||||
run: |
|
||||
test_repo_dir="${{ runner.temp }}/orca-test-repo"
|
||||
rm -rf "$test_repo_dir"
|
||||
git clone --depth 1 https://github.com/OrcaSlicer/orca-test-repo.git "$test_repo_dir"
|
||||
python3 "$test_repo_dir/run_test.py" "${{ github.workspace }}/build/package/bin/orca-slicer"
|
||||
|
||||
- name: Build orca_custom_preset_tests
|
||||
if: github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED && inputs.arch != 'aarch64'
|
||||
if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-24.04'
|
||||
working-directory: ${{ github.workspace }}/build/src/Release
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -502,31 +355,38 @@ jobs:
|
||||
zip -r orca_custom_preset_tests.zip user/
|
||||
|
||||
- name: Upload artifacts Ubuntu
|
||||
if: ${{ ! env.ACT && runner.os == 'Linux' }}
|
||||
uses: actions/upload-artifact@v7
|
||||
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
|
||||
env:
|
||||
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
|
||||
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}${{ env.arch_suffix }}_${{ env.ver }}
|
||||
path: "./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_${{ env.ver }}.AppImage"
|
||||
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
|
||||
path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage'
|
||||
|
||||
- name: Upload OrcaSlicer_profile_validator Ubuntu
|
||||
if: ${{ ! env.ACT && runner.os == 'Linux' && !vars.SELF_HOSTED && inputs.arch != 'aarch64' }}
|
||||
uses: actions/upload-artifact@v7
|
||||
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
|
||||
env:
|
||||
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: OrcaSlicer_profile_validator_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
|
||||
path: './build/src/Release/OrcaSlicer_profile_validator'
|
||||
|
||||
- name: Deploy Ubuntu release
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && env.deploy_nightly == 'true' && runner.os == 'Linux' && !vars.SELF_HOSTED }}
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
|
||||
env:
|
||||
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_${{ env.ver }}.AppImage
|
||||
asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_nightly${{ env.nightly_suffix }}.AppImage
|
||||
asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_nightly.AppImage
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
- name: Deploy Ubuntu release
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED && inputs.arch != 'aarch64' }}
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-24.04' }}
|
||||
uses: rickstaa/action-create-tag@v1
|
||||
with:
|
||||
tag: "nightly-builds"
|
||||
@@ -535,7 +395,9 @@ jobs:
|
||||
message: "nightly-builds"
|
||||
|
||||
- name: Deploy Ubuntu OrcaSlicer_profile_validator release
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED && inputs.arch != 'aarch64' }}
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
|
||||
env:
|
||||
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
@@ -546,7 +408,7 @@ jobs:
|
||||
max_releases: 1
|
||||
|
||||
- name: Deploy orca_custom_preset_tests
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED && inputs.arch != 'aarch64' }}
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-24.04' }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
|
||||
2
.github/workflows/check_locale.yml
vendored
2
.github/workflows/check_locale.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install gettext
|
||||
run: |
|
||||
|
||||
177
.github/workflows/check_profiles.yml
vendored
177
.github/workflows/check_profiles.yml
vendored
@@ -15,16 +15,17 @@ on:
|
||||
default: 'warning'
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
|
||||
jobs:
|
||||
check_profiles:
|
||||
check_translation:
|
||||
name: Check profiles
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Run extra JSON check
|
||||
id: extra_json_check
|
||||
@@ -38,7 +39,7 @@ jobs:
|
||||
- name: Download
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
curl -L -o OrcaSlicer_profile_validator https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/OrcaSlicer_profile_validator_Linux_Ubuntu2404_nightly
|
||||
curl -LJO https://github.com/SoftFever/Orca_tools/releases/download/1/OrcaSlicer_profile_validator
|
||||
chmod +x ./OrcaSlicer_profile_validator
|
||||
|
||||
# validate profiles
|
||||
@@ -49,142 +50,24 @@ jobs:
|
||||
set +e
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_system.log
|
||||
exit ${PIPESTATUS[0]}
|
||||
# For now run filament subtype check only for BBL profiles until we fix other vendors' profiles.
|
||||
- name: validate filament subtype check for BBL profiles
|
||||
id: validate_filament_subtypes
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set +e
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 -v BBL -f 2>&1 | tee ${{ runner.temp }}/validate_filament_subtypes.log
|
||||
exit ${PIPESTATUS[0]}
|
||||
# Flag inherits/compatible_printers/compatible_prints references that point at a deleted or
|
||||
# renamed preset. Opt-in per vendor for now (via -r); enabled for BBL and Qidi until other
|
||||
# vendors' profiles are cleaned up. Runs before the custom-preset injection below.
|
||||
- name: validate preset references for BBL and Qidi profiles
|
||||
id: validate_preset_references
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set +e
|
||||
rc=0
|
||||
for v in BBL Qidi; do
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 -v "$v" -r 2>&1 | tee -a ${{ runner.temp }}/validate_preset_references.log
|
||||
[ ${PIPESTATUS[0]} -ne 0 ] && rc=1
|
||||
done
|
||||
exit $rc
|
||||
|
||||
- name: validate custom presets
|
||||
id: validate_custom
|
||||
continue-on-error: true
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
fixtures_dir="${{ runner.temp }}/profile-fixtures"
|
||||
output_dir="${{ runner.temp }}/custom-preset-validation"
|
||||
combined_log="${{ runner.temp }}/validate_custom.log"
|
||||
summary="${output_dir}/summary.md"
|
||||
release_url="https://github.com/OrcaSlicer/OrcaSlicer-profile-validator/releases/download/fixture-archive"
|
||||
set +e
|
||||
curl -LJO https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip
|
||||
unzip -q ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_custom.log
|
||||
exit ${PIPESTATUS[0]}
|
||||
|
||||
rm -rf "${fixtures_dir}" "${output_dir}"
|
||||
mkdir -p "${fixtures_dir}" "${output_dir}"
|
||||
|
||||
curl -fsSL -o "${fixtures_dir}/manifest.json" "${release_url}/manifest.json"
|
||||
|
||||
MANIFEST_PATH="${fixtures_dir}/manifest.json" python3 <<'PY' > "${fixtures_dir}/fixtures.tsv"
|
||||
import json
|
||||
import os
|
||||
|
||||
with open(os.environ["MANIFEST_PATH"], encoding="utf-8") as fh:
|
||||
manifest = json.load(fh)
|
||||
|
||||
if isinstance(manifest, dict):
|
||||
entries = manifest.get("fixtures", [])
|
||||
else:
|
||||
entries = manifest
|
||||
|
||||
for entry in entries:
|
||||
version = entry.get("version", "")
|
||||
asset = entry.get("asset", "")
|
||||
sha256 = entry.get("asset_sha256", "")
|
||||
if not version or not asset:
|
||||
continue
|
||||
print(f"{version}\t{asset}\t{sha256}")
|
||||
PY
|
||||
|
||||
if [ ! -s "${fixtures_dir}/fixtures.tsv" ]; then
|
||||
echo "No custom preset fixtures found in ${release_url}/manifest.json" | tee "${combined_log}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
{
|
||||
echo "## Custom Preset Fixture Validation"
|
||||
echo ""
|
||||
echo "| Version | Status | Log |"
|
||||
echo "| --- | --- | --- |"
|
||||
} > "${summary}"
|
||||
|
||||
status=0
|
||||
failed_logs=()
|
||||
|
||||
while IFS=$'\t' read -r version asset expected_sha256; do
|
||||
fixture_zip="${fixtures_dir}/${asset}"
|
||||
asset_url_name="$(python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1], safe=""))' "${asset}")"
|
||||
profile_tree="${output_dir}/profiles-${version}"
|
||||
log_path="${output_dir}/${version}.log"
|
||||
|
||||
curl -fsSL -o "${fixture_zip}" "${release_url}/${asset_url_name}"
|
||||
|
||||
if [ -n "${expected_sha256}" ] && [ "${expected_sha256}" != "<sha256>" ]; then
|
||||
echo "${expected_sha256} ${fixture_zip}" | sha256sum -c -
|
||||
fi
|
||||
|
||||
rm -rf "${profile_tree}"
|
||||
mkdir -p "${profile_tree}"
|
||||
cp -a "${{ github.workspace }}/resources/profiles/." "${profile_tree}/"
|
||||
rm -rf "${profile_tree}/user"
|
||||
unzip -q "${fixture_zip}" -d "${profile_tree}"
|
||||
|
||||
set +e
|
||||
./OrcaSlicer_profile_validator -p "${profile_tree}" -l 2 > "${log_path}" 2>&1
|
||||
result=$?
|
||||
set -e
|
||||
|
||||
if [ "${result}" -eq 0 ]; then
|
||||
echo "| ${version} | PASS | ${version}.log |" >> "${summary}"
|
||||
else
|
||||
echo "| ${version} | FAIL | ${version}.log |" >> "${summary}"
|
||||
failed_logs+=("${log_path}")
|
||||
status=1
|
||||
fi
|
||||
done < "${fixtures_dir}/fixtures.tsv"
|
||||
|
||||
{
|
||||
cat "${summary}"
|
||||
if [ "${#failed_logs[@]}" -gt 0 ]; then
|
||||
echo ""
|
||||
echo "## Failed Fixture Logs"
|
||||
for log_path in "${failed_logs[@]}"; do
|
||||
echo ""
|
||||
echo "### $(basename "${log_path}" .log)"
|
||||
echo '```'
|
||||
head -c 12000 "${log_path}" || echo "No output captured"
|
||||
echo '```'
|
||||
done
|
||||
fi
|
||||
} | tee "${combined_log}"
|
||||
|
||||
exit "${status}"
|
||||
|
||||
- name: Prepare PR number for comment workflow
|
||||
if: ${{ always() && github.event_name == 'pull_request' }}
|
||||
run: |
|
||||
mkdir -p ${{ runner.temp }}/profile-check-results
|
||||
echo "${{ github.event.pull_request.number }}" > ${{ runner.temp }}/profile-check-results/pr_number.txt
|
||||
|
||||
- name: Prepare comment artifact
|
||||
if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_preset_references.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||
- name: Post error comment on PR
|
||||
if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
{
|
||||
# Marker matched by check_profiles_comment.yml to delete prior comments.
|
||||
echo "<!-- profile-validation-comment -->"
|
||||
echo "## :x: Profile Validation Errors"
|
||||
echo ""
|
||||
|
||||
@@ -206,24 +89,6 @@ jobs:
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ "${{ steps.validate_filament_subtypes.outcome }}" = "failure" ]; then
|
||||
echo "### BBL Filament Subtype Validation Failed"
|
||||
echo ""
|
||||
echo '```'
|
||||
head -c 30000 ${{ runner.temp }}/validate_filament_subtypes.log || echo "No output captured"
|
||||
echo '```'
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ "${{ steps.validate_preset_references.outcome }}" = "failure" ]; then
|
||||
echo "### BBL/Qidi Preset Reference Validation Failed"
|
||||
echo ""
|
||||
echo '```'
|
||||
head -c 30000 ${{ runner.temp }}/validate_preset_references.log || echo "No output captured"
|
||||
echo '```'
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ "${{ steps.validate_custom.outcome }}" = "failure" ]; then
|
||||
echo "### Custom Preset Validation Failed"
|
||||
echo ""
|
||||
@@ -235,18 +100,16 @@ jobs:
|
||||
|
||||
echo "---"
|
||||
echo "*Please fix the above errors and push a new commit.*"
|
||||
} > ${{ runner.temp }}/profile-check-results/pr_comment.md
|
||||
} > ${{ runner.temp }}/pr_comment.md
|
||||
|
||||
- name: Upload comment artifact
|
||||
if: ${{ always() && github.event_name == 'pull_request' }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: profile-check-results
|
||||
path: ${{ runner.temp }}/profile-check-results/
|
||||
retention-days: 1
|
||||
gh pr comment ${{ github.event.pull_request.number }} --body-file ${{ runner.temp }}/pr_comment.md
|
||||
|
||||
- name: Fail if any check failed
|
||||
if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_preset_references.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||
if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||
run: |
|
||||
echo "One or more profile checks failed. See above for details."
|
||||
exit 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
66
.github/workflows/check_profiles_comment.yml
vendored
66
.github/workflows/check_profiles_comment.yml
vendored
@@ -1,66 +0,0 @@
|
||||
name: Post profile check comment
|
||||
|
||||
# NOTE: The workflow name in the 'workflows' filter below must match the 'name'
|
||||
# field in check_profiles.yml exactly. If that name changes, update it here too.
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Check profiles"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
# Needed to delete outdated bot comments via the issues/comments endpoint.
|
||||
issues: write
|
||||
|
||||
# Serialize handlers per source branch so parallel runs don't race delete-and-post.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
post_comment:
|
||||
name: Post PR comment
|
||||
runs-on: ubuntu-24.04
|
||||
if: ${{ github.event.workflow_run.event == 'pull_request' && (github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure') }}
|
||||
steps:
|
||||
- name: Download artifact
|
||||
id: download
|
||||
uses: actions/download-artifact@v8
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: profile-check-results
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
github-token: ${{ github.token }}
|
||||
|
||||
- name: Update PR comment
|
||||
if: ${{ steps.download.outcome == 'success' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
run: |
|
||||
if [ ! -f pr_number.txt ]; then
|
||||
echo "No pr_number.txt in artifact, skipping."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PR_NUMBER=$(cat pr_number.txt)
|
||||
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
|
||||
echo "Invalid PR number: $PR_NUMBER"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Delete prior comments matching the marker (from check_profiles.yml) or the legacy heading.
|
||||
OLD_IDS=$(gh api --paginate "repos/${GH_REPO}/issues/${PR_NUMBER}/comments" \
|
||||
--jq '.[] | select(.user.login == "github-actions[bot]") | select((.body | startswith("<!-- profile-validation-comment -->")) or (.body | startswith("## :x: Profile Validation Errors"))) | .id')
|
||||
for comment_id in $OLD_IDS; do
|
||||
echo "Deleting outdated profile-validation comment ${comment_id}"
|
||||
gh api -X DELETE "repos/${GH_REPO}/issues/comments/${comment_id}" || true
|
||||
done
|
||||
|
||||
# Post a new comment only when validation failed (pr_comment.md present).
|
||||
if [ -f pr_comment.md ]; then
|
||||
gh pr comment "$PR_NUMBER" --body-file pr_comment.md
|
||||
else
|
||||
echo "Validation succeeded; cleaned up prior comments without posting."
|
||||
fi
|
||||
2
.github/workflows/dedupe-issues.yml
vendored
2
.github/workflows/dedupe-issues.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Run Claude Code slash command
|
||||
uses: anthropics/claude-code-base-action@beta
|
||||
|
||||
2
.github/workflows/doxygen-docs.yml
vendored
2
.github/workflows/doxygen-docs.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
remove-existing-swap-files: true
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Doxygen and Graphviz
|
||||
run: |
|
||||
|
||||
275
.github/workflows/pr-label-bot.yml
vendored
275
.github/workflows/pr-label-bot.yml
vendored
@@ -1,275 +0,0 @@
|
||||
name: PR Label Bot
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
issue_comment:
|
||||
types:
|
||||
- created
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
request-label:
|
||||
if: github.event_name == 'pull_request_target' && github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' && github.event.pull_request.author_association != 'MEMBER'
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
issues: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Ask PR author for label
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
function isPermissionDenied(error) {
|
||||
return error && error.status === 403 && /Resource not accessible by integration/i.test(error.message || '');
|
||||
}
|
||||
|
||||
const allowedLabels = [
|
||||
'bug-fix',
|
||||
'enhancement',
|
||||
'Localization',
|
||||
'profile',
|
||||
'QoL',
|
||||
'UI/UX',
|
||||
'dependencies'
|
||||
];
|
||||
const pr = context.payload.pull_request;
|
||||
const labelsList = `${allowedLabels
|
||||
.slice(0, -1)
|
||||
.map((label) => `\`${label}\``)
|
||||
.join(', ')} and \`${allowedLabels[allowedLabels.length - 1]}\`.`;
|
||||
const examplesText = [
|
||||
'```',
|
||||
'/bot add-label bug-fix',
|
||||
'```',
|
||||
'```',
|
||||
'/bot add-label bug-fix, UI/UX',
|
||||
'```',
|
||||
'```',
|
||||
'/bot remove-label bug-fix, UI/UX',
|
||||
'```'
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
body:
|
||||
`Hi @${pr.user.login}, you can manage the labels for this PR by \`/bot add-label\` and \`/bot remove-label\`\n\n` +
|
||||
`Allowed labels are:\n${labelsList}\n\n` +
|
||||
`Examples:\n${examplesText}`
|
||||
});
|
||||
} catch (error) {
|
||||
if (isPermissionDenied(error)) {
|
||||
core.warning(
|
||||
'Skipping PR comment because token cannot write. Enable Actions write permissions, ' +
|
||||
'or run with a token that has issues:write and pull_requests:write.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
apply-label:
|
||||
if: github.event_name == 'issue_comment'
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
issues: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Apply label command from PR author
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
function isPermissionDenied(error) {
|
||||
return error && error.status === 403 && /Resource not accessible by integration/i.test(error.message || '');
|
||||
}
|
||||
|
||||
const allowedLabels = [
|
||||
'bug-fix',
|
||||
'enhancement',
|
||||
'Localization',
|
||||
'profile',
|
||||
'QoL',
|
||||
'UI/UX',
|
||||
'dependencies'
|
||||
];
|
||||
|
||||
const issue = context.payload.issue;
|
||||
if (!issue.pull_request) {
|
||||
core.info('Ignoring comment that is not on a pull request.');
|
||||
return;
|
||||
}
|
||||
|
||||
const body = (context.payload.comment.body || '').trim();
|
||||
const commandLine = body
|
||||
.split('\n')
|
||||
.map((line) => line.trim())
|
||||
.find((line) => /^\/bot\s+(add-label|remove-label)(?:\s*:\s*|\s+)/i.test(line));
|
||||
|
||||
if (!commandLine) {
|
||||
core.info('No /bot add-label or /bot remove-label command found.');
|
||||
return;
|
||||
}
|
||||
|
||||
const commandMatch = commandLine.match(/^\/bot\s+(add-label|remove-label)(?:\s*:\s*|\s+)(.+)\s*$/i);
|
||||
if (!commandMatch) {
|
||||
core.info('Label command format is invalid.');
|
||||
return;
|
||||
}
|
||||
|
||||
const action = commandMatch[1].toLowerCase() === 'add-label' ? 'add' : 'remove';
|
||||
let labelsExpr = (commandMatch[2] || '').trim();
|
||||
if (!labelsExpr) {
|
||||
core.info('Label command is missing label name.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (labelsExpr.startsWith('[') && labelsExpr.endsWith(']')) {
|
||||
labelsExpr = labelsExpr.slice(1, -1).trim();
|
||||
}
|
||||
|
||||
const requestedRawLabels = labelsExpr
|
||||
.split(',')
|
||||
.map((part) => part.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
if (!requestedRawLabels.length) {
|
||||
core.info('No labels were provided in the command.');
|
||||
return;
|
||||
}
|
||||
|
||||
const { data: pr } = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: issue.number
|
||||
});
|
||||
|
||||
const commenter = context.payload.comment.user.login;
|
||||
if (commenter !== pr.user.login) {
|
||||
core.info('Ignoring command because commenter is not the PR author.');
|
||||
return;
|
||||
}
|
||||
|
||||
const labelsByLower = new Map(
|
||||
allowedLabels.map((label) => [label.toLowerCase(), label])
|
||||
);
|
||||
|
||||
const resolvedLabels = [];
|
||||
const invalidLabels = [];
|
||||
|
||||
for (const rawLabel of requestedRawLabels) {
|
||||
const resolved = labelsByLower.get(rawLabel.toLowerCase());
|
||||
if (resolved) {
|
||||
resolvedLabels.push(resolved);
|
||||
} else {
|
||||
invalidLabels.push(rawLabel);
|
||||
}
|
||||
}
|
||||
const uniqueRequestedLabels = [...new Set(resolvedLabels)];
|
||||
|
||||
if (action === 'add' && uniqueRequestedLabels.length) {
|
||||
try {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
labels: uniqueRequestedLabels
|
||||
});
|
||||
} catch (error) {
|
||||
if (isPermissionDenied(error)) {
|
||||
core.warning(
|
||||
'Cannot add labels because token cannot write. Enable Actions write permissions, ' +
|
||||
'or run with a token that has issues:write and pull_requests:write.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
core.info(`Added labels: ${uniqueRequestedLabels.join(', ')}`);
|
||||
}
|
||||
|
||||
if (action === 'remove' && uniqueRequestedLabels.length) {
|
||||
let removedCount = 0;
|
||||
try {
|
||||
for (const label of uniqueRequestedLabels) {
|
||||
try {
|
||||
await github.rest.issues.removeLabel({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
name: label
|
||||
});
|
||||
removedCount += 1;
|
||||
} catch (error) {
|
||||
if (isPermissionDenied(error)) {
|
||||
core.warning(
|
||||
'Cannot remove labels because token cannot write. Enable Actions write permissions, ' +
|
||||
'or run with a token that has issues:write and pull_requests:write.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (error.status === 404) {
|
||||
core.info(`Label is not currently applied: ${label}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
core.info(`Removed labels count: ${removedCount}`);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!uniqueRequestedLabels.length) {
|
||||
core.info('No valid labels were provided in the command.');
|
||||
}
|
||||
|
||||
if (invalidLabels.length) {
|
||||
const allowedText = allowedLabels.map((label) => `\`${label}\``).join(', ');
|
||||
const invalidText = invalidLabels.map((label) => `\`${label}\``).join(', ');
|
||||
const validText = uniqueRequestedLabels.length
|
||||
? `\n\nProcessed valid label(s): ${uniqueRequestedLabels.map((label) => `\`${label}\``).join(', ')}`
|
||||
: '';
|
||||
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
body:
|
||||
`@${commenter} invalid label(s): ${invalidText}.${validText}\n\n` +
|
||||
`Allowed labels: ${allowedText}\n\n` +
|
||||
`Use:\n` +
|
||||
`- \`/bot add-label label\`\n` +
|
||||
`- \`/bot remove-label label\`\n` +
|
||||
`- \`/bot add-label label1, label2\``
|
||||
});
|
||||
} catch (error) {
|
||||
if (isPermissionDenied(error)) {
|
||||
core.warning('Cannot post invalid-label feedback because token cannot write comments.');
|
||||
return;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
const processedLabelsText = uniqueRequestedLabels.length ? uniqueRequestedLabels.join(', ') : '(none)';
|
||||
core.info(`Processed label command: ${action} ${processedLabelsText}`);
|
||||
131
.github/workflows/publish_release.yml
vendored
131
.github/workflows/publish_release.yml
vendored
@@ -1,131 +0,0 @@
|
||||
name: Publish to draft release
|
||||
|
||||
# Manually pulls the platform binaries produced by a "Build all" run and uploads
|
||||
# them to an existing DRAFT release. Decoupled from the build so you can test a
|
||||
# build first, then publish exactly that run's artifacts once you're happy.
|
||||
#
|
||||
# Trigger: Actions tab -> "Publish to draft release" -> Run workflow.
|
||||
# Locked to a single person: the first step aborts unless the actor matches the
|
||||
# `RELEASE_PUBLISHER` repo variable (set to "SoftFever"). To allow someone else,
|
||||
# change that variable: gh variable set RELEASE_PUBLISHER --body "<login>".
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run_id:
|
||||
description: 'Run ID of the "Build all" workflow to pull binaries from (the number in the Actions run URL)'
|
||||
required: true
|
||||
type: string
|
||||
tag:
|
||||
description: 'Tag of the draft release to upload to (e.g. v2.4.0-beta)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write # upload release assets
|
||||
actions: read # download artifacts from another run
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish binaries to draft release
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RUN_ID: ${{ inputs.run_id }}
|
||||
TAG: ${{ inputs.tag }}
|
||||
steps:
|
||||
- name: Restrict to the release publisher
|
||||
env:
|
||||
PUBLISHER: ${{ vars.RELEASE_PUBLISHER }}
|
||||
run: |
|
||||
if [ -z "$PUBLISHER" ]; then
|
||||
echo "::error::RELEASE_PUBLISHER repo variable is not set."
|
||||
exit 1
|
||||
fi
|
||||
if [ "${{ github.actor }}" != "$PUBLISHER" ]; then
|
||||
echo "::error::Only @$PUBLISHER may run this workflow (you are @${{ github.actor }})."
|
||||
exit 1
|
||||
fi
|
||||
echo "Authorized: @${{ github.actor }}"
|
||||
|
||||
- name: Verify target is a draft release
|
||||
run: |
|
||||
if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isDraft >/dev/null 2>&1; then
|
||||
echo "::error::Release '$TAG' not found. Create the draft (with this tag) first."
|
||||
exit 1
|
||||
fi
|
||||
is_draft=$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isDraft --jq '.isDraft')
|
||||
if [ "$is_draft" != "true" ]; then
|
||||
echo "::error::Release '$TAG' is published, not a draft. Aborting to avoid touching a live release."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Verify source build run
|
||||
run: |
|
||||
info=$(gh run view "$RUN_ID" --repo "$GITHUB_REPOSITORY" --json workflowName,conclusion,headBranch)
|
||||
name=$(echo "$info" | jq -r '.workflowName')
|
||||
conclusion=$(echo "$info" | jq -r '.conclusion')
|
||||
branch=$(echo "$info" | jq -r '.headBranch')
|
||||
echo "Source run #$RUN_ID: '$name' on '$branch' (conclusion: $conclusion)"
|
||||
if [ "$conclusion" != "success" ]; then
|
||||
echo "::warning::Source run did not conclude 'success' ($conclusion). Some assets may be missing."
|
||||
fi
|
||||
|
||||
- name: Download release artifacts from build run
|
||||
run: |
|
||||
# Windows_V* (not Windows_*) keeps the MSIX Store artifact out: it goes to Partner Center, not GitHub releases.
|
||||
gh run download "$RUN_ID" --repo "$GITHUB_REPOSITORY" --dir artifacts \
|
||||
-p 'OrcaSlicer_Windows_V*' \
|
||||
-p 'OrcaSlicer_Mac_universal_*' \
|
||||
-p 'OrcaSlicer_Linux_ubuntu_*' \
|
||||
-p 'OrcaSlicer-Linux-flatpak_*' \
|
||||
-p 'PDB'
|
||||
echo "Downloaded artifact folders:"
|
||||
ls -1 artifacts
|
||||
|
||||
- name: Assemble release assets
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p upload
|
||||
|
||||
# gh run download auto-extracts each artifact into a folder, so the inner
|
||||
# binaries are already unzipped. Copy the inner binary for each platform.
|
||||
# -type f is required (some artifact *folders* are named "*.flatpak").
|
||||
|
||||
# Windows installers (x64 + arm64): the .exe inside each installer
|
||||
# artifact, NOT the orca-slicer.exe in the portable app folder. CPack
|
||||
# now bakes the arch into the filename (…_x64.exe / …_arm64.exe), so
|
||||
# copy them straight through.
|
||||
find artifacts -type f -name '*.exe' -path '*OrcaSlicer_Windows_V*' ! -path '*_portable*' -exec cp -v {} upload/ \;
|
||||
# macOS universal DMG (profile-validator DMG isn't downloaded).
|
||||
find artifacts -type f -name '*.dmg' -path '*OrcaSlicer_Mac_universal_*' -exec cp -v {} upload/ \;
|
||||
# Linux AppImage.
|
||||
find artifacts -type f -name '*.AppImage' -exec cp -v {} upload/ \;
|
||||
# Flatpak bundles (x86_64 + aarch64).
|
||||
find artifacts -type f -name '*.flatpak' -exec cp -v {} upload/ \;
|
||||
# Windows debug symbols (PDB archive, for developers).
|
||||
find artifacts -type f -name 'Debug_PDB_*.7z' -exec cp -v {} upload/ \;
|
||||
|
||||
# Portable Windows builds (x64 + arm64) are unzipped folder artifacts;
|
||||
# re-zip each to its released filename (these stay .zip on the release).
|
||||
mapfile -t portable_dirs < <(find artifacts -maxdepth 1 -type d -name 'OrcaSlicer_Windows_*_portable')
|
||||
if [ ${#portable_dirs[@]} -eq 0 ]; then
|
||||
echo "::warning::Windows portable artifact not found."
|
||||
fi
|
||||
for portable_dir in "${portable_dirs[@]}"; do
|
||||
( cd "$portable_dir" && zip -qr "$GITHUB_WORKSPACE/upload/$(basename "$portable_dir").zip" . )
|
||||
echo "Zipped portable -> $(basename "$portable_dir").zip"
|
||||
done
|
||||
|
||||
echo "Assets to upload:"
|
||||
ls -lh upload
|
||||
if [ -z "$(ls -A upload)" ]; then
|
||||
echo "::error::No assets assembled. Check the run_id and that its artifacts haven't expired."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Upload assets to draft release
|
||||
run: |
|
||||
gh release upload "$TAG" upload/* --repo "$GITHUB_REPOSITORY" --clobber
|
||||
echo "Uploaded to draft release: $TAG"
|
||||
gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name'
|
||||
4
.github/workflows/shellcheck.yml
vendored
4
.github/workflows/shellcheck.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
steps:
|
||||
- name: Cache shellcheck download
|
||||
id: cache-shellcheck-v0_11
|
||||
uses: actions/cache@v6
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/shellcheck
|
||||
key: ${{ runner.os }}-shellcheck-v0_11
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
tar -xvf ~/sc.tar.xz -C ~
|
||||
mv ~/shellcheck-"${INPUT_VERSION}"/shellcheck ~/shellcheck
|
||||
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
|
||||
2
.github/workflows/update-translation.yml
vendored
2
.github/workflows/update-translation.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v6
|
||||
|
||||
14
.github/workflows/winget_updater.yml
vendored
14
.github/workflows/winget_updater.yml
vendored
@@ -1,14 +0,0 @@
|
||||
name: Publish to WinGet
|
||||
on:
|
||||
release:
|
||||
types: [ released ]
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: vedantmgoyal9/winget-releaser@main
|
||||
with:
|
||||
identifier: SoftFever.OrcaSlicer
|
||||
version: ${{ github.event.release.tag_name }}
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
installers-regex: '\.exe$'
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -36,7 +36,6 @@ src/OrcaSlicer-doc/
|
||||
/deps/DL_CACHE/
|
||||
/deps/DL_CACHE
|
||||
**/.flatpak-builder/
|
||||
*.no-debug.yml
|
||||
resources/profiles/user/default
|
||||
*.code-workspace
|
||||
deps_src/build/
|
||||
@@ -44,8 +43,3 @@ test.js
|
||||
/.cache/
|
||||
.clangd
|
||||
internal_docs/
|
||||
*.flatpak
|
||||
/flatpak-repo/
|
||||
# Python bytecode
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
2
.idea/OrcaSlicer.iml
generated
Normal file
2
.idea/OrcaSlicer.iml
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
7
.idea/codeStyles/Project.xml
generated
Normal file
7
.idea/codeStyles/Project.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<clangFormatSettings>
|
||||
<option name="ENABLED" value="true" />
|
||||
</clangFormatSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
||||
4
.idea/misc.xml
generated
Normal file
4
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/OrcaSlicer.iml" filepath="$PROJECT_DIR$/.idea/OrcaSlicer.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
68
AGENTS.md
68
AGENTS.md
@@ -1,57 +1,23 @@
|
||||
# CLAUDE.md
|
||||
# Repository Guidelines
|
||||
|
||||
OrcaSlicer — open-source C++17 3D slicer. wxWidgets GUI, CMake build system.
|
||||
## Project Structure & Module Organization
|
||||
OrcaSlicer’s C++17 sources live in `src/`, split by feature modules and platform adapters. User assets, icons, and printer presets are in `resources/`; translations stay in `localization/`. Tests sit in `tests/`, grouped by domain (`libslic3r/`, `sla_print/`, etc.) with fixtures under `tests/data/`. CMake helpers reside in `cmake/`, and longer references in `doc/` and `SoftFever_doc/`. Automation scripts belong in `scripts/` and `tools/`. Treat everything in `deps/` and `deps_src/` as vendored snapshots—do not modify without mirroring upstream tags.
|
||||
|
||||
## Build Commands
|
||||
## Build, Test, and Development Commands
|
||||
Use out-of-source builds:
|
||||
- `cmake -S . -B build -DCMAKE_BUILD_TYPE=Release` configures dependencies and generates build files.
|
||||
- `cmake --build build --target OrcaSlicer --config Release` compiles the app; add `--parallel` to speed up.
|
||||
- `cmake --build build --target tests` then `ctest --test-dir build --output-on-failure` runs automated suites.
|
||||
Platform helpers such as `build_linux.sh`, `build_release_macos.sh`, and `build_release_vs2022.bat` wrap the same flow with toolchain flags. Use `build_release_macos.sh -sx` when reproducing macOS build issues, and `scripts/DockerBuild.sh` for reproducible container builds.
|
||||
|
||||
```bash
|
||||
# macOS
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
## Coding Style & Naming Conventions
|
||||
`.clang-format` enforces 4-space indents, a 140-column limit, aligned initializers, and brace wrapping for classes and functions. Run `clang-format -i <file>` before committing; the CMake `clang-format` target is available when LLVM tools are on your PATH. Prefer `CamelCase` for classes, `snake_case` for functions and locals, and `SCREAMING_CASE` for constants, matching conventions in `src/`. Keep headers self-contained and align include order with the IWYU pragmas.
|
||||
|
||||
# Linux
|
||||
cmake --build build --config RelWithDebInfo --target all --
|
||||
## Testing Guidelines
|
||||
Unit tests rely on Catch2 (`tests/catch2/`). Name specs after the component under test—for example `tests/libslic3r/TestPlanarHole.cpp`—and tag long-running cases so `ctest -L fast` remains useful. Cover new algorithms with deterministic fixtures or sample G-code stored in `tests/data/`. Document manual printer validation or regression slicer checks in your PR when automated coverage is insufficient.
|
||||
|
||||
# Windows (replace %build_type% with Debug/Release/RelWithDebInfo)
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
```
|
||||
## Commit & Pull Request Guidelines
|
||||
The history favors concise, sentence-style subject lines with optional issue references, e.g., `Fix grid lines origin for multiple plates (#10724)`. Squash fixups locally before opening a PR. Complete `.github/pull_request_template.md`, include reproduction steps or screenshots for UI changes, and mention impacted presets or translations. Link issues via `Closes #NNNN` when applicable, and call out dependency bumps or profile migrations for maintainer review.
|
||||
|
||||
## Testing
|
||||
|
||||
Catch2 framework. Tests in `tests/` directory.
|
||||
|
||||
```bash
|
||||
cd build && ctest --output-on-failure # all tests
|
||||
ctest --test-dir ./tests/libslic3r # individual suite
|
||||
ctest --test-dir ./tests/fff_print
|
||||
```
|
||||
|
||||
## Code Style
|
||||
|
||||
- C++17, selective C++20. PascalCase classes, snake_case functions/variables
|
||||
- `#pragma once` for headers. Smart pointers and RAII preferred
|
||||
- Parallelization via TBB — be mindful of shared state
|
||||
|
||||
## Key Entry Points
|
||||
|
||||
- App startup: `src/OrcaSlicer.cpp`
|
||||
- Slicing pipeline: `src/libslic3r/Print.cpp`
|
||||
- All print/printer/material settings: `src/libslic3r/PrintConfig.cpp`
|
||||
- GUI: `src/slic3r/GUI/`
|
||||
- Core algorithms: `src/libslic3r/` (GCode/, Fill/, Support/, Geometry/, Format/, Arachne/)
|
||||
- Printer profiles: `resources/profiles/[manufacturer].json`
|
||||
|
||||
## Critical Constraints
|
||||
|
||||
- **Backward compatibility required** for .3mf project files and printer profiles
|
||||
- **Cross-platform** — all changes must work on Windows, macOS, and Linux
|
||||
- Profile/format changes need version migration handling
|
||||
- Dependencies built separately in `deps/build/`, then linked to main app
|
||||
|
||||
## Code review focus areas
|
||||
|
||||
- Changes must not cause regressions in existing functionality, defaults, profiles, or project compatibility.
|
||||
- Features gated by options must not affect existing behavior when those options are disabled.
|
||||
- Changes should follow the existing code style and architecture. Architectural changes should be justified in code comments and the PR description.
|
||||
- Add helper functions or utilities only when existing code cannot reasonably be reused. Avoid duplication.
|
||||
- Keep code concise and clear. Manually simplify AI generated bloated codes before review.
|
||||
- Include targeted tests or documented verification for behavior changes, especially in slicing logic, profiles, formats, and GUI defaults.
|
||||
## Security & Configuration Tips
|
||||
Follow `SECURITY.md` for vulnerability reporting. Keep API tokens and printer credentials out of tracked configs; use `sandboxes/` for experimental settings. When touching third-party code in `deps_src/`, record the upstream commit or release in your PR description and run the relevant platform build script to confirm integration.
|
||||
|
||||
235
CLAUDE.md
235
CLAUDE.md
@@ -1 +1,234 @@
|
||||
@AGENTS.md
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Overview
|
||||
|
||||
OrcaSlicer is an open-source 3D slicer application forked from Bambu Studio, built using C++ with wxWidgets for the GUI and CMake as the build system. The project uses a modular architecture with separate libraries for core slicing functionality, GUI components, and platform-specific code.
|
||||
|
||||
## Build Commands
|
||||
|
||||
### Building on Windows
|
||||
**Always use this command to build the project when testing build issues on Windows.**
|
||||
```bash
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
```
|
||||
|
||||
### Building on macOS
|
||||
**Always use this command to build the project when testing build issues on macOS.**
|
||||
```bash
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
```
|
||||
|
||||
### Building on Linux
|
||||
**Always use this command to build the project when testing build issues on Linux.**
|
||||
```bash
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
|
||||
```
|
||||
### Build test:
|
||||
|
||||
**Always use this command to build the project when testing build issues on Windows.**
|
||||
```bash
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
```
|
||||
|
||||
### Building on macOS
|
||||
**Always use this command to build the project when testing build issues on macOS.**
|
||||
```bash
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
```
|
||||
|
||||
### Building on Linux
|
||||
**Always use this command to build the project when testing build issues on Linux.**
|
||||
```bash
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Build System
|
||||
- Uses CMake with minimum version 3.13 (maximum 3.31.x on Windows)
|
||||
- Primary build directory: `build/`
|
||||
- Dependencies are built in `deps/build/`
|
||||
- The build process is split into dependency building and main application building
|
||||
- Windows builds use Visual Studio generators
|
||||
- macOS builds use Xcode by default, Ninja with -x flag
|
||||
- Linux builds use Ninja generator
|
||||
|
||||
### Testing
|
||||
Tests are located in the `tests/` directory and use the Catch2 testing framework. Test structure:
|
||||
- `tests/libslic3r/` - Core library tests (21 test files)
|
||||
- Geometry processing, algorithms, file formats (STL, 3MF, AMF)
|
||||
- Polygon operations, clipper utilities, Voronoi diagrams
|
||||
- `tests/fff_print/` - Fused Filament Fabrication tests (12 test files)
|
||||
- Slicing algorithms, G-code generation, print mechanics
|
||||
- Fill patterns, extrusion, support material
|
||||
- `tests/sla_print/` - Stereolithography tests (4 test files)
|
||||
- SLA-specific printing algorithms, support generation
|
||||
- `tests/libnest2d/` - 2D nesting algorithm tests
|
||||
- `tests/slic3rutils/` - Utility function tests
|
||||
- `tests/sandboxes/` - Experimental/sandbox test code
|
||||
|
||||
Run all tests after building:
|
||||
```bash
|
||||
cd build && ctest
|
||||
```
|
||||
|
||||
Run tests with verbose output:
|
||||
```bash
|
||||
cd build && ctest --output-on-failure
|
||||
```
|
||||
|
||||
Run individual test suites:
|
||||
```bash
|
||||
# From build directory
|
||||
ctest --test-dir ./tests/libslic3r/libslic3r_tests
|
||||
ctest --test-dir ./tests/fff_print/fff_print_tests
|
||||
ctest --test-dir ./tests/sla_print/sla_print_tests
|
||||
# and so on
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Core Libraries
|
||||
- **libslic3r/**: Core slicing engine and algorithms (platform-independent)
|
||||
- Main slicing logic, geometry processing, G-code generation
|
||||
- Key classes: Print, PrintObject, Layer, GCode, Config
|
||||
- Modular design with specialized subdirectories:
|
||||
- `GCode/` - G-code generation, cooling, pressure equalization, thumbnails
|
||||
- `Fill/` - Infill pattern implementations (gyroid, honeycomb, lightning, etc.)
|
||||
- `Support/` - Tree supports and traditional support generation
|
||||
- `Geometry/` - Advanced geometry operations, Voronoi diagrams, medial axis
|
||||
- `Format/` - File I/O for 3MF, AMF, STL, OBJ, STEP formats
|
||||
- `SLA/` - SLA-specific print processing and support generation
|
||||
- `Arachne/` - Advanced wall generation using skeletal trapezoidation
|
||||
|
||||
- **src/slic3r/**: Main application framework and GUI
|
||||
- GUI application built with wxWidgets
|
||||
- Integration between libslic3r core and user interface
|
||||
- Located in `src/slic3r/GUI/` (not shown in this directory but exists)
|
||||
|
||||
### Key Algorithmic Components
|
||||
- **Arachne Wall Generation**: Variable-width perimeter generation using skeletal trapezoidation
|
||||
- **Tree Supports**: Organic support generation algorithm
|
||||
- **Lightning Infill**: Sparse infill optimization for internal structures
|
||||
- **Adaptive Slicing**: Variable layer height based on geometry
|
||||
- **Multi-material**: Multi-extruder and soluble support processing
|
||||
- **G-code Post-processing**: Cooling, fan control, pressure advance, conflict checking
|
||||
|
||||
### File Format Support
|
||||
- **3MF/BBS_3MF**: Native format with extensions for multi-material and metadata
|
||||
- **STL**: Standard tessellation language for 3D models
|
||||
- **AMF**: Additive Manufacturing Format with color/material support
|
||||
- **OBJ**: Wavefront OBJ with material definitions
|
||||
- **STEP**: CAD format support for precise geometry
|
||||
- **G-code**: Output format with extensive post-processing capabilities
|
||||
|
||||
### External Dependencies
|
||||
- **Clipper2**: Advanced 2D polygon clipping and offsetting
|
||||
- **libigl**: Computational geometry library for mesh operations
|
||||
- **TBB**: Intel Threading Building Blocks for parallelization
|
||||
- **wxWidgets**: Cross-platform GUI framework
|
||||
- **OpenGL**: 3D graphics rendering and visualization
|
||||
- **CGAL**: Computational Geometry Algorithms Library (selective use)
|
||||
- **OpenVDB**: Volumetric data structures for advanced operations
|
||||
- **Eigen**: Linear algebra library for mathematical operations
|
||||
|
||||
## File Organization
|
||||
|
||||
### Resources and Configuration
|
||||
- `resources/profiles/` - Printer and material profiles organized by manufacturer
|
||||
- `resources/printers/` - Printer-specific configurations and G-code templates
|
||||
- `resources/images/` - UI icons, logos, calibration images
|
||||
- `resources/calib/` - Calibration test patterns and data
|
||||
- `resources/handy_models/` - Built-in test models (benchy, calibration cubes)
|
||||
|
||||
### Internationalization and Localization
|
||||
- `localization/i18n/` - Source translation files (.pot, .po)
|
||||
- `resources/i18n/` - Runtime language resources
|
||||
- Translation managed via `scripts/run_gettext.sh` / `scripts/run_gettext.bat`
|
||||
|
||||
### Platform-Specific Code
|
||||
- `src/libslic3r/Platform.cpp` - Platform abstractions and utilities
|
||||
- `src/libslic3r/MacUtils.mm` - macOS-specific utilities (Objective-C++)
|
||||
- Windows-specific build scripts and configurations
|
||||
- Linux distribution support scripts in `scripts/linux.d/`
|
||||
|
||||
### Build and Development Tools
|
||||
- `cmake/modules/` - Custom CMake find modules and utilities
|
||||
- `scripts/` - Python utilities for profile generation and validation
|
||||
- `tools/` - Windows build tools (gettext utilities)
|
||||
- `deps/` - External dependency build configurations
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Code Style and Standards
|
||||
- **C++17 standard** with selective C++20 features
|
||||
- **Naming conventions**: PascalCase for classes, snake_case for functions/variables
|
||||
- **Header guards**: Use `#pragma once`
|
||||
- **Memory management**: Prefer smart pointers, RAII patterns
|
||||
- **Thread safety**: Use TBB for parallelization, be mindful of shared state
|
||||
|
||||
### Common Development Tasks
|
||||
|
||||
#### Adding New Print Settings
|
||||
1. Define setting in `PrintConfig.cpp` with proper bounds and defaults
|
||||
2. Add UI controls in appropriate GUI components
|
||||
3. Update serialization in config save/load
|
||||
4. Add tooltips and help text for user guidance
|
||||
5. Test with different printer profiles
|
||||
|
||||
#### Modifying Slicing Algorithms
|
||||
1. Core algorithms live in `libslic3r/` subdirectories
|
||||
2. Performance-critical code should be profiled and optimized
|
||||
3. Consider multi-threading implications (TBB integration)
|
||||
4. Validate changes don't break existing profiles
|
||||
5. Add regression tests where appropriate
|
||||
|
||||
#### GUI Development
|
||||
1. GUI code resides in `src/slic3r/GUI/` (not visible in current tree)
|
||||
2. Use existing wxWidgets patterns and custom controls
|
||||
3. Support both light and dark themes
|
||||
4. Consider DPI scaling on high-resolution displays
|
||||
5. Maintain cross-platform compatibility
|
||||
|
||||
#### Adding Printer Support
|
||||
1. Create JSON profile in `resources/profiles/[manufacturer].json`
|
||||
2. Add printer-specific start/end G-code templates
|
||||
3. Configure build volume, capabilities, and material compatibility
|
||||
4. Test thoroughly with actual hardware when possible
|
||||
5. Follow existing profile structure and naming conventions
|
||||
|
||||
### Dependencies and Build System
|
||||
- **CMake-based** with separate dependency building phase
|
||||
- **Dependencies** built once in `deps/build/`, then linked to main application
|
||||
- **Cross-platform** considerations important for all changes
|
||||
- **Resource files** embedded at build time, platform-specific handling
|
||||
|
||||
### Performance Considerations
|
||||
- **Slicing algorithms** are CPU-intensive, profile before optimizing
|
||||
- **Memory usage** can be substantial with complex models
|
||||
- **Multi-threading** extensively used via TBB
|
||||
- **File I/O** optimized for large 3MF files with embedded textures
|
||||
- **Real-time preview** requires efficient mesh processing
|
||||
|
||||
## Important Development Notes
|
||||
|
||||
### Codebase Navigation
|
||||
- Use search tools extensively - codebase has 500k+ lines
|
||||
- Key entry points: `src/OrcaSlicer.cpp` for application startup
|
||||
- Core slicing: `libslic3r/Print.cpp` orchestrates the slicing pipeline
|
||||
- Configuration: `PrintConfig.cpp` defines all print/printer/material settings
|
||||
|
||||
### Compatibility and Stability
|
||||
- **Backward compatibility** maintained for project files and profiles
|
||||
- **Cross-platform** support essential (Windows/macOS/Linux)
|
||||
- **File format** changes require careful version handling
|
||||
- **Profile migrations** needed when settings change significantly
|
||||
|
||||
### Quality and Testing
|
||||
- **Regression testing** important due to algorithm complexity
|
||||
- **Performance benchmarks** help catch performance regressions
|
||||
- **Memory leak** detection important for long-running GUI application
|
||||
- **Cross-platform** testing required before releases
|
||||
|
||||
417
CMakeLists.txt
417
CMakeLists.txt
@@ -1,9 +1,13 @@
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0")
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.13 CACHE STRING "" FORCE)
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# Verify that your CMake version is exactly 3.5 series or higher on windows
|
||||
if ( (MSVC OR WIN32) AND (${CMAKE_VERSION} VERSION_LESS "3.5") )
|
||||
message(FATAL_ERROR "CMake current version ${CMAKE_VERSION} is too old. Minimum required is 3.5.")
|
||||
endif()
|
||||
|
||||
# The following line used to be in tests/CMakeLists.txt
|
||||
# Having it there causes rebuilds of all targets on any CMakeLists.txt change under tests/
|
||||
@@ -85,9 +89,10 @@ else ()
|
||||
endif ()
|
||||
|
||||
find_package(Git)
|
||||
if(DEFINED ENV{git_commit_hash} AND NOT "$ENV{git_commit_hash}" STREQUAL "")
|
||||
message(STATUS "Specified git commit hash: $ENV{git_commit_hash}")
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
if(DEFINED ENV{git_commit_hash} AND NOT "$ENV{git_commit_hash}" STREQUAL "")
|
||||
message(STATUS "Specified git commit hash: $ENV{git_commit_hash}")
|
||||
|
||||
# Convert the given hash to short hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short "$ENV{git_commit_hash}"
|
||||
@@ -95,20 +100,17 @@ if(DEFINED ENV{git_commit_hash} AND NOT "$ENV{git_commit_hash}" STREQUAL "")
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
else()
|
||||
# No .git directory (e.g., Flatpak sandbox) — truncate directly
|
||||
string(SUBSTRING "$ENV{git_commit_hash}" 0 7 GIT_COMMIT_HASH)
|
||||
# Check current Git commit hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
endif()
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
elseif(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
# Check current Git commit hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{SLIC3R_STATIC})
|
||||
@@ -117,139 +119,15 @@ else()
|
||||
set(SLIC3R_STATIC_INITIAL 1)
|
||||
endif()
|
||||
|
||||
option(SLIC3R_STATIC "Compile OrcaSlicer with static libraries (Boost, TBB)" ${SLIC3R_STATIC_INITIAL})
|
||||
option(SLIC3R_GUI "Compile OrcaSlicer with GUI components (OpenGL, wxWidgets)" 1)
|
||||
option(SLIC3R_STATIC "Compile OrcaSlicer with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
|
||||
option(SLIC3R_GUI "Compile OrcaSlicer with GUI components (OpenGL, wxWidgets)" 1)
|
||||
option(SLIC3R_FHS "Assume OrcaSlicer is to be installed in a FHS directory structure" 0)
|
||||
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
|
||||
option(SLIC3R_WX_STABLE "Build against wxWidgets stable (3.0) as oppsed to dev (3.1) on Linux" 0)
|
||||
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
|
||||
option(SLIC3R_PCH "Use precompiled headers" 1)
|
||||
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
|
||||
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
|
||||
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
|
||||
|
||||
# Python stubgen module
|
||||
option(ORCA_BUILD_PYTHON_STUBGEN_MODULE "Build importable Python module for pybind11-stubgen" ON)
|
||||
set(ORCA_BUNDLED_UV_EXECUTABLE "" CACHE FILEPATH "Path to a uv executable to bundle for Python package installation. Leave empty to auto-download.")
|
||||
|
||||
# Auto-download uv if not provided by the user.
|
||||
# uv is pinned: the executable ships inside the signed app, so the build must
|
||||
# be reproducible and the download verified. To upgrade, bump ORCA_UV_VERSION
|
||||
# and refresh every hash below from the release's .sha256 assets, e.g.:
|
||||
# curl -sL https://github.com/astral-sh/uv/releases/download/<ver>/uv-<triple>.tar.gz.sha256
|
||||
set(ORCA_UV_VERSION "0.11.21")
|
||||
set(ORCA_UV_SHA256_aarch64-apple-darwin "1f921d491ba5ffeea774eb04d6681ecee379101341cbb1500394993b541bf3f4")
|
||||
set(ORCA_UV_SHA256_x86_64-apple-darwin "f3c8e5708a84b920c18b691214d54d2b0da6b984789caae95d47c95120cb7765")
|
||||
set(ORCA_UV_SHA256_aarch64-unknown-linux-gnu "88e800834007cc5efd4675f166eb2a51e7e3ad19876d85fa8805a6fb5c922397")
|
||||
set(ORCA_UV_SHA256_x86_64-unknown-linux-gnu "8c88519b0ef0af9801fcdee419bbb12116bd9e6b18e162ae093c932d8b264050")
|
||||
set(ORCA_UV_SHA256_x86_64-pc-windows-msvc "ace861f360c6de2babedc1607d0f454b6b09a820dbc8182dc15af927e4df9589")
|
||||
|
||||
# Version-scoped cache dir so a version bump invalidates the cached binary.
|
||||
set(ORCA_UV_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/.uv/${ORCA_UV_VERSION}")
|
||||
set(ORCA_UV_BINARY "${ORCA_UV_DOWNLOAD_DIR}/uv")
|
||||
if(WIN32)
|
||||
set(ORCA_UV_BINARY "${ORCA_UV_DOWNLOAD_DIR}/uv.exe")
|
||||
endif()
|
||||
|
||||
# Older configures FORCE-cached the auto-downloaded path; any cache entry
|
||||
# under .uv/ is that legacy value -- clear it so auto-download re-resolves
|
||||
# (user-provided paths never live under .uv/).
|
||||
if(ORCA_BUNDLED_UV_EXECUTABLE MATCHES "/\\.uv/")
|
||||
set(ORCA_BUNDLED_UV_EXECUTABLE "" CACHE FILEPATH "Path to the auto-downloaded uv executable" FORCE)
|
||||
endif()
|
||||
|
||||
if(NOT ORCA_BUNDLED_UV_EXECUTABLE)
|
||||
if(NOT EXISTS "${ORCA_UV_BINARY}")
|
||||
# Select uv by TARGET arch. On macOS universal builds each leg sets a single
|
||||
# CMAKE_OSX_ARCHITECTURES (and the x86_64 leg cross-builds on an arm64 runner),
|
||||
# so prefer it over the host CMAKE_SYSTEM_PROCESSOR -- otherwise both legs fetch
|
||||
# the same arch and the later universal lipo merge of tools/uv/uv fails.
|
||||
set(_orca_uv_proc "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
set(_orca_uv_proc "${CMAKE_OSX_ARCHITECTURES}")
|
||||
endif()
|
||||
# All release archives are tar.gz except the Windows zip.
|
||||
set(ORCA_UV_EXT "tar.gz")
|
||||
if(_orca_uv_proc MATCHES "x86_64|AMD64|amd64")
|
||||
if(WIN32)
|
||||
set(ORCA_UV_ARCH "x86_64-pc-windows-msvc")
|
||||
set(ORCA_UV_EXT "zip")
|
||||
elseif(APPLE)
|
||||
set(ORCA_UV_ARCH "x86_64-apple-darwin")
|
||||
else()
|
||||
set(ORCA_UV_ARCH "x86_64-unknown-linux-gnu")
|
||||
endif()
|
||||
elseif(_orca_uv_proc MATCHES "aarch64|arm64|ARM64")
|
||||
if(APPLE)
|
||||
set(ORCA_UV_ARCH "aarch64-apple-darwin")
|
||||
else()
|
||||
set(ORCA_UV_ARCH "aarch64-unknown-linux-gnu")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Unsupported architecture for auto-downloading uv: ${_orca_uv_proc}")
|
||||
endif()
|
||||
|
||||
if(ORCA_UV_ARCH)
|
||||
set(ORCA_UV_URL "https://github.com/astral-sh/uv/releases/download/${ORCA_UV_VERSION}/uv-${ORCA_UV_ARCH}.${ORCA_UV_EXT}")
|
||||
set(ORCA_UV_ARCHIVE "${ORCA_UV_DOWNLOAD_DIR}/uv-archive.${ORCA_UV_EXT}")
|
||||
file(MAKE_DIRECTORY "${ORCA_UV_DOWNLOAD_DIR}")
|
||||
message(STATUS "Downloading uv ${ORCA_UV_VERSION} from ${ORCA_UV_URL} ...")
|
||||
file(DOWNLOAD "${ORCA_UV_URL}" "${ORCA_UV_ARCHIVE}" STATUS ORCA_UV_DL_STATUS TLS_VERIFY ON)
|
||||
list(GET ORCA_UV_DL_STATUS 0 ORCA_UV_DL_CODE)
|
||||
list(GET ORCA_UV_DL_STATUS 1 ORCA_UV_DL_MSG)
|
||||
if(NOT ORCA_UV_DL_CODE EQUAL 0)
|
||||
# Network failure keeps the historical graceful degradation (uv is
|
||||
# optional at build time) -- but a hash mismatch below is fatal.
|
||||
message(WARNING "Failed to download uv: ${ORCA_UV_DL_MSG}")
|
||||
file(REMOVE "${ORCA_UV_ARCHIVE}")
|
||||
else()
|
||||
file(SHA256 "${ORCA_UV_ARCHIVE}" _orca_uv_actual_sha256)
|
||||
if(NOT _orca_uv_actual_sha256 STREQUAL "${ORCA_UV_SHA256_${ORCA_UV_ARCH}}")
|
||||
file(REMOVE "${ORCA_UV_ARCHIVE}")
|
||||
message(FATAL_ERROR
|
||||
"uv archive checksum mismatch for ${ORCA_UV_ARCH} ${ORCA_UV_VERSION}:\n"
|
||||
" expected ${ORCA_UV_SHA256_${ORCA_UV_ARCH}}\n"
|
||||
" actual ${_orca_uv_actual_sha256}\n"
|
||||
"Possible tampering or a stale pin; refusing to bundle.")
|
||||
endif()
|
||||
message(STATUS "Extracting uv ...")
|
||||
file(ARCHIVE_EXTRACT INPUT "${ORCA_UV_ARCHIVE}" DESTINATION "${ORCA_UV_DOWNLOAD_DIR}")
|
||||
file(REMOVE "${ORCA_UV_ARCHIVE}")
|
||||
# Pinned archives have a fixed layout: the tarballs hold
|
||||
# uv-<triple>/uv, the Windows zip holds uv.exe at the root
|
||||
# (already at ORCA_UV_BINARY). A layout change implies a new
|
||||
# archive, hence a hash bump -- and RENAME fails loudly.
|
||||
if(NOT WIN32)
|
||||
file(RENAME "${ORCA_UV_DOWNLOAD_DIR}/uv-${ORCA_UV_ARCH}/uv" "${ORCA_UV_BINARY}")
|
||||
file(REMOVE_RECURSE "${ORCA_UV_DOWNLOAD_DIR}/uv-${ORCA_UV_ARCH}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS "${ORCA_UV_BINARY}")
|
||||
# Plain set (shadows the empty cache entry for this configure run):
|
||||
# the version-scoped path re-derives every configure, so a version
|
||||
# bump takes effect in warm build dirs without cache surgery.
|
||||
set(ORCA_BUNDLED_UV_EXECUTABLE "${ORCA_UV_BINARY}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Resolve ORCA_BUNDLED_UV_EXECUTABLE -> ORCA_BUNDLED_UV_EXECUTABLE_CONFIG / ORCA_BUNDLED_UV_FILENAME
|
||||
# Must run before add_subdirectory(src) so target_compile_definitions sees it.
|
||||
if(ORCA_BUNDLED_UV_EXECUTABLE)
|
||||
if(EXISTS "${ORCA_BUNDLED_UV_EXECUTABLE}")
|
||||
file(TO_CMAKE_PATH "${ORCA_BUNDLED_UV_EXECUTABLE}" ORCA_BUNDLED_UV_EXECUTABLE_CONFIG)
|
||||
get_filename_component(ORCA_BUNDLED_UV_FILENAME "${ORCA_BUNDLED_UV_EXECUTABLE}" NAME)
|
||||
else()
|
||||
message(WARNING "ORCA_BUNDLED_UV_EXECUTABLE does not exist: ${ORCA_BUNDLED_UV_EXECUTABLE}")
|
||||
set(ORCA_BUNDLED_UV_EXECUTABLE "")
|
||||
set(ORCA_BUNDLED_UV_EXECUTABLE_CONFIG "")
|
||||
set(ORCA_BUNDLED_UV_FILENAME "")
|
||||
endif()
|
||||
else()
|
||||
set(ORCA_BUNDLED_UV_EXECUTABLE_CONFIG "")
|
||||
set(ORCA_BUNDLED_UV_FILENAME "")
|
||||
endif()
|
||||
|
||||
# If SLIC3R_FHS is 1 -> SLIC3R_DESKTOP_INTEGRATION is always 0, othrewise variable.
|
||||
CMAKE_DEPENDENT_OPTION(SLIC3R_DESKTOP_INTEGRATION "Allow performing desktop integration during runtime" 1 "NOT SLIC3R_FHS" 0)
|
||||
|
||||
@@ -282,7 +160,7 @@ if (APPLE)
|
||||
if (CMAKE_MACOSX_BUNDLE)
|
||||
set(CMAKE_INSTALL_RPATH @executable_path/../Frameworks)
|
||||
endif()
|
||||
SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.orcaslicer.OrcaSlicer")
|
||||
SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.softfever3d.orca-slicer")
|
||||
|
||||
message(STATUS "Orca: IS_CROSS_COMPILE: ${IS_CROSS_COMPILE}")
|
||||
endif ()
|
||||
@@ -293,7 +171,10 @@ option(BUILD_TESTS "Build unit tests" OFF)
|
||||
option(ORCA_TOOLS "Build Orca tools" OFF)
|
||||
|
||||
if (FLATPAK)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++20")
|
||||
set(SLIC3R_PCH OFF CACHE BOOL "" FORCE)
|
||||
set(SLIC3R_FHS ON CACHE BOOL "" FORCE)
|
||||
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(SLIC3R_DESKTOP_INTEGRATION OFF CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
@@ -345,9 +226,7 @@ if (MSVC)
|
||||
# /bigobj (Increase Number of Sections in .Obj file)
|
||||
# error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm90' or greater
|
||||
# Generate symbols at every build target, even for the release.
|
||||
# -Zm520 fixes error C3859 but forces the compiler to pre-allocate that memory for every translation unit regardless
|
||||
# combining /Zi with /FS frees up a significant amount of memory pressure across all parallel compile jobs and makes /MP faster overall.
|
||||
add_compile_options(-bigobj /Zi /FS)
|
||||
add_compile_options(-bigobj -Zm520 /Zi)
|
||||
# Disable STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17.
|
||||
#FIXME Remove this line after eigen library adapts to the new C++17 adaptor rules.
|
||||
add_compile_options(-D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING)
|
||||
@@ -358,11 +237,6 @@ if (MSVC)
|
||||
# Disable warnings on comparison of unsigned and signed
|
||||
# C4018: signed/unsigned mismatch
|
||||
add_compile_options(/wd4018)
|
||||
# Prevent linker restart when TBB (or other deps) built with /GL are linked
|
||||
# Make your full (clean) build slower because it enables link-time code generation across all translation units.
|
||||
# helps incremental builds by preventing the double-link restart from TBB
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG")
|
||||
endif ()
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
|
||||
@@ -455,44 +329,43 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# WIN10SDK_PATH is used to point CMake to the WIN10 SDK installation directory.
|
||||
# We pick it from environment if it is not defined in another way
|
||||
# ORCA: Removed Netfabb STL fixing service support in favor of CGAL.
|
||||
# if(WIN32)
|
||||
# if(NOT DEFINED WIN10SDK_PATH)
|
||||
# if(DEFINED ENV{WIN10SDK_PATH})
|
||||
# set(WIN10SDK_PATH "$ENV{WIN10SDK_PATH}")
|
||||
# endif()
|
||||
# endif()
|
||||
# if(DEFINED WIN10SDK_PATH)
|
||||
# #BBS: modify win10sdk_path
|
||||
# if (EXISTS "${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h")
|
||||
# set(WIN10SDK_INCLUDE_PATH "${WIN10SDK_PATH}")
|
||||
# else()
|
||||
# message("WIN10SDK_PATH is invalid: ${WIN10SDK_PATH}")
|
||||
# message("${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h was not found")
|
||||
# message("STL fixing by the Netfabb service will not be compiled")
|
||||
# unset(WIN10SDK_PATH)
|
||||
# endif()
|
||||
# else()
|
||||
# # Try to use the default Windows 10 SDK path.
|
||||
# if (DEFINED ENV{WindowsSdkDir} AND DEFINED ENV{WindowsSDKVersion})
|
||||
# set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}")
|
||||
# else ()
|
||||
# set(WIN10SDK_INCLUDE_PATH "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0")
|
||||
# endif ()
|
||||
# if (NOT EXISTS "${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h")
|
||||
# message("${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h was not found")
|
||||
# message("STL fixing by the Netfabb service will not be compiled")
|
||||
# unset(WIN10SDK_INCLUDE_PATH)
|
||||
# endif()
|
||||
# endif()
|
||||
# if(WIN10SDK_INCLUDE_PATH)
|
||||
# message("Building with Win10 Netfabb STL fixing service support")
|
||||
# add_definitions(-DHAS_WIN10SDK)
|
||||
# include_directories(SYSTEM "${WIN10SDK_INCLUDE_PATH}")
|
||||
# else()
|
||||
# message("Building without Win10 Netfabb STL fixing service support")
|
||||
# endif()
|
||||
# endif()
|
||||
if(WIN32)
|
||||
if(NOT DEFINED WIN10SDK_PATH)
|
||||
if(DEFINED ENV{WIN10SDK_PATH})
|
||||
set(WIN10SDK_PATH "$ENV{WIN10SDK_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
if(DEFINED WIN10SDK_PATH)
|
||||
#BBS: modify win10sdk_path
|
||||
if (EXISTS "${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h")
|
||||
set(WIN10SDK_INCLUDE_PATH "${WIN10SDK_PATH}")
|
||||
else()
|
||||
message("WIN10SDK_PATH is invalid: ${WIN10SDK_PATH}")
|
||||
message("${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h was not found")
|
||||
message("STL fixing by the Netfabb service will not be compiled")
|
||||
unset(WIN10SDK_PATH)
|
||||
endif()
|
||||
else()
|
||||
# Try to use the default Windows 10 SDK path.
|
||||
if (DEFINED ENV{WindowsSdkDir} AND DEFINED ENV{WindowsSDKVersion})
|
||||
set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}")
|
||||
else ()
|
||||
set(WIN10SDK_INCLUDE_PATH "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0")
|
||||
endif ()
|
||||
if (NOT EXISTS "${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h")
|
||||
message("${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h was not found")
|
||||
message("STL fixing by the Netfabb service will not be compiled")
|
||||
unset(WIN10SDK_INCLUDE_PATH)
|
||||
endif()
|
||||
endif()
|
||||
if(WIN10SDK_INCLUDE_PATH)
|
||||
message("Building with Win10 Netfabb STL fixing service support")
|
||||
add_definitions(-DHAS_WIN10SDK)
|
||||
include_directories(SYSTEM "${WIN10SDK_INCLUDE_PATH}")
|
||||
else()
|
||||
message("Building without Win10 Netfabb STL fixing service support")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
|
||||
@@ -506,6 +379,11 @@ endif ()
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||
# Workaround for an old CMake, which does not understand CMAKE_CXX_STANDARD.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif()
|
||||
|
||||
# Boost on Raspberry-Pi does not link to pthreads.
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
@@ -558,11 +436,7 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
|
||||
endif()
|
||||
|
||||
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag(-Wno-error=enum-constexpr-conversion HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
|
||||
if(HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
|
||||
add_compile_options(-Wno-error=enum-constexpr-conversion)
|
||||
endif()
|
||||
add_compile_options(-Wno-error=enum-constexpr-conversion)
|
||||
endif()
|
||||
|
||||
#GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
|
||||
@@ -577,12 +451,9 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
|
||||
add_compile_options(-Wno-unknown-pragmas)
|
||||
endif()
|
||||
|
||||
# Compress the debug info with zstd to save space in Flatpak CI builds
|
||||
if(FLATPAK)
|
||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0) OR
|
||||
("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
|
||||
add_compile_options(-gz=zstd)
|
||||
endif()
|
||||
# Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
|
||||
add_compile_options(-gz=zstd)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
|
||||
@@ -616,8 +487,7 @@ if (APPLE)
|
||||
endif ()
|
||||
|
||||
if(MSVC)
|
||||
# Ignore truncating casts in initializers & constructors
|
||||
# https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4305
|
||||
# 添加编译选项,忽略警告 C4305 (格式转换截断)
|
||||
add_compile_options(/wd4305)
|
||||
endif()
|
||||
|
||||
@@ -708,9 +578,6 @@ endif()
|
||||
set(Boost_NO_SYSTEM_PATHS TRUE)
|
||||
find_package(Boost 1.83.0 REQUIRED COMPONENTS system filesystem thread log log_setup locale regex chrono atomic date_time iostreams program_options nowide)
|
||||
|
||||
# Find and configure Eigen3
|
||||
find_package(Eigen3 5.0.1 REQUIRED)
|
||||
|
||||
add_library(boost_libs INTERFACE)
|
||||
add_library(boost_headeronly INTERFACE)
|
||||
|
||||
@@ -795,6 +662,16 @@ endif()
|
||||
|
||||
## OPTIONAL packages
|
||||
|
||||
# Find eigen3 or use bundled version
|
||||
if (NOT SLIC3R_STATIC)
|
||||
find_package(Eigen3 3.3)
|
||||
endif ()
|
||||
if (NOT EIGEN3_FOUND)
|
||||
set(EIGEN3_FOUND 1)
|
||||
set(EIGEN3_INCLUDE_DIR ${LIBDIR}/eigen/)
|
||||
endif ()
|
||||
include_directories(BEFORE SYSTEM ${EIGEN3_INCLUDE_DIR})
|
||||
|
||||
# Find expat or use bundled version
|
||||
# Always use the system libexpat on Linux.
|
||||
|
||||
@@ -820,6 +697,16 @@ if(APPLE AND CMAKE_VERSION VERSION_GREATER_EQUAL "4.0")
|
||||
set(OPENGL_LIBRARIES "-framework OpenGL" CACHE STRING "OpenGL framework" FORCE)
|
||||
endif()
|
||||
|
||||
set(GLEW_ROOT "${CMAKE_PREFIX_PATH}")
|
||||
message("GLEW_ROOT: ${GLEW_ROOT}")
|
||||
# Find glew or use bundled version
|
||||
if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_GLEW)
|
||||
set(GLEW_USE_STATIC_LIBS ON)
|
||||
set(GLEW_VERBOSE ON)
|
||||
endif()
|
||||
|
||||
find_package(GLEW REQUIRED)
|
||||
|
||||
find_package(glfw3 REQUIRED)
|
||||
|
||||
# Find the Cereal serialization library
|
||||
@@ -838,7 +725,7 @@ add_custom_target(gettext_make_pot
|
||||
COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost
|
||||
-f "${BBL_L18N_DIR}/list.txt"
|
||||
-o "${BBL_L18N_DIR}/OrcaSlicer.pot"
|
||||
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
|
||||
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Generate pot file from strings in the source tree"
|
||||
)
|
||||
@@ -875,86 +762,6 @@ endforeach()
|
||||
|
||||
find_package(NLopt 1.4 REQUIRED)
|
||||
|
||||
# Use bundled Python from deps instead of system Python
|
||||
set(_bundled_python_version "3.12.13")
|
||||
set(_bundled_python_abi "312")
|
||||
string(REGEX REPLACE "^([0-9]+\\.[0-9]+)\\..*$" "\\1" _bundled_python_version_short "${_bundled_python_version}")
|
||||
set(_bundled_python_root "${CMAKE_PREFIX_PATH}/libpython")
|
||||
set(Python3_ROOT_DIR "${_bundled_python_root}" CACHE PATH "Root directory for bundled Python" FORCE)
|
||||
set(Python3_USE_STATIC_LIBS OFF)
|
||||
set(Python3_FIND_STRATEGY LOCATION)
|
||||
set(Python3_FIND_IMPLEMENTATIONS CPython)
|
||||
|
||||
if(WIN32)
|
||||
set(_bundled_python_executable "${_bundled_python_root}/python.exe")
|
||||
set(_bundled_python_library "${_bundled_python_root}/libs/python${_bundled_python_abi}.lib")
|
||||
if(EXISTS "${_bundled_python_root}/python_d.exe")
|
||||
set(_bundled_python_executable "${_bundled_python_root}/python_d.exe")
|
||||
endif()
|
||||
if(EXISTS "${_bundled_python_root}/libs/python${_bundled_python_abi}_d.lib")
|
||||
set(_bundled_python_library "${_bundled_python_root}/libs/python${_bundled_python_abi}_d.lib")
|
||||
endif()
|
||||
|
||||
set(Python3_FIND_REGISTRY NEVER)
|
||||
set(Python3_EXECUTABLE "${_bundled_python_executable}" CACHE FILEPATH "Bundled Python executable" FORCE)
|
||||
set(Python3_INCLUDE_DIR "${_bundled_python_root}/include" CACHE PATH "Bundled Python include directory" FORCE)
|
||||
set(Python3_LIBRARY "${_bundled_python_library}" CACHE FILEPATH "Bundled Python embed import library" FORCE)
|
||||
elseif(APPLE)
|
||||
set(Python3_FIND_FRAMEWORK NEVER)
|
||||
|
||||
find_program(_bundled_python_executable
|
||||
NAMES python${_bundled_python_version_short} python3
|
||||
PATHS "${_bundled_python_root}/bin"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
find_path(_bundled_python_include_dir
|
||||
NAMES Python.h
|
||||
PATHS
|
||||
"${_bundled_python_root}/include/python${_bundled_python_version_short}"
|
||||
"${_bundled_python_root}/include"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
find_library(_bundled_python_library
|
||||
NAMES python${_bundled_python_version_short} libpython${_bundled_python_version_short}
|
||||
PATHS "${_bundled_python_root}/lib"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(NOT _bundled_python_executable)
|
||||
message(FATAL_ERROR "Bundled Python executable not found under ${_bundled_python_root}/bin")
|
||||
endif()
|
||||
if(NOT _bundled_python_include_dir)
|
||||
message(FATAL_ERROR "Bundled Python headers not found under ${_bundled_python_root}/include")
|
||||
endif()
|
||||
if(NOT _bundled_python_library)
|
||||
message(FATAL_ERROR "Bundled Python library not found under ${_bundled_python_root}/lib")
|
||||
endif()
|
||||
|
||||
set(Python3_EXECUTABLE "${_bundled_python_executable}" CACHE FILEPATH "Bundled Python executable" FORCE)
|
||||
set(Python3_INCLUDE_DIR "${_bundled_python_include_dir}" CACHE PATH "Bundled Python include directory" FORCE)
|
||||
set(Python3_LIBRARY "${_bundled_python_library}" CACHE FILEPATH "Bundled Python embed library" FORCE)
|
||||
endif()
|
||||
|
||||
find_package(Python3 ${_bundled_python_version} EXACT REQUIRED
|
||||
COMPONENTS Interpreter Development.Embed
|
||||
)
|
||||
|
||||
# Provide a minimal pybind11::embed target sourced from deps_src/pybind11 headers.
|
||||
set(PYBIND11_SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps_src/pybind11")
|
||||
if(NOT EXISTS "${PYBIND11_SOURCE_DIR}/include/pybind11/pybind11.h")
|
||||
message(FATAL_ERROR "pybind11 headers not found in ${PYBIND11_SOURCE_DIR}. Did you initialize submodules?")
|
||||
endif()
|
||||
|
||||
add_library(pybind11_headers INTERFACE)
|
||||
target_include_directories(pybind11_headers INTERFACE "${PYBIND11_SOURCE_DIR}/include")
|
||||
add_library(pybind11::headers ALIAS pybind11_headers)
|
||||
add_library(pybind11::pybind11 ALIAS pybind11_headers)
|
||||
|
||||
add_library(pybind11_embed INTERFACE)
|
||||
target_link_libraries(pybind11_embed INTERFACE pybind11_headers Python3::Python)
|
||||
target_compile_definitions(pybind11_embed INTERFACE PYBIND11_SIMPLE_GIL_MANAGEMENT)
|
||||
add_library(pybind11::embed ALIAS pybind11_embed)
|
||||
|
||||
|
||||
if(SLIC3R_STATIC)
|
||||
set(OPENVDB_USE_STATIC_LIBS ON)
|
||||
@@ -990,10 +797,8 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
set(_arch "x64")
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86")
|
||||
set(_arch "x86")
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
|
||||
set(_arch "arm64")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unable to detect architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(FATAL_ERROR "Unable to detect architecture")
|
||||
endif ()
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
@@ -1104,12 +909,10 @@ if (NOT WIN32 AND NOT APPLE)
|
||||
configure_file(${LIBDIR}/dev-utils/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh USE_SOURCE_PERMISSIONS @ONLY)
|
||||
endif()
|
||||
|
||||
|
||||
# Resources install target, configure fhs.hpp on UNIX
|
||||
if (WIN32)
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources")
|
||||
if(ORCA_BUNDLED_UV_EXECUTABLE)
|
||||
install(PROGRAMS "${ORCA_BUNDLED_UV_EXECUTABLE}" DESTINATION "./resources/tools/uv" RENAME "${ORCA_BUNDLED_UV_FILENAME}")
|
||||
endif()
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".")
|
||||
@@ -1119,10 +922,7 @@ elseif (SLIC3R_FHS)
|
||||
install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/ DESTINATION ${SLIC3R_FHS_RESOURCES}
|
||||
PATTERN "*/udev" EXCLUDE
|
||||
)
|
||||
if(ORCA_BUNDLED_UV_EXECUTABLE)
|
||||
install(PROGRAMS "${ORCA_BUNDLED_UV_EXECUTABLE}" DESTINATION "${SLIC3R_FHS_RESOURCES}/tools/uv" RENAME "${ORCA_BUNDLED_UV_FILENAME}")
|
||||
endif()
|
||||
install(FILES src/dev-utils/platform/unix/com.orcaslicer.OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
install(FILES src/dev-utils/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
foreach(SIZE 32 128 192)
|
||||
install(FILES ${SLIC3R_RESOURCES_DIR}/images/OrcaSlicer_${SIZE}px.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME OrcaSlicer.png
|
||||
@@ -1130,15 +930,9 @@ elseif (SLIC3R_FHS)
|
||||
endforeach()
|
||||
elseif (CMAKE_MACOSX_BUNDLE)
|
||||
# install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/OrcaSlicer.app/Contents/resources")
|
||||
if(ORCA_BUNDLED_UV_EXECUTABLE)
|
||||
install(PROGRAMS "${ORCA_BUNDLED_UV_EXECUTABLE}" DESTINATION "${CMAKE_INSTALL_PREFIX}/OrcaSlicer.app/Contents/Resources/tools/uv" RENAME "${ORCA_BUNDLED_UV_FILENAME}")
|
||||
endif()
|
||||
else ()
|
||||
install(FILES src/dev-utils/platform/unix/com.orcaslicer.OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
|
||||
install(FILES src/dev-utils/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
|
||||
if(ORCA_BUNDLED_UV_EXECUTABLE)
|
||||
install(PROGRAMS "${ORCA_BUNDLED_UV_EXECUTABLE}" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources/tools/uv" RENAME "${ORCA_BUNDLED_UV_FILENAME}")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ".")
|
||||
@@ -1150,16 +944,6 @@ set (CPACK_PACKAGE_VERSION_MAJOR "${ORCA_VERSION_MAJOR}")
|
||||
set (CPACK_PACKAGE_VERSION_MINOR "${ORCA_VERSION_MINOR}")
|
||||
set (CPACK_PACKAGE_VERSION_PATCH "${ORCA_VERSION_PATCH}")
|
||||
set (CPACK_PACKAGE_FILE_NAME "OrcaSlicer_Windows_Installer_V${SoftFever_VERSION}")
|
||||
# Suffix the Windows installer with its target arch so the x64 and arm64 builds
|
||||
# produce distinct filenames (matches ARCH_SUFFIX in build_orca.yml). Same
|
||||
# CMAKE_SYSTEM_PROCESSOR mapping used by orcaslicer_copy_dlls() above.
|
||||
if (WIN32)
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
|
||||
string (APPEND CPACK_PACKAGE_FILE_NAME "_arm64")
|
||||
else ()
|
||||
string (APPEND CPACK_PACKAGE_FILE_NAME "_x64")
|
||||
endif ()
|
||||
endif ()
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Orca Slicer is an open source slicer for FDM printers")
|
||||
set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/OrcaSlicer/OrcaSlicer")
|
||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
||||
@@ -1167,6 +951,9 @@ set (CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/images\\\\OrcaSlicer.ico"
|
||||
set (CPACK_NSIS_MUI_ICON "${CPACK_PACKAGE_ICON}")
|
||||
set (CPACK_NSIS_MUI_UNIICON "${CPACK_PACKAGE_ICON}")
|
||||
set (CPACK_NSIS_INSTALLED_ICON_NAME "$INSTDIR\\\\orca-slicer.exe")
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
|
||||
CreateShortCut \\\"$DESKTOP\\\\OrcaSlicer.lnk\\\" \\\"$INSTDIR\\\\orca-slicer.exe\\\"
|
||||
")
|
||||
set (CPACK_PACKAGE_CHECKSUM SHA256)
|
||||
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OrcaSlicer")
|
||||
set (CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
|
||||
78
README.md
78
README.md
@@ -4,7 +4,7 @@
|
||||
<img alt="OrcaSlicer logo" src="resources/images/OrcaSlicer.png" width="15%" height="15%">
|
||||
</picture>
|
||||
|
||||
<a href="https://trendshift.io/repositories/15552" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15552" alt="OrcaSlicer%2FOrcaSlicer | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
<a href="https://trendshift.io/repositories/952" target="_blank"><img src="https://trendshift.io/api/badge/repositories/952" alt="SoftFever%2FOrcaSlicer | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
[](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml)
|
||||
|
||||
@@ -15,20 +15,15 @@ Optimize your prints with ultra-fast slicing, intelligent support generation, an
|
||||
# Official links and community
|
||||
|
||||
#### Official Website:
|
||||
|
||||
<a href="https://www.orcaslicer.com/" style="font-size:2em;">OrcaSlicer.com</a>
|
||||
|
||||
#### Github Repository:
|
||||
|
||||
<a href="https://github.com/OrcaSlicer/OrcaSlicer"><img src="https://img.shields.io/badge/OrcaSlicer-181717?style=flat&logo=github&logoColor=white" width="200" alt="GitHub Logo"/> </a>
|
||||
|
||||
#### Follow us:
|
||||
|
||||
<a href="https://twitter.com/real_OrcaSlicer"><img src="https://img.shields.io/badge/real__OrcaSlicer-000000?style=flat&logo=x&logoColor=white" width="200" alt="X Logo"/> </a>
|
||||
<a href="https://www.youtube.com/@OfficialOrcaSlicer"><img src="https://img.shields.io/badge/OfficialOrcaSlicer-FF0000?style=flat&logo=youtube&logoColor=white" width="200" alt="YouTube Logo"/> </a>
|
||||
<a href="https://twitter.com/real_OrcaSlicer"><img src="https://img.shields.io/badge/real__OrcaSlicer-000000?style=flat&logo=x&logoColor=white" width="200" alt="X Logo"/> </a>
|
||||
|
||||
#### Join our Discord community:
|
||||
|
||||
<a href="https://discord.gg/P4VE9UY9gJ"><img src="https://img.shields.io/badge/-Discord-5865F2?style=flat&logo=discord&logoColor=fff" width="200" alt="discord logo"/> </a>
|
||||
|
||||
<table border="2" style="border-color: #ffa500; background-color:rgb(232, 220, 180); color: #856404;">
|
||||
@@ -49,7 +44,7 @@ If you come across any of these in search results, please <b>report them</b> as
|
||||
|
||||
# Main features
|
||||
|
||||
- **[Advanced Calibration Tools](https://www.orcaslicer.com/wiki/calibration_guide)**
|
||||
- **[Advanced Calibration Tools](https://www.orcaslicer.com/wiki/Calibration)**
|
||||
Comprehensive suite: temperature towers, flow rate, retraction & more for optimal performance.
|
||||
- **[Precise Wall](https://www.orcaslicer.com/wiki/quality_settings_precision#precise-wall) and [Seam Control](https://www.orcaslicer.com/wiki/quality_settings_seam)**
|
||||
Adjust outer wall spacing and apply scarf seams to enhance print accuracy.
|
||||
@@ -76,7 +71,7 @@ If you come across any of these in search results, please <b>report them</b> as
|
||||
The [wiki](https://www.orcaslicer.com/wiki) aims to provide a detailed explanation of the slicer settings, including how to maximize their use and how to calibrate and set up your printer.
|
||||
|
||||
- **[Access the wiki here](https://www.orcaslicer.com/wiki)**
|
||||
- **[Contribute to the wiki](https://www.orcaslicer.com/wiki/how_to_wiki)**
|
||||
- **[Contribute to the wiki](https://www.orcaslicer.com/wiki/How-to-wiki)**
|
||||
|
||||
# Download
|
||||
|
||||
@@ -96,17 +91,17 @@ Explore the latest developments in OrcaSlicer with our nightly builds. Feedback
|
||||
|
||||
Download the **Windows Installer exe** for your preferred version from the [releases page](https://github.com/OrcaSlicer/OrcaSlicer/releases).
|
||||
|
||||
- *For convenience there is also a portable build available.*
|
||||
- *For convenience there is also a portable build available.*
|
||||
<details>
|
||||
<summary>Troubleshooting</summary>
|
||||
|
||||
- *If you have troubles to run the build, you might need to install following runtimes:*
|
||||
- [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
|
||||
- [Details of this runtime](https://aka.ms/webview2)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://go.microsoft.com/fwlink/p/?LinkId=2124703)
|
||||
- [vcredist2019_x64](https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v1.0.10-sf2/vcredist2019_x64.exe)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
- This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142`
|
||||
- *If you have troubles to run the build, you might need to install following runtimes:*
|
||||
- [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
|
||||
- [Details of this runtime](https://aka.ms/webview2)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://go.microsoft.com/fwlink/p/?LinkId=2124703)
|
||||
- [vcredist2019_x64](https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v1.0.10-sf2/vcredist2019_x64.exe)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
- This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142`
|
||||
</details>
|
||||
|
||||
Windows Package Manager
|
||||
@@ -142,36 +137,14 @@ winget install --id=SoftFever.OrcaSlicer -e
|
||||

|
||||
</details>
|
||||
|
||||
## Linux
|
||||
## Linux (Ubuntu)
|
||||
|
||||
### Flathub (Recommended)
|
||||
|
||||
OrcaSlicer is available through FlatHub:
|
||||
|
||||
<a href='https://flathub.org/apps/com.orcaslicer.OrcaSlicer'><img width='240' alt='Download on Flathub' src='https://dl.flathub.org/assets/badges/flathub-badge-en.png'/></a>
|
||||
|
||||
Install from the command line:
|
||||
|
||||
```shell
|
||||
flatpak install flathub com.orcaslicer.OrcaSlicer
|
||||
flatpak run com.orcaslicer.OrcaSlicer
|
||||
```
|
||||
|
||||
It can also be installed through graphical software managers (KDE Discover, GNOME Software, etc.) when Flathub is enabled. Search for **OrcaSlicer** in your software center.
|
||||
|
||||
### AppImage
|
||||
|
||||
AppImages are published for both **x86_64** and **aarch64** (ARM64). Pick the file matching your CPU — the ARM64 build has `aarch64` in its name (e.g. `OrcaSlicer_Linux_AppImage_Ubuntu2404_aarch64_*.AppImage`).
|
||||
|
||||
1. Download App image from the [releases page](https://github.com/OrcaSlicer/OrcaSlicer/releases).
|
||||
2. Double click the downloaded file to run it.
|
||||
|
||||
3. If you run into trouble executing it, try this command in the terminal:
|
||||
1. If you run into trouble executing it, try this command in the terminal:
|
||||
`chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage`
|
||||
|
||||
# How to Compile
|
||||
|
||||
All updated build instructions for Windows, macOS, and Linux are now available on the official [OrcaSlicer Wiki - How to build](https://www.orcaslicer.com/wiki/how_to_build) page.
|
||||
All updated build instructions for Windows, macOS, and Linux are now available on the official [OrcaSlicer Wiki - How to build](https://www.orcaslicer.com/wiki/How-to-build) page.
|
||||
|
||||
Please refer to the wiki to ensure you're following the latest and most accurate steps for your platform.
|
||||
|
||||
@@ -194,7 +167,7 @@ resolution: 0.1
|
||||
Their generous support enables me to purchase filaments and other essential 3D printing materials for the project.
|
||||
Thank you! :)
|
||||
|
||||
## Sponsors
|
||||
## Sponsors:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -217,21 +190,24 @@ Thank you! :)
|
||||
|
||||
## Support me
|
||||
|
||||
<a href="https://github.com/sponsors/SoftFever"><img src="https://img.shields.io/badge/GitHub%20Sponsors-30363D?style=flat&logo=GitHub-Sponsors&logoColor=EA4AAA" height="50"></a>
|
||||
<a href="https://ko-fi.com/G2G5IP3CP"><img src="https://img.shields.io/badge/Support_me_on_Ko--fi-FF5E5B?style=flat&logo=ko-fi&logoColor=white" height="50"></a>
|
||||
<a href="https://github.com/sponsors/SoftFever"><img src="https://img.shields.io/badge/GitHub%20Sponsors-30363D?style=flat&logo=GitHub-Sponsors&logoColor=EA4AAA" height="50"></a>
|
||||
<a href="https://ko-fi.com/G2G5IP3CP"><img src="https://img.shields.io/badge/Support_me_on_Ko--fi-FF5E5B?style=flat&logo=ko-fi&logoColor=white" height="50"></a>
|
||||
<a href="https://paypal.me/softfever3d"><img src="https://img.shields.io/badge/PayPal-003087?style=flat&logo=paypal&logoColor=fff" height="50"></a>
|
||||
|
||||
## Some Background
|
||||
## Some background
|
||||
|
||||
Open-source slicing has always been built on a tradition of collaboration and attribution. [Slic3r](https://github.com/Slic3r/Slic3r), created by Alessandro Ranellucci and the RepRap community, laid the foundation. [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research built on Slic3r and acknowledged that heritage. [Bambu Studio](https://github.com/bambulab/BambuStudio) in turn forked from PrusaSlicer, and [SuperSlicer](https://github.com/supermerill/SuperSlicer) by @supermerill extended PrusaSlicer with community-driven enhancements. Each project carried the work of its predecessors forward, crediting those who came before.
|
||||
OrcaSlicer was originally forked from Bambu Studio, it was previously known as BambuStudio-SoftFever.
|
||||
|
||||
OrcaSlicer began in that same spirit, drawing from BambuStudio, PrusaSlicer, and ideas inspired by CuraSlicer and SuperSlicer. But it has since grown far beyond its origins. Through relentless innovation — introducing advanced calibration tools, precise wall and seam control, tree supports, adaptive slicing, and hundreds of other features — OrcaSlicer has become the most widely used and actively developed open-source slicer in the 3D printing community. Many of its innovations have been adopted by other slicers, making it a driving force for the entire industry.
|
||||
|
||||
The OrcaSlicer logo was designed by community member [Justin Levine](https://github.com/jal-co).
|
||||
[Bambu Studio](https://github.com/bambulab/BambuStudio) is forked from [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community.
|
||||
OrcaSlicer incorporates a lot of features from [SuperSlicer](https://github.com/supermerill/SuperSlicer) by @supermerill
|
||||
OrcaSlicer's logo is designed by community member Justin Levine (@freejstnalxndr).
|
||||
|
||||
# License
|
||||
|
||||
- **OrcaSlicer** is licensed under the GNU Affero General Public License, version 3.
|
||||
- **OrcaSlicer** is licensed under the GNU Affero General Public License, version 3. OrcaSlicer is based on Bambu Studio by BambuLab.
|
||||
- **Bambu Studio** is licensed under the GNU Affero General Public License, version 3. Bambu Studio is based on PrusaSlicer by PrusaResearch.
|
||||
- **PrusaSlicer** is licensed under the GNU Affero General Public License, version 3. PrusaSlicer is owned by Prusa Research. PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci.
|
||||
- **Slic3r** is licensed under the GNU Affero General Public License, version 3. Slic3r was created by Alessandro Ranellucci with the help of many other contributors.
|
||||
- The **GNU Affero General Public License**, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.
|
||||
- OrcaSlicer includes a **pressure advance calibration pattern test** adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3.
|
||||
- The **Bambu networking plugin** is based on non-free libraries from BambuLab. It is optional to the OrcaSlicer and provides extended functionalities for Bambulab printer users.
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
# Based on the GitHub Actions workflow in .github/workflows/build_all.yml
|
||||
|
||||
set -e
|
||||
SECONDS=0
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
@@ -22,8 +21,6 @@ INSTALL_RUNTIME=false
|
||||
JOBS=$(nproc)
|
||||
FORCE_CLEAN=false
|
||||
ENABLE_CCACHE=false
|
||||
DISABLE_ROFILES_FUSE=false
|
||||
NO_DEBUGINFO=true
|
||||
CACHE_DIR=".flatpak-builder"
|
||||
|
||||
# Help function
|
||||
@@ -39,8 +36,6 @@ show_help() {
|
||||
echo " -c, --cleanup Clean build directory before building"
|
||||
echo " -f, --force-clean Force clean build (disables caching)"
|
||||
echo " --ccache Enable ccache for faster rebuilds (requires ccache in SDK)"
|
||||
echo " --disable-rofiles-fuse Disable rofiles-fuse (workaround for FUSE issues)"
|
||||
echo " --with-debuginfo Include debug info (slower builds, needed for Flathub)"
|
||||
echo " --cache-dir DIR Flatpak builder cache directory [default: $CACHE_DIR]"
|
||||
echo " -i, --install-runtime Install required Flatpak runtime and SDK"
|
||||
echo " -h, --help Show this help message"
|
||||
@@ -80,14 +75,6 @@ while [[ $# -gt 0 ]]; do
|
||||
ENABLE_CCACHE=true
|
||||
shift
|
||||
;;
|
||||
--disable-rofiles-fuse)
|
||||
DISABLE_ROFILES_FUSE=true
|
||||
shift
|
||||
;;
|
||||
--with-debuginfo)
|
||||
NO_DEBUGINFO=false
|
||||
shift
|
||||
;;
|
||||
--cache-dir)
|
||||
CACHE_DIR="$2"
|
||||
shift 2
|
||||
@@ -199,22 +186,22 @@ echo -e "${GREEN}All required dependencies found${NC}"
|
||||
# Install runtime and SDK if requested
|
||||
if [[ "$INSTALL_RUNTIME" == true ]]; then
|
||||
echo -e "${YELLOW}Installing GNOME runtime and SDK...${NC}"
|
||||
flatpak install --user -y flathub org.gnome.Platform//50
|
||||
flatpak install --user -y flathub org.gnome.Sdk//50
|
||||
flatpak install --user -y flathub org.gnome.Platform//48
|
||||
flatpak install --user -y flathub org.gnome.Sdk//48
|
||||
fi
|
||||
|
||||
# Check if required runtime is available
|
||||
if ! flatpak info --user org.gnome.Platform//50 &> /dev/null; then
|
||||
echo -e "${RED}Error: GNOME Platform 50 runtime is not installed.${NC}"
|
||||
if ! flatpak info --user org.gnome.Platform//48 &> /dev/null; then
|
||||
echo -e "${RED}Error: GNOME Platform 48 runtime is not installed.${NC}"
|
||||
echo "Run with -i flag to install it automatically, or install manually:"
|
||||
echo "flatpak install --user flathub org.gnome.Platform//50"
|
||||
echo "flatpak install --user flathub org.gnome.Platform//48"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! flatpak info --user org.gnome.Sdk//50 &> /dev/null; then
|
||||
echo -e "${RED}Error: GNOME SDK 50 is not installed.${NC}"
|
||||
if ! flatpak info --user org.gnome.Sdk//48 &> /dev/null; then
|
||||
echo -e "${RED}Error: GNOME SDK 48 is not installed.${NC}"
|
||||
echo "Run with -i flag to install it automatically, or install manually:"
|
||||
echo "flatpak install --user flathub org.gnome.Sdk//50"
|
||||
echo "flatpak install --user flathub org.gnome.Sdk//48"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -255,8 +242,8 @@ mkdir -p "$BUILD_DIR"
|
||||
rm -rf "$BUILD_DIR/build-dir"
|
||||
|
||||
# Check if flatpak manifest exists
|
||||
if [[ ! -f "./scripts/flatpak/com.orcaslicer.OrcaSlicer.yml" ]]; then
|
||||
echo -e "${RED}Error: Flatpak manifest not found at scripts/flatpak/com.orcaslicer.OrcaSlicer.yml${NC}"
|
||||
if [[ ! -f "./scripts/flatpak/io.github.softfever.OrcaSlicer.yml" ]]; then
|
||||
echo -e "${RED}Error: Flatpak manifest not found at scripts/flatpak/io.github.softfever.OrcaSlicer.yml${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -292,7 +279,6 @@ BUILDER_ARGS=(
|
||||
--verbose
|
||||
--state-dir="$CACHE_DIR"
|
||||
--jobs="$JOBS"
|
||||
--mirror-screenshots-url=https://dl.flathub.org/media/
|
||||
)
|
||||
|
||||
# Add force-clean only if explicitly requested (disables caching)
|
||||
@@ -309,40 +295,21 @@ if [[ "$ENABLE_CCACHE" == true ]]; then
|
||||
echo -e "${GREEN}Using ccache for compiler caching${NC}"
|
||||
fi
|
||||
|
||||
# Disable rofiles-fuse if requested (workaround for FUSE issues)
|
||||
if [[ "$DISABLE_ROFILES_FUSE" == true ]]; then
|
||||
BUILDER_ARGS+=(--disable-rofiles-fuse)
|
||||
echo -e "${YELLOW}rofiles-fuse disabled${NC}"
|
||||
fi
|
||||
|
||||
# Use a temp manifest with no-debuginfo if requested
|
||||
MANIFEST="scripts/flatpak/com.orcaslicer.OrcaSlicer.yml"
|
||||
if [[ "$NO_DEBUGINFO" == true ]]; then
|
||||
MANIFEST="scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
|
||||
sed '/^build-options:/a\ no-debuginfo: true\n strip: true' \
|
||||
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml > "$MANIFEST"
|
||||
echo -e "${YELLOW}Debug info disabled (using temp manifest)${NC}"
|
||||
fi
|
||||
|
||||
if ! flatpak-builder \
|
||||
"${BUILDER_ARGS[@]}" \
|
||||
"$BUILD_DIR/build-dir" \
|
||||
"$MANIFEST"; then
|
||||
scripts/flatpak/io.github.softfever.OrcaSlicer.yml; then
|
||||
echo -e "${RED}Error: flatpak-builder failed${NC}"
|
||||
echo -e "${YELLOW}Check the build log above for details${NC}"
|
||||
rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Clean up temp manifest
|
||||
rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
|
||||
|
||||
# Create bundle
|
||||
echo -e "${YELLOW}Creating Flatpak bundle...${NC}"
|
||||
if ! flatpak build-bundle \
|
||||
"$BUILD_DIR/repo" \
|
||||
"$BUNDLE_NAME" \
|
||||
com.orcaslicer.OrcaSlicer \
|
||||
io.github.softfever.OrcaSlicer \
|
||||
--arch="$ARCH"; then
|
||||
echo -e "${RED}Error: Failed to create Flatpak bundle${NC}"
|
||||
exit 1
|
||||
@@ -361,10 +328,10 @@ echo -e "${BLUE}To install the Flatpak:${NC}"
|
||||
echo -e "flatpak install --user $BUNDLE_NAME"
|
||||
echo ""
|
||||
echo -e "${BLUE}To run OrcaSlicer:${NC}"
|
||||
echo -e "flatpak run com.orcaslicer.OrcaSlicer"
|
||||
echo -e "flatpak run io.github.softfever.OrcaSlicer"
|
||||
echo ""
|
||||
echo -e "${BLUE}To uninstall:${NC}"
|
||||
echo -e "flatpak uninstall --user com.orcaslicer.OrcaSlicer"
|
||||
echo -e "flatpak uninstall --user io.github.softfever.OrcaSlicer"
|
||||
echo ""
|
||||
if [[ "$FORCE_CLEAN" != true ]]; then
|
||||
echo -e "${BLUE}Cache Management:${NC}"
|
||||
@@ -372,6 +339,3 @@ if [[ "$FORCE_CLEAN" != true ]]; then
|
||||
echo -e "• To force a clean build: $0 -f"
|
||||
echo -e "• To clean cache manually: rm -rf $CACHE_DIR"
|
||||
fi
|
||||
|
||||
elapsed=$SECONDS
|
||||
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))
|
||||
|
||||
338
build_linux.sh
338
build_linux.sh
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e # Exit immediately if a command exits with a non-zero status.
|
||||
SECONDS=0
|
||||
|
||||
SCRIPT_NAME=$(basename "$0")
|
||||
SCRIPT_PATH=$(dirname "$(readlink -f "${0}")")
|
||||
@@ -8,7 +7,7 @@ SCRIPT_PATH=$(dirname "$(readlink -f "${0}")")
|
||||
pushd "${SCRIPT_PATH}" > /dev/null
|
||||
|
||||
function usage() {
|
||||
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-p][-r][-s][-t][-u][-l][-L]"
|
||||
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-h][-i][-j N][-p][-r][-s][-t][-u][-l][-L]"
|
||||
echo " -1: limit builds to one core (where possible)"
|
||||
echo " -j N: limit builds to N cores (where possible)"
|
||||
echo " -b: build in Debug mode"
|
||||
@@ -17,8 +16,6 @@ function usage() {
|
||||
echo " -d: download and build dependencies in ./deps/ (build prerequisite)"
|
||||
echo " -D: dry run"
|
||||
echo " -e: build in RelWithDebInfo mode"
|
||||
echo " -F: rebuild the cached Docker/Podman runner image from scratch when used with -g"
|
||||
echo " -g: run the requested build steps inside a Docker/Podman Ubuntu 24.04 container similar to the GitHub Actions Linux runner"
|
||||
echo " -h: prints this help text"
|
||||
echo " -i: build the Orca Slicer AppImage (optional)"
|
||||
echo " -p: boost ccache hit rate by disabling precompiled headers (default: ON)"
|
||||
@@ -30,9 +27,6 @@ function usage() {
|
||||
echo " -L: use ld.lld as linker (if available)"
|
||||
echo "For a first use, you want to './${SCRIPT_NAME} -u'"
|
||||
echo " and then './${SCRIPT_NAME} -dsi'"
|
||||
echo "For a GitHub Actions-like Linux build locally, use './${SCRIPT_NAME} -g -istrlL'"
|
||||
echo "Use './${SCRIPT_NAME} -gF -istrlL' to rebuild the cached runner image first."
|
||||
echo "Set ORCA_CONTAINER_CLI, ORCA_DOCKER_IMAGE, ORCA_DOCKER_BASE_IMAGE, or ORCA_DOCKER_CMAKE_VERSION to override the container runtime, cached image tag, base image, or CMake version."
|
||||
}
|
||||
|
||||
SLIC3R_PRECOMPILED_HEADERS="ON"
|
||||
@@ -40,83 +34,60 @@ SLIC3R_PRECOMPILED_HEADERS="ON"
|
||||
unset name
|
||||
BUILD_DIR=build
|
||||
BUILD_CONFIG=Release
|
||||
FORWARDED_ARGS=()
|
||||
while getopts ":1j:bcCdDeFghiprstulL" opt ; do
|
||||
while getopts ":1j:bcCdDehiprstulL" opt ; do
|
||||
case ${opt} in
|
||||
1 )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=1
|
||||
FORWARDED_ARGS+=("-1")
|
||||
;;
|
||||
j )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=$OPTARG
|
||||
FORWARDED_ARGS+=("-j" "$OPTARG")
|
||||
;;
|
||||
b )
|
||||
BUILD_DIR=build-dbg
|
||||
BUILD_CONFIG=Debug
|
||||
FORWARDED_ARGS+=("-b")
|
||||
;;
|
||||
c )
|
||||
CLEAN_BUILD=1
|
||||
FORWARDED_ARGS+=("-c")
|
||||
;;
|
||||
C )
|
||||
COLORED_OUTPUT="-DCOLORED_OUTPUT=ON"
|
||||
FORWARDED_ARGS+=("-C")
|
||||
;;
|
||||
d )
|
||||
BUILD_DEPS="1"
|
||||
FORWARDED_ARGS+=("-d")
|
||||
;;
|
||||
D )
|
||||
DRY_RUN="1"
|
||||
FORWARDED_ARGS+=("-D")
|
||||
;;
|
||||
e )
|
||||
BUILD_DIR=build-dbginfo
|
||||
BUILD_CONFIG=RelWithDebInfo
|
||||
FORWARDED_ARGS+=("-e")
|
||||
;;
|
||||
F )
|
||||
CLEAN_DOCKER_IMAGE="1"
|
||||
;;
|
||||
g )
|
||||
USE_DOCKER="1"
|
||||
;;
|
||||
h ) usage
|
||||
exit 1
|
||||
;;
|
||||
i )
|
||||
BUILD_IMAGE="1"
|
||||
FORWARDED_ARGS+=("-i")
|
||||
;;
|
||||
p )
|
||||
SLIC3R_PRECOMPILED_HEADERS="OFF"
|
||||
FORWARDED_ARGS+=("-p")
|
||||
;;
|
||||
r )
|
||||
SKIP_RAM_CHECK="1"
|
||||
FORWARDED_ARGS+=("-r")
|
||||
;;
|
||||
s )
|
||||
BUILD_ORCA="1"
|
||||
FORWARDED_ARGS+=("-s")
|
||||
;;
|
||||
t )
|
||||
BUILD_TESTS="1"
|
||||
FORWARDED_ARGS+=("-t")
|
||||
;;
|
||||
u )
|
||||
export UPDATE_LIB="1"
|
||||
FORWARDED_ARGS+=("-u")
|
||||
;;
|
||||
l )
|
||||
USE_CLANG="1"
|
||||
FORWARDED_ARGS+=("-l")
|
||||
;;
|
||||
L )
|
||||
USE_LLD="1"
|
||||
FORWARDED_ARGS+=("-L")
|
||||
;;
|
||||
* )
|
||||
echo "Unknown argument '${opt}', aborting."
|
||||
@@ -130,11 +101,6 @@ if [ ${OPTIND} -eq 1 ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n "${CLEAN_DOCKER_IMAGE}" ]] && [[ -z "${USE_DOCKER}" ]] ; then
|
||||
echo "Error: -F requires -g."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function check_available_memory_and_disk() {
|
||||
FREE_MEM_GB=$(free --gibi --total | grep 'Mem' | rev | cut --delimiter=" " --fields=1 | rev)
|
||||
MIN_MEM_GB=10
|
||||
@@ -172,275 +138,6 @@ function print_and_run() {
|
||||
fi
|
||||
}
|
||||
|
||||
function resolve_container_cli() {
|
||||
if [[ -n "${ORCA_CONTAINER_CLI}" ]] ; then
|
||||
if ! command -v "${ORCA_CONTAINER_CLI}" >/dev/null 2>&1 ; then
|
||||
echo "Error: container runtime '${ORCA_CONTAINER_CLI}' was not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${ORCA_CONTAINER_CLI}"
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v docker >/dev/null 2>&1 ; then
|
||||
echo "docker"
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v podman >/dev/null 2>&1 ; then
|
||||
echo "podman"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Error: neither docker nor podman is available. Install one of them or set ORCA_CONTAINER_CLI." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function get_docker_runner_image() {
|
||||
local base_image
|
||||
local docker_cmake_version
|
||||
local recipe_hash
|
||||
local sanitized_base_image
|
||||
local sanitized_cmake_version
|
||||
|
||||
if [[ -n "${ORCA_DOCKER_IMAGE}" ]] ; then
|
||||
echo "${ORCA_DOCKER_IMAGE}"
|
||||
return
|
||||
fi
|
||||
|
||||
base_image="${ORCA_DOCKER_BASE_IMAGE:-ubuntu:24.04}"
|
||||
docker_cmake_version="${ORCA_DOCKER_CMAKE_VERSION-4.3.0}"
|
||||
recipe_hash=$(find "${SCRIPT_PATH}/build_linux.sh" "${SCRIPT_PATH}/scripts/linux.d" -type f -print0 | sort -z | xargs -0 cat | sha256sum | cut -c1-12)
|
||||
sanitized_base_image=$(echo "${base_image}" | tr '/:@' '---' | tr -cs 'A-Za-z0-9_.-' '-')
|
||||
sanitized_cmake_version=$(echo "${docker_cmake_version:-system}" | tr -cs 'A-Za-z0-9_.-' '-')
|
||||
echo "orcaslicer-linux-builder:${sanitized_base_image}-cmake-${sanitized_cmake_version}-${recipe_hash}"
|
||||
}
|
||||
|
||||
function docker_runner_dockerfile() {
|
||||
cat <<'EOF'
|
||||
ARG BASE_IMAGE=ubuntu:24.04
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
ARG CMAKE_VERSION=4.3.0
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
RUN apt-get update && apt-get install -y sudo ca-certificates curl tar
|
||||
|
||||
COPY build_linux.sh /tmp/orcaslicer/build_linux.sh
|
||||
COPY scripts/linux.d /tmp/orcaslicer/scripts/linux.d
|
||||
|
||||
WORKDIR /tmp/orcaslicer
|
||||
|
||||
RUN chmod +x ./build_linux.sh
|
||||
RUN ./build_linux.sh -ur
|
||||
RUN if [[ -n "${CMAKE_VERSION}" ]] ; then \
|
||||
case "$(uname -m)" in \
|
||||
x86_64|amd64) cmake_arch="x86_64" ;; \
|
||||
aarch64|arm64) cmake_arch="aarch64" ;; \
|
||||
*) cmake_arch="" ;; \
|
||||
esac ; \
|
||||
if [[ -n "${cmake_arch}" ]] ; then \
|
||||
cmake_root="/opt/cmake-${CMAKE_VERSION}-linux-${cmake_arch}" ; \
|
||||
if ! curl -fsSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.tar.gz" | tar -xz -C /opt ; then \
|
||||
echo "Warning: failed to install CMake ${CMAKE_VERSION}; falling back to the distro cmake package." ; \
|
||||
elif [[ -d "${cmake_root}" ]] ; then \
|
||||
ln -sf "${cmake_root}/bin/"* /usr/local/bin/ ; \
|
||||
fi ; \
|
||||
else \
|
||||
echo "Skipping GitHub Actions CMake install for unsupported architecture $(uname -m)." ; \
|
||||
fi ; \
|
||||
fi
|
||||
RUN rm -rf /var/lib/apt/lists/* /tmp/orcaslicer
|
||||
EOF
|
||||
}
|
||||
|
||||
function ensure_docker_runner_image() {
|
||||
local container_cli
|
||||
local base_image
|
||||
local runner_image
|
||||
local docker_cmake_version
|
||||
local image_exists="0"
|
||||
local force_rebuild="0"
|
||||
local -a build_cmd
|
||||
|
||||
container_cli="$1"
|
||||
runner_image="$2"
|
||||
base_image="${ORCA_DOCKER_BASE_IMAGE:-ubuntu:24.04}"
|
||||
docker_cmake_version="${ORCA_DOCKER_CMAKE_VERSION-4.3.0}"
|
||||
|
||||
if "${container_cli}" image inspect "${runner_image}" >/dev/null 2>&1 ; then
|
||||
image_exists="1"
|
||||
fi
|
||||
|
||||
if [[ -n "${CLEAN_DOCKER_IMAGE}" ]] ; then
|
||||
force_rebuild="1"
|
||||
if [[ "${image_exists}" == "1" ]] ; then
|
||||
echo "Removing cached container image ${runner_image} ..."
|
||||
if [[ -z "${DRY_RUN}" ]] ; then
|
||||
"${container_cli}" image rm -f "${runner_image}" >/dev/null
|
||||
else
|
||||
printf '%q ' "${container_cli}" image rm -f "${runner_image}"
|
||||
echo
|
||||
fi
|
||||
image_exists="0"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${image_exists}" == "1" ]] ; then
|
||||
echo "Using cached container image ${runner_image}"
|
||||
return
|
||||
fi
|
||||
|
||||
build_cmd=(
|
||||
"${container_cli}" build --pull
|
||||
-t "${runner_image}"
|
||||
--build-arg "BASE_IMAGE=${base_image}"
|
||||
--build-arg "CMAKE_VERSION=${docker_cmake_version}"
|
||||
)
|
||||
if [[ "${force_rebuild}" == "1" ]] ; then
|
||||
build_cmd+=(--no-cache)
|
||||
fi
|
||||
build_cmd+=(-f - "${SCRIPT_PATH}")
|
||||
|
||||
printf '%q ' "${build_cmd[@]}"
|
||||
echo
|
||||
if [[ -n "${DRY_RUN}" ]] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
docker_runner_dockerfile | "${build_cmd[@]}"
|
||||
}
|
||||
|
||||
function run_in_docker() {
|
||||
local container_cli
|
||||
local runner_image
|
||||
local container_workspace
|
||||
local host_uid
|
||||
local host_gid
|
||||
local host_user
|
||||
local -a build_args
|
||||
local -a container_env
|
||||
|
||||
container_cli=$(resolve_container_cli)
|
||||
runner_image=$(get_docker_runner_image)
|
||||
host_uid=$(id -u)
|
||||
host_gid=$(id -g)
|
||||
host_user="${USER:-orca}"
|
||||
container_workspace="/__w/OrcaSlicer/OrcaSlicer"
|
||||
build_args=()
|
||||
for item in "${FORWARDED_ARGS[@]}" ; do
|
||||
if [[ "${item}" == "-u" ]] || [[ "${item}" == "-D" ]] ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
build_args+=("${item}")
|
||||
done
|
||||
|
||||
container_env=(
|
||||
-e "CI=true"
|
||||
-e "GITHUB_ACTIONS=true"
|
||||
-e "GITHUB_WORKSPACE=${container_workspace}"
|
||||
-e "RUNNER_OS=Linux"
|
||||
-e "RUNNER_TEMP=/tmp"
|
||||
-e "HOST_UID=${host_uid}"
|
||||
-e "HOST_GID=${host_gid}"
|
||||
-e "HOST_USER=${host_user}"
|
||||
)
|
||||
if [[ -n "${CMAKE_BUILD_PARALLEL_LEVEL}" ]] ; then
|
||||
container_env+=( -e "CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}" )
|
||||
fi
|
||||
if [[ -n "${ORCA_UPDATER_SIG_KEY}" ]] ; then
|
||||
container_env+=( -e "ORCA_UPDATER_SIG_KEY=${ORCA_UPDATER_SIG_KEY}" )
|
||||
fi
|
||||
|
||||
ensure_docker_runner_image "${container_cli}" "${runner_image}"
|
||||
|
||||
printf '%q ' "${container_cli}" run --rm -i \
|
||||
-v "${SCRIPT_PATH}:${container_workspace}" \
|
||||
-w "${container_workspace}" \
|
||||
"${container_env[@]}" \
|
||||
"${runner_image}" \
|
||||
bash -s -- "${build_args[@]}"
|
||||
echo
|
||||
if [[ -n "${DRY_RUN}" ]] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
"${container_cli}" run --rm -i \
|
||||
-v "${SCRIPT_PATH}:${container_workspace}" \
|
||||
-w "${container_workspace}" \
|
||||
"${container_env[@]}" \
|
||||
"${runner_image}" \
|
||||
bash -s -- "${build_args[@]}" <<'EOF'
|
||||
set -e
|
||||
|
||||
function create_builder_user() {
|
||||
if [[ "${HOST_UID}" == "0" ]] ; then
|
||||
HOST_USER=root
|
||||
return
|
||||
fi
|
||||
|
||||
if getent group "${HOST_GID}" >/dev/null 2>&1 ; then
|
||||
HOST_GROUP=$(getent group "${HOST_GID}" | cut -d: -f1)
|
||||
else
|
||||
HOST_GROUP="orca-builder"
|
||||
if getent group "${HOST_GROUP}" >/dev/null 2>&1 ; then
|
||||
HOST_GROUP="orca-builder-${HOST_GID}"
|
||||
fi
|
||||
groupadd -g "${HOST_GID}" "${HOST_GROUP}"
|
||||
fi
|
||||
|
||||
if getent passwd "${HOST_UID}" >/dev/null 2>&1 ; then
|
||||
HOST_USER=$(getent passwd "${HOST_UID}" | cut -d: -f1)
|
||||
usermod -g "${HOST_GROUP}" "${HOST_USER}"
|
||||
elif id -u "${HOST_USER}" >/dev/null 2>&1 ; then
|
||||
usermod -u "${HOST_UID}" -g "${HOST_GROUP}" "${HOST_USER}"
|
||||
else
|
||||
useradd -m -u "${HOST_UID}" -g "${HOST_GROUP}" -s /bin/bash "${HOST_USER}"
|
||||
fi
|
||||
|
||||
echo "${HOST_USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/orcaslicer-builder
|
||||
chmod 0440 /etc/sudoers.d/orcaslicer-builder
|
||||
}
|
||||
|
||||
create_builder_user
|
||||
mkdir -p "${GITHUB_WORKSPACE}/deps/build/destdir"
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/deps/build"
|
||||
if [[ -d "${GITHUB_WORKSPACE}/build" ]] ; then
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/build"
|
||||
fi
|
||||
if [[ -d "${GITHUB_WORKSPACE}/build-dbg" ]] ; then
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/build-dbg"
|
||||
fi
|
||||
if [[ -d "${GITHUB_WORKSPACE}/build-dbginfo" ]] ; then
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/build-dbginfo"
|
||||
fi
|
||||
|
||||
sudo -H -u "${HOST_USER}" env \
|
||||
CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL-}" \
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" \
|
||||
ORCA_UPDATER_SIG_KEY="${ORCA_UPDATER_SIG_KEY-}" \
|
||||
bash -c '
|
||||
set -e
|
||||
cd "${GITHUB_WORKSPACE}"
|
||||
if [[ "$#" -gt 0 ]] ; then
|
||||
./build_linux.sh "$@"
|
||||
else
|
||||
echo "No build steps were requested after container setup."
|
||||
fi
|
||||
' bash "$@"
|
||||
EOF
|
||||
}
|
||||
|
||||
if [[ -n "${USE_DOCKER}" ]] ; then
|
||||
run_in_docker
|
||||
popd > /dev/null # ${SCRIPT_PATH}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# cmake 4.x compatibility workaround
|
||||
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
|
||||
@@ -454,8 +151,6 @@ elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" ==
|
||||
DISTRIBUTION="debian"
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]] ; then
|
||||
DISTRIBUTION="arch"
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"suse"* ]] ; then
|
||||
DISTRIBUTION="suse"
|
||||
fi
|
||||
|
||||
if [ ! -f "./scripts/linux.d/${DISTRIBUTION}" ] ; then
|
||||
@@ -504,26 +199,6 @@ if [[ -n "${USE_LLD}" ]] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
export CMAKE_CCACHE_ARGS=()
|
||||
CMAKE_CCACHE=${CMAKE_CCACHE:-}
|
||||
if [ -n "$CMAKE_CCACHE" ]; then
|
||||
echo "Checking ${CMAKE_CCACHE} environment variable for compiler cache program..."
|
||||
CMAKE_CCACHE=$(command -v "${CMAKE_CCACHE}") || {
|
||||
echo "CMAKE_CCACHE environment variable is set to '${CMAKE_CCACHE}' but it was not found in PATH."
|
||||
CMAKE_CCACHE=""
|
||||
}
|
||||
elif command -v sccache >/dev/null 2>&1 ; then
|
||||
CMAKE_CCACHE=$(command -v sccache)
|
||||
elif command -v ccache >/dev/null 2>&1 ; then
|
||||
CMAKE_CCACHE=$(command -v ccache)
|
||||
fi
|
||||
if [ -n "${CMAKE_CCACHE}" ] ; then
|
||||
echo "${CMAKE_CCACHE} found, enabling compiler caching..."
|
||||
export CMAKE_CCACHE_ARGS=(-DCMAKE_C_COMPILER_LAUNCHER="${CMAKE_CCACHE}" -DCMAKE_CXX_COMPILER_LAUNCHER="${CMAKE_CCACHE}")
|
||||
else
|
||||
echo "Note: ccache or sccache are not found. Install either of them for faster rebuilds."
|
||||
fi
|
||||
|
||||
if [[ -n "${BUILD_DEPS}" ]] ; then
|
||||
echo "Configuring dependencies..."
|
||||
read -r -a BUILD_ARGS <<< "${DEPS_EXTRA_BUILD_ARGS}"
|
||||
@@ -536,8 +211,8 @@ if [[ -n "${BUILD_DEPS}" ]] ; then
|
||||
BUILD_ARGS+=(-DCMAKE_BUILD_TYPE="${BUILD_CONFIG}")
|
||||
fi
|
||||
|
||||
print_and_run cmake -S deps -B deps/$BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" "${CMAKE_CCACHE_ARGS[@]}" -G Ninja "${COLORED_OUTPUT}" "${BUILD_ARGS[@]}"
|
||||
print_and_run cmake --build deps/$BUILD_DIR -j1
|
||||
print_and_run cmake -S deps -B deps/$BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" -G Ninja "${COLORED_OUTPUT}" "${BUILD_ARGS[@]}"
|
||||
print_and_run cmake --build deps/$BUILD_DIR
|
||||
fi
|
||||
|
||||
if [[ -n "${BUILD_ORCA}" ]] || [[ -n "${BUILD_TESTS}" ]] ; then
|
||||
@@ -556,7 +231,7 @@ if [[ -n "${BUILD_ORCA}" ]] || [[ -n "${BUILD_TESTS}" ]] ; then
|
||||
BUILD_ARGS+=(-DORCA_UPDATER_SIG_KEY="${ORCA_UPDATER_SIG_KEY}")
|
||||
fi
|
||||
|
||||
print_and_run cmake -S . -B $BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" "${CMAKE_CCACHE_ARGS[@]}" -G "Ninja Multi-Config" \
|
||||
print_and_run cmake -S . -B $BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" -G "Ninja Multi-Config" \
|
||||
-DSLIC3R_PCH=${SLIC3R_PRECOMPILED_HEADERS} \
|
||||
-DORCA_TOOLS=ON \
|
||||
"${COLORED_OUTPUT}" \
|
||||
@@ -591,7 +266,4 @@ if [[ -n "${BUILD_IMAGE}" || -n "${BUILD_ORCA}" ]] ; then
|
||||
popd > /dev/null # build
|
||||
fi
|
||||
|
||||
elapsed=$SECONDS
|
||||
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))
|
||||
|
||||
popd > /dev/null # ${SCRIPT_PATH}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
SECONDS=0
|
||||
|
||||
while getopts ":dpa:snt:xbc:i:1Tuh" opt; do
|
||||
while getopts ":dpa:snt:xbc:1Th" opt; do
|
||||
case "${opt}" in
|
||||
d )
|
||||
export BUILD_TARGET="deps"
|
||||
@@ -35,29 +34,21 @@ while getopts ":dpa:snt:xbc:i:1Tuh" opt; do
|
||||
c )
|
||||
export BUILD_CONFIG="$OPTARG"
|
||||
;;
|
||||
i )
|
||||
export CMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH:+$CMAKE_IGNORE_PREFIX_PATH;}$OPTARG"
|
||||
;;
|
||||
1 )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=1
|
||||
;;
|
||||
T )
|
||||
export BUILD_TESTS="1"
|
||||
;;
|
||||
u )
|
||||
export BUILD_TARGET="universal"
|
||||
;;
|
||||
h ) echo "Usage: ./build_release_macos.sh [-d]"
|
||||
echo " -d: Build deps only"
|
||||
echo " -a: Set ARCHITECTURE (arm64 or x86_64 or universal)"
|
||||
echo " -s: Build slicer only"
|
||||
echo " -u: Build universal app only (requires existing arm64 and x86_64 app bundles)"
|
||||
echo " -n: Nightly build"
|
||||
echo " -t: Specify minimum version of the target platform, default is 11.3"
|
||||
echo " -x: Use Ninja Multi-Config CMake generator, default is Xcode"
|
||||
echo " -b: Build without reconfiguring CMake"
|
||||
echo " -c: Set CMake build configuration, default is Release"
|
||||
echo " -i: Add a prefix to ignore during CMake dependency discovery (repeatable), defaults to /opt/local:/usr/local:/opt/homebrew"
|
||||
echo " -1: Use single job for building"
|
||||
echo " -T: Build and run tests"
|
||||
exit 0
|
||||
@@ -98,10 +89,6 @@ if [ -z "$OSX_DEPLOYMENT_TARGET" ]; then
|
||||
export OSX_DEPLOYMENT_TARGET="11.3"
|
||||
fi
|
||||
|
||||
if [ -z "$CMAKE_IGNORE_PREFIX_PATH" ]; then
|
||||
export CMAKE_IGNORE_PREFIX_PATH="/opt/local:/usr/local:/opt/homebrew"
|
||||
fi
|
||||
|
||||
CMAKE_VERSION=$(cmake --version | head -1 | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
||||
if [ "$CMAKE_VERSION" -ge 4 ] 2>/dev/null; then
|
||||
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
@@ -117,7 +104,6 @@ echo " - BUILD_CONFIG: $BUILD_CONFIG"
|
||||
echo " - BUILD_TARGET: $BUILD_TARGET"
|
||||
echo " - CMAKE_GENERATOR: $SLICER_CMAKE_GENERATOR for Slicer, $DEPS_CMAKE_GENERATOR for deps"
|
||||
echo " - OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET"
|
||||
echo " - CMAKE_IGNORE_PREFIX_PATH: $CMAKE_IGNORE_PREFIX_PATH"
|
||||
echo
|
||||
|
||||
# if which -s brew; then
|
||||
@@ -161,7 +147,6 @@ function build_deps() {
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
|
||||
-DCMAKE_OSX_ARCHITECTURES:STRING="${_ARCH}" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \
|
||||
-DCMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH}" \
|
||||
${CMAKE_POLICY_COMPAT}
|
||||
fi
|
||||
cmake --build . --config "$BUILD_CONFIG" --target deps
|
||||
@@ -179,45 +164,6 @@ function pack_deps() {
|
||||
)
|
||||
}
|
||||
|
||||
# --- Bundled Python runtime verification --------------------------------------
|
||||
# Relocation is handled at the source: deps/python3/python3.cmake stamps
|
||||
# libpython with an @rpath id and src/CMakeLists.txt gives the app a matching
|
||||
# rpath. This gate catches regressions that would otherwise only surface as
|
||||
# launch failures on end users' machines (the absolute deps path still exists
|
||||
# on the build host, so a plain run can pass while relocation is broken --
|
||||
# hence the otool checks). The x86_64 leg runs under Rosetta on arm64 hosts.
|
||||
function verify_python_runtime() {
|
||||
local app="$1"
|
||||
local pydir="$app/Contents/MacOS/python"
|
||||
[ -d "$pydir" ] || return 0 # app doesn't bundle Python (e.g. profile validator)
|
||||
# Version-agnostic interpreter name so a CPython version bump cannot
|
||||
# silently skip the gate; if the dir exists the interpreter must too.
|
||||
local pybin="$pydir/bin/python3"
|
||||
if [ ! -x "$pybin" ]; then
|
||||
echo "ERROR: bundled python/ present but no interpreter at $pybin" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo " Verifying bundled Python runtime in $(basename "$app")..."
|
||||
local bad
|
||||
bad=$(otool -arch all -L "$pybin" "$app/Contents/MacOS/OrcaSlicer" | grep "libpython" | grep -v "@rpath/" || true)
|
||||
if [ -n "$bad" ]; then
|
||||
echo "ERROR: a bundled binary references libpython by absolute path (relocation regression):" >&2
|
||||
echo "$bad" >&2
|
||||
exit 1
|
||||
fi
|
||||
# otool -L shows load commands only; assert the consumer rpath separately.
|
||||
# Its loss is masked on the build host by CMake's absolute build-tree rpath.
|
||||
if ! otool -arch all -l "$app/Contents/MacOS/OrcaSlicer" | grep -q "path @executable_path/python/lib "; then
|
||||
echo "ERROR: OrcaSlicer lacks the @executable_path/python/lib rpath (relocation regression)" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! "$pybin" -c "import ssl"; then
|
||||
echo "ERROR: bundled Python failed to start (libpython relocation broken," >&2
|
||||
echo " or missing Rosetta 2 for the x86_64 leg?)" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function build_slicer() {
|
||||
# iterate over two architectures: x86_64 and arm64
|
||||
for _ARCH in x86_64 arm64; do
|
||||
@@ -242,7 +188,6 @@ function build_slicer() {
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
|
||||
-DCMAKE_OSX_ARCHITECTURES="${_ARCH}" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \
|
||||
-DCMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH}" \
|
||||
${CMAKE_POLICY_COMPAT}
|
||||
fi
|
||||
cmake --build . --config "$BUILD_CONFIG" --target "$SLICER_BUILD_TARGET"
|
||||
@@ -278,8 +223,6 @@ function build_slicer() {
|
||||
cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources
|
||||
# delete .DS_Store file
|
||||
find ./OrcaSlicer.app/ -name '.DS_Store' -delete
|
||||
|
||||
verify_python_runtime ./OrcaSlicer.app
|
||||
|
||||
# Copy OrcaSlicer_profile_validator.app if it exists
|
||||
if [ -f "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
@@ -288,7 +231,6 @@ function build_slicer() {
|
||||
cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app" ./OrcaSlicer_profile_validator.app
|
||||
# delete .DS_Store file
|
||||
find ./OrcaSlicer_profile_validator.app/ -name '.DS_Store' -delete
|
||||
verify_python_runtime ./OrcaSlicer_profile_validator.app
|
||||
fi
|
||||
)
|
||||
|
||||
@@ -307,55 +249,48 @@ function build_slicer() {
|
||||
done
|
||||
}
|
||||
|
||||
function lipo_dir() {
|
||||
local universal_dir="$1"
|
||||
local x86_64_dir="$2"
|
||||
|
||||
# Find all Mach-O files in the universal (arm64-based) copy and lipo them
|
||||
while IFS= read -r -d '' f; do
|
||||
local rel="${f#"$universal_dir"/}"
|
||||
local x86="$x86_64_dir/$rel"
|
||||
if [ -f "$x86" ]; then
|
||||
echo " lipo: $rel"
|
||||
lipo -create "$f" "$x86" -output "$f.tmp"
|
||||
mv "$f.tmp" "$f"
|
||||
else
|
||||
echo " warning: no x86_64 counterpart for $rel, keeping arm64 only"
|
||||
fi
|
||||
done < <(find "$universal_dir" -type f -print0 | while IFS= read -r -d '' candidate; do
|
||||
if file "$candidate" | grep -q "Mach-O"; then
|
||||
printf '%s\0' "$candidate"
|
||||
fi
|
||||
done)
|
||||
}
|
||||
|
||||
function build_universal() {
|
||||
echo "Building universal binary..."
|
||||
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$ARCH"
|
||||
ARM64_APP="$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer.app"
|
||||
X86_64_APP="$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer.app"
|
||||
|
||||
|
||||
# Create universal binary
|
||||
echo "Creating universal binary..."
|
||||
# PROJECT_BUILD_DIR="$PROJECT_DIR/build_Universal"
|
||||
mkdir -p "$PROJECT_BUILD_DIR/OrcaSlicer"
|
||||
UNIVERSAL_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer.app"
|
||||
rm -rf "$UNIVERSAL_APP"
|
||||
cp -R "$ARM64_APP" "$UNIVERSAL_APP"
|
||||
|
||||
echo "Creating universal binaries for OrcaSlicer.app..."
|
||||
lipo_dir "$UNIVERSAL_APP" "$X86_64_APP"
|
||||
echo "Universal OrcaSlicer.app created at $UNIVERSAL_APP"
|
||||
verify_python_runtime "$UNIVERSAL_APP"
|
||||
|
||||
cp -R "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer.app" "$UNIVERSAL_APP"
|
||||
|
||||
# Get the binary path inside the .app bundle
|
||||
BINARY_PATH="Contents/MacOS/OrcaSlicer"
|
||||
|
||||
# Create universal binary using lipo
|
||||
lipo -create \
|
||||
"$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
|
||||
"$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
|
||||
-output "$UNIVERSAL_APP/$BINARY_PATH"
|
||||
|
||||
echo "Universal binary created at $UNIVERSAL_APP"
|
||||
|
||||
# Create universal binary for profile validator if it exists
|
||||
ARM64_VALIDATOR="$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app"
|
||||
X86_64_VALIDATOR="$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app"
|
||||
if [ -d "$ARM64_VALIDATOR" ] && [ -d "$X86_64_VALIDATOR" ]; then
|
||||
echo "Creating universal binaries for OrcaSlicer_profile_validator.app..."
|
||||
if [ -f "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ] && \
|
||||
[ -f "$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
echo "Creating universal binary for OrcaSlicer_profile_validator..."
|
||||
UNIVERSAL_VALIDATOR_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer_profile_validator.app"
|
||||
rm -rf "$UNIVERSAL_VALIDATOR_APP"
|
||||
cp -R "$ARM64_VALIDATOR" "$UNIVERSAL_VALIDATOR_APP"
|
||||
lipo_dir "$UNIVERSAL_VALIDATOR_APP" "$X86_64_VALIDATOR"
|
||||
echo "Universal OrcaSlicer_profile_validator.app created at $UNIVERSAL_VALIDATOR_APP"
|
||||
cp -R "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app" "$UNIVERSAL_VALIDATOR_APP"
|
||||
|
||||
# Get the binary path inside the profile validator .app bundle
|
||||
VALIDATOR_BINARY_PATH="Contents/MacOS/OrcaSlicer_profile_validator"
|
||||
|
||||
# Create universal binary using lipo
|
||||
lipo -create \
|
||||
"$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app/$VALIDATOR_BINARY_PATH" \
|
||||
"$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app/$VALIDATOR_BINARY_PATH" \
|
||||
-output "$UNIVERSAL_VALIDATOR_APP/$VALIDATOR_BINARY_PATH"
|
||||
|
||||
echo "Universal binary for OrcaSlicer_profile_validator created at $UNIVERSAL_VALIDATOR_APP"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -370,22 +305,16 @@ case "${BUILD_TARGET}" in
|
||||
slicer)
|
||||
build_slicer
|
||||
;;
|
||||
universal)
|
||||
build_universal
|
||||
;;
|
||||
*)
|
||||
echo "Unknown target: $BUILD_TARGET. Available targets: deps, slicer, universal, all."
|
||||
echo "Unknown target: $BUILD_TARGET. Available targets: deps, slicer, all."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$ARCH" = "universal" ] && { [ "$BUILD_TARGET" = "all" ] || [ "$BUILD_TARGET" = "slicer" ]; }; then
|
||||
if [ "$ARCH" = "universal" ] && [ "$BUILD_TARGET" != "deps" ]; then
|
||||
build_universal
|
||||
fi
|
||||
|
||||
if [ "1." == "$PACK_DEPS". ]; then
|
||||
pack_deps
|
||||
fi
|
||||
|
||||
elapsed=$SECONDS
|
||||
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
@REM OrcaSlicer build script for Windows with VS auto-detect
|
||||
@echo off
|
||||
set WP=%CD%
|
||||
set _START_TIME=%TIME%
|
||||
|
||||
@REM Default target architecture to the host CPU arch; override by passing
|
||||
@REM "x64" or "arm64" as an argument. PROCESSOR_ARCHITEW6432 covers a 32-bit
|
||||
@REM shell running on a 64-bit OS, where PROCESSOR_ARCHITECTURE reads "x86".
|
||||
set arch=x64
|
||||
if /I "%PROCESSOR_ARCHITECTURE%"=="ARM64" set arch=ARM64
|
||||
if /I "%PROCESSOR_ARCHITEW6432%"=="ARM64" set arch=ARM64
|
||||
if /I "%1"=="arm64" set arch=ARM64
|
||||
if /I "%2"=="arm64" set arch=ARM64
|
||||
if /I "%1"=="x64" set arch=x64
|
||||
if /I "%2"=="x64" set arch=x64
|
||||
|
||||
@REM Check for Ninja Multi-Config option (-x)
|
||||
set USE_NINJA=0
|
||||
@@ -79,14 +67,13 @@ echo Using CMake generator: %CMAKE_GENERATOR%
|
||||
|
||||
@REM Pack deps
|
||||
if "%1"=="pack" (
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
cd %WP%/deps/build
|
||||
if "%arch%"=="ARM64" cd %WP%/deps/build-arm64
|
||||
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set build_date=%%c%%b%%a
|
||||
echo packing deps: OrcaSlicer_dep_win-!arch!_!build_date!_vs!VS_VERSION!.zip
|
||||
echo packing deps: OrcaSlicer_dep_win64_!build_date!_vs!VS_VERSION!.zip
|
||||
|
||||
%WP%/tools/7z.exe a OrcaSlicer_dep_win-!arch!_!build_date!_vs!VS_VERSION!.zip OrcaSlicer_dep
|
||||
goto :done
|
||||
%WP%/tools/7z.exe a OrcaSlicer_dep_win64_!build_date!_vs!VS_VERSION!.zip OrcaSlicer_dep
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
set debug=OFF
|
||||
@@ -107,10 +94,9 @@ if "%debug%"=="ON" (
|
||||
set build_dir=build
|
||||
)
|
||||
)
|
||||
if "%arch%"=="ARM64" set build_dir=%build_dir%-arm64
|
||||
echo build type set to %build_type%, arch=%arch%
|
||||
echo build type set to %build_type%
|
||||
|
||||
setlocal DISABLEDELAYEDEXPANSION
|
||||
setlocal DISABLEDELAYEDEXPANSION
|
||||
cd deps
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
@@ -129,12 +115,12 @@ if "%USE_NINJA%"=="1" (
|
||||
cmake ../ -G %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target deps
|
||||
) else (
|
||||
cmake ../ -G %CMAKE_GENERATOR% -A %arch% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake ../ -G %CMAKE_GENERATOR% -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target deps -- -m
|
||||
)
|
||||
@echo off
|
||||
|
||||
if "%1"=="deps" goto :done
|
||||
if "%1"=="deps" exit /b 0
|
||||
|
||||
:slicer
|
||||
echo "building Orca Slicer..."
|
||||
@@ -148,7 +134,7 @@ if "%USE_NINJA%"=="1" (
|
||||
cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target ALL_BUILD
|
||||
) else (
|
||||
cmake .. -G %CMAKE_GENERATOR% -A %arch% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake .. -G %CMAKE_GENERATOR% -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
)
|
||||
@echo off
|
||||
@@ -156,16 +142,3 @@ cd ..
|
||||
call scripts/run_gettext.bat
|
||||
cd %build_dir%
|
||||
cmake --build . --target install --config %build_type%
|
||||
|
||||
:done
|
||||
@echo off
|
||||
for /f "tokens=1-3 delims=:.," %%a in ("%_START_TIME: =0%") do set /a "_start_s=%%a*3600+%%b*60+%%c"
|
||||
for /f "tokens=1-3 delims=:.," %%a in ("%TIME: =0%") do set /a "_end_s=%%a*3600+%%b*60+%%c"
|
||||
set /a "_elapsed=_end_s - _start_s"
|
||||
if %_elapsed% lss 0 set /a "_elapsed+=86400"
|
||||
set /a "_hours=_elapsed / 3600"
|
||||
set /a "_remainder=_elapsed - _hours * 3600"
|
||||
set /a "_mins=_remainder / 60"
|
||||
set /a "_secs=_remainder - _mins * 60"
|
||||
echo.
|
||||
echo Build completed in %_hours%h %_mins%m %_secs%s
|
||||
|
||||
@@ -15,18 +15,10 @@ if "%1"=="pack" (
|
||||
|
||||
set debug=OFF
|
||||
set debuginfo=OFF
|
||||
@REM Default target architecture to the host CPU arch; override with x64/arm64 arg.
|
||||
set arch=x64
|
||||
if /I "%PROCESSOR_ARCHITECTURE%"=="ARM64" set arch=ARM64
|
||||
if /I "%PROCESSOR_ARCHITEW6432%"=="ARM64" set arch=ARM64
|
||||
if "%1"=="debug" set debug=ON
|
||||
if "%2"=="debug" set debug=ON
|
||||
if "%1"=="debuginfo" set debuginfo=ON
|
||||
if "%2"=="debuginfo" set debuginfo=ON
|
||||
if /I "%1"=="arm64" set arch=ARM64
|
||||
if /I "%2"=="arm64" set arch=ARM64
|
||||
if /I "%1"=="x64" set arch=x64
|
||||
if /I "%2"=="x64" set arch=x64
|
||||
if "%debug%"=="ON" (
|
||||
set build_type=Debug
|
||||
set build_dir=build-dbg
|
||||
@@ -39,8 +31,7 @@ if "%debug%"=="ON" (
|
||||
set build_dir=build
|
||||
)
|
||||
)
|
||||
if "%arch%"=="ARM64" set build_dir=%build_dir%-arm64
|
||||
echo build type set to %build_type%, arch=%arch%
|
||||
echo build type set to %build_type%
|
||||
|
||||
setlocal DISABLEDELAYEDEXPANSION
|
||||
cd deps
|
||||
@@ -57,7 +48,7 @@ echo "building deps.."
|
||||
echo on
|
||||
REM Set minimum CMake policy to avoid <3.5 errors
|
||||
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
cmake ../ -G "Visual Studio 17 2022" -A %arch% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target deps -- -m
|
||||
@echo off
|
||||
|
||||
@@ -71,7 +62,7 @@ cd %build_dir%
|
||||
|
||||
echo on
|
||||
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
cmake .. -G "Visual Studio 17 2022" -A %arch% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake .. -G "Visual Studio 17 2022" -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
@echo off
|
||||
cd ..
|
||||
|
||||
86
cmake/modules/FindEigen3.cmake
Normal file
86
cmake/modules/FindEigen3.cmake
Normal file
@@ -0,0 +1,86 @@
|
||||
# - Try to find Eigen3 lib
|
||||
#
|
||||
# This module supports requiring a minimum version, e.g. you can do
|
||||
# find_package(Eigen3 3.1.2)
|
||||
# to require version 3.1.2 or newer of Eigen3.
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# EIGEN3_FOUND - system has eigen lib with correct version
|
||||
# EIGEN3_INCLUDE_DIR - the eigen include directory
|
||||
# EIGEN3_VERSION - eigen version
|
||||
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
|
||||
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
|
||||
|
||||
if(NOT Eigen3_FIND_VERSION)
|
||||
if(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
set(Eigen3_FIND_VERSION_MAJOR 2)
|
||||
endif(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
if(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
set(Eigen3_FIND_VERSION_MINOR 91)
|
||||
endif(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
if(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
set(Eigen3_FIND_VERSION_PATCH 0)
|
||||
endif(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
|
||||
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
|
||||
endif(NOT Eigen3_FIND_VERSION)
|
||||
|
||||
macro(_eigen3_check_version)
|
||||
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
|
||||
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
|
||||
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
|
||||
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK FALSE)
|
||||
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK TRUE)
|
||||
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
|
||||
if(NOT EIGEN3_VERSION_OK)
|
||||
|
||||
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
|
||||
"but at least version ${Eigen3_FIND_VERSION} is required")
|
||||
endif(NOT EIGEN3_VERSION_OK)
|
||||
endmacro(_eigen3_check_version)
|
||||
|
||||
if (EIGEN3_INCLUDE_DIR)
|
||||
|
||||
# in cache already
|
||||
_eigen3_check_version()
|
||||
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
|
||||
|
||||
else (EIGEN3_INCLUDE_DIR)
|
||||
|
||||
# specific additional paths for some OS
|
||||
if (WIN32)
|
||||
set(EIGEN_ADDITIONAL_SEARCH_PATHS ${EIGEN_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/Eigen/include" "C:/Program Files (x86)/Eigen/include")
|
||||
endif(WIN32)
|
||||
|
||||
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
|
||||
PATHS
|
||||
${CMAKE_INSTALL_PREFIX}/include
|
||||
${EIGEN_ADDITIONAL_SEARCH_PATHS}
|
||||
${KDE4_INCLUDE_DIR}
|
||||
PATH_SUFFIXES eigen3 eigen
|
||||
)
|
||||
|
||||
if(EIGEN3_INCLUDE_DIR)
|
||||
_eigen3_check_version()
|
||||
endif(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
|
||||
|
||||
mark_as_advanced(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
endif(EIGEN3_INCLUDE_DIR)
|
||||
@@ -124,8 +124,6 @@ endif()
|
||||
|
||||
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64" OR "${CMAKE_GENERATOR}" MATCHES "Win64")
|
||||
set(_arch "x64")
|
||||
elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "ARM64")
|
||||
set(_arch "x64") # GLEW ships one header set; ARM64 uses the x64 import path
|
||||
else()
|
||||
set(_arch "Win32")
|
||||
endif()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.orcaslicer.OrcaSlicer</string>
|
||||
<string>com.softfever3d.orca-slicer</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
|
||||
18
deps/Boost/Boost.cmake
vendored
18
deps/Boost/Boost.cmake
vendored
@@ -10,22 +10,7 @@ if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=${CMAKE_OSX_ARCHITECTURES}")
|
||||
endif ()
|
||||
|
||||
# Windows ARM64: Boost.Context's default fcontext implementation assembles .asm
|
||||
# via armasm64, which trips a CMake ASM_ARMASM linker-module bug under the VS
|
||||
# generator. The winfib implementation (Windows Fiber API) avoids assembly while
|
||||
# keeping the Boost::context target that Boost.Asio's stackful coroutines need.
|
||||
set(_context_impl_line "")
|
||||
if (MSVC AND "${DEPS_ARCH}" STREQUAL "arm64")
|
||||
set(_context_impl_line "-DBOOST_CONTEXT_IMPLEMENTATION:STRING=winfib")
|
||||
endif ()
|
||||
|
||||
set(_options "")
|
||||
if (MSVC AND DEP_DEBUG)
|
||||
set(_options "FORWARD_CONFIG")
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(Boost
|
||||
${_options}
|
||||
URL "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz"
|
||||
URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95
|
||||
LIST_SEPARATOR |
|
||||
@@ -33,11 +18,8 @@ orcaslicer_add_cmake_project(Boost
|
||||
-DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|stacktrace|wave|test
|
||||
-DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros
|
||||
-DBUILD_TESTING:BOOL=OFF
|
||||
-DBOOST_IOSTREAMS_ENABLE_BZIP2:BOOL=OFF # avoid libbz2 soname differences in AppImage builds
|
||||
-DBOOST_IOSTREAMS_ENABLE_ZSTD:BOOL=OFF
|
||||
"${_context_abi_line}"
|
||||
"${_context_arch_line}"
|
||||
"${_context_impl_line}"
|
||||
)
|
||||
|
||||
set(DEP_Boost_DEPENDS ZLIB)
|
||||
2
deps/CGAL/CGAL.cmake
vendored
2
deps/CGAL/CGAL.cmake
vendored
@@ -9,7 +9,7 @@ orcaslicer_add_cmake_project(
|
||||
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
|
||||
URL https://github.com/CGAL/cgal/releases/download/v5.6.3/CGAL-5.6.3.zip
|
||||
URL_HASH SHA256=5d577acb4a9918ccb960491482da7a3838f8d363aff47e14d703f19fd84733d4
|
||||
DEPENDS dep_Boost dep_Eigen dep_GMP dep_MPFR
|
||||
DEPENDS dep_Boost dep_GMP dep_MPFR
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
72
deps/CMakeLists.txt
vendored
72
deps/CMakeLists.txt
vendored
@@ -134,7 +134,7 @@ if (APPLE)
|
||||
endif ()
|
||||
|
||||
|
||||
# On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL.
|
||||
# On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL.
|
||||
# FIXME:
|
||||
# Enabling this option is not safe. IGL will compile itself with its own version of Eigen while
|
||||
# Slic3r compiles with a different version which will cause runtime errors.
|
||||
@@ -146,7 +146,7 @@ message(STATUS "OrcaSlicer deps debug build: ${DEP_DEBUG}")
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
# The default command line for patching. Only works for newer
|
||||
# The default command line for patching. Only works for newer
|
||||
set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix)
|
||||
|
||||
if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
|
||||
@@ -155,37 +155,22 @@ if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
|
||||
endif ()
|
||||
|
||||
function(orcaslicer_add_cmake_project projectname)
|
||||
cmake_parse_arguments(P_ARGS "FORWARD_CONFIG" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
|
||||
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
|
||||
|
||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||
if (_is_multi OR MSVC)
|
||||
if (P_ARGS_FORWARD_CONFIG)
|
||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||
elseif (ORCA_INCLUDE_DEBUG_INFO AND NOT DEP_DEBUG)
|
||||
if (ORCA_INCLUDE_DEBUG_INFO AND NOT DEP_DEBUG)
|
||||
set(_configs_line "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
else ()
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (P_ARGS_FORWARD_CONFIG)
|
||||
set(_target_config "$<CONFIG>")
|
||||
else()
|
||||
set(_target_config "Release")
|
||||
endif()
|
||||
|
||||
set(_gen "")
|
||||
set(_build_j "-j${NPROC}")
|
||||
if (MSVC)
|
||||
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
|
||||
else()
|
||||
set(_gen "")
|
||||
endif()
|
||||
|
||||
if ($ENV{CMAKE_BUILD_PARALLEL_LEVEL})
|
||||
set(_build_j "") # assume environment will control --build parallel setting
|
||||
elseif(MSVC)
|
||||
set(_build_j "/m")
|
||||
else()
|
||||
set(_build_j "-j${NPROC}")
|
||||
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
|
||||
set(_build_j "/m")
|
||||
endif ()
|
||||
|
||||
if (NOT IS_CROSS_COMPILE OR NOT APPLE)
|
||||
@@ -200,24 +185,18 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE)
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
|
||||
-DCMAKE_IGNORE_PREFIX_PATH:STRING=${CMAKE_IGNORE_PREFIX_PATH}
|
||||
-DCMAKE_DEBUG_POSTFIX:STRING=d
|
||||
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER}
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=${CMAKE_CXX_COMPILER_LAUNCHER}
|
||||
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
|
||||
-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
|
||||
-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${_target_config} -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${_target_config}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
|
||||
if (FLATPAK)
|
||||
@@ -250,17 +229,14 @@ else()
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
|
||||
-DCMAKE_IGNORE_PREFIX_PATH:STRING=${CMAKE_IGNORE_PREFIX_PATH}
|
||||
-DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER}
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=${CMAKE_CXX_COMPILER_LAUNCHER}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${_target_config} -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${_target_config}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
|
||||
endif()
|
||||
@@ -277,12 +253,8 @@ if (MSVC)
|
||||
message(STATUS "\nDetected X86 compiler => building X86 deps bundle\n")
|
||||
set(DEPS_ARCH "x86")
|
||||
include("deps-windows.cmake")
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
|
||||
message(STATUS "\nDetected ARM64 compiler => building ARM64 deps bundle\n")
|
||||
set(DEPS_ARCH "arm64")
|
||||
include("deps-windows.cmake")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unable to detect architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(FATAL_ERROR "Unable to detect architecture")
|
||||
endif ()
|
||||
elseif (APPLE)
|
||||
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
|
||||
@@ -324,26 +296,26 @@ if(FLATPAK)
|
||||
endif()
|
||||
|
||||
set(ZLIB_PKG "")
|
||||
if (NOT ZLIB_FOUND)
|
||||
if (NOT ZLIB_FOUND)
|
||||
include(ZLIB/ZLIB.cmake)
|
||||
set(ZLIB_PKG dep_ZLIB)
|
||||
endif ()
|
||||
set(PNG_PKG "")
|
||||
if (NOT PNG_FOUND)
|
||||
if (NOT PNG_FOUND)
|
||||
include(PNG/PNG.cmake)
|
||||
set(PNG_PKG dep_PNG)
|
||||
endif ()
|
||||
set(EXPAT_PKG "")
|
||||
find_package(EXPAT)
|
||||
if (NOT EXPAT_FOUND)
|
||||
if (NOT EXPAT_FOUND)
|
||||
include(EXPAT/EXPAT.cmake)
|
||||
set(EXPAT_PKG dep_EXPAT)
|
||||
endif ()
|
||||
|
||||
# The order of includes respects the dependencies between libraries
|
||||
set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time)
|
||||
include(Boost/Boost.cmake)
|
||||
|
||||
# The order of includes respects the dependencies between libraries
|
||||
include(Cereal/Cereal.cmake)
|
||||
include(Qhull/Qhull.cmake)
|
||||
include(GLEW/GLEW.cmake)
|
||||
@@ -359,7 +331,6 @@ include(OpenVDB/OpenVDB.cmake)
|
||||
|
||||
include(GMP/GMP.cmake)
|
||||
include(MPFR/MPFR.cmake)
|
||||
include(Eigen/Eigen.cmake)
|
||||
include(CGAL/CGAL.cmake)
|
||||
|
||||
include(NLopt/NLopt.cmake)
|
||||
@@ -371,7 +342,7 @@ include(Draco/Draco.cmake)
|
||||
# I *think* 1.1 is used for *just* md5 hashing?
|
||||
# 3.1 has everything in the right place, but the md5 funcs used are deprecated
|
||||
# a grep across the repo shows it is used for other things
|
||||
# TODO: update openssl and everything that uses <openssl/md5.h>
|
||||
# TODO: update openssl and everything that uses <openssl/md5.h>
|
||||
set(OPENSSL_PKG "")
|
||||
if(NOT OPENSSL_FOUND)
|
||||
include(OpenSSL/OpenSSL.cmake)
|
||||
@@ -379,7 +350,7 @@ if(NOT OPENSSL_FOUND)
|
||||
endif()
|
||||
|
||||
# we don't want to load a "wrong" openssl when loading curl
|
||||
# so, just don't even bother
|
||||
# so, just don't even bother
|
||||
# ...i think this is how it works? change if wrong
|
||||
set(CURL_PKG "")
|
||||
if (NOT OPENSSL_FOUND OR NOT CURL_FOUND)
|
||||
@@ -403,7 +374,7 @@ endif()
|
||||
set(FREETYPE_PKG "")
|
||||
if(NOT FREETYPE_FOUND)
|
||||
include(FREETYPE/FREETYPE.cmake)
|
||||
set(FREETYPE_PKG "dep_FREETYPE")
|
||||
set(FREETYPE_PKG "dep_FREETYPE")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
@@ -422,7 +393,6 @@ endif ()
|
||||
|
||||
include(OCCT/OCCT.cmake)
|
||||
include(OpenCV/OpenCV.cmake)
|
||||
include(python3/python3.cmake)
|
||||
|
||||
set(_dep_list
|
||||
dep_Boost
|
||||
@@ -436,7 +406,6 @@ set(_dep_list
|
||||
dep_OpenVDB
|
||||
dep_OpenCSG
|
||||
dep_OpenCV
|
||||
dep_Eigen
|
||||
dep_CGAL
|
||||
dep_GLFW
|
||||
dep_OCCT
|
||||
@@ -445,7 +414,6 @@ set(_dep_list
|
||||
${ZLIB_PKG}
|
||||
${EXPAT_PKG}
|
||||
dep_libnoise
|
||||
dep_python3
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
|
||||
6
deps/Draco/Draco.cmake
vendored
6
deps/Draco/Draco.cmake
vendored
@@ -1,10 +1,4 @@
|
||||
set(_options "")
|
||||
if (MSVC AND DEP_DEBUG)
|
||||
set(_options "FORWARD_CONFIG")
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(Draco
|
||||
${_options}
|
||||
URL https://github.com/google/draco/archive/refs/tags/1.5.7.zip
|
||||
URL_HASH SHA256=27b72ba2d5ff3d0a9814ad40d4cb88f8dc89a35491c0866d952473f8f9416b77
|
||||
)
|
||||
11
deps/Eigen/Eigen.cmake
vendored
11
deps/Eigen/Eigen.cmake
vendored
@@ -1,11 +0,0 @@
|
||||
set(_eigen_extra_flags "")
|
||||
if (MSVC)
|
||||
set(_eigen_extra_flags "-DCMAKE_CXX_FLAGS:STRING=/bigobj")
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(Eigen
|
||||
URL https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.zip
|
||||
URL_HASH SHA256=0dbb1f9e3aaad66f352c03227d8c983f6f0b49e0b07e71a7300f4abcc01aee12
|
||||
CMAKE_ARGS "${_eigen_extra_flags}"
|
||||
DEPENDS dep_Boost dep_GMP dep_MPFR
|
||||
)
|
||||
2
deps/GLEW/GLEW.cmake
vendored
2
deps/GLEW/GLEW.cmake
vendored
@@ -5,8 +5,6 @@ find_package(OpenGL QUIET REQUIRED)
|
||||
orcaslicer_add_cmake_project(
|
||||
GLEW
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/glew
|
||||
CMAKE_ARGS
|
||||
-DGLEW_USE_EGL=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
|
||||
12
deps/GLEW/glew/CMakeLists.txt
vendored
12
deps/GLEW/glew/CMakeLists.txt
vendored
@@ -3,17 +3,9 @@ project(GLEW)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
# Allow parent project to control EGL usage.
|
||||
# Default to OFF since OrcaSlicer forces GDK_BACKEND=x11 (using GLX contexts).
|
||||
# GLEW must use glXGetProcAddressARB (GLX) to match wxWidgets GL canvas.
|
||||
# Using EGL function loading with GLX contexts causes rendering failures.
|
||||
option(GLEW_USE_EGL "Use EGL instead of GLX for OpenGL function loading" OFF)
|
||||
|
||||
if(GLEW_USE_EGL)
|
||||
message(STATUS "Building GLEW with EGL support")
|
||||
if(OpenGL_EGL_FOUND)
|
||||
message(STATUS "building GLEW for EGL (hope that wxWidgets agrees, otherwise you won't have any output!)")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGLEW_EGL")
|
||||
else()
|
||||
message(STATUS "Building GLEW with GLX support")
|
||||
endif()
|
||||
|
||||
add_library(GLEW src/glew.c)
|
||||
|
||||
16
deps/GLFW/GLFW.cmake
vendored
16
deps/GLFW/GLFW.cmake
vendored
@@ -6,20 +6,22 @@ else()
|
||||
set(_build_static ON)
|
||||
endif()
|
||||
|
||||
set(_glfw_platform_args "")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(_glfw_platform_args -DGLFW_BUILD_WAYLAND=ON -DGLFW_BUILD_X11=ON)
|
||||
set(_glfw_use_wayland "-DGLFW_USE_WAYLAND=ON")
|
||||
else()
|
||||
set(_glfw_use_wayland "-DGLFW_USE_WAYLAND=FF")
|
||||
endif()
|
||||
|
||||
orcaslicer_add_cmake_project(GLFW
|
||||
URL https://github.com/glfw/glfw/archive/refs/tags/3.4.zip
|
||||
URL_HASH SHA256=a133ddc3d3c66143eba9035621db8e0bcf34dba1ee9514a9e23e96afd39fd57a
|
||||
URL https://github.com/glfw/glfw/archive/refs/tags/3.3.7.zip
|
||||
URL_HASH SHA256=e02d956935e5b9fb4abf90e2c2e07c9a0526d7eacae8ee5353484c69a2a76cd0
|
||||
#DEPENDS dep_Boost
|
||||
CMAKE_ARGS
|
||||
-DBUILD_SHARED_LIBS=${_build_shared}
|
||||
-DBUILD_SHARED_LIBS=${_build_shared}
|
||||
-DGLFW_BUILD_DOCS=OFF
|
||||
-DGLFW_BUILD_EXAMPLES=OFF
|
||||
-DGLFW_BUILD_TESTS=OFF
|
||||
${_glfw_platform_args}
|
||||
-DGLFW_BUILD_TESTS=OFF
|
||||
${_glfw_use_wayland}
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
|
||||
2
deps/GMP/GMP.cmake
vendored
2
deps/GMP/GMP.cmake
vendored
@@ -65,7 +65,7 @@ else ()
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
|
||||
PATCH_COMMAND git apply ${GMP_DIRECTORY_FLAG} --verbose ${CMAKE_CURRENT_LIST_DIR}/0001-GMP_GCC15.patch
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND env "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}" ${_gmp_build_tgt}
|
||||
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}" ${_gmp_build_tgt}
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
|
||||
BIN
deps/GMP/gmp/lib/win-arm64/libgmp-10.dll
vendored
BIN
deps/GMP/gmp/lib/win-arm64/libgmp-10.dll
vendored
Binary file not shown.
BIN
deps/GMP/gmp/lib/win-arm64/libgmp-10.lib
vendored
BIN
deps/GMP/gmp/lib/win-arm64/libgmp-10.lib
vendored
Binary file not shown.
2
deps/MPFR/MPFR.cmake
vendored
2
deps/MPFR/MPFR.cmake
vendored
@@ -31,7 +31,7 @@ else ()
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND autoreconf -f -i &&
|
||||
env "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR} --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR} ${_gmp_build_tgt}
|
||||
env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR} --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR} ${_gmp_build_tgt}
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
DEPENDS dep_GMP
|
||||
|
||||
BIN
deps/MPFR/mpfr/lib/win-arm64/libmpfr-4.dll
vendored
BIN
deps/MPFR/mpfr/lib/win-arm64/libmpfr-4.dll
vendored
Binary file not shown.
BIN
deps/MPFR/mpfr/lib/win-arm64/libmpfr-4.lib
vendored
BIN
deps/MPFR/mpfr/lib/win-arm64/libmpfr-4.lib
vendored
Binary file not shown.
1
deps/OCCT/OCCT.cmake
vendored
1
deps/OCCT/OCCT.cmake
vendored
@@ -16,7 +16,6 @@ orcaslicer_add_cmake_project(OCCT
|
||||
#DEPENDS dep_Boost
|
||||
DEPENDS ${FREETYPE_PKG}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_CXX_STANDARD=17
|
||||
-DBUILD_LIBRARY_TYPE=${library_build_type}
|
||||
-DUSE_TK=OFF
|
||||
-DUSE_TBB=OFF
|
||||
|
||||
11
deps/OpenCV/OpenCV.cmake
vendored
11
deps/OpenCV/OpenCV.cmake
vendored
@@ -1,13 +1,7 @@
|
||||
# Intel IPP / IPP-ICV is x86/x64 only — there is no ARM64 build, so enabling it
|
||||
# leaves ~200 unresolved ippicv* externals at link time on Windows ARM64.
|
||||
if (MSVC AND NOT "${DEPS_ARCH}" STREQUAL "arm64")
|
||||
if (MSVC)
|
||||
set(_use_IPP "-DWITH_IPP=ON")
|
||||
if (DEP_DEBUG)
|
||||
set(_options "FORWARD_CONFIG")
|
||||
endif ()
|
||||
else ()
|
||||
set(_use_IPP "-DWITH_IPP=OFF")
|
||||
set(_options "")
|
||||
endif ()
|
||||
|
||||
if (IN_GIT_REPO)
|
||||
@@ -15,7 +9,6 @@ if (IN_GIT_REPO)
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(OpenCV
|
||||
${_options}
|
||||
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
|
||||
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
|
||||
PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
|
||||
@@ -62,8 +55,6 @@ orcaslicer_add_cmake_project(OpenCV
|
||||
-DWITH_VTK=OFF
|
||||
-DWITH_JPEG=OFF
|
||||
-DWITH_WEBP=OFF
|
||||
-DWITH_TIFF=OFF
|
||||
-DBUILD_TIFF=OFF
|
||||
-DENABLE_PRECOMPILED_HEADERS=OFF
|
||||
-DINSTALL_TESTS=OFF
|
||||
-DINSTALL_C_EXAMPLES=OFF
|
||||
|
||||
12
deps/OpenEXR/OpenEXR.cmake
vendored
12
deps/OpenEXR/OpenEXR.cmake
vendored
@@ -32,17 +32,6 @@ else()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OpenEXR-GCC13.patch)
|
||||
elseif (MSVC AND "${DEPS_ARCH}" STREQUAL "arm64")
|
||||
# Windows ARM64: OpenEXR 2.5.5 hard-codes IMF_HAVE_SSE2 for any MSVC
|
||||
# (ImfSimd.h: `_MSC_VER >= 1300`), pulling in <emmintrin.h> (x86-only) -> C1189.
|
||||
# Patch the header to require an x86 target, and force the SSE cache vars off.
|
||||
set(_patch_cmd ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/patch_openexr_arm64.cmake)
|
||||
set(_openexr_arm64_args
|
||||
-DOPENEXR_IMF_HAVE_SSE2:BOOL=OFF
|
||||
-DOPENEXR_IMF_HAVE_SSSE3:BOOL=OFF
|
||||
-DILMBASE_HAVE_SSE:BOOL=OFF
|
||||
-DILMBASE_FORCE_DISABLE_INTEL_SSE:BOOL=ON
|
||||
)
|
||||
else ()
|
||||
set(_patch_cmd "")
|
||||
endif ()
|
||||
@@ -60,7 +49,6 @@ orcaslicer_add_cmake_project(OpenEXR
|
||||
-DPYILMBASE_ENABLE:BOOL=OFF
|
||||
-DOPENEXR_VIEWERS_ENABLE:BOOL=OFF
|
||||
-DOPENEXR_BUILD_UTILS:BOOL=OFF
|
||||
${_openexr_arm64_args}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
29
deps/OpenEXR/patch_openexr_arm64.cmake
vendored
29
deps/OpenEXR/patch_openexr_arm64.cmake
vendored
@@ -1,29 +0,0 @@
|
||||
# Applied as PATCH_COMMAND for OpenEXR 2.5.5 on Windows ARM64.
|
||||
#
|
||||
# Root cause of the ARM64 build failure: OpenEXR/IlmImf/ImfSimd.h hard-codes
|
||||
# #if defined __SSE2__ || (_MSC_VER >= 1300 && !_M_CEE_PURE)
|
||||
# #define IMF_HAVE_SSE2 1
|
||||
# #endif
|
||||
# The `_MSC_VER >= 1300` arm is true for *every* MSVC, including ARM64, so
|
||||
# IMF_HAVE_SSE2 gets defined and <emmintrin.h> (an x86-only header) is pulled
|
||||
# in -> error C1189. This is a pure-preprocessor decision, so no CMake cache
|
||||
# variable can suppress it. Patch the header to also require an x86 target.
|
||||
|
||||
set(_simd "OpenEXR/IlmImf/ImfSimd.h")
|
||||
if(EXISTS "${_simd}")
|
||||
file(READ "${_simd}" _content)
|
||||
set(_old "#if defined __SSE2__ || (_MSC_VER >= 1300 && !_M_CEE_PURE)")
|
||||
set(_new "#if (defined __SSE2__ || (_MSC_VER >= 1300 && !_M_CEE_PURE)) && (defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__))")
|
||||
if(_content MATCHES "_M_IX86")
|
||||
message(STATUS "[ARM64 patch] ImfSimd.h already guarded")
|
||||
else()
|
||||
string(REPLACE "${_old}" "${_new}" _patched "${_content}")
|
||||
if(_patched STREQUAL _content)
|
||||
message(FATAL_ERROR "[ARM64 patch] Failed to match SSE2 guard in ${_simd}")
|
||||
endif()
|
||||
file(WRITE "${_simd}" "${_patched}")
|
||||
message(STATUS "[ARM64 patch] Guarded IMF_HAVE_SSE2 with x86 arch check in ${_simd}")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "[ARM64 patch] Not found: ${_simd}")
|
||||
endif()
|
||||
8
deps/OpenSSL/OpenSSL.cmake
vendored
8
deps/OpenSSL/OpenSSL.cmake
vendored
@@ -6,11 +6,7 @@ if(DEFINED OPENSSL_ARCH)
|
||||
set(_cross_arch ${OPENSSL_ARCH})
|
||||
else()
|
||||
if(WIN32)
|
||||
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64")
|
||||
set(_cross_arch "VC-WIN64-ARM")
|
||||
else()
|
||||
set(_cross_arch "VC-WIN64A")
|
||||
endif()
|
||||
set(_cross_arch "VC-WIN64A")
|
||||
elseif(APPLE)
|
||||
set(_cross_arch "darwin64-${CMAKE_OSX_ARCHITECTURES}-cc")
|
||||
endif()
|
||||
@@ -25,7 +21,7 @@ else()
|
||||
if(APPLE)
|
||||
set(_conf_cmd export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} && ./Configure -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(_conf_cmd env "CC=${CMAKE_C_COMPILER}" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" "./config")
|
||||
set(_conf_cmd "./config")
|
||||
endif()
|
||||
set(_cross_comp_prefix_line "")
|
||||
set(_make_cmd make -j${NPROC})
|
||||
|
||||
2
deps/TBB/TBB.cmake
vendored
2
deps/TBB/TBB.cmake
vendored
@@ -1,4 +1,4 @@
|
||||
if (FLATPAK AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
if (FLATPAK)
|
||||
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake ./cmake/compilers/GNU.cmake)
|
||||
else()
|
||||
set(_patch_command "")
|
||||
|
||||
9
deps/deps-windows.cmake
vendored
9
deps/deps-windows.cmake
vendored
@@ -36,10 +36,8 @@ if ("${DEPS_ARCH}" STREQUAL "x86")
|
||||
set(DEP_PLATFORM "Win32")
|
||||
elseif ("${DEPS_ARCH}" STREQUAL "x64")
|
||||
set(DEP_PLATFORM "x64")
|
||||
elseif ("${DEPS_ARCH}" STREQUAL "arm64")
|
||||
set(DEP_PLATFORM "ARM64")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported OS architecture: ${DEPS_ARCH}")
|
||||
message(FATAL_ERROR "Unsupported OS architecture")
|
||||
endif ()
|
||||
|
||||
if (${DEP_DEBUG})
|
||||
@@ -66,11 +64,8 @@ if ("${DEPS_ARCH}" STREQUAL "x86")
|
||||
elseif ("${DEPS_ARCH}" STREQUAL "x64")
|
||||
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
|
||||
set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
|
||||
elseif ("${DEPS_ARCH}" STREQUAL "arm64")
|
||||
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=ARM64")
|
||||
set(DEP_WXWIDGETS_LIBDIR "vc_arm64_lib")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported OS architecture: ${DEPS_ARCH}")
|
||||
message(FATAL_ERROR "Unsupported OS architecture")
|
||||
endif ()
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
269
deps/python3/python3.cmake
vendored
269
deps/python3/python3.cmake
vendored
@@ -1,269 +0,0 @@
|
||||
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NPROC)
|
||||
|
||||
set(_python_version "3.12.13")
|
||||
string(REGEX REPLACE "^([0-9]+\\.[0-9]+)\\..*" "\\1" _python_version_short "${_python_version}")
|
||||
set(_python_url "https://www.python.org/ftp/python/${_python_version}/Python-${_python_version}.tar.xz")
|
||||
set(_python_sha256 "c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684")
|
||||
|
||||
if(WIN32)
|
||||
if(MSVC_VERSION EQUAL 1800)
|
||||
set(_python_platform_toolset v120)
|
||||
elseif(MSVC_VERSION EQUAL 1900)
|
||||
set(_python_platform_toolset v140)
|
||||
elseif(MSVC_VERSION LESS 1920)
|
||||
set(_python_platform_toolset v141)
|
||||
elseif(MSVC_VERSION LESS 1930)
|
||||
set(_python_platform_toolset v142)
|
||||
elseif(MSVC_VERSION LESS 1950)
|
||||
set(_python_platform_toolset v143)
|
||||
elseif(MSVC_VERSION LESS 1960)
|
||||
set(_python_platform_toolset v145)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported MSVC version for CPython build: ${MSVC_VERSION}")
|
||||
endif()
|
||||
|
||||
# 64-bit-hosted MSBuild selection (see the build-step comment below). Default
|
||||
# to the amd64 host + x64 tools; only the native ARM64 build differs.
|
||||
set(_python_msbuild_host amd64)
|
||||
set(_python_tool_arch x64)
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64")
|
||||
set(_python_pcbuild_platform ARM64)
|
||||
set(_python_layout_arch arm64)
|
||||
set(_python_pcbuild_output_dir arm64)
|
||||
set(_python_msbuild_host arm64) # native ARM64 MSBuild already hosts arm64 tools
|
||||
set(_python_tool_arch "")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_python_pcbuild_platform x64)
|
||||
set(_python_layout_arch amd64)
|
||||
set(_python_pcbuild_output_dir amd64)
|
||||
else()
|
||||
set(_python_pcbuild_platform Win32)
|
||||
set(_python_layout_arch win32)
|
||||
set(_python_pcbuild_output_dir win32)
|
||||
endif()
|
||||
|
||||
set(_python_pcbuild_config Release)
|
||||
set(_python_layout_debug OFF)
|
||||
if(DEFINED DEP_DEBUG AND DEP_DEBUG)
|
||||
set(_python_pcbuild_config Debug)
|
||||
set(_python_layout_debug ON)
|
||||
endif()
|
||||
|
||||
# CPython's PCbuild needs a 64-bit-hosted toolchain: find_msbuild.bat picks the
|
||||
# 32-bit Bin\MSBuild.exe, whose x86 cl.exe/link.exe run out of address space
|
||||
# (fatal C1002 "out of heap space") building the LTCG-optimized pythoncore.
|
||||
# That 32-bit MSBuild ignores PreferredToolArchitecture, so build.bat must be
|
||||
# pointed at a 64-bit MSBuild via the MSBUILD env var. The native arm64 MSBuild
|
||||
# then hosts arm64 tools on its own; the amd64 MSBuild still defaults to x86, so
|
||||
# PreferredToolArchitecture pins it to x64. Scoped to this build step, so
|
||||
# CPython's own sources stay untouched.
|
||||
set(_python_env_args "GIT_CEILING_DIRECTORIES=<SOURCE_DIR>/..")
|
||||
if(CMAKE_GENERATOR_INSTANCE) # empty for non-VS generators (e.g. Ninja)
|
||||
set(_python_msbuild "${CMAKE_GENERATOR_INSTANCE}/MSBuild/Current/Bin/${_python_msbuild_host}/MSBuild.exe")
|
||||
if(EXISTS "${_python_msbuild}")
|
||||
file(TO_NATIVE_PATH "${_python_msbuild}" _python_msbuild_native)
|
||||
list(APPEND _python_env_args "MSBUILD=${_python_msbuild_native}")
|
||||
else()
|
||||
# Loud signal: a silent fall-through to the 32-bit MSBuild reintroduces C1002.
|
||||
message(WARNING "Bundled Python: 64-bit MSBuild not found at '${_python_msbuild}'. "
|
||||
"CPython will fall back to find_msbuild.bat's default (32-bit) MSBuild, which may "
|
||||
"fail with C1002 (out of heap space) building the optimized pythoncore.")
|
||||
endif()
|
||||
endif()
|
||||
if(_python_tool_arch)
|
||||
list(APPEND _python_env_args "PreferredToolArchitecture=${_python_tool_arch}")
|
||||
endif()
|
||||
|
||||
set(_conf_cmd
|
||||
cmd /c "echo /p:PlatformToolset=${_python_platform_toolset}>PCbuild\\msbuild.rsp"
|
||||
)
|
||||
set(_build_cmd
|
||||
${CMAKE_COMMAND} -E env ${_python_env_args}
|
||||
cmd /c PCbuild\\build.bat
|
||||
-p ${_python_pcbuild_platform}
|
||||
-c ${_python_pcbuild_config}
|
||||
--no-tkinter
|
||||
)
|
||||
set(_install_cmd
|
||||
${CMAKE_COMMAND}
|
||||
-DPYTHON_SOURCE_DIR=<SOURCE_DIR>
|
||||
-DPYTHON_BUILD_DIR=<SOURCE_DIR>/PCbuild/${_python_pcbuild_output_dir}
|
||||
-DPYTHON_DEST_DIR=${DESTDIR}/libpython
|
||||
-DPYTHON_LAYOUT_ARCH=${_python_layout_arch}
|
||||
-DPYTHON_DEBUG=${_python_layout_debug}
|
||||
-P ${CMAKE_CURRENT_LIST_DIR}/stage_windows.cmake
|
||||
)
|
||||
elseif(APPLE)
|
||||
# macOS configuration
|
||||
if(CMAKE_OSX_ARCHITECTURES)
|
||||
set(_python_target_arch "${CMAKE_OSX_ARCHITECTURES}")
|
||||
else()
|
||||
set(_python_target_arch "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|arm64|aarch64")
|
||||
set(_python_build_arch aarch64)
|
||||
set(_python_build_arch_flag "arm64")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64")
|
||||
set(_python_build_arch x86_64)
|
||||
set(_python_build_arch_flag "x86_64")
|
||||
else()
|
||||
set(_python_build_arch "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(_python_build_arch_flag "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
|
||||
if(_python_target_arch MATCHES "ARM64|arm64|aarch64")
|
||||
set(_python_host_arch aarch64)
|
||||
set(_python_arch_flag "arm64")
|
||||
elseif(_python_target_arch MATCHES "x86_64|AMD64|amd64")
|
||||
set(_python_host_arch x86_64)
|
||||
set(_python_arch_flag "x86_64")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported macOS Python target architecture: ${_python_target_arch}")
|
||||
endif()
|
||||
|
||||
set(_python_arch_flags "-arch ${_python_arch_flag} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
# No -rpath: all other deps are static, so libpython has no shared
|
||||
# dependencies to find there. headerpad reserves load-command space for
|
||||
# the post-install -add_rpath below.
|
||||
set(_python_ldflags "${_python_arch_flags} -Wl,-headerpad_max_install_names")
|
||||
|
||||
if(IS_CROSS_COMPILE)
|
||||
set(_python_build_tgt --build=${_python_build_arch}-apple-darwin --host=${_python_host_arch}-apple-darwin)
|
||||
set(_python_build_arch_flags "-arch ${_python_build_arch_flag} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
set(_python_build_ldflags "${_python_build_arch_flags} -Wl,-rpath,${DESTDIR}/lib")
|
||||
set(_python_build_python_dir "<SOURCE_DIR>/build-python-host")
|
||||
set(_python_build_python "${_python_build_python_dir}/python")
|
||||
set(_conf_cmd
|
||||
/bin/sh -c
|
||||
"rm -rf '${_python_build_python_dir}' && \
|
||||
mkdir -p '${_python_build_python_dir}' && \
|
||||
cd '${_python_build_python_dir}' && \
|
||||
env \
|
||||
CC='${CMAKE_C_COMPILER}' \
|
||||
CXX='${CMAKE_CXX_COMPILER}' \
|
||||
CFLAGS='${_python_build_arch_flags}' \
|
||||
CXXFLAGS='${_python_build_arch_flags}' \
|
||||
LDFLAGS='${_python_build_ldflags}' \
|
||||
MACOSX_DEPLOYMENT_TARGET='${CMAKE_OSX_DEPLOYMENT_TARGET}' \
|
||||
../configure \
|
||||
--prefix='${_python_build_python_dir}/install' \
|
||||
--enable-shared \
|
||||
--without-static-libpython \
|
||||
--disable-test-modules \
|
||||
--build=${_python_build_arch}-apple-darwin && \
|
||||
make -j${NPROC} python && \
|
||||
cd '<SOURCE_DIR>' && \
|
||||
env \
|
||||
CC='${CMAKE_C_COMPILER}' \
|
||||
CXX='${CMAKE_CXX_COMPILER}' \
|
||||
CFLAGS='${_python_arch_flags}' \
|
||||
CXXFLAGS='${_python_arch_flags}' \
|
||||
LDFLAGS='${_python_ldflags}' \
|
||||
MACOSX_DEPLOYMENT_TARGET='${CMAKE_OSX_DEPLOYMENT_TARGET}' \
|
||||
./configure \
|
||||
--prefix='${DESTDIR}/libpython' \
|
||||
--enable-shared \
|
||||
--enable-optimizations \
|
||||
--without-static-libpython \
|
||||
--with-openssl='${DESTDIR}' \
|
||||
--disable-test-modules \
|
||||
${_python_build_tgt} \
|
||||
--with-build-python='${_python_build_python}' \
|
||||
py_cv_module__tkinter=n/a"
|
||||
)
|
||||
else()
|
||||
set(_python_build_tgt --build=${_python_host_arch}-apple-darwin)
|
||||
set(_conf_cmd
|
||||
env
|
||||
"CC=${CMAKE_C_COMPILER}"
|
||||
"CXX=${CMAKE_CXX_COMPILER}"
|
||||
"CFLAGS=${_python_arch_flags}"
|
||||
"CXXFLAGS=${_python_arch_flags}"
|
||||
"LDFLAGS=${_python_ldflags}"
|
||||
"MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
||||
./configure
|
||||
--prefix=${DESTDIR}/libpython
|
||||
--enable-shared
|
||||
--enable-optimizations
|
||||
--without-static-libpython
|
||||
--with-openssl=${DESTDIR}
|
||||
--disable-test-modules
|
||||
${_python_build_tgt}
|
||||
# Tcl/Tk 9.0 (e.g. from Homebrew) is incompatible with CPython 3.12's
|
||||
# _tkinter; OrcaSlicer's embedded Python does not need tkinter anyway.
|
||||
py_cv_module__tkinter=n/a
|
||||
)
|
||||
endif()
|
||||
set(_build_cmd make -j${NPROC})
|
||||
|
||||
# CPython stamps libpython with an absolute install name ($prefix/lib/...),
|
||||
# which every consumer inherits at link time and which only exists on the
|
||||
# build host. Normalize once here, before anything links against the dep:
|
||||
# give the dylib an @rpath id and teach the interpreter to find it relative
|
||||
# to itself. Consumers then just need an rpath entry (src/CMakeLists.txt).
|
||||
# install_name_tool invalidates code signatures, so re-sign ad-hoc; CI
|
||||
# re-signs the whole bundle with the real identity later.
|
||||
# ld collapses '//' in -install_name (but not in -rpath) strings, while
|
||||
# ${DESTDIR} ends with a slash -- collapse slashes so -change matches the
|
||||
# recorded install name.
|
||||
string(REGEX REPLACE "/+" "/" _python_prefix "${DESTDIR}/libpython")
|
||||
set(_python_dylib "${_python_prefix}/lib/libpython${_python_version_short}.dylib")
|
||||
set(_python_bin "${_python_prefix}/bin/python${_python_version_short}")
|
||||
set(_install_cmd make install
|
||||
COMMAND install_name_tool -id "@rpath/libpython${_python_version_short}.dylib" "${_python_dylib}"
|
||||
COMMAND install_name_tool -change "${_python_dylib}" "@rpath/libpython${_python_version_short}.dylib" "${_python_bin}"
|
||||
COMMAND install_name_tool -add_rpath "@loader_path/../lib" "${_python_bin}"
|
||||
COMMAND codesign --force --sign - "${_python_dylib}"
|
||||
COMMAND codesign --force --sign - "${_python_bin}"
|
||||
)
|
||||
else()
|
||||
# Linux/Unix
|
||||
# Kept verbatim, no slash normalization (unlike the macOS branch's
|
||||
# collapsed copy): the LDFLAGS rpath below is recorded byte-for-byte in
|
||||
# the ELF, and the OLD_RPATH handed to relocate_linux.cmake must match it
|
||||
# exactly -- both derive from this one variable to make that structural.
|
||||
set(_python_prefix "${DESTDIR}/libpython")
|
||||
# The rpath points at libpython's real install dir, so the interpreter runs
|
||||
# in-tree pre-relocation -- and, critically, it reserves enough RUNPATH
|
||||
# bytes for the in-place $ORIGIN rewrite at install time (Flatpak's
|
||||
# DESTDIR is the short /app) -- see relocate_linux.cmake.
|
||||
set(_conf_cmd ./configure
|
||||
--prefix=${_python_prefix}
|
||||
--enable-shared
|
||||
--enable-optimizations
|
||||
--with-openssl=${DESTDIR}
|
||||
--without-static-libpython
|
||||
--disable-test-modules
|
||||
# Tcl/Tk 9.0 is incompatible with CPython 3.12's _tkinter; not needed here.
|
||||
py_cv_module__tkinter=n/a
|
||||
LDFLAGS=-Wl,-rpath,${_python_prefix}/lib
|
||||
)
|
||||
set(_build_cmd make -j${NPROC})
|
||||
set(_install_cmd make install
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
"-DPYTHON_BIN=${_python_prefix}/bin/python${_python_version_short}"
|
||||
"-DOLD_RPATH=${_python_prefix}/lib"
|
||||
-P "${CMAKE_CURRENT_LIST_DIR}/relocate_linux.cmake"
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(dep_python3
|
||||
URL "${_python_url}"
|
||||
URL_HASH SHA256=${_python_sha256}
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/python3
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND ${_conf_cmd}
|
||||
BUILD_COMMAND ${_build_cmd}
|
||||
INSTALL_COMMAND ${_install_cmd}
|
||||
)
|
||||
|
||||
# Python depends on OpenSSL and ZLIB
|
||||
if(TARGET dep_OpenSSL)
|
||||
add_dependencies(dep_python3 dep_OpenSSL)
|
||||
endif()
|
||||
if(TARGET dep_ZLIB)
|
||||
add_dependencies(dep_python3 dep_ZLIB)
|
||||
endif()
|
||||
10
deps/python3/relocate_linux.cmake
vendored
10
deps/python3/relocate_linux.cmake
vendored
@@ -1,10 +0,0 @@
|
||||
# Repoint the installed interpreter's RUNPATH from the absolute deps dir to a
|
||||
# self-relative entry so the bundled runtime is relocatable (the deps tree,
|
||||
# Flatpak /app/libpython, and AppImage $APPDIR/lib/python all keep bin/ and
|
||||
# lib/ as siblings). $ORIGIN is expanded by the dynamic loader; CMake leaves
|
||||
# it alone (only ${...} is expanded here). RPATH_CHANGE edits the ELF in
|
||||
# place, so the new entry must not be longer than the old one: the reserved
|
||||
# ${DESTDIR}/libpython/lib is at least 18 bytes even for the shortest
|
||||
# supported DESTDIR (Flatpak's /app), longer than the 14-byte $ORIGIN/../lib.
|
||||
# Invoked from python3.cmake with -DPYTHON_BIN=... -DOLD_RPATH=...
|
||||
file(RPATH_CHANGE FILE "${PYTHON_BIN}" OLD_RPATH "${OLD_RPATH}" NEW_RPATH "$ORIGIN/../lib")
|
||||
72
deps/python3/stage_windows.cmake
vendored
72
deps/python3/stage_windows.cmake
vendored
@@ -1,72 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(_python_abi "312")
|
||||
|
||||
foreach(_var PYTHON_SOURCE_DIR PYTHON_BUILD_DIR PYTHON_DEST_DIR PYTHON_LAYOUT_ARCH)
|
||||
if(NOT DEFINED ${_var} OR "${${_var}}" STREQUAL "")
|
||||
message(FATAL_ERROR "${_var} is required")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(_python_exe "${PYTHON_BUILD_DIR}/python.exe")
|
||||
if(PYTHON_DEBUG)
|
||||
set(_python_exe "${PYTHON_BUILD_DIR}/python_d.exe")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${_python_exe}")
|
||||
message(FATAL_ERROR "Built Python executable not found: ${_python_exe}")
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${PYTHON_DEST_DIR}")
|
||||
file(MAKE_DIRECTORY "${PYTHON_DEST_DIR}")
|
||||
|
||||
# CPython's Windows layout helper reads LICENSE.txt from the build output.
|
||||
# Source archives ship this file as LICENSE, so provide the expected name.
|
||||
if(EXISTS "${PYTHON_SOURCE_DIR}/LICENSE" AND NOT EXISTS "${PYTHON_BUILD_DIR}/LICENSE.txt")
|
||||
configure_file("${PYTHON_SOURCE_DIR}/LICENSE" "${PYTHON_BUILD_DIR}/LICENSE.txt" COPYONLY)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E env
|
||||
"PYTHONHOME="
|
||||
"PYTHONPATH=${PYTHON_SOURCE_DIR}/Lib"
|
||||
"${_python_exe}"
|
||||
"${PYTHON_SOURCE_DIR}/PC/layout"
|
||||
--source "${PYTHON_SOURCE_DIR}"
|
||||
--build "${PYTHON_BUILD_DIR}"
|
||||
--arch "${PYTHON_LAYOUT_ARCH}"
|
||||
--copy "${PYTHON_DEST_DIR}"
|
||||
--include-dev
|
||||
WORKING_DIRECTORY "${PYTHON_SOURCE_DIR}"
|
||||
RESULT_VARIABLE _layout_result
|
||||
)
|
||||
|
||||
if(NOT _layout_result EQUAL 0)
|
||||
message(FATAL_ERROR "CPython Windows layout staging failed with exit code ${_layout_result}")
|
||||
endif()
|
||||
|
||||
set(_required_files
|
||||
"${PYTHON_DEST_DIR}/Lib/encodings/__init__.py"
|
||||
"${PYTHON_DEST_DIR}/include/Python.h"
|
||||
)
|
||||
|
||||
if(PYTHON_DEBUG)
|
||||
list(APPEND _required_files
|
||||
"${PYTHON_DEST_DIR}/python_d.exe"
|
||||
"${PYTHON_DEST_DIR}/python${_python_abi}_d.dll"
|
||||
"${PYTHON_DEST_DIR}/libs/python${_python_abi}_d.lib"
|
||||
)
|
||||
else()
|
||||
list(APPEND _required_files
|
||||
"${PYTHON_DEST_DIR}/python.exe"
|
||||
"${PYTHON_DEST_DIR}/python${_python_abi}.dll"
|
||||
"${PYTHON_DEST_DIR}/libs/python${_python_abi}.lib"
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(_required_file IN LISTS _required_files)
|
||||
if(NOT EXISTS "${_required_file}")
|
||||
message(FATAL_ERROR "Staged Python file missing: ${_required_file}")
|
||||
endif()
|
||||
endforeach()
|
||||
40
deps/wxWidgets/wxWidgets.cmake
vendored
40
deps/wxWidgets/wxWidgets.cmake
vendored
@@ -1,6 +1,8 @@
|
||||
set(_wx_toolkit "")
|
||||
set(_wx_debug_postfix "")
|
||||
set(_wx_shared -DwxBUILD_SHARED=OFF)
|
||||
set(_wx_flatpak_patch "")
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(_gtk_ver 2)
|
||||
|
||||
@@ -12,6 +14,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
if (FLATPAK)
|
||||
set(_wx_debug_postfix "d")
|
||||
set(_wx_shared -DwxBUILD_SHARED=ON -DBUILD_SHARED_LIBS:BOOL=ON)
|
||||
set(_wx_flatpak_patch PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-flatpak.patch)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
@@ -21,13 +24,22 @@ else ()
|
||||
set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF")
|
||||
endif ()
|
||||
|
||||
set(_wx_opengl_override "")
|
||||
if(APPLE AND CMAKE_VERSION VERSION_GREATER_EQUAL "4.0")
|
||||
set(_wx_opengl_override
|
||||
-DOPENGL_gl_LIBRARY="-framework OpenGL"
|
||||
-DOPENGL_glu_LIBRARY="-framework OpenGL"
|
||||
)
|
||||
endif()
|
||||
|
||||
orcaslicer_add_cmake_project(
|
||||
wxWidgets
|
||||
GIT_REPOSITORY "https://github.com/SoftFever/Orca-deps-wxWidgets"
|
||||
GIT_TAG v3.3.2
|
||||
GIT_SHALLOW ON
|
||||
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${JPEG_PKG}
|
||||
${_wx_flatpak_patch}
|
||||
CMAKE_ARGS
|
||||
${_wx_opengl_override}
|
||||
-DwxBUILD_PRECOMP=ON
|
||||
${_wx_toolkit}
|
||||
"-DCMAKE_DEBUG_POSTFIX:STRING=${_wx_debug_postfix}"
|
||||
@@ -36,9 +48,9 @@ orcaslicer_add_cmake_project(
|
||||
${_wx_shared}
|
||||
-DwxUSE_MEDIACTRL=ON
|
||||
-DwxUSE_DETECT_SM=OFF
|
||||
-DwxUSE_UNICODE=ON
|
||||
-DwxUSE_PRIVATE_FONTS=ON
|
||||
-DwxUSE_OPENGL=ON
|
||||
-DwxUSE_GLCANVAS_EGL=ON
|
||||
-DwxUSE_WEBREQUEST=ON
|
||||
-DwxUSE_WEBVIEW=ON
|
||||
${_wx_edge}
|
||||
@@ -52,31 +64,7 @@ orcaslicer_add_cmake_project(
|
||||
-DwxUSE_ZLIB=sys
|
||||
-DwxUSE_LIBJPEG=sys
|
||||
-DwxUSE_LIBTIFF=OFF
|
||||
-DwxUSE_LIBWEBP=builtin
|
||||
-DwxUSE_EXPAT=sys
|
||||
-DwxUSE_NANOSVG=OFF
|
||||
)
|
||||
|
||||
# wxWidgets 3.3 cmake install doesn't include private headers.
|
||||
# OrcaSlicer uses some of the private headers (for accessibility support).
|
||||
# Copy the private headers directory after install.
|
||||
if(MSVC)
|
||||
set(_wx_inc_dest ${DESTDIR}/include/wx)
|
||||
else()
|
||||
set(_wx_inc_dest ${DESTDIR}/include/wx-3.3/wx)
|
||||
endif()
|
||||
ExternalProject_Add_Step(dep_wxWidgets copy_private_headers
|
||||
DEPENDEES install
|
||||
COMMENT "Copying wxWidgets private headers"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
<SOURCE_DIR>/include/wx/private
|
||||
${_wx_inc_dest}/private
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
<SOURCE_DIR>/include/wx/generic/private
|
||||
${_wx_inc_dest}/generic/private
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
<SOURCE_DIR>/include/wx/gtk/private
|
||||
${_wx_inc_dest}/gtk/private
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
|
||||
@@ -27,9 +27,11 @@ add_subdirectory(libigl)
|
||||
add_subdirectory(libnest2d)
|
||||
add_subdirectory(mcut)
|
||||
add_subdirectory(md4c)
|
||||
add_subdirectory(mdns)
|
||||
add_subdirectory(miniz)
|
||||
add_subdirectory(minilzo)
|
||||
add_subdirectory(qhull)
|
||||
add_subdirectory(qoi)
|
||||
add_subdirectory(semver) # Semver static library
|
||||
|
||||
# Eigen header-only library
|
||||
add_subdirectory(eigen)
|
||||
|
||||
@@ -18,6 +18,6 @@ target_include_directories(admesh SYSTEM
|
||||
)
|
||||
|
||||
target_link_libraries(admesh
|
||||
PUBLIC Eigen3::Eigen
|
||||
PRIVATE boost_headeronly
|
||||
PUBLIC eigen
|
||||
)
|
||||
|
||||
@@ -15,6 +15,6 @@ target_include_directories(clipper SYSTEM
|
||||
)
|
||||
|
||||
target_link_libraries(clipper
|
||||
PUBLIC Eigen3::Eigen
|
||||
PUBLIC eigen
|
||||
PRIVATE TBB::tbb TBB::tbbmalloc
|
||||
)
|
||||
|
||||
12
deps_src/eigen/CMakeLists.txt
Normal file
12
deps_src/eigen/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(eigen)
|
||||
|
||||
add_library(eigen INTERFACE)
|
||||
|
||||
target_include_directories(eigen SYSTEM
|
||||
INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# Eigen is header-only, so we only need to specify the include directory
|
||||
# The headers are in the Eigen/ subdirectory structure
|
||||
18
deps_src/eigen/COPYING.README
Normal file
18
deps_src/eigen/COPYING.README
Normal file
@@ -0,0 +1,18 @@
|
||||
Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links:
|
||||
http://www.mozilla.org/MPL/2.0/
|
||||
http://www.mozilla.org/MPL/2.0/FAQ.html
|
||||
|
||||
Some files contain third-party code under BSD or LGPL licenses, whence the other
|
||||
COPYING.* files here.
|
||||
|
||||
All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later.
|
||||
For this reason, the COPYING.LGPL file contains the LGPL 2.1 text.
|
||||
|
||||
If you want to guarantee that the Eigen code that you are #including is licensed
|
||||
under the MPL2 and possibly more permissive licenses (like BSD), #define this
|
||||
preprocessor symbol:
|
||||
EIGEN_MPL2_ONLY
|
||||
For example, with most compilers, you could add this to your project CXXFLAGS:
|
||||
-DEIGEN_MPL2_ONLY
|
||||
This will cause a compilation error to be generated if you #include any code that is
|
||||
LGPL licensed.
|
||||
19
deps_src/eigen/Eigen/CMakeLists.txt
Normal file
19
deps_src/eigen/Eigen/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
include(RegexUtils)
|
||||
test_escape_string_as_regex()
|
||||
|
||||
file(GLOB Eigen_directory_files "*")
|
||||
|
||||
escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
foreach(f ${Eigen_directory_files})
|
||||
if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||
list(APPEND Eigen_directory_files_to_install ${f})
|
||||
endif()
|
||||
endforeach(f ${Eigen_directory_files})
|
||||
|
||||
install(FILES
|
||||
${Eigen_directory_files_to_install}
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel
|
||||
)
|
||||
|
||||
install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h")
|
||||
46
deps_src/eigen/Eigen/Cholesky
Normal file
46
deps_src/eigen/Eigen/Cholesky
Normal file
@@ -0,0 +1,46 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_CHOLESKY_MODULE_H
|
||||
#define EIGEN_CHOLESKY_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
#include "Jacobi"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup Cholesky_Module Cholesky module
|
||||
*
|
||||
*
|
||||
*
|
||||
* This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
|
||||
* Those decompositions are also accessible via the following methods:
|
||||
* - MatrixBase::llt()
|
||||
* - MatrixBase::ldlt()
|
||||
* - SelfAdjointView::llt()
|
||||
* - SelfAdjointView::ldlt()
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/Cholesky>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/Cholesky/LLT.h"
|
||||
#include "src/Cholesky/LDLT.h"
|
||||
#ifdef EIGEN_USE_LAPACKE
|
||||
#ifdef EIGEN_USE_MKL
|
||||
#include "mkl_lapacke.h"
|
||||
#else
|
||||
#include "src/misc/lapacke.h"
|
||||
#endif
|
||||
#include "src/Cholesky/LLT_LAPACKE.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_CHOLESKY_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
48
deps_src/eigen/Eigen/CholmodSupport
Normal file
48
deps_src/eigen/Eigen/CholmodSupport
Normal file
@@ -0,0 +1,48 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H
|
||||
#define EIGEN_CHOLMODSUPPORT_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
extern "C" {
|
||||
#include <cholmod.h>
|
||||
}
|
||||
|
||||
/** \ingroup Support_modules
|
||||
* \defgroup CholmodSupport_Module CholmodSupport module
|
||||
*
|
||||
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
|
||||
* It provides the two following main factorization classes:
|
||||
* - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
|
||||
* - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).
|
||||
*
|
||||
* For the sake of completeness, this module also propose the two following classes:
|
||||
* - class CholmodSimplicialLLT
|
||||
* - class CholmodSimplicialLDLT
|
||||
* Note that these classes does not bring any particular advantage compared to the built-in
|
||||
* SimplicialLLT and SimplicialLDLT factorization classes.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/CholmodSupport>
|
||||
* \endcode
|
||||
*
|
||||
* In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies.
|
||||
* The dependencies depend on how cholmod has been compiled.
|
||||
* For a cmake based project, you can use our FindCholmod.cmake module to help you in this task.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "src/CholmodSupport/CholmodSupport.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_CHOLMODSUPPORT_MODULE_H
|
||||
|
||||
537
deps_src/eigen/Eigen/Core
Normal file
537
deps_src/eigen/Eigen/Core
Normal file
@@ -0,0 +1,537 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
|
||||
// Copyright (C) 2007-2011 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_CORE_H
|
||||
#define EIGEN_CORE_H
|
||||
|
||||
// first thing Eigen does: stop the compiler from committing suicide
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA)
|
||||
#define EIGEN_CUDACC __CUDACC__
|
||||
#endif
|
||||
|
||||
#if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA)
|
||||
#define EIGEN_CUDA_ARCH __CUDA_ARCH__
|
||||
#endif
|
||||
|
||||
#if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
|
||||
#define EIGEN_CUDACC_VER ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
|
||||
#elif defined(__CUDACC_VER__)
|
||||
#define EIGEN_CUDACC_VER __CUDACC_VER__
|
||||
#else
|
||||
#define EIGEN_CUDACC_VER 0
|
||||
#endif
|
||||
|
||||
// Handle NVCC/CUDA/SYCL
|
||||
#if defined(__CUDACC__) || defined(__SYCL_DEVICE_ONLY__)
|
||||
// Do not try asserts on CUDA and SYCL!
|
||||
#ifndef EIGEN_NO_DEBUG
|
||||
#define EIGEN_NO_DEBUG
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_INTERNAL_DEBUGGING
|
||||
#undef EIGEN_INTERNAL_DEBUGGING
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_EXCEPTIONS
|
||||
#undef EIGEN_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
// All functions callable from CUDA code must be qualified with __device__
|
||||
#ifdef __CUDACC__
|
||||
// Do not try to vectorize on CUDA and SYCL!
|
||||
#ifndef EIGEN_DONT_VECTORIZE
|
||||
#define EIGEN_DONT_VECTORIZE
|
||||
#endif
|
||||
|
||||
#define EIGEN_DEVICE_FUNC __host__ __device__
|
||||
// We need cuda_runtime.h to ensure that that EIGEN_USING_STD_MATH macro
|
||||
// works properly on the device side
|
||||
#include <cuda_runtime.h>
|
||||
#else
|
||||
#define EIGEN_DEVICE_FUNC
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define EIGEN_DEVICE_FUNC
|
||||
|
||||
#endif
|
||||
|
||||
// When compiling CUDA device code with NVCC, pull in math functions from the
|
||||
// global namespace. In host mode, and when device doee with clang, use the
|
||||
// std versions.
|
||||
#if defined(__CUDA_ARCH__) && defined(__NVCC__)
|
||||
#define EIGEN_USING_STD_MATH(FUNC) using ::FUNC;
|
||||
#else
|
||||
#define EIGEN_USING_STD_MATH(FUNC) using std::FUNC;
|
||||
#endif
|
||||
|
||||
#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(EIGEN_EXCEPTIONS) && !defined(EIGEN_USE_SYCL)
|
||||
#define EIGEN_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_EXCEPTIONS
|
||||
#include <new>
|
||||
#endif
|
||||
|
||||
// then include this file where all our macros are defined. It's really important to do it first because
|
||||
// it's where we do all the alignment settings (platform detection and honoring the user's will if he
|
||||
// defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization.
|
||||
#include "src/Core/util/Macros.h"
|
||||
|
||||
// Disable the ipa-cp-clone optimization flag with MinGW 6.x or newer (enabled by default with -O3)
|
||||
// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details.
|
||||
#if EIGEN_COMP_MINGW && EIGEN_GNUC_AT_LEAST(4,6)
|
||||
#pragma GCC optimize ("-fno-ipa-cp-clone")
|
||||
#endif
|
||||
|
||||
#include <complex>
|
||||
|
||||
// this include file manages BLAS and MKL related macros
|
||||
// and inclusion of their respective header files
|
||||
#include "src/Core/util/MKL_support.h"
|
||||
|
||||
// if alignment is disabled, then disable vectorization. Note: EIGEN_MAX_ALIGN_BYTES is the proper check, it takes into
|
||||
// account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks
|
||||
#if EIGEN_MAX_ALIGN_BYTES==0
|
||||
#ifndef EIGEN_DONT_VECTORIZE
|
||||
#define EIGEN_DONT_VECTORIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if EIGEN_COMP_MSVC
|
||||
#include <malloc.h> // for _aligned_malloc -- need it regardless of whether vectorization is enabled
|
||||
#if (EIGEN_COMP_MSVC >= 1500) // 2008 or later
|
||||
// Remember that usage of defined() in a #define is undefined by the standard.
|
||||
// a user reported that in 64-bit mode, MSVC doesn't care to define _M_IX86_FP.
|
||||
#if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || EIGEN_ARCH_x86_64
|
||||
#define EIGEN_SSE2_ON_MSVC_2008_OR_LATER
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
// Remember that usage of defined() in a #define is undefined by the standard
|
||||
#if (defined __SSE2__) && ( (!EIGEN_COMP_GNUC) || EIGEN_COMP_ICC || EIGEN_GNUC_AT_LEAST(4,2) )
|
||||
#define EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EIGEN_DONT_VECTORIZE
|
||||
|
||||
#if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
|
||||
|
||||
// Defines symbols for compile-time detection of which instructions are
|
||||
// used.
|
||||
// EIGEN_VECTORIZE_YY is defined if and only if the instruction set YY is used
|
||||
#define EIGEN_VECTORIZE
|
||||
#define EIGEN_VECTORIZE_SSE
|
||||
#define EIGEN_VECTORIZE_SSE2
|
||||
|
||||
// Detect sse3/ssse3/sse4:
|
||||
// gcc and icc defines __SSE3__, ...
|
||||
// there is no way to know about this on msvc. You can define EIGEN_VECTORIZE_SSE* if you
|
||||
// want to force the use of those instructions with msvc.
|
||||
#ifdef __SSE3__
|
||||
#define EIGEN_VECTORIZE_SSE3
|
||||
#endif
|
||||
#ifdef __SSSE3__
|
||||
#define EIGEN_VECTORIZE_SSSE3
|
||||
#endif
|
||||
#ifdef __SSE4_1__
|
||||
#define EIGEN_VECTORIZE_SSE4_1
|
||||
#endif
|
||||
#ifdef __SSE4_2__
|
||||
#define EIGEN_VECTORIZE_SSE4_2
|
||||
#endif
|
||||
#ifdef __AVX__
|
||||
#define EIGEN_VECTORIZE_AVX
|
||||
#define EIGEN_VECTORIZE_SSE3
|
||||
#define EIGEN_VECTORIZE_SSSE3
|
||||
#define EIGEN_VECTORIZE_SSE4_1
|
||||
#define EIGEN_VECTORIZE_SSE4_2
|
||||
#endif
|
||||
#ifdef __AVX2__
|
||||
#define EIGEN_VECTORIZE_AVX2
|
||||
#endif
|
||||
#ifdef __FMA__
|
||||
#define EIGEN_VECTORIZE_FMA
|
||||
#endif
|
||||
#if defined(__AVX512F__) && defined(EIGEN_ENABLE_AVX512)
|
||||
#define EIGEN_VECTORIZE_AVX512
|
||||
#define EIGEN_VECTORIZE_AVX2
|
||||
#define EIGEN_VECTORIZE_AVX
|
||||
#define EIGEN_VECTORIZE_FMA
|
||||
#ifdef __AVX512DQ__
|
||||
#define EIGEN_VECTORIZE_AVX512DQ
|
||||
#endif
|
||||
#ifdef __AVX512ER__
|
||||
#define EIGEN_VECTORIZE_AVX512ER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// include files
|
||||
|
||||
// This extern "C" works around a MINGW-w64 compilation issue
|
||||
// https://sourceforge.net/tracker/index.php?func=detail&aid=3018394&group_id=202880&atid=983354
|
||||
// In essence, intrin.h is included by windows.h and also declares intrinsics (just as emmintrin.h etc. below do).
|
||||
// However, intrin.h uses an extern "C" declaration, and g++ thus complains of duplicate declarations
|
||||
// with conflicting linkage. The linkage for intrinsics doesn't matter, but at that stage the compiler doesn't know;
|
||||
// so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too.
|
||||
// notice that since these are C headers, the extern "C" is theoretically needed anyways.
|
||||
extern "C" {
|
||||
// In theory we should only include immintrin.h and not the other *mmintrin.h header files directly.
|
||||
// Doing so triggers some issues with ICC. However old gcc versions seems to not have this file, thus:
|
||||
#if EIGEN_COMP_ICC >= 1110
|
||||
#include <immintrin.h>
|
||||
#else
|
||||
#include <mmintrin.h>
|
||||
#include <emmintrin.h>
|
||||
#include <xmmintrin.h>
|
||||
#ifdef EIGEN_VECTORIZE_SSE3
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
#ifdef EIGEN_VECTORIZE_SSSE3
|
||||
#include <tmmintrin.h>
|
||||
#endif
|
||||
#ifdef EIGEN_VECTORIZE_SSE4_1
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
#ifdef EIGEN_VECTORIZE_SSE4_2
|
||||
#include <nmmintrin.h>
|
||||
#endif
|
||||
#if defined(EIGEN_VECTORIZE_AVX) || defined(EIGEN_VECTORIZE_AVX512)
|
||||
#include <immintrin.h>
|
||||
#endif
|
||||
#endif
|
||||
} // end extern "C"
|
||||
#elif defined __VSX__
|
||||
#define EIGEN_VECTORIZE
|
||||
#define EIGEN_VECTORIZE_VSX
|
||||
#include <altivec.h>
|
||||
// We need to #undef all these ugly tokens defined in <altivec.h>
|
||||
// => use __vector instead of vector
|
||||
#undef bool
|
||||
#undef vector
|
||||
#undef pixel
|
||||
#elif defined __ALTIVEC__
|
||||
#define EIGEN_VECTORIZE
|
||||
#define EIGEN_VECTORIZE_ALTIVEC
|
||||
#include <altivec.h>
|
||||
// We need to #undef all these ugly tokens defined in <altivec.h>
|
||||
// => use __vector instead of vector
|
||||
#undef bool
|
||||
#undef vector
|
||||
#undef pixel
|
||||
#elif (defined __ARM_NEON) || (defined __ARM_NEON__)
|
||||
#define EIGEN_VECTORIZE
|
||||
#define EIGEN_VECTORIZE_NEON
|
||||
#include <arm_neon.h>
|
||||
#elif (defined __s390x__ && defined __VEC__)
|
||||
#define EIGEN_VECTORIZE
|
||||
#define EIGEN_VECTORIZE_ZVECTOR
|
||||
#include <vecintrin.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__F16C__) && !defined(EIGEN_COMP_CLANG)
|
||||
// We can use the optimized fp16 to float and float to fp16 conversion routines
|
||||
#define EIGEN_HAS_FP16_C
|
||||
#endif
|
||||
|
||||
#if defined __CUDACC__
|
||||
#define EIGEN_VECTORIZE_CUDA
|
||||
#include <vector_types.h>
|
||||
#if EIGEN_CUDACC_VER >= 70500
|
||||
#define EIGEN_HAS_CUDA_FP16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined EIGEN_HAS_CUDA_FP16
|
||||
#include <host_defines.h>
|
||||
#include <cuda_fp16.h>
|
||||
#endif
|
||||
|
||||
#if (defined _OPENMP) && (!defined EIGEN_DONT_PARALLELIZE)
|
||||
#define EIGEN_HAS_OPENMP
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_HAS_OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
// MSVC for windows mobile does not have the errno.h file
|
||||
#if !(EIGEN_COMP_MSVC && EIGEN_OS_WINCE) && !EIGEN_COMP_ARM
|
||||
#define EIGEN_HAS_ERRNO
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_HAS_ERRNO
|
||||
#include <cerrno>
|
||||
#endif
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <iosfwd>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <limits>
|
||||
#include <climits> // for CHAR_BIT
|
||||
// for min/max:
|
||||
#include <algorithm>
|
||||
|
||||
// for std::is_nothrow_move_assignable
|
||||
#ifdef EIGEN_INCLUDE_TYPE_TRAITS
|
||||
#include <type_traits>
|
||||
#endif
|
||||
|
||||
// for outputting debug info
|
||||
#ifdef EIGEN_DEBUG_ASSIGN
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
// required for __cpuid, needs to be included after cmath
|
||||
#if EIGEN_COMP_MSVC && EIGEN_ARCH_i386_OR_x86_64 && !EIGEN_OS_WINCE
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
/** \brief Namespace containing all symbols from the %Eigen library. */
|
||||
namespace Eigen {
|
||||
|
||||
inline static const char *SimdInstructionSetsInUse(void) {
|
||||
#if defined(EIGEN_VECTORIZE_AVX512)
|
||||
return "AVX512, FMA, AVX2, AVX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
|
||||
#elif defined(EIGEN_VECTORIZE_AVX)
|
||||
return "AVX SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
|
||||
#elif defined(EIGEN_VECTORIZE_SSE4_2)
|
||||
return "SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
|
||||
#elif defined(EIGEN_VECTORIZE_SSE4_1)
|
||||
return "SSE, SSE2, SSE3, SSSE3, SSE4.1";
|
||||
#elif defined(EIGEN_VECTORIZE_SSSE3)
|
||||
return "SSE, SSE2, SSE3, SSSE3";
|
||||
#elif defined(EIGEN_VECTORIZE_SSE3)
|
||||
return "SSE, SSE2, SSE3";
|
||||
#elif defined(EIGEN_VECTORIZE_SSE2)
|
||||
return "SSE, SSE2";
|
||||
#elif defined(EIGEN_VECTORIZE_ALTIVEC)
|
||||
return "AltiVec";
|
||||
#elif defined(EIGEN_VECTORIZE_VSX)
|
||||
return "VSX";
|
||||
#elif defined(EIGEN_VECTORIZE_NEON)
|
||||
return "ARM NEON";
|
||||
#elif defined(EIGEN_VECTORIZE_ZVECTOR)
|
||||
return "S390X ZVECTOR";
|
||||
#else
|
||||
return "None";
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
#if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS || defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API || defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS || defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API || defined EIGEN2_SUPPORT
|
||||
// This will generate an error message:
|
||||
#error Eigen2-support is only available up to version 3.2. Please go to "http://eigen.tuxfamily.org/index.php?title=Eigen2" for further information
|
||||
#endif
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to
|
||||
// ensure QNX/QCC support
|
||||
using std::size_t;
|
||||
// gcc 4.6.0 wants std:: for ptrdiff_t
|
||||
using std::ptrdiff_t;
|
||||
|
||||
}
|
||||
|
||||
/** \defgroup Core_Module Core module
|
||||
* This is the main module of Eigen providing dense matrix and vector support
|
||||
* (both fixed and dynamic size) with all the features corresponding to a BLAS library
|
||||
* and much more...
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/Core>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/Core/util/Constants.h"
|
||||
#include "src/Core/util/Meta.h"
|
||||
#include "src/Core/util/ForwardDeclarations.h"
|
||||
#include "src/Core/util/StaticAssert.h"
|
||||
#include "src/Core/util/XprHelper.h"
|
||||
#include "src/Core/util/Memory.h"
|
||||
|
||||
#include "src/Core/NumTraits.h"
|
||||
#include "src/Core/MathFunctions.h"
|
||||
#include "src/Core/GenericPacketMath.h"
|
||||
#include "src/Core/MathFunctionsImpl.h"
|
||||
#include "src/Core/arch/Default/ConjHelper.h"
|
||||
|
||||
#if defined EIGEN_VECTORIZE_AVX512
|
||||
#include "src/Core/arch/SSE/PacketMath.h"
|
||||
#include "src/Core/arch/AVX/PacketMath.h"
|
||||
#include "src/Core/arch/AVX512/PacketMath.h"
|
||||
#include "src/Core/arch/AVX512/MathFunctions.h"
|
||||
#elif defined EIGEN_VECTORIZE_AVX
|
||||
// Use AVX for floats and doubles, SSE for integers
|
||||
#include "src/Core/arch/SSE/PacketMath.h"
|
||||
#include "src/Core/arch/SSE/Complex.h"
|
||||
#include "src/Core/arch/SSE/MathFunctions.h"
|
||||
#include "src/Core/arch/AVX/PacketMath.h"
|
||||
#include "src/Core/arch/AVX/MathFunctions.h"
|
||||
#include "src/Core/arch/AVX/Complex.h"
|
||||
#include "src/Core/arch/AVX/TypeCasting.h"
|
||||
#include "src/Core/arch/SSE/TypeCasting.h"
|
||||
#elif defined EIGEN_VECTORIZE_SSE
|
||||
#include "src/Core/arch/SSE/PacketMath.h"
|
||||
#include "src/Core/arch/SSE/MathFunctions.h"
|
||||
#include "src/Core/arch/SSE/Complex.h"
|
||||
#include "src/Core/arch/SSE/TypeCasting.h"
|
||||
#elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
|
||||
#include "src/Core/arch/AltiVec/PacketMath.h"
|
||||
#include "src/Core/arch/AltiVec/MathFunctions.h"
|
||||
#include "src/Core/arch/AltiVec/Complex.h"
|
||||
#elif defined EIGEN_VECTORIZE_NEON
|
||||
#include "src/Core/arch/NEON/PacketMath.h"
|
||||
#include "src/Core/arch/NEON/MathFunctions.h"
|
||||
#include "src/Core/arch/NEON/Complex.h"
|
||||
#elif defined EIGEN_VECTORIZE_ZVECTOR
|
||||
#include "src/Core/arch/ZVector/PacketMath.h"
|
||||
#include "src/Core/arch/ZVector/MathFunctions.h"
|
||||
#include "src/Core/arch/ZVector/Complex.h"
|
||||
#endif
|
||||
|
||||
// Half float support
|
||||
#include "src/Core/arch/CUDA/Half.h"
|
||||
#include "src/Core/arch/CUDA/PacketMathHalf.h"
|
||||
#include "src/Core/arch/CUDA/TypeCasting.h"
|
||||
|
||||
#if defined EIGEN_VECTORIZE_CUDA
|
||||
#include "src/Core/arch/CUDA/PacketMath.h"
|
||||
#include "src/Core/arch/CUDA/MathFunctions.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/arch/Default/Settings.h"
|
||||
|
||||
#include "src/Core/functors/TernaryFunctors.h"
|
||||
#include "src/Core/functors/BinaryFunctors.h"
|
||||
#include "src/Core/functors/UnaryFunctors.h"
|
||||
#include "src/Core/functors/NullaryFunctors.h"
|
||||
#include "src/Core/functors/StlFunctors.h"
|
||||
#include "src/Core/functors/AssignmentFunctors.h"
|
||||
|
||||
// Specialized functors to enable the processing of complex numbers
|
||||
// on CUDA devices
|
||||
#include "src/Core/arch/CUDA/Complex.h"
|
||||
|
||||
#include "src/Core/IO.h"
|
||||
#include "src/Core/DenseCoeffsBase.h"
|
||||
#include "src/Core/DenseBase.h"
|
||||
#include "src/Core/MatrixBase.h"
|
||||
#include "src/Core/EigenBase.h"
|
||||
|
||||
#include "src/Core/Product.h"
|
||||
#include "src/Core/CoreEvaluators.h"
|
||||
#include "src/Core/AssignEvaluator.h"
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874
|
||||
// at least confirmed with Doxygen 1.5.5 and 1.5.6
|
||||
#include "src/Core/Assign.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/ArrayBase.h"
|
||||
#include "src/Core/util/BlasUtil.h"
|
||||
#include "src/Core/DenseStorage.h"
|
||||
#include "src/Core/NestByValue.h"
|
||||
|
||||
// #include "src/Core/ForceAlignedAccess.h"
|
||||
|
||||
#include "src/Core/ReturnByValue.h"
|
||||
#include "src/Core/NoAlias.h"
|
||||
#include "src/Core/PlainObjectBase.h"
|
||||
#include "src/Core/Matrix.h"
|
||||
#include "src/Core/Array.h"
|
||||
#include "src/Core/CwiseTernaryOp.h"
|
||||
#include "src/Core/CwiseBinaryOp.h"
|
||||
#include "src/Core/CwiseUnaryOp.h"
|
||||
#include "src/Core/CwiseNullaryOp.h"
|
||||
#include "src/Core/CwiseUnaryView.h"
|
||||
#include "src/Core/SelfCwiseBinaryOp.h"
|
||||
#include "src/Core/Dot.h"
|
||||
#include "src/Core/StableNorm.h"
|
||||
#include "src/Core/Stride.h"
|
||||
#include "src/Core/MapBase.h"
|
||||
#include "src/Core/Map.h"
|
||||
#include "src/Core/Ref.h"
|
||||
#include "src/Core/Block.h"
|
||||
#include "src/Core/VectorBlock.h"
|
||||
#include "src/Core/Transpose.h"
|
||||
#include "src/Core/DiagonalMatrix.h"
|
||||
#include "src/Core/Diagonal.h"
|
||||
#include "src/Core/DiagonalProduct.h"
|
||||
#include "src/Core/Redux.h"
|
||||
#include "src/Core/Visitor.h"
|
||||
#include "src/Core/Fuzzy.h"
|
||||
#include "src/Core/Swap.h"
|
||||
#include "src/Core/CommaInitializer.h"
|
||||
#include "src/Core/GeneralProduct.h"
|
||||
#include "src/Core/Solve.h"
|
||||
#include "src/Core/Inverse.h"
|
||||
#include "src/Core/SolverBase.h"
|
||||
#include "src/Core/PermutationMatrix.h"
|
||||
#include "src/Core/Transpositions.h"
|
||||
#include "src/Core/TriangularMatrix.h"
|
||||
#include "src/Core/SelfAdjointView.h"
|
||||
#include "src/Core/products/GeneralBlockPanelKernel.h"
|
||||
#include "src/Core/products/Parallelizer.h"
|
||||
#include "src/Core/ProductEvaluators.h"
|
||||
#include "src/Core/products/GeneralMatrixVector.h"
|
||||
#include "src/Core/products/GeneralMatrixMatrix.h"
|
||||
#include "src/Core/SolveTriangular.h"
|
||||
#include "src/Core/products/GeneralMatrixMatrixTriangular.h"
|
||||
#include "src/Core/products/SelfadjointMatrixVector.h"
|
||||
#include "src/Core/products/SelfadjointMatrixMatrix.h"
|
||||
#include "src/Core/products/SelfadjointProduct.h"
|
||||
#include "src/Core/products/SelfadjointRank2Update.h"
|
||||
#include "src/Core/products/TriangularMatrixVector.h"
|
||||
#include "src/Core/products/TriangularMatrixMatrix.h"
|
||||
#include "src/Core/products/TriangularSolverMatrix.h"
|
||||
#include "src/Core/products/TriangularSolverVector.h"
|
||||
#include "src/Core/BandMatrix.h"
|
||||
#include "src/Core/CoreIterators.h"
|
||||
#include "src/Core/ConditionEstimator.h"
|
||||
|
||||
#include "src/Core/BooleanRedux.h"
|
||||
#include "src/Core/Select.h"
|
||||
#include "src/Core/VectorwiseOp.h"
|
||||
#include "src/Core/Random.h"
|
||||
#include "src/Core/Replicate.h"
|
||||
#include "src/Core/Reverse.h"
|
||||
#include "src/Core/ArrayWrapper.h"
|
||||
|
||||
#ifdef EIGEN_USE_BLAS
|
||||
#include "src/Core/products/GeneralMatrixMatrix_BLAS.h"
|
||||
#include "src/Core/products/GeneralMatrixVector_BLAS.h"
|
||||
#include "src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h"
|
||||
#include "src/Core/products/SelfadjointMatrixMatrix_BLAS.h"
|
||||
#include "src/Core/products/SelfadjointMatrixVector_BLAS.h"
|
||||
#include "src/Core/products/TriangularMatrixMatrix_BLAS.h"
|
||||
#include "src/Core/products/TriangularMatrixVector_BLAS.h"
|
||||
#include "src/Core/products/TriangularSolverMatrix_BLAS.h"
|
||||
#endif // EIGEN_USE_BLAS
|
||||
|
||||
#ifdef EIGEN_USE_MKL_VML
|
||||
#include "src/Core/Assign_MKL.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/GlobalFunctions.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_CORE_H
|
||||
7
deps_src/eigen/Eigen/Dense
Normal file
7
deps_src/eigen/Eigen/Dense
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "Core"
|
||||
#include "LU"
|
||||
#include "Cholesky"
|
||||
#include "QR"
|
||||
#include "SVD"
|
||||
#include "Geometry"
|
||||
#include "Eigenvalues"
|
||||
2
deps_src/eigen/Eigen/Eigen
Normal file
2
deps_src/eigen/Eigen/Eigen
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "Dense"
|
||||
#include "Sparse"
|
||||
61
deps_src/eigen/Eigen/Eigenvalues
Normal file
61
deps_src/eigen/Eigen/Eigenvalues
Normal file
@@ -0,0 +1,61 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_EIGENVALUES_MODULE_H
|
||||
#define EIGEN_EIGENVALUES_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "Cholesky"
|
||||
#include "Jacobi"
|
||||
#include "Householder"
|
||||
#include "LU"
|
||||
#include "Geometry"
|
||||
|
||||
/** \defgroup Eigenvalues_Module Eigenvalues module
|
||||
*
|
||||
*
|
||||
*
|
||||
* This module mainly provides various eigenvalue solvers.
|
||||
* This module also provides some MatrixBase methods, including:
|
||||
* - MatrixBase::eigenvalues(),
|
||||
* - MatrixBase::operatorNorm()
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/Eigenvalues>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/misc/RealSvd2x2.h"
|
||||
#include "src/Eigenvalues/Tridiagonalization.h"
|
||||
#include "src/Eigenvalues/RealSchur.h"
|
||||
#include "src/Eigenvalues/EigenSolver.h"
|
||||
#include "src/Eigenvalues/SelfAdjointEigenSolver.h"
|
||||
#include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h"
|
||||
#include "src/Eigenvalues/HessenbergDecomposition.h"
|
||||
#include "src/Eigenvalues/ComplexSchur.h"
|
||||
#include "src/Eigenvalues/ComplexEigenSolver.h"
|
||||
#include "src/Eigenvalues/RealQZ.h"
|
||||
#include "src/Eigenvalues/GeneralizedEigenSolver.h"
|
||||
#include "src/Eigenvalues/MatrixBaseEigenvalues.h"
|
||||
#ifdef EIGEN_USE_LAPACKE
|
||||
#ifdef EIGEN_USE_MKL
|
||||
#include "mkl_lapacke.h"
|
||||
#else
|
||||
#include "src/misc/lapacke.h"
|
||||
#endif
|
||||
#include "src/Eigenvalues/RealSchur_LAPACKE.h"
|
||||
#include "src/Eigenvalues/ComplexSchur_LAPACKE.h"
|
||||
#include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_EIGENVALUES_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
62
deps_src/eigen/Eigen/Geometry
Normal file
62
deps_src/eigen/Eigen/Geometry
Normal file
@@ -0,0 +1,62 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_GEOMETRY_MODULE_H
|
||||
#define EIGEN_GEOMETRY_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "SVD"
|
||||
#include "LU"
|
||||
#include <limits>
|
||||
|
||||
/** \defgroup Geometry_Module Geometry module
|
||||
*
|
||||
* This module provides support for:
|
||||
* - fixed-size homogeneous transformations
|
||||
* - translation, scaling, 2D and 3D rotations
|
||||
* - \link Quaternion quaternions \endlink
|
||||
* - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3)
|
||||
* - orthognal vector generation (\ref MatrixBase::unitOrthogonal)
|
||||
* - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink
|
||||
* - \link AlignedBox axis aligned bounding boxes \endlink
|
||||
* - \link umeyama least-square transformation fitting \endlink
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/Geometry>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/Geometry/OrthoMethods.h"
|
||||
#include "src/Geometry/EulerAngles.h"
|
||||
|
||||
#include "src/Geometry/Homogeneous.h"
|
||||
#include "src/Geometry/RotationBase.h"
|
||||
#include "src/Geometry/Rotation2D.h"
|
||||
#include "src/Geometry/Quaternion.h"
|
||||
#include "src/Geometry/AngleAxis.h"
|
||||
#include "src/Geometry/Transform.h"
|
||||
#include "src/Geometry/Translation.h"
|
||||
#include "src/Geometry/Scaling.h"
|
||||
#include "src/Geometry/Hyperplane.h"
|
||||
#include "src/Geometry/ParametrizedLine.h"
|
||||
#include "src/Geometry/AlignedBox.h"
|
||||
#include "src/Geometry/Umeyama.h"
|
||||
|
||||
// Use the SSE optimized version whenever possible. At the moment the
|
||||
// SSE version doesn't compile when AVX is enabled
|
||||
#if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
|
||||
#include "src/Geometry/arch/Geometry_SSE.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_GEOMETRY_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
|
||||
30
deps_src/eigen/Eigen/Householder
Normal file
30
deps_src/eigen/Eigen/Householder
Normal file
@@ -0,0 +1,30 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_HOUSEHOLDER_MODULE_H
|
||||
#define EIGEN_HOUSEHOLDER_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup Householder_Module Householder module
|
||||
* This module provides Householder transformations.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/Householder>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/Householder/Householder.h"
|
||||
#include "src/Householder/HouseholderSequence.h"
|
||||
#include "src/Householder/BlockHouseholder.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_HOUSEHOLDER_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
48
deps_src/eigen/Eigen/IterativeLinearSolvers
Normal file
48
deps_src/eigen/Eigen/IterativeLinearSolvers
Normal file
@@ -0,0 +1,48 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
|
||||
#define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
#include "OrderingMethods"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/**
|
||||
* \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module
|
||||
*
|
||||
* This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse.
|
||||
* Those solvers are accessible via the following classes:
|
||||
* - ConjugateGradient for selfadjoint (hermitian) matrices,
|
||||
* - LeastSquaresConjugateGradient for rectangular least-square problems,
|
||||
* - BiCGSTAB for general square matrices.
|
||||
*
|
||||
* These iterative solvers are associated with some preconditioners:
|
||||
* - IdentityPreconditioner - not really useful
|
||||
* - DiagonalPreconditioner - also called Jacobi preconditioner, work very well on diagonal dominant matrices.
|
||||
* - IncompleteLUT - incomplete LU factorization with dual thresholding
|
||||
*
|
||||
* Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport.
|
||||
*
|
||||
\code
|
||||
#include <Eigen/IterativeLinearSolvers>
|
||||
\endcode
|
||||
*/
|
||||
|
||||
#include "src/IterativeLinearSolvers/SolveWithGuess.h"
|
||||
#include "src/IterativeLinearSolvers/IterativeSolverBase.h"
|
||||
#include "src/IterativeLinearSolvers/BasicPreconditioners.h"
|
||||
#include "src/IterativeLinearSolvers/ConjugateGradient.h"
|
||||
#include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h"
|
||||
#include "src/IterativeLinearSolvers/BiCGSTAB.h"
|
||||
#include "src/IterativeLinearSolvers/IncompleteLUT.h"
|
||||
#include "src/IterativeLinearSolvers/IncompleteCholesky.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
|
||||
33
deps_src/eigen/Eigen/Jacobi
Normal file
33
deps_src/eigen/Eigen/Jacobi
Normal file
@@ -0,0 +1,33 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_JACOBI_MODULE_H
|
||||
#define EIGEN_JACOBI_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup Jacobi_Module Jacobi module
|
||||
* This module provides Jacobi and Givens rotations.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/Jacobi>
|
||||
* \endcode
|
||||
*
|
||||
* In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation:
|
||||
* - MatrixBase::applyOnTheLeft()
|
||||
* - MatrixBase::applyOnTheRight().
|
||||
*/
|
||||
|
||||
#include "src/Jacobi/Jacobi.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_JACOBI_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
|
||||
50
deps_src/eigen/Eigen/LU
Normal file
50
deps_src/eigen/Eigen/LU
Normal file
@@ -0,0 +1,50 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_LU_MODULE_H
|
||||
#define EIGEN_LU_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup LU_Module LU module
|
||||
* This module includes %LU decomposition and related notions such as matrix inversion and determinant.
|
||||
* This module defines the following MatrixBase methods:
|
||||
* - MatrixBase::inverse()
|
||||
* - MatrixBase::determinant()
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/LU>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/misc/Kernel.h"
|
||||
#include "src/misc/Image.h"
|
||||
#include "src/LU/FullPivLU.h"
|
||||
#include "src/LU/PartialPivLU.h"
|
||||
#ifdef EIGEN_USE_LAPACKE
|
||||
#ifdef EIGEN_USE_MKL
|
||||
#include "mkl_lapacke.h"
|
||||
#else
|
||||
#include "src/misc/lapacke.h"
|
||||
#endif
|
||||
#include "src/LU/PartialPivLU_LAPACKE.h"
|
||||
#endif
|
||||
#include "src/LU/Determinant.h"
|
||||
#include "src/LU/InverseImpl.h"
|
||||
|
||||
// Use the SSE optimized version whenever possible. At the moment the
|
||||
// SSE version doesn't compile when AVX is enabled
|
||||
#if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
|
||||
#include "src/LU/arch/Inverse_SSE.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_LU_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
35
deps_src/eigen/Eigen/MetisSupport
Normal file
35
deps_src/eigen/Eigen/MetisSupport
Normal file
@@ -0,0 +1,35 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_METISSUPPORT_MODULE_H
|
||||
#define EIGEN_METISSUPPORT_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
extern "C" {
|
||||
#include <metis.h>
|
||||
}
|
||||
|
||||
|
||||
/** \ingroup Support_modules
|
||||
* \defgroup MetisSupport_Module MetisSupport module
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/MetisSupport>
|
||||
* \endcode
|
||||
* This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis).
|
||||
* It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink
|
||||
*/
|
||||
|
||||
|
||||
#include "src/MetisSupport/MetisSupport.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_METISSUPPORT_MODULE_H
|
||||
73
deps_src/eigen/Eigen/OrderingMethods
Normal file
73
deps_src/eigen/Eigen/OrderingMethods
Normal file
@@ -0,0 +1,73 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_ORDERINGMETHODS_MODULE_H
|
||||
#define EIGEN_ORDERINGMETHODS_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/**
|
||||
* \defgroup OrderingMethods_Module OrderingMethods module
|
||||
*
|
||||
* This module is currently for internal use only
|
||||
*
|
||||
* It defines various built-in and external ordering methods for sparse matrices.
|
||||
* They are typically used to reduce the number of elements during
|
||||
* the sparse matrix decomposition (LLT, LU, QR).
|
||||
* Precisely, in a preprocessing step, a permutation matrix P is computed using
|
||||
* those ordering methods and applied to the columns of the matrix.
|
||||
* Using for instance the sparse Cholesky decomposition, it is expected that
|
||||
* the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A).
|
||||
*
|
||||
*
|
||||
* Usage :
|
||||
* \code
|
||||
* #include <Eigen/OrderingMethods>
|
||||
* \endcode
|
||||
*
|
||||
* A simple usage is as a template parameter in the sparse decomposition classes :
|
||||
*
|
||||
* \code
|
||||
* SparseLU<MatrixType, COLAMDOrdering<int> > solver;
|
||||
* \endcode
|
||||
*
|
||||
* \code
|
||||
* SparseQR<MatrixType, COLAMDOrdering<int> > solver;
|
||||
* \endcode
|
||||
*
|
||||
* It is possible as well to call directly a particular ordering method for your own purpose,
|
||||
* \code
|
||||
* AMDOrdering<int> ordering;
|
||||
* PermutationMatrix<Dynamic, Dynamic, int> perm;
|
||||
* SparseMatrix<double> A;
|
||||
* //Fill the matrix ...
|
||||
*
|
||||
* ordering(A, perm); // Call AMD
|
||||
* \endcode
|
||||
*
|
||||
* \note Some of these methods (like AMD or METIS), need the sparsity pattern
|
||||
* of the input matrix to be symmetric. When the matrix is structurally unsymmetric,
|
||||
* Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method.
|
||||
* If your matrix is already symmetric (at leat in structure), you can avoid that
|
||||
* by calling the method with a SelfAdjointView type.
|
||||
*
|
||||
* \code
|
||||
* // Call the ordering on the pattern of the lower triangular matrix A
|
||||
* ordering(A.selfadjointView<Lower>(), perm);
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#ifndef EIGEN_MPL2_ONLY
|
||||
#include "src/OrderingMethods/Amd.h"
|
||||
#endif
|
||||
|
||||
#include "src/OrderingMethods/Ordering.h"
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_ORDERINGMETHODS_MODULE_H
|
||||
48
deps_src/eigen/Eigen/PaStiXSupport
Normal file
48
deps_src/eigen/Eigen/PaStiXSupport
Normal file
@@ -0,0 +1,48 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_PASTIXSUPPORT_MODULE_H
|
||||
#define EIGEN_PASTIXSUPPORT_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
extern "C" {
|
||||
#include <pastix_nompi.h>
|
||||
#include <pastix.h>
|
||||
}
|
||||
|
||||
#ifdef complex
|
||||
#undef complex
|
||||
#endif
|
||||
|
||||
/** \ingroup Support_modules
|
||||
* \defgroup PaStiXSupport_Module PaStiXSupport module
|
||||
*
|
||||
* This module provides an interface to the <a href="http://pastix.gforge.inria.fr/">PaSTiX</a> library.
|
||||
* PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver.
|
||||
* It provides the two following main factorization classes:
|
||||
* - class PastixLLT : a supernodal, parallel LLt Cholesky factorization.
|
||||
* - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization.
|
||||
* - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern).
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/PaStiXSupport>
|
||||
* \endcode
|
||||
*
|
||||
* In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies.
|
||||
* The dependencies depend on how PaSTiX has been compiled.
|
||||
* For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "src/PaStiXSupport/PaStiXSupport.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_PASTIXSUPPORT_MODULE_H
|
||||
35
deps_src/eigen/Eigen/PardisoSupport
Normal file
35
deps_src/eigen/Eigen/PardisoSupport
Normal file
@@ -0,0 +1,35 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_PARDISOSUPPORT_MODULE_H
|
||||
#define EIGEN_PARDISOSUPPORT_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include <mkl_pardiso.h>
|
||||
|
||||
/** \ingroup Support_modules
|
||||
* \defgroup PardisoSupport_Module PardisoSupport module
|
||||
*
|
||||
* This module brings support for the Intel(R) MKL PARDISO direct sparse solvers.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/PardisoSupport>
|
||||
* \endcode
|
||||
*
|
||||
* In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies.
|
||||
* See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "src/PardisoSupport/PardisoSupport.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_PARDISOSUPPORT_MODULE_H
|
||||
51
deps_src/eigen/Eigen/QR
Normal file
51
deps_src/eigen/Eigen/QR
Normal file
@@ -0,0 +1,51 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_QR_MODULE_H
|
||||
#define EIGEN_QR_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "Cholesky"
|
||||
#include "Jacobi"
|
||||
#include "Householder"
|
||||
|
||||
/** \defgroup QR_Module QR module
|
||||
*
|
||||
*
|
||||
*
|
||||
* This module provides various QR decompositions
|
||||
* This module also provides some MatrixBase methods, including:
|
||||
* - MatrixBase::householderQr()
|
||||
* - MatrixBase::colPivHouseholderQr()
|
||||
* - MatrixBase::fullPivHouseholderQr()
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/QR>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/QR/HouseholderQR.h"
|
||||
#include "src/QR/FullPivHouseholderQR.h"
|
||||
#include "src/QR/ColPivHouseholderQR.h"
|
||||
#include "src/QR/CompleteOrthogonalDecomposition.h"
|
||||
#ifdef EIGEN_USE_LAPACKE
|
||||
#ifdef EIGEN_USE_MKL
|
||||
#include "mkl_lapacke.h"
|
||||
#else
|
||||
#include "src/misc/lapacke.h"
|
||||
#endif
|
||||
#include "src/QR/HouseholderQR_LAPACKE.h"
|
||||
#include "src/QR/ColPivHouseholderQR_LAPACKE.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_QR_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
40
deps_src/eigen/Eigen/QtAlignedMalloc
Normal file
40
deps_src/eigen/Eigen/QtAlignedMalloc
Normal file
@@ -0,0 +1,40 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_QTMALLOC_MODULE_H
|
||||
#define EIGEN_QTMALLOC_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
void *qMalloc(std::size_t size)
|
||||
{
|
||||
return Eigen::internal::aligned_malloc(size);
|
||||
}
|
||||
|
||||
void qFree(void *ptr)
|
||||
{
|
||||
Eigen::internal::aligned_free(ptr);
|
||||
}
|
||||
|
||||
void *qRealloc(void *ptr, std::size_t size)
|
||||
{
|
||||
void* newPtr = Eigen::internal::aligned_malloc(size);
|
||||
std::memcpy(newPtr, ptr, size);
|
||||
Eigen::internal::aligned_free(ptr);
|
||||
return newPtr;
|
||||
}
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // EIGEN_QTMALLOC_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
34
deps_src/eigen/Eigen/SPQRSupport
Normal file
34
deps_src/eigen/Eigen/SPQRSupport
Normal file
@@ -0,0 +1,34 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SPQRSUPPORT_MODULE_H
|
||||
#define EIGEN_SPQRSUPPORT_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "SuiteSparseQR.hpp"
|
||||
|
||||
/** \ingroup Support_modules
|
||||
* \defgroup SPQRSupport_Module SuiteSparseQR module
|
||||
*
|
||||
* This module provides an interface to the SPQR library, which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/SPQRSupport>
|
||||
* \endcode
|
||||
*
|
||||
* In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...).
|
||||
* For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules
|
||||
*
|
||||
*/
|
||||
|
||||
#include "src/CholmodSupport/CholmodSupport.h"
|
||||
#include "src/SPQRSupport/SuiteSparseQRSupport.h"
|
||||
|
||||
#endif
|
||||
51
deps_src/eigen/Eigen/SVD
Normal file
51
deps_src/eigen/Eigen/SVD
Normal file
@@ -0,0 +1,51 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SVD_MODULE_H
|
||||
#define EIGEN_SVD_MODULE_H
|
||||
|
||||
#include "QR"
|
||||
#include "Householder"
|
||||
#include "Jacobi"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup SVD_Module SVD module
|
||||
*
|
||||
*
|
||||
*
|
||||
* This module provides SVD decomposition for matrices (both real and complex).
|
||||
* Two decomposition algorithms are provided:
|
||||
* - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones.
|
||||
* - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems.
|
||||
* These decompositions are accessible via the respective classes and following MatrixBase methods:
|
||||
* - MatrixBase::jacobiSvd()
|
||||
* - MatrixBase::bdcSvd()
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/SVD>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include "src/misc/RealSvd2x2.h"
|
||||
#include "src/SVD/UpperBidiagonalization.h"
|
||||
#include "src/SVD/SVDBase.h"
|
||||
#include "src/SVD/JacobiSVD.h"
|
||||
#include "src/SVD/BDCSVD.h"
|
||||
#if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT)
|
||||
#ifdef EIGEN_USE_MKL
|
||||
#include "mkl_lapacke.h"
|
||||
#else
|
||||
#include "src/misc/lapacke.h"
|
||||
#endif
|
||||
#include "src/SVD/JacobiSVD_LAPACKE.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_SVD_MODULE_H
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
36
deps_src/eigen/Eigen/Sparse
Normal file
36
deps_src/eigen/Eigen/Sparse
Normal file
@@ -0,0 +1,36 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SPARSE_MODULE_H
|
||||
#define EIGEN_SPARSE_MODULE_H
|
||||
|
||||
/** \defgroup Sparse_Module Sparse meta-module
|
||||
*
|
||||
* Meta-module including all related modules:
|
||||
* - \ref SparseCore_Module
|
||||
* - \ref OrderingMethods_Module
|
||||
* - \ref SparseCholesky_Module
|
||||
* - \ref SparseLU_Module
|
||||
* - \ref SparseQR_Module
|
||||
* - \ref IterativeLinearSolvers_Module
|
||||
*
|
||||
\code
|
||||
#include <Eigen/Sparse>
|
||||
\endcode
|
||||
*/
|
||||
|
||||
#include "SparseCore"
|
||||
#include "OrderingMethods"
|
||||
#ifndef EIGEN_MPL2_ONLY
|
||||
#include "SparseCholesky"
|
||||
#endif
|
||||
#include "SparseLU"
|
||||
#include "SparseQR"
|
||||
#include "IterativeLinearSolvers"
|
||||
|
||||
#endif // EIGEN_SPARSE_MODULE_H
|
||||
|
||||
45
deps_src/eigen/Eigen/SparseCholesky
Normal file
45
deps_src/eigen/Eigen/SparseCholesky
Normal file
@@ -0,0 +1,45 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2008-2013 Gael Guennebaud <gael.guennebaud@inria.fr>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SPARSECHOLESKY_MODULE_H
|
||||
#define EIGEN_SPARSECHOLESKY_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
#include "OrderingMethods"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/**
|
||||
* \defgroup SparseCholesky_Module SparseCholesky module
|
||||
*
|
||||
* This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices.
|
||||
* Those decompositions are accessible via the following classes:
|
||||
* - SimplicialLLt,
|
||||
* - SimplicialLDLt
|
||||
*
|
||||
* Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/SparseCholesky>
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#ifdef EIGEN_MPL2_ONLY
|
||||
#error The SparseCholesky module has nothing to offer in MPL2 only mode
|
||||
#endif
|
||||
|
||||
#include "src/SparseCholesky/SimplicialCholesky.h"
|
||||
|
||||
#ifndef EIGEN_MPL2_ONLY
|
||||
#include "src/SparseCholesky/SimplicialCholesky_impl.h"
|
||||
#endif
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_SPARSECHOLESKY_MODULE_H
|
||||
69
deps_src/eigen/Eigen/SparseCore
Normal file
69
deps_src/eigen/Eigen/SparseCore
Normal file
@@ -0,0 +1,69 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SPARSECORE_MODULE_H
|
||||
#define EIGEN_SPARSECORE_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
/**
|
||||
* \defgroup SparseCore_Module SparseCore module
|
||||
*
|
||||
* This module provides a sparse matrix representation, and basic associated matrix manipulations
|
||||
* and operations.
|
||||
*
|
||||
* See the \ref TutorialSparse "Sparse tutorial"
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/SparseCore>
|
||||
* \endcode
|
||||
*
|
||||
* This module depends on: Core.
|
||||
*/
|
||||
|
||||
#include "src/SparseCore/SparseUtil.h"
|
||||
#include "src/SparseCore/SparseMatrixBase.h"
|
||||
#include "src/SparseCore/SparseAssign.h"
|
||||
#include "src/SparseCore/CompressedStorage.h"
|
||||
#include "src/SparseCore/AmbiVector.h"
|
||||
#include "src/SparseCore/SparseCompressedBase.h"
|
||||
#include "src/SparseCore/SparseMatrix.h"
|
||||
#include "src/SparseCore/SparseMap.h"
|
||||
#include "src/SparseCore/MappedSparseMatrix.h"
|
||||
#include "src/SparseCore/SparseVector.h"
|
||||
#include "src/SparseCore/SparseRef.h"
|
||||
#include "src/SparseCore/SparseCwiseUnaryOp.h"
|
||||
#include "src/SparseCore/SparseCwiseBinaryOp.h"
|
||||
#include "src/SparseCore/SparseTranspose.h"
|
||||
#include "src/SparseCore/SparseBlock.h"
|
||||
#include "src/SparseCore/SparseDot.h"
|
||||
#include "src/SparseCore/SparseRedux.h"
|
||||
#include "src/SparseCore/SparseView.h"
|
||||
#include "src/SparseCore/SparseDiagonalProduct.h"
|
||||
#include "src/SparseCore/ConservativeSparseSparseProduct.h"
|
||||
#include "src/SparseCore/SparseSparseProductWithPruning.h"
|
||||
#include "src/SparseCore/SparseProduct.h"
|
||||
#include "src/SparseCore/SparseDenseProduct.h"
|
||||
#include "src/SparseCore/SparseSelfAdjointView.h"
|
||||
#include "src/SparseCore/SparseTriangularView.h"
|
||||
#include "src/SparseCore/TriangularSolver.h"
|
||||
#include "src/SparseCore/SparsePermutation.h"
|
||||
#include "src/SparseCore/SparseFuzzy.h"
|
||||
#include "src/SparseCore/SparseSolverBase.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_SPARSECORE_MODULE_H
|
||||
|
||||
46
deps_src/eigen/Eigen/SparseLU
Normal file
46
deps_src/eigen/Eigen/SparseLU
Normal file
@@ -0,0 +1,46 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
|
||||
// Copyright (C) 2012 Gael Guennebaud <gael.guennebaud@inria.fr>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SPARSELU_MODULE_H
|
||||
#define EIGEN_SPARSELU_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
/**
|
||||
* \defgroup SparseLU_Module SparseLU module
|
||||
* This module defines a supernodal factorization of general sparse matrices.
|
||||
* The code is fully optimized for supernode-panel updates with specialized kernels.
|
||||
* Please, see the documentation of the SparseLU class for more details.
|
||||
*/
|
||||
|
||||
// Ordering interface
|
||||
#include "OrderingMethods"
|
||||
|
||||
#include "src/SparseLU/SparseLU_gemm_kernel.h"
|
||||
|
||||
#include "src/SparseLU/SparseLU_Structs.h"
|
||||
#include "src/SparseLU/SparseLU_SupernodalMatrix.h"
|
||||
#include "src/SparseLU/SparseLUImpl.h"
|
||||
#include "src/SparseCore/SparseColEtree.h"
|
||||
#include "src/SparseLU/SparseLU_Memory.h"
|
||||
#include "src/SparseLU/SparseLU_heap_relax_snode.h"
|
||||
#include "src/SparseLU/SparseLU_relax_snode.h"
|
||||
#include "src/SparseLU/SparseLU_pivotL.h"
|
||||
#include "src/SparseLU/SparseLU_panel_dfs.h"
|
||||
#include "src/SparseLU/SparseLU_kernel_bmod.h"
|
||||
#include "src/SparseLU/SparseLU_panel_bmod.h"
|
||||
#include "src/SparseLU/SparseLU_column_dfs.h"
|
||||
#include "src/SparseLU/SparseLU_column_bmod.h"
|
||||
#include "src/SparseLU/SparseLU_copy_to_ucol.h"
|
||||
#include "src/SparseLU/SparseLU_pruneL.h"
|
||||
#include "src/SparseLU/SparseLU_Utils.h"
|
||||
#include "src/SparseLU/SparseLU.h"
|
||||
|
||||
#endif // EIGEN_SPARSELU_MODULE_H
|
||||
37
deps_src/eigen/Eigen/SparseQR
Normal file
37
deps_src/eigen/Eigen/SparseQR
Normal file
@@ -0,0 +1,37 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SPARSEQR_MODULE_H
|
||||
#define EIGEN_SPARSEQR_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
#include "OrderingMethods"
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup SparseQR_Module SparseQR module
|
||||
* \brief Provides QR decomposition for sparse matrices
|
||||
*
|
||||
* This module provides a simplicial version of the left-looking Sparse QR decomposition.
|
||||
* The columns of the input matrix should be reordered to limit the fill-in during the
|
||||
* decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end.
|
||||
* See the \link OrderingMethods_Module OrderingMethods\endlink module for the list
|
||||
* of built-in and external ordering methods.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/SparseQR>
|
||||
* \endcode
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "OrderingMethods"
|
||||
#include "src/SparseCore/SparseColEtree.h"
|
||||
#include "src/SparseQR/SparseQR.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif
|
||||
27
deps_src/eigen/Eigen/StdDeque
Normal file
27
deps_src/eigen/Eigen/StdDeque
Normal file
@@ -0,0 +1,27 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
||||
// Copyright (C) 2009 Hauke Heibel <hauke.heibel@googlemail.com>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_STDDEQUE_MODULE_H
|
||||
#define EIGEN_STDDEQUE_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
#include <deque>
|
||||
|
||||
#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
|
||||
|
||||
#define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...)
|
||||
|
||||
#else
|
||||
|
||||
#include "src/StlSupport/StdDeque.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // EIGEN_STDDEQUE_MODULE_H
|
||||
26
deps_src/eigen/Eigen/StdList
Normal file
26
deps_src/eigen/Eigen/StdList
Normal file
@@ -0,0 +1,26 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2009 Hauke Heibel <hauke.heibel@googlemail.com>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_STDLIST_MODULE_H
|
||||
#define EIGEN_STDLIST_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
#include <list>
|
||||
|
||||
#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
|
||||
|
||||
#define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...)
|
||||
|
||||
#else
|
||||
|
||||
#include "src/StlSupport/StdList.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // EIGEN_STDLIST_MODULE_H
|
||||
27
deps_src/eigen/Eigen/StdVector
Normal file
27
deps_src/eigen/Eigen/StdVector
Normal file
@@ -0,0 +1,27 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
||||
// Copyright (C) 2009 Hauke Heibel <hauke.heibel@googlemail.com>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_STDVECTOR_MODULE_H
|
||||
#define EIGEN_STDVECTOR_MODULE_H
|
||||
|
||||
#include "Core"
|
||||
#include <vector>
|
||||
|
||||
#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
|
||||
|
||||
#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...)
|
||||
|
||||
#else
|
||||
|
||||
#include "src/StlSupport/StdVector.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // EIGEN_STDVECTOR_MODULE_H
|
||||
64
deps_src/eigen/Eigen/SuperLUSupport
Normal file
64
deps_src/eigen/Eigen/SuperLUSupport
Normal file
@@ -0,0 +1,64 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_SUPERLUSUPPORT_MODULE_H
|
||||
#define EIGEN_SUPERLUSUPPORT_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#ifdef EMPTY
|
||||
#define EIGEN_EMPTY_WAS_ALREADY_DEFINED
|
||||
#endif
|
||||
|
||||
typedef int int_t;
|
||||
#include <slu_Cnames.h>
|
||||
#include <supermatrix.h>
|
||||
#include <slu_util.h>
|
||||
|
||||
// slu_util.h defines a preprocessor token named EMPTY which is really polluting,
|
||||
// so we remove it in favor of a SUPERLU_EMPTY token.
|
||||
// If EMPTY was already defined then we don't undef it.
|
||||
|
||||
#if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED)
|
||||
# undef EIGEN_EMPTY_WAS_ALREADY_DEFINED
|
||||
#elif defined(EMPTY)
|
||||
# undef EMPTY
|
||||
#endif
|
||||
|
||||
#define SUPERLU_EMPTY (-1)
|
||||
|
||||
namespace Eigen { struct SluMatrix; }
|
||||
|
||||
/** \ingroup Support_modules
|
||||
* \defgroup SuperLUSupport_Module SuperLUSupport module
|
||||
*
|
||||
* This module provides an interface to the <a href="http://crd-legacy.lbl.gov/~xiaoye/SuperLU/">SuperLU</a> library.
|
||||
* It provides the following factorization class:
|
||||
* - class SuperLU: a supernodal sequential LU factorization.
|
||||
* - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods).
|
||||
*
|
||||
* \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported.
|
||||
*
|
||||
* \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/SuperLUSupport>
|
||||
* \endcode
|
||||
*
|
||||
* In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies.
|
||||
* The dependencies depend on how superlu has been compiled.
|
||||
* For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "src/SuperLUSupport/SuperLUSupport.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_SUPERLUSUPPORT_MODULE_H
|
||||
40
deps_src/eigen/Eigen/UmfPackSupport
Normal file
40
deps_src/eigen/Eigen/UmfPackSupport
Normal file
@@ -0,0 +1,40 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_UMFPACKSUPPORT_MODULE_H
|
||||
#define EIGEN_UMFPACKSUPPORT_MODULE_H
|
||||
|
||||
#include "SparseCore"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
extern "C" {
|
||||
#include <umfpack.h>
|
||||
}
|
||||
|
||||
/** \ingroup Support_modules
|
||||
* \defgroup UmfPackSupport_Module UmfPackSupport module
|
||||
*
|
||||
* This module provides an interface to the UmfPack library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
|
||||
* It provides the following factorization class:
|
||||
* - class UmfPackLU: a multifrontal sequential LU factorization.
|
||||
*
|
||||
* \code
|
||||
* #include <Eigen/UmfPackSupport>
|
||||
* \endcode
|
||||
*
|
||||
* In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies.
|
||||
* The dependencies depend on how umfpack has been compiled.
|
||||
* For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "src/UmfPackSupport/UmfPackSupport.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_UMFPACKSUPPORT_MODULE_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user