Compare commits

..

66 Commits

Author SHA1 Message Date
SoftFever
ca1f360b83 bump version to 2.3.2-rc 2026-03-01 14:14:33 +08:00
Ian Bassi
4c73ac2fea Fix "Glidlines" "gridlines locale (#12529) 2026-03-01 14:13:54 +08:00
gerchowl
36b764f735 fix: typo "Glidlines" → "Gridlines" in View menu tooltip (#12527) 2026-03-01 14:13:54 +08:00
Rodrigo Faselli
ce1d91024b Fix missing infill layers (fill_surface_by_multilines & fill_surface_trapezoidal bug fix) (#12516)
* FillRectilinear bugfix

* cleaning

* Revert "cleaning"

This reverts commit 0de21ada78.

* Filltrapezoidal is OK

* Filltrapezoidal fix 2
2026-03-01 14:13:54 +08:00
SoftFever
2f3bfd03d5 fix missing translations for Canvas Toolbar Menu 2026-03-01 14:13:53 +08:00
SoftFever
f03c34024d update profile version 2026-03-01 14:13:53 +08:00
SoftFever
6b3f554732 update locale 2026-03-01 14:13:53 +08:00
yw4z
325ced958e Add option for hiding / showing gridlines (#10545)
Might be useful who want to use custom grid line system with textures. or a clean look

### PROBLEM / SCENARIOS
• Custom made textures overlapping with grid system. so it might be confusing for user if want to use specific markings
• User may found its a distracting item and wants a clean look

### SOLUTION
added to view menu
<img width="477" height="434" alt="Screenshot-20251230192707" src="https://github.com/user-attachments/assets/e298d9b2-5f8f-4e33-af22-ea7c84c9b5b8" />

added to canvas menu
<img width="278" height="297" alt="Screenshot-20251230192717" src="https://github.com/user-attachments/assets/a9952408-a361-4e64-ad9a-72e2480c74cf" />

Clean look without gridlines
<img width="1669" height="1157" alt="Screenshot-20250827144140" src="https://github.com/user-attachments/assets/9229f330-9543-4d39-a8fc-01deb9b61336" />

<img width="1669" height="1157" alt="Screenshot-20250827144212" src="https://github.com/user-attachments/assets/ab3848fb-74d7-4618-8bc7-0cdff10a3804" />


Few Examples with custom made textures / markings without gridlines
<img width="1669" height="1157" alt="Screenshot-20250827140008" src="https://github.com/user-attachments/assets/5d7b17ab-e97a-489c-9e4d-99157a37b6b7" />

<img width="1669" height="1157" alt="Screenshot-20250827141904" src="https://github.com/user-attachments/assets/a7e0f360-a85a-489d-9bc2-39286984643a" />
2026-03-01 14:13:53 +08:00
SoftFever
bbbc044e92 update locale and Simplified/Tranditional Chinese translation 2026-03-01 14:13:53 +08:00
Valerii Bokhan
0c666da430 Enhancement: Enabling base patterns (infill) for Organic supports (#12141)
Enhancement: Enabling base patterns for Organic supports
2026-03-01 14:13:53 +08:00
Valerii Bokhan
c924b8ed25 I18n: Preview translations minor fix (Ukrainian) (#12504) 2026-03-01 14:13:53 +08:00
SoftFever
c8dde0f8ca update locale 2026-03-01 14:13:52 +08:00
Ian Bassi
401fb935bc Fix: Init Serialized options (#12489)
Update Tab.cpp
2026-03-01 14:13:52 +08:00
Ian Bassi
7747a6e7a1 Preview translations (#12503)
Updated new preview options missing
+ Ru improvements (thanks @valerii-bokhan )
2026-03-01 14:13:52 +08:00
Ioannis Giannakas
545cdc74ca Fix wipe tower first layer leaving gaps when spacing other than 100pc is specified (#12491)
Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-03-01 14:13:52 +08:00
Heiko Liebscher
b0e19d5577 add new de translations (#12501)
add new translations
2026-03-01 14:13:52 +08:00
Molly K
df216c5105 Simplified Chinese translation improvement (≈ lines after 16500) (second minor update) (#12453)
* SAVE line 20K+ ~ 16573

* fix syntax errors

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-03-01 14:13:52 +08:00
Alexandre Folle de Menezes
e5d037c044 Fix GUI strings that should start with uppercase (#12499) 2026-03-01 14:13:52 +08:00
SoftFever
6e01d38a5c Skip uploading cache for PR build (#12494) 2026-03-01 14:13:51 +08:00
SoftFever
37790f2a3d Feature/mac_build (#12493)
* fix deps cache miss for Mac PR build
2026-03-01 14:13:51 +08:00
tome9111991
6437fb57e8 Fix: crash in PA calibration pattern generation (#12406)
Fix crash in PA calibration pattern generation

Reset current extruder ID and clear pointers in set_extruders to prevent dangling pointers when extruders are recreated. Also fixed undefined behavior by checking if the vector is empty before taking max_element.

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-03-01 14:13:51 +08:00
yw4z
a46c8970bf Filament Selection dialog Fixes / Improvements (#12325)
* Update 22.js

* fix printer list empty

* switch to vertical scrolling on custom filaments

* Update 23.css

* add stats

* fix uncommon filament types

* fix setup wizerd styling

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-03-01 14:13:51 +08:00
Ian Bassi
03bc0af038 "None (allow paint)" to "Painted Only" (#12487)
Co-authored-by: Valerii Bokhan <80919135+valerii-bokhan@users.noreply.github.com>
2026-03-01 14:13:51 +08:00
Felix14_v2
c03fdb4ca0 Update Russian localization (#12001) 2026-03-01 14:13:51 +08:00
SoftFever
1162b101b8 Change bed temperature type to use highest temp by default (#12486)
## Summary
- Change default bed temperature type from "By First filament" to "By Highest Temp"
- Move `bed_temperature_formula` option from develop mode to advanced mode for better accessibility
- Relocate UI control from "Basic Information - Advanced" to "Multimaterial Setup" section where it's more relevant for multi-filament printing
Using the highest temperature of all printed filaments is generally safer for bed adhesion than using the first filament's temperature, especially in multi-material prints where different filaments may require different bed temperatures.

<img width="390" height="239" alt="Screenshot 2026-02-26 at 18 44 56" src="https://github.com/user-attachments/assets/0fe9f8c7-062a-4a7a-8ab3-c52df7e74b26" />
2026-03-01 14:13:51 +08:00
Valerii Bokhan
f91971baf9 Fix: Fixed the values comparison for Float-based config options (#12478) 2026-03-01 14:13:51 +08:00
Argo
937b356725 Wipe tower "infinite out of bed line" fix (#12267)
Fix wipe tower out-of-bed moves

Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
2026-03-01 14:13:50 +08:00
Boštjan Čadež
721ee0ab00 Fix: macOS 2 finger tap moves moves slider instead of opening context menu (#12375) 2026-03-01 14:13:50 +08:00
SoftFever
f054e3ad9b Fix wipe tower skirt alignment by computing bbx from actual first-layer polygon (#12457) 2026-03-01 14:13:50 +08:00
Ian Bassi
1a57ec13a5 Minor export text change (#12461) 2026-03-01 14:13:50 +08:00
Alexandre Folle de Menezes
c7b65ef498 Fix spacing issues (#12404) 2026-03-01 14:13:50 +08:00
Ioannis Giannakas
31cb77116c Fix wipe tower Y offset for SEMM (#12442) 2026-03-01 14:13:50 +08:00
Ian Bassi
74f75bb90d JD processor upgrade (#12440)
* Update GCodeProcessor.cpp

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Fix

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* get_axis_max_jerk_with_jd

* get_get fix

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-03-01 14:13:50 +08:00
Alexandre Folle de Menezes
a3c067cd3b Add translation markers to measure units (#12403)
# Description
Some units were missing the translation markers, others were not in the standard format.
2026-03-01 14:13:49 +08:00
Rodrigo Faselli
90cd00382a Added Junction Deviation support to time estimation (#12417)
# Description

This PR enhances the GCodeProcessor's time estimation by incorporating Junction Deviation (JD) into the jerk calculations, providing more accurate print time predictions for firmwares that use JD (like modern Marlin).

Key Changes:
- Added JD support to time estimation

- Reads machine_max_junction_deviation (machine limits) and default_junction_deviation (print profile)

- When JD is enabled (>0), replaces traditional X/Y jerk values with JD-based calculation:
$Jerk = \sqrt{2.5\cdot JD \cdot acceleration }$

- Falls back to traditional jerk when JD is not used

# Test:
JD:0.0256mm   Accel.: 1000 mm/s²
<img width="2560" height="1392" alt="image" src="https://github.com/user-attachments/assets/f0e95294-bfca-400e-bffc-8d615d051b70" />

Jerk: 8mm/s  (equivalent)
<img width="2560" height="1392" alt="image" src="https://github.com/user-attachments/assets/8508727e-70f6-49ed-ac19-002db73e957b" />

JD:0.0128mm (4mm/s jerk)
<img width="2560" height="1392" alt="image" src="https://github.com/user-attachments/assets/91b04d3b-1b9e-48f4-b4b4-5addda2eff57" />
2026-03-01 14:13:49 +08:00
Sabriel-Koh
deef8b107d fix: filament remap should not "paint" unpainted triangles (#12437)
fix: filament remap should not "paint" unpainted triangles and should update the object extruder UI
2026-03-01 14:13:49 +08:00
Kellwa
478f1fa117 Anycubic Kobra Neo printer profiles (#12341)
* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* fix

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-03-01 14:13:49 +08:00
mlugo-apx
3f82902ebe Add Elegoo filament profiles to OrcaFilamentLibrary (#12359)
* Add Elegoo filament profiles to OrcaFilamentLibrary

Add 7 Elegoo filament profiles based on manufacturer specifications:
- Elegoo Rapid PETG (high-speed PETG, 240-270°C, 30-600mm/s)
- Elegoo PETG Pro (standard PETG, 230-260°C, 30-270mm/s)
- Elegoo PETG-CF (carbon fiber PETG, 240-270°C, 30-220mm/s)
- Elegoo PLA (standard PLA, 190-230°C, 30-280mm/s)
- Elegoo Rapid PLA+ (high-speed PLA, 190-230°C, 30-600mm/s)
- Elegoo ASA (ASA, 250-280°C, 30-270mm/s)
- Elegoo TPU 95A (flexible TPU, 220-240°C, 30-60mm/s)

All settings sourced from Elegoo's official product specifications.

* Fix dual seam fuzzy painted rev 2 (#11923)

* 2 seam fuzzy 2nd attempt

* Update FuzzySkin.cpp

* Fix debug SVG

* solve bump artifact in extrusion junction joint

* minor fixes

* cleaning

Update FuzzySkin.cpp

* Fix filament override changes not appearing in Unsaved Changes and showing as “Undef category” in preset comparison (#12298)

* Fix an issue that on Windows the Bambu legacy plugin is 01.10.01.09 (#12380)

* tweak legacy library migration from rename to copy in BBLNetworkPlugin (#12400)

* tweak legacy library migration from rename to copy in BBLNetworkPlugin

* Add Pressure Advance visualization support (#11673)

* Add Pressure Advance visualization support

Signed-off-by: minicx <minicx@disroot.org>

* Port Pressure Advance visualization to libvgcode architecture

Adapt PA visualization (originally in commit e3a77259) to work with
the new libvgcode library introduced by upstream PR #10735.

Changes across the libvgcode stack:
- PathVertex: add pressure_advance field
- Types.hpp: add PressureAdvance to EViewType enum
- ViewerImpl: add ColorRange, color mapping, range updates for PA
- LibVGCodeWrapper: pass pressure_advance from MoveVertex to PathVertex

GCodeViewer UI integration:
- Add "Pressure Advance" to view type dropdown
- Add PA color range in legend (3 decimal places)
- Add PA value display in sequential view marker tooltip
- Add PA row in position properties table

The GCodeProcessor PA parsing (M900, M572, SET_PRESSURE_ADVANCE)
is preserved from the original implementation.

* Tag Pressure Advance visualization changes with ORCA comments

Signed-off-by: minicx <minicx@disroot.org>

---------

Signed-off-by: minicx <minicx@disroot.org>
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* Fix time estimation using wrong machine limits due to broken extruder_id indexing (#12411)

The extruder_id*2 offset in get_axis_max_feedrate/get_axis_max_acceleration
was cherry-picked from BambuStudio's per-nozzle limit system, which OrcaSlicer
never ported. Without that system the limit arrays only have 2 values
([0]=Normal, [1]=Stealth), so any extruder_id > 0 or the uninitialized
value (255) would overshoot the array and fall back to values.back(),
always returning stealth-mode limits and producing incorrect time estimates.

Revert to indexing by time mode only (matching v2.3.1 behavior) and simplify
the M201/M203 handlers to write only the two mode slots they actually use.

* Fix machine envelope G-code emitting wrong limits due to broken extruder_id indexing (#12414)

print_machine_envelope() used get_extruder_id(extruder_id)*2 to index
machine limit arrays that only hold [Normal, Stealth] (2 entries).
For multi-extruder setups this went out-of-bounds, causing wrong M201/M203
values in the G-code which then override the estimator's correct limits.

Same class of bug as c6d1c11ebb but on the G-code writer side.

Changes:
- Remove unused extruder_id param from print_machine_envelope()
- Use .values.front() for M201/M203, matching M204/M205 in same function
- Change get_option_value() fallback from .back() to .front() so any
  future out-of-bounds index returns Normal mode instead of Stealth

* update error message when plugin upgrade failed

* Add and update pt-BR translations (#12409)

* Add preference for filament area height to reduce scrolling while using 16+ filaments (#12317)

Fixes https://github.com/OrcaSlicer/OrcaSlicer/issues/12284

Adds a preference for filaments area height since every user has different amount of MM units and external filaments
so users can set a value that fits their setups this way

we might see 3 or 6 filaments for each unit on future. thats why i set value as int

used 10 as default value. its good for 2 multimaterial units ( 8 filaments ) and 1 external filament

min value is 8.  might be good when no external filaments in use

max value is 99. UI works same as 2.3.1 version

<img width="562" height="122" alt="Screenshot-20260215194149" src="https://github.com/user-attachments/assets/309cec36-8b83-48f3-875f-d5f22a9631e7" />

**BEFORE**
Scrollable area fixed for 10 items. that causes a lot of scrolling whe user has 3 or 4 ams units

<img width="411" height="237" alt="Screenshot-20260215194816" src="https://github.com/user-attachments/assets/fc7823c0-d82a-4d1f-bb5b-56e8dd47abd2" />

**AFTER**
value 10. - 2 multimaterial units ( 8 filaments ) and 1 external filament
<img width="1002" height="250" alt="Screenshot-20260215195243" src="https://github.com/user-attachments/assets/e3238cd1-788e-4ed2-b048-89c63bd323db" />

value 18  - 4 multimaterial units ( 16 filaments ) and 1 external filament
<img width="1001" height="355" alt="Screenshot-20260215195127" src="https://github.com/user-attachments/assets/afe0305e-fcb4-4a51-b8dc-e70a063aa391" />

* Fix: Correct range checking for int and float Config Options + QoL changes in tooltips (#11915)

* Fix float number not working properly for option min/max (#11211)

* ConfigOptionDef: min/max values type are changed from INT to FLOAT.

(cherry picked from commit f277bc80c22e0c9a067481a4301922e2c96aed47)

* Fix infinite loop and crash when `fuzzy_skin_point_distance` = 0 (SoftFever/OrcaSlicer#11069)

* Fix Linux build issue

* Fix float comparison due to precision loss

* Fix: Range check added for coInt options; Ranges and defaults added in tooltips

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>

* Update machine profile for OpenEYE Peacock V2 (#12333)

* OpenEYE Peacock V2 machine profile: Add printer_agent key to enable AMS filament synchronization (Klipper/Moonraker)

Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>

* Optimize retraction settings in printer profiles to reduce stringing and improve print quality

Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>

---------

Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>

* Fix preheat regression bugs  (#12438)

Fix preheat regression bugs
revert 769fc137c7

* Fix the issue where `resources/profiles/OrcaFilamentLibrary.json` is not updated accordingly.

---------

Signed-off-by: minicx <minicx@disroot.org>
Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
Co-authored-by: Kiss Lorand <50251547+kisslorand@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
Co-authored-by: minicx <39405619+loss-and-quick@users.noreply.github.com>
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Alexandre Folle de Menezes <afmenez@terra.com.br>
Co-authored-by: yw4z <ywsyildiz@gmail.com>
Co-authored-by: Valerii Bokhan <80919135+valerii-bokhan@users.noreply.github.com>
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
Co-authored-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>
2026-03-01 14:13:49 +08:00
Derrick
1c42f67000 Fix Intra-layer "As Object List" not working. (#12368)
Added checks in ByLayer print sequence to handle ordering for Intra-layer ordering option. Prevents new ordering setup when "As object list" is enabled.
2026-03-01 14:13:49 +08:00
SoftFever
b45c7a8112 Fix preheat regression bugs (#12438)
Fix preheat regression bugs
revert 769fc137c7
2026-03-01 14:13:49 +08:00
Sezgin AÇIKGÖZ
da8be684dc Update machine profile for OpenEYE Peacock V2 (#12333)
* OpenEYE Peacock V2 machine profile: Add printer_agent key to enable AMS filament synchronization (Klipper/Moonraker)

Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>

* Optimize retraction settings in printer profiles to reduce stringing and improve print quality

Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>

---------

Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>
2026-03-01 14:13:49 +08:00
Valerii Bokhan
dc27345b05 Fix: Correct range checking for int and float Config Options + QoL changes in tooltips (#11915)
* Fix float number not working properly for option min/max (#11211)

* ConfigOptionDef: min/max values type are changed from INT to FLOAT.

(cherry picked from commit f277bc80c22e0c9a067481a4301922e2c96aed47)

* Fix infinite loop and crash when `fuzzy_skin_point_distance` = 0 (SoftFever/OrcaSlicer#11069)

* Fix Linux build issue

* Fix float comparison due to precision loss

* Fix: Range check added for coInt options; Ranges and defaults added in tooltips

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-03-01 14:13:49 +08:00
yw4z
10cfab0501 Add preference for filament area height to reduce scrolling while using 16+ filaments (#12317)
Fixes https://github.com/OrcaSlicer/OrcaSlicer/issues/12284

Adds a preference for filaments area height since every user has different amount of MM units and external filaments
so users can set a value that fits their setups this way

we might see 3 or 6 filaments for each unit on future. thats why i set value as int

used 10 as default value. its good for 2 multimaterial units ( 8 filaments ) and 1 external filament

min value is 8.  might be good when no external filaments in use

max value is 99. UI works same as 2.3.1 version

<img width="562" height="122" alt="Screenshot-20260215194149" src="https://github.com/user-attachments/assets/309cec36-8b83-48f3-875f-d5f22a9631e7" />

**BEFORE**
Scrollable area fixed for 10 items. that causes a lot of scrolling whe user has 3 or 4 ams units

<img width="411" height="237" alt="Screenshot-20260215194816" src="https://github.com/user-attachments/assets/fc7823c0-d82a-4d1f-bb5b-56e8dd47abd2" />

**AFTER**
value 10. - 2 multimaterial units ( 8 filaments ) and 1 external filament
<img width="1002" height="250" alt="Screenshot-20260215195243" src="https://github.com/user-attachments/assets/e3238cd1-788e-4ed2-b048-89c63bd323db" />

value 18  - 4 multimaterial units ( 16 filaments ) and 1 external filament
<img width="1001" height="355" alt="Screenshot-20260215195127" src="https://github.com/user-attachments/assets/afe0305e-fcb4-4a51-b8dc-e70a063aa391" />
2026-03-01 14:13:49 +08:00
Alexandre Folle de Menezes
4146066f76 Add and update pt-BR translations (#12409) 2026-03-01 14:13:49 +08:00
SoftFever
8aa43d1ef7 update error message when plugin upgrade failed 2026-03-01 14:13:49 +08:00
SoftFever
04bf8b6bb9 Fix machine envelope G-code emitting wrong limits due to broken extruder_id indexing (#12414)
print_machine_envelope() used get_extruder_id(extruder_id)*2 to index
machine limit arrays that only hold [Normal, Stealth] (2 entries).
For multi-extruder setups this went out-of-bounds, causing wrong M201/M203
values in the G-code which then override the estimator's correct limits.

Same class of bug as c6d1c11ebb but on the G-code writer side.

Changes:
- Remove unused extruder_id param from print_machine_envelope()
- Use .values.front() for M201/M203, matching M204/M205 in same function
- Change get_option_value() fallback from .back() to .front() so any
  future out-of-bounds index returns Normal mode instead of Stealth
2026-03-01 14:13:49 +08:00
SoftFever
84b5906ffa Fix time estimation using wrong machine limits due to broken extruder_id indexing (#12411)
The extruder_id*2 offset in get_axis_max_feedrate/get_axis_max_acceleration
was cherry-picked from BambuStudio's per-nozzle limit system, which OrcaSlicer
never ported. Without that system the limit arrays only have 2 values
([0]=Normal, [1]=Stealth), so any extruder_id > 0 or the uninitialized
value (255) would overshoot the array and fall back to values.back(),
always returning stealth-mode limits and producing incorrect time estimates.

Revert to indexing by time mode only (matching v2.3.1 behavior) and simplify
the M201/M203 handlers to write only the two mode slots they actually use.
2026-03-01 14:13:49 +08:00
minicx
318b7742cc Add Pressure Advance visualization support (#11673)
* Add Pressure Advance visualization support

Signed-off-by: minicx <minicx@disroot.org>

* Port Pressure Advance visualization to libvgcode architecture

Adapt PA visualization (originally in commit e3a77259) to work with
the new libvgcode library introduced by upstream PR #10735.

Changes across the libvgcode stack:
- PathVertex: add pressure_advance field
- Types.hpp: add PressureAdvance to EViewType enum
- ViewerImpl: add ColorRange, color mapping, range updates for PA
- LibVGCodeWrapper: pass pressure_advance from MoveVertex to PathVertex

GCodeViewer UI integration:
- Add "Pressure Advance" to view type dropdown
- Add PA color range in legend (3 decimal places)
- Add PA value display in sequential view marker tooltip
- Add PA row in position properties table

The GCodeProcessor PA parsing (M900, M572, SET_PRESSURE_ADVANCE)
is preserved from the original implementation.

* Tag Pressure Advance visualization changes with ORCA comments

Signed-off-by: minicx <minicx@disroot.org>

---------

Signed-off-by: minicx <minicx@disroot.org>
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-01 14:13:49 +08:00
SoftFever
b68fd2dc21 tweak legacy library migration from rename to copy in BBLNetworkPlugin (#12400)
* tweak legacy library migration from rename to copy in BBLNetworkPlugin
2026-03-01 14:13:49 +08:00
SoftFever
f2cc134a8f Fix an issue that on Windows the Bambu legacy plugin is 01.10.01.09 (#12380) 2026-03-01 14:13:49 +08:00
Kiss Lorand
31d9c9d087 Fix filament override changes not appearing in Unsaved Changes and showing as “Undef category” in preset comparison (#12298) 2026-03-01 14:13:49 +08:00
Rodrigo Faselli
c9ffc5a699 Fix dual seam fuzzy painted rev 2 (#11923)
* 2 seam fuzzy 2nd attempt

* Update FuzzySkin.cpp

* Fix debug SVG

* solve bump artifact in extrusion junction joint

* minor fixes

* cleaning

Update FuzzySkin.cpp
2026-03-01 14:13:49 +08:00
SoftFever
d37be2f4f5 Reapply "Switch to self hosted mac runner (#12024)" with proper fix (#12278)
* Reapply "Switch to self hosted mac runner (#12024)" with proper fix

This reverts commit 783f9926e3.

* use conditional logic for self-hosted runners

* improve readbility
2026-03-01 14:13:49 +08:00
SoftFever
4cc4da8868 fix flatpak CI build cache 2026-03-01 14:13:49 +08:00
SoftFever
9f5214d14d tweak: adjust max volumetric speed for PETG profiles to improve print quality (#12329)
* tweak: adjust max volumetric speed for PETG profiles to improve print quality
2026-03-01 14:13:48 +08:00
Argo
7e63fce706 Fix 3MF import crash for silent-mode machine limits with legacy vector sizes (#12289)
Normalize printer_options_with_variant_2 (stride=2) machine limit vectors during preset merge to handle legacy 3MF/projects that store only a single (normal,silent) pair despite multiple printer variants, preventing set_with_restore() size-mismatch crashes.

Crash error message during 3MF import as project:

<img width="833" height="274" alt="image" src="https://github.com/user-attachments/assets/f92148a9-98c6-47b7-a0ab-d5ac8b1f2be4" />

3MF attached that causes the bug. 
[cube.3mf.zip](https://github.com/user-attachments/files/25318309/cube.3mf.zip)
2026-02-15 20:50:17 +08:00
Matthias Blaicher
380f4b4a18 Fix EGL/GLX mismatch causing blank 3D preview on Linux (#12308)
- Add configurable GLEW_USE_EGL option (default OFF) to match wxWidgets
- Explicitly set wxUSE_GLCANVAS_EGL=OFF for vendored wxWidgets build
- Add compile-time check to detect EGL/GLX backend mismatch between
  GLEW and wxWidgets, preventing silent rendering failures

The bug occurred when GLEW was compiled with EGL support (using
eglGetProcAddress) but wxWidgets created GLX contexts. This mismatch
caused OpenGL function pointers to fail loading, resulting in blank
3D model preview.

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-02-15 16:27:07 +08:00
SoftFever
240cf9ab5d bump version to 2.3.2-beta2 2026-02-15 14:31:57 +08:00
Branden Cash
05cb8b4d89 feat(MoonrakerPrinterAgent): support Happy Hare as alternative to AFC for filament sync (#12307)
# Description


# Screenshots/Recordings/Graphs


https://github.com/user-attachments/assets/5558b4be-24eb-4f2d-83fd-8482560a0014

<img width="445" height="285" alt="Screenshot 2026-02-14 at 7 31 57 PM" src="https://github.com/user-attachments/assets/e71fee66-05da-4f9c-8123-0f52e93f0ebb" />


## Tests

Removed configured filaments and pressed the sync button. Observed the filaments configured in my system were populated.
2026-02-15 14:31:29 +08:00
SoftFever
897a3e915f bump profile version to "02.03.02.40" (#12309) 2026-02-15 14:26:33 +08:00
Ian Bassi
586e96479a Linux: Repaired VFA tower (#12290)
* Update CalibUtils.cpp

* VFA.drc case to vfa.drc
2026-02-15 14:26:33 +08:00
Ian Bassi
0879b2079b Spanish minor update (#12268) 2026-02-15 14:26:33 +08:00
Ian Bassi
c4801250ea Spanish Update (#12254)
* Spanish Update
2026-02-15 14:26:33 +08:00
SoftFever
f0386d981f Revert "Switch to self hosted mac runner (#12024)"
This reverts commit f1212be6bb.
2026-02-14 18:11:06 +08:00
Argo
cd5c8f2ad0 Ported Bambu Studio wipe tower interface features (with improved preheat and cooldown behaviour) - NEW (#12266)
Wipe tower interface features and preheat fixes

Fresh PR branch rebuilt on upstream/main (squash of origin/BBL-studio-wipe-tower-merge) to avoid merge-history issues.
2026-02-13 22:57:55 +08:00
SoftFever
2d0a0568e7 Change SoftFever version from '2.3.2-dev' to '2.3.2-beta' 2026-02-13 19:43:45 +08:00
16118 changed files with 2229901 additions and 2705881 deletions

View File

@@ -5,7 +5,7 @@ Language: Cpp
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false AlignConsecutiveDeclarations: true
AlignEscapedNewlines: DontAlign AlignEscapedNewlines: DontAlign
AlignOperands: true AlignOperands: true
AlignTrailingComments: true AlignTrailingComments: true

View File

@@ -4,7 +4,7 @@
"dockerfile": "Dockerfile", "dockerfile": "Dockerfile",
"args": { "args": {
"PLATFORM": "linux/amd64", "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"] "options": ["--platform=linux/amd64"]
}, },

View File

@@ -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. 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. 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 - type: checkboxes
attributes: attributes:
label: Is there an existing issue for this problem? label: Is there an existing issue for this problem?

View File

@@ -19,9 +19,3 @@
<!-- <!--
> Please describe the tests that you have conducted to verify the changes made in this PR. > 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)

View File

@@ -15,7 +15,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Setup Bun - name: Setup Bun
uses: oven-sh/setup-bun@v2 uses: oven-sh/setup-bun@v2

View File

@@ -29,7 +29,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Setup Bun - name: Setup Bun
uses: oven-sh/setup-bun@v2 uses: oven-sh/setup-bun@v2

View File

@@ -5,7 +5,6 @@ on:
branches: branches:
- main - main
- release/* - release/*
- belt-printer
paths: paths:
- 'deps/**' - 'deps/**'
- 'src/**' - 'src/**'
@@ -15,8 +14,6 @@ on:
- 'resources/**' - 'resources/**'
- ".github/workflows/build_*.yml" - ".github/workflows/build_*.yml"
- 'scripts/flatpak/**' - 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'tests/**'
pull_request: pull_request:
branches: branches:
@@ -30,12 +27,9 @@ on:
- 'version.inc' - 'version.inc'
- ".github/workflows/build_*.yml" - ".github/workflows/build_*.yml"
- 'build_linux.sh' - 'build_linux.sh'
- 'build_release_vs.bat'
- 'build_release_vs2022.bat' - 'build_release_vs2022.bat'
- 'build_release_macos.sh' - 'build_release_macos.sh'
- 'scripts/flatpak/**' - 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'tests/**'
schedule: schedule:
@@ -57,17 +51,21 @@ jobs:
build_linux: build_linux:
strategy: strategy:
fail-fast: false fail-fast: false
# Build both arches on every event (PRs included), through the same # Don't run scheduled builds on forks:
# build_check_cache -> build_deps -> build_orca chain (the AppImage). if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
# aarch64 always uses the GitHub-hosted arm runner (there is no arm uses: ./.github/workflows/build_check_cache.yml
# self-hosted server). amd64's empty arch is load-bearing: it keeps the with:
# historical 'linux-clang' deps cache key and the unsuffixed asset names. os: ubuntu-24.04
build-deps-only: ${{ inputs.build-deps-only || false }}
secrets: inherit
build_all:
strategy:
fail-fast: false
matrix: matrix:
include: include:
- arch: "" - os: windows-latest
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }} - os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
- arch: "aarch64" arch: arm64
os: ubuntu-24.04-arm
# Don't run scheduled builds on forks: # Don't run scheduled builds on forks:
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }} if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
uses: ./.github/workflows/build_check_cache.yml uses: ./.github/workflows/build_check_cache.yml
@@ -75,148 +73,50 @@ jobs:
os: ${{ matrix.os }} os: ${{ matrix.os }}
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
build-deps-only: ${{ inputs.build-deps-only || false }} 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' }} force-build: ${{ github.event_name == 'schedule' }}
secrets: inherit secrets: inherit
build_macos_arch: unit_tests:
strategy: name: Unit Tests
fail-fast: false runs-on: ubuntu-24.04
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
# One test job per built arch, on the runner that built it.
unit_tests_linux_x86_64:
name: Linux x86_64
needs: build_linux needs: build_linux
if: ${{ !cancelled() && success() }} if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
artifact: ${{ github.sha }}-tests-linux-x86_64
unit_tests_linux_aarch64:
name: Linux aarch64
needs: build_linux
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests.yml
with:
os: ubuntu-24.04-arm
artifact: ${{ github.sha }}-tests-linux-aarch64
unit_tests_windows_x64:
name: Windows x64
needs: build_windows
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
artifact: ${{ github.sha }}-tests-windows-x64
unit_tests_windows_arm64:
name: Windows arm64
needs: build_windows
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests.yml
with:
os: windows-11-arm
artifact: ${{ github.sha }}-tests-windows-arm64
test-dir: build-arm64/tests
unit_tests_macos_arm64:
name: macOS arm64
needs: build_macos_arch
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
artifact: ${{ github.sha }}-tests-macos-arm64
test-dir: build/arm64/tests
# Slice a two-colour cube through every shipped printer with this PR's engine
# so all custom g-code (change_filament_gcode, machine start/end, etc.) is
# expanded - catches slicing regressions the static profile checks and unit
# tests can't see. Profile-only PRs are covered by check_profiles.yml (nightly
# binary); this covers src/engine PRs with the PR-built binary. Runs in
# parallel off build_linux's artifact so it doesn't lengthen the build leg.
slice_check_linux:
name: Slice check (Linux aarch64)
needs: build_linux
if: ${{ !cancelled() && success() }}
runs-on: ubuntu-24.04-arm
steps: steps:
- name: Checkout repository - name: Checkout
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Download profile validator
uses: actions/download-artifact@v8
with: with:
name: ${{ github.sha }}-profile-validator-linux-aarch64 sparse-checkout: |
path: validator-bin .github
- name: Validate slice (expand custom g-code) scripts
timeout-minutes: 60 tests
- name: Apt-Install Dependencies
uses: ./.github/actions/apt-install-deps
- name: Restore Test Artifact
uses: actions/download-artifact@v7
with:
name: ${{ github.sha }}-tests
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
- name: Unpackage and Run Unit Tests
timeout-minutes: 20
run: | run: |
chmod +x validator-bin/OrcaSlicer_profile_validator tar -xvf build_tests.tar
./validator-bin/OrcaSlicer_profile_validator -p "${{ github.workspace }}/resources/profiles" -s -l 2 scripts/run_unit_tests.sh
publish_test_results: - name: Upload Test Logs
name: Publish Test Results uses: actions/upload-artifact@v6
needs: [unit_tests_linux_x86_64, unit_tests_linux_aarch64, unit_tests_windows_x64, unit_tests_windows_arm64, unit_tests_macos_arm64] if: ${{ failure() }}
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Download Test Results
uses: actions/download-artifact@v8
with: with:
pattern: test-results-* name: unit-test-logs
path: test-results path: build/tests/**/*.log
# Best-effort: a read-only token (e.g. fork PRs) can't write the check, so
# don't let a publish failure fail the run. The test jobs gate correctness.
- name: Publish Test Results - name: Publish Test Results
continue-on-error: true if: always()
uses: EnricoMi/publish-unit-test-result-action@v2 uses: EnricoMi/publish-unit-test-result-action@v2
with: with:
files: "test-results/**/*.xml" files: "ctest_results.xml"
- name: Delete Test Results
if: success()
uses: geekyeggo/delete-artifact@v6
with:
name: test-results-*
failOnError: false
flatpak: flatpak:
name: "Flatpak" name: "Flatpak"
container: container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50 image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
options: --privileged options: --privileged
volumes: volumes:
- /usr/local/lib/android:/usr/local/lib/android - /usr/local/lib/android:/usr/local/lib/android
@@ -232,22 +132,18 @@ jobs:
runner: ubuntu-24.04 runner: ubuntu-24.04
- arch: aarch64 - arch: aarch64
runner: ubuntu-24.04-arm runner: ubuntu-24.04-arm
# Don't run scheduled builds on forks; skip entirely on self-hosted runners # Don't run scheduled builds on forks:
if: ${{ !cancelled() && !vars.SELF_HOSTED && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }} if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
runs-on: ${{ matrix.variant.runner }} runs-on: ${{ matrix.variant.runner }}
env: env:
date: date:
ver: ver:
ver_pure: 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: steps:
- name: "Remove unneeded stuff to free disk space" - name: "Remove unneeded stuff to free disk space"
run: run:
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/* 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 - name: Get the version and date
run: | run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2) ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
@@ -256,7 +152,7 @@ jobs:
git_commit_hash="${{ github.event.pull_request.head.sha }}" git_commit_hash="${{ github.event.pull_request.head.sha }}"
else else
ver=V$ver_pure ver=V$ver_pure
git_commit_hash="${{ github.sha }}" git_commit_hash=""
fi fi
echo "ver=$ver" >> $GITHUB_ENV echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV echo "ver_pure=$ver_pure" >> $GITHUB_ENV
@@ -266,47 +162,37 @@ jobs:
# Manage flatpak-builder cache externally so PRs restore but never upload # Manage flatpak-builder cache externally so PRs restore but never upload
- name: Restore flatpak-builder cache - name: Restore flatpak-builder cache
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
uses: actions/cache/restore@v6 uses: actions/cache/restore@v4
with: with:
path: .flatpak-builder path: .flatpak-builder
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.event.pull_request.base.sha }} key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.event.pull_request.base.sha }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}- restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
- name: Save/restore flatpak-builder cache - name: Save/restore flatpak-builder cache
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
uses: actions/cache@v6 uses: actions/cache@v4
with: with:
path: .flatpak-builder path: .flatpak-builder
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.sha }} key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.sha }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}- 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 - uses: flatpak/flatpak-github-actions/flatpak-builder@master
with: with:
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml manifest-path: scripts/flatpak/io.github.softfever.OrcaSlicer.yml
cache: false cache: false
arch: ${{ matrix.variant.arch }} arch: ${{ matrix.variant.arch }}
upload-artifact: false upload-artifact: false
- name: Upload artifacts Flatpak - name: Upload artifacts Flatpak
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
path: '/__w/OrcaSlicer/OrcaSlicer/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 - 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 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak 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 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 max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted

View File

@@ -26,27 +26,24 @@ jobs:
valid-cache: ${{ steps.cache_deps.outputs.cache-hit }} valid-cache: ${{ steps.cache_deps.outputs.cache-hit }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v7 uses: actions/checkout@v6
with: with:
lfs: 'false' lfs: 'true'
- name: set outputs - name: set outputs
id: set_outputs id: set_outputs
env: env:
# Keep macOS/Windows cache keys architecture-specific. amd64 Linux passes # Normalize macOS runner names so self-hosted and GitHub-hosted produce the same cache key
# no arch (key stays 'linux-clang', preserving the existing cache); cache-os: ${{ contains(inputs.os, 'macos') && 'macos-arm64' || inputs.os }}
# aarch64 gets its own 'linux-clang-aarch64' key. dep-folder-name: ${{ !contains(inputs.os, 'macos') && '/OrcaSlicer_dep' || '' }}
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) || '')) }} output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
# 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"'}}
run: | run: |
echo cache-key=${{ env.cache-os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }} echo cache-key=${{ env.cache-os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }} echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }}
- name: load cache - name: load cache
id: cache_deps id: cache_deps
uses: actions/cache@v6 uses: actions/cache@v5
with: with:
path: ${{ steps.set_outputs.outputs.cache-path }} path: ${{ steps.set_outputs.outputs.cache-path }}
key: ${{ steps.set_outputs.outputs.cache-key }} key: ${{ steps.set_outputs.outputs.cache-key }}

View File

@@ -34,165 +34,96 @@ jobs:
# Setup the environment # Setup the environment
- name: Checkout - name: Checkout
uses: actions/checkout@v7 uses: actions/checkout@v6
with: with:
lfs: 'false' lfs: 'true'
- name: load cached deps - name: load cached deps
uses: actions/cache@v6 uses: actions/cache@v5
with: with:
path: ${{ inputs.cache-path }} path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }} key: ${{ inputs.cache-key }}
- uses: lukka/get-cmake@latest - 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: with:
cmakeVersion: "~4.3.0" # use most recent 4.3.x version cmakeVersion: "~3.28.0" # use most recent 3.28.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
- name: setup dev on Windows - name: setup dev on Windows
if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
uses: microsoft/setup-msbuild@v3 uses: microsoft/setup-msbuild@v2
- name: Get the date on Ubuntu and macOS - 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 run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash shell: bash
- name: Get the date on Windows - 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 run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
shell: pwsh 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 # Build Dependencies
- name: Build on Windows - name: Build on Windows
if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
if (-not "${{ vars.SELF_HOSTED }}") { choco install strawberryperl
choco install strawberryperl .\build_release_vs.bat deps
} .\build_release_vs.bat pack
$arch = "${{ inputs.arch }}" cd ${{ github.workspace }}/deps/build
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
- name: Build on Mac ${{ inputs.arch }} - name: Build on Mac ${{ inputs.arch }}
if: runner.os == 'macOS' if: contains(inputs.os, 'macos')
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
if [ -z "${{ vars.SELF_HOSTED }}" ]; then if [ -z "${{ vars.SELF_HOSTED }}" ]; then
brew install automake texinfo libtool brew install automake texinfo libtool
fi fi
./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15 ./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-1' || '' }} -a universal -t 10.15
(cd "${{ github.workspace }}/deps/build/${{ inputs.arch }}" && \ for arch in arm64 x86_64; do
find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +) (cd "${{ github.workspace }}/deps/build/${arch}" && \
find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +)
done
- name: Apt-Install Dependencies - name: Apt-Install Dependencies
if: runner.os == 'Linux' && !vars.SELF_HOSTED if: inputs.os == 'ubuntu-24.04'
uses: ./.github/actions/apt-install-deps uses: ./.github/actions/apt-install-deps
- name: Build on Ubuntu - name: Build on Ubuntu
if: runner.os == 'Linux' if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
mkdir -p ${{ github.workspace }}/deps/build/destdir mkdir -p ${{ github.workspace }}/deps/build/destdir
./build_linux.sh -drlL ./build_linux.sh -dr
cd deps/build cd deps/build
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
# Upload Artifacts # Upload Artifacts
# - name: Upload Mac ${{ inputs.arch }} artifacts # - name: Upload Mac ${{ inputs.arch }} artifacts
# if: runner.os == 'macOS' # if: contains(inputs.os, 'macos')
# uses: actions/upload-artifact@v6 # uses: actions/upload-artifact@v6
# with: # with:
# name: OrcaSlicer_dep_mac_${{ env.date }} # name: OrcaSlicer_dep_mac_${{ env.date }}
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz # path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz
# - name: Upload Windows artifacts - name: Upload Windows artifacts
# if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
# uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v6
# with: with:
# name: OrcaSlicer_dep_win64_${{ env.date }} name: OrcaSlicer_dep_win64_${{ env.date }}
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
# - name: Upload Ubuntu artifacts - name: Upload Ubuntu artifacts
# if: runner.os == 'Linux' && !env.ACT if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
# env: env:
# ubuntu-ver: '2404' ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
# uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v6
# with: with:
# name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }} name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }}
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
build_orca: build_orca:
name: Build OrcaSlicer name: Build OrcaSlicer

View File

@@ -2,10 +2,10 @@ on:
workflow_call: workflow_call:
inputs: inputs:
cache-key: cache-key:
required: false required: true
type: string type: string
cache-path: cache-path:
required: false required: true
type: string type: string
os: os:
required: true required: true
@@ -13,10 +13,6 @@ on:
arch: arch:
required: false required: false
type: string type: string
macos-combine-only:
required: false
type: boolean
default: false
jobs: jobs:
build_orca: build_orca:
@@ -26,54 +22,27 @@ jobs:
date: date:
ver: ver:
ver_pure: ver_pure:
ubuntu-ver: '2404'
ubuntu-ver-str: '_Ubuntu2404'
ORCA_UPDATER_SIG_KEY: ${{ secrets.ORCA_UPDATER_SIG_KEY }} 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: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v7 uses: actions/checkout@v6
with: with:
lfs: 'false' lfs: 'true'
- name: load cached deps - name: load cached deps
if: ${{ !(runner.os == 'macOS' && inputs.macos-combine-only) }} uses: actions/cache@v5
uses: actions/cache@v6
with: with:
path: ${{ inputs.cache-path }} path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }} key: ${{ inputs.cache-key }}
fail-on-cache-miss: true fail-on-cache-miss: true
- uses: lukka/get-cmake@latest - 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: with:
cmakeVersion: "~4.3.0" # use most recent 4.3.x version cmakeVersion: "~3.28.0" # use most recent 3.28.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
- name: Get the version and date on Ubuntu and macOS - name: Get the version and date on Ubuntu and macOS
if: runner.os != 'Windows' if: inputs.os != 'windows-latest'
run: | run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2) ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then if [[ "${{ github.event_name }}" == "pull_request" ]]; then
@@ -87,15 +56,10 @@ jobs:
echo "ver_pure=$ver_pure" >> $GITHUB_ENV echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "git_commit_hash=$git_commit_hash" >> $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 shell: bash
- name: Get the version and date on Windows - name: Get the version and date on Windows
if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
run: | run: |
$date = Get-Date -Format 'yyyyMMdd' $date = Get-Date -Format 'yyyyMMdd'
$ref = "${{ github.ref }}" $ref = "${{ github.ref }}"
@@ -122,16 +86,16 @@ jobs:
# Mac # Mac
- name: Install tools mac - name: Install tools mac
if: runner.os == 'macOS' && !inputs.macos-combine-only if: contains(inputs.os, 'macos')
run: | run: |
if [ -z "${{ vars.SELF_HOSTED }}" ]; then if [ -z "${{ vars.SELF_HOSTED }}" ]; then
brew install libtool brew install libtool
brew list brew list
fi fi
mkdir -p ${{ github.workspace }}/deps/build/${{ inputs.arch }} mkdir -p ${{ github.workspace }}/deps/build
- name: Free disk space - name: Free disk space
if: runner.os == 'macOS' && !inputs.macos-combine-only && !vars.SELF_HOSTED if: contains(inputs.os, 'macos') && !vars.SELF_HOSTED
run: | run: |
df -hI /dev/disk3s1s1 df -hI /dev/disk3s1s1
sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} + sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} +
@@ -139,68 +103,14 @@ jobs:
df -hI /dev/disk3s1s1 df -hI /dev/disk3s1s1
- name: Build slicer mac - name: Build slicer mac
if: runner.os == 'macOS' && !inputs.macos-combine-only if: contains(inputs.os, 'macos')
working-directory: ${{ github.workspace }}
# arm64 only: build the tests here; the unit_tests_macos job runs them.
env:
ORCA_TESTS_BUILD_ONLY: ${{ inputs.arch == 'arm64' && '1' || '' }}
run: |
./build_release_macos.sh -s -n -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15 ${{ inputs.arch == 'arm64' && '-T' || '' }}
- name: Pack unit tests mac
if: runner.os == 'macOS' && !inputs.macos-combine-only && inputs.arch == 'arm64'
working-directory: ${{ github.workspace }}
run: tar -cvf build_tests.tar build/arm64/tests
- name: Upload Test Artifact mac
if: runner.os == 'macOS' && !inputs.macos-combine-only && inputs.arch == 'arm64'
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}-tests-macos-arm64
overwrite: true
path: build_tests.tar
retention-days: 5
if-no-files-found: error
- name: Pack macOS app bundle ${{ inputs.arch }}
if: runner.os == 'macOS' && !inputs.macos-combine-only
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
tar -czvf OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}.tar.gz -C build/${{ inputs.arch }} OrcaSlicer ./build_release_macos.sh -s -n -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a universal -t 10.15
- 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
# Thanks to RaySajuuk, it's working now # Thanks to RaySajuuk, it's working now
- name: Sign app and notary - 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/')) && contains(inputs.os, 'macos')
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
env: env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
@@ -208,8 +118,6 @@ jobs:
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
CERTIFICATE_ID: ${{ secrets.MACOS_CERTIFICATE_ID }} CERTIFICATE_ID: ${{ secrets.MACOS_CERTIFICATE_ID }}
run: | 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 CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
@@ -222,14 +130,9 @@ jobs:
security list-keychain -d user -s $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $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 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 # 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 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 --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 fi
# Create main OrcaSlicer DMG without the profile validator helper # Create main OrcaSlicer DMG without the profile validator helper
@@ -237,7 +140,7 @@ jobs:
rm -rf ${{ 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/ 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 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 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 # Create separate OrcaSlicer_profile_validator DMG if the app exists
@@ -246,7 +149,7 @@ jobs:
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/* 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/ 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 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 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 fi
@@ -261,16 +164,14 @@ jobs:
fi fi
- name: Create DMG without notary - 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' && contains(inputs.os, 'macos')
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | 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 mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_dmg
rm -rf ${{ 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/ 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 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 # 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 if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
@@ -278,47 +179,37 @@ jobs:
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/* 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/ 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 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 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 - name: Upload artifacts mac
if: runner.os == 'macOS' && inputs.macos-combine-only if: contains(inputs.os, 'macos')
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: OrcaSlicer_Mac_universal_${{ env.ver }} name: OrcaSlicer_Mac_universal_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
- name: Upload OrcaSlicer_profile_validator DMG mac - name: Upload OrcaSlicer_profile_validator DMG mac
if: runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED if: contains(inputs.os, 'macos')
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: OrcaSlicer_profile_validator_Mac_universal_DMG_${{ env.ver }} name: OrcaSlicer_profile_validator_Mac_universal_DMG_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
if-no-files-found: ignore if-no-files-found: ignore
- name: Deploy Mac release - 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' && contains(inputs.os, 'macos')
uses: WebFreak001/deploy-nightly@v3.2.0 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg 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 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 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 - 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' && contains(inputs.os, 'macos')
uses: WebFreak001/deploy-nightly@v3.2.0 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
@@ -329,129 +220,94 @@ jobs:
max_releases: 1 max_releases: 1
# Windows # 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 - name: setup MSVC
if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
uses: microsoft/setup-msbuild@v3 uses: microsoft/setup-msbuild@v2
- name: Install nsis - name: Install nsis
if: runner.os == 'Windows' && !vars.SELF_HOSTED if: inputs.os == 'windows-latest'
run: | run: |
dir "C:/Program Files (x86)/Windows Kits/10/Include" dir "C:/Program Files (x86)/Windows Kits/10/Include"
choco install nsis choco install nsis
- name: Build slicer Win - name: Build slicer Win
if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
# Orca: Removed Netfabb STL fixing service support in favor of CGAL. env:
# env: WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
# WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\' WindowsSDKVersion: '10.0.26100.0\'
# WindowsSDKVersion: '10.0.26100.0\' run: .\build_release_vs.bat slicer
# "tests" builds the unit tests too; the unit_tests_windows_* jobs run them.
run: |
$arch = "${{ inputs.arch }}"
if ($arch -eq "arm64") { .\build_release_vs.bat slicer arm64 tests } else { .\build_release_vs.bat slicer tests }
shell: pwsh
- name: Pack unit tests Win
if: runner.os == 'Windows'
working-directory: ${{ github.workspace }}
shell: pwsh
run: tar -cvf build_tests.tar ${{ env.BUILD_DIR }}/tests
- name: Upload Test Artifact Win
if: runner.os == 'Windows'
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}-tests-windows-${{ inputs.arch }}
overwrite: true
path: build_tests.tar
retention-days: 5
if-no-files-found: error
# 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 - name: Create installer Win
if: runner.os == 'Windows' && !vars.SELF_HOSTED if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} working-directory: ${{ github.workspace }}/build
run: | run: |
cpack -G NSIS cpack -G NSIS
- name: Pack app - name: Pack app
if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} working-directory: ${{ github.workspace }}/build
shell: cmd 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 - name: Pack PDB
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}/src/Release working-directory: ${{ github.workspace }}/build/src/Release
shell: cmd shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb' 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 - name: Upload artifacts Win zip
if: runner.os == 'Windows' if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable name: OrcaSlicer_Windows_${{ env.ver }}_portable
path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer path: ${{ github.workspace }}/build/OrcaSlicer
- name: Upload artifacts Win installer - name: Upload artifacts Win installer
if: runner.os == 'Windows' && !vars.SELF_HOSTED if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }} name: OrcaSlicer_Windows_${{ env.ver }}
path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer*.exe path: ${{ github.workspace }}/build/OrcaSlicer*.exe
- name: Upload artifacts Win PDB - name: Upload artifacts Win PDB
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: PDB name: PDB
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
- name: Upload OrcaSlicer_profile_validator Win - name: Upload OrcaSlicer_profile_validator Win
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: OrcaSlicer_profile_validator_Windows_${{ env.ver }} name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}
path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
- name: Deploy Windows release portable - 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 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable.zip asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
asset_name: OrcaSlicer_Windows${{ env.ARCH_SUFFIX }}_nightly${{ env.nightly_suffix }}_portable.zip asset_name: OrcaSlicer_Windows_nightly_portable.zip
asset_content_type: application/x-zip-compressed asset_content_type: application/x-zip-compressed
max_releases: 1 max_releases: 1
- name: Deploy Windows release installer - 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 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_Installer_${{ env.ver }}${{ env.ARCH_SUFFIX }}.exe asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
asset_name: OrcaSlicer_Windows_Installer${{ env.ARCH_SUFFIX }}_nightly${{ env.nightly_suffix }}.exe asset_name: OrcaSlicer_Windows_Installer_nightly.exe
asset_content_type: application/x-msdownload asset_content_type: application/x-msdownload
max_releases: 1 max_releases: 1
- name: Deploy Windows OrcaSlicer_profile_validator release - 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 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
@@ -461,86 +317,38 @@ jobs:
asset_content_type: application/x-msdownload asset_content_type: application/x-msdownload
max_releases: 1 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 # Ubuntu
- name: Apt-Install Dependencies - name: Apt-Install Dependencies
if: runner.os == 'Linux' && !vars.SELF_HOSTED if: inputs.os == 'ubuntu-24.04'
uses: ./.github/actions/apt-install-deps uses: ./.github/actions/apt-install-deps
# Tests must built at the same time as the slicer; # Tests must built at the same time as the slicer;
# if you untangle them feel free to separate them here too # if you untangle them feel free to separate them here too
- name: Build slicer and tests - name: Build slicer and tests
if: runner.os == 'Linux' if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
shell: bash shell: bash
env:
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
run: | run: |
# Build + tar the unit tests (-t) on both Linux legs so each arch ./build_linux.sh -istr
# (x86_64 + aarch64) gets tested by its own unit_tests_linux_* job. mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
./build_linux.sh -istrlL chmod +x ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
./scripts/check_appimage_libs.sh ./build/package ./build/package/bin/orca-slicer tar -cvpf build_tests.tar build/tests
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"
tar -cvf build_tests.tar build/tests
# Use tar because upload-artifacts won't always preserve directory structure # Use tar because upload-artifacts won't always preserve directory structure
# and doesn't preserve file permissions # and doesn't preserve file permissions
- name: Upload Test Artifact - name: Upload Test Artifact
if: runner.os == 'Linux' if: inputs.os == 'ubuntu-24.04'
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: ${{ github.sha }}-tests-linux-${{ inputs.arch == 'aarch64' && 'aarch64' || 'x86_64' }} name: ${{ github.sha }}-tests
overwrite: true overwrite: true
path: build_tests.tar path: build_tests.tar
retention-days: 5 retention-days: 5
if-no-files-found: error if-no-files-found: error
# Ship the freshly-built validator so the parallel slice_check_linux job
# (build_all.yml) can slice-sweep the shipped profiles with this PR's
# engine. Taken from the aarch64 leg so the sweep runs on arm64 (its
# GitHub-hosted runner is free, and it also exercises the arm build).
# Stable sha-based name mirrors the tests artifact above so the
# downstream job downloads it by exact name.
- name: Upload profile validator (for slice check)
if: runner.os == 'Linux' && inputs.arch == 'aarch64'
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}-profile-validator-linux-aarch64
overwrite: true
path: ./build/src/Release/OrcaSlicer_profile_validator
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 - 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 working-directory: ${{ github.workspace }}/build/src/Release
shell: bash shell: bash
run: | run: |
@@ -549,31 +357,38 @@ jobs:
zip -r orca_custom_preset_tests.zip user/ zip -r orca_custom_preset_tests.zip user/
- name: Upload artifacts Ubuntu - name: Upload artifacts Ubuntu
if: ${{ ! env.ACT && runner.os == 'Linux' }} if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
uses: actions/upload-artifact@v7 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: with:
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}${{ env.arch_suffix }}_${{ env.ver }} name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
path: "./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_${{ env.ver }}.AppImage" path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage'
- name: Upload OrcaSlicer_profile_validator Ubuntu - name: Upload OrcaSlicer_profile_validator Ubuntu
if: ${{ ! env.ACT && runner.os == 'Linux' && !vars.SELF_HOSTED && inputs.arch != 'aarch64' }} if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
uses: actions/upload-artifact@v7 env:
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
uses: actions/upload-artifact@v6
with: with:
name: OrcaSlicer_profile_validator_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }} name: OrcaSlicer_profile_validator_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
path: './build/src/Release/OrcaSlicer_profile_validator' path: './build/src/Release/OrcaSlicer_profile_validator'
- name: Deploy Ubuntu release - 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 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_${{ env.ver }}.AppImage asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_nightly${{ env.nightly_suffix }}.AppImage asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_nightly.AppImage
asset_content_type: application/octet-stream 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 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 - 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 uses: rickstaa/action-create-tag@v1
with: with:
tag: "nightly-builds" tag: "nightly-builds"
@@ -582,7 +397,9 @@ jobs:
message: "nightly-builds" message: "nightly-builds"
- name: Deploy Ubuntu OrcaSlicer_profile_validator release - 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 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
@@ -593,7 +410,7 @@ jobs:
max_releases: 1 max_releases: 1
- name: Deploy orca_custom_preset_tests - 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 uses: WebFreak001/deploy-nightly@v3.2.0
with: with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Install gettext - name: Install gettext
run: | run: |

View File

@@ -15,16 +15,17 @@ on:
default: 'warning' default: 'warning'
permissions: permissions:
pull-requests: write
contents: read contents: read
jobs: jobs:
check_profiles: check_translation:
name: Check profiles name: Check profiles
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Run extra JSON check - name: Run extra JSON check
id: extra_json_check id: extra_json_check
@@ -38,10 +39,10 @@ jobs:
- name: Download - name: Download
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | 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 chmod +x ./OrcaSlicer_profile_validator
# Validate all system profiles. # validate profiles
- name: validate system profiles - name: validate system profiles
id: validate_system id: validate_system
continue-on-error: true continue-on-error: true
@@ -49,137 +50,24 @@ jobs:
set +e set +e
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_system.log ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_system.log
exit ${PIPESTATUS[0]} exit ${PIPESTATUS[0]}
# Slice a two-colour cube through every printer so all custom g-code (incl. change_filament_gcode)
# is expanded - catches undefined-placeholder / invalid-flow bugs the static checks above cannot see.
- name: validate slice (expand custom g-code)
id: validate_slice
continue-on-error: true
run: |
set +e
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -s -l 2 2>&1 | tee ${{ runner.temp }}/validate_slice.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]}
- name: validate custom presets - name: validate custom presets
id: validate_custom id: validate_custom
continue-on-error: true continue-on-error: true
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
fixtures_dir="${{ runner.temp }}/profile-fixtures" set +e
output_dir="${{ runner.temp }}/custom-preset-validation" curl -LJO https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip
combined_log="${{ runner.temp }}/validate_custom.log" unzip -q ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles
summary="${output_dir}/summary.md" ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_custom.log
release_url="https://github.com/OrcaSlicer/OrcaSlicer-profile-validator/releases/download/fixture-archive" exit ${PIPESTATUS[0]}
rm -rf "${fixtures_dir}" "${output_dir}" - name: Post error comment on PR
mkdir -p "${fixtures_dir}" "${output_dir}" if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
env:
curl -fsSL -o "${fixtures_dir}/manifest.json" "${release_url}/manifest.json" GH_TOKEN: ${{ github.token }}
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_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
run: | run: |
{ {
# Marker matched by check_profiles_comment.yml to delete prior comments.
echo "<!-- profile-validation-comment -->"
echo "## :x: Profile Validation Errors" echo "## :x: Profile Validation Errors"
echo "" echo ""
@@ -201,24 +89,6 @@ jobs:
echo "" echo ""
fi fi
if [ "${{ steps.validate_slice.outcome }}" = "failure" ]; then
echo "### Slice Validation Failed (custom g-code expansion)"
echo ""
echo '```'
head -c 30000 ${{ runner.temp }}/validate_slice.log || echo "No output captured"
echo '```'
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_custom.outcome }}" = "failure" ]; then if [ "${{ steps.validate_custom.outcome }}" = "failure" ]; then
echo "### Custom Preset Validation Failed" echo "### Custom Preset Validation Failed"
echo "" echo ""
@@ -230,18 +100,16 @@ jobs:
echo "---" echo "---"
echo "*Please fix the above errors and push a new commit.*" 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 gh pr comment ${{ github.event.pull_request.number }} --body-file ${{ runner.temp }}/pr_comment.md
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
- name: Fail if any check failed - name: Fail if any check failed
if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.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: | run: |
echo "One or more profile checks failed. See above for details." echo "One or more profile checks failed. See above for details."
exit 1 exit 1

View File

@@ -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

View File

@@ -20,14 +20,14 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Run Claude Code slash command - name: Run Claude Code slash command
uses: anthropics/claude-code-base-action@beta uses: anthropics/claude-code-base-action@beta
with: with:
prompt: "/dedupe ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}" prompt: "/dedupe ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}"
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
model: "claude-sonnet-4-5-20250929" claude_args: "--model claude-sonnet-4-5-20250929"
claude_env: | claude_env: |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -26,7 +26,7 @@ jobs:
remove-existing-swap-files: true remove-existing-swap-files: true
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Install Doxygen and Graphviz - name: Install Doxygen and Graphviz
run: | run: |

View File

@@ -1,361 +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;
}
localization-pr:
if: github.event_name == 'pull_request_target'
permissions:
contents: read
pull-requests: write
issues: write
runs-on: ubuntu-latest
steps:
- name: Auto-label and remind about the localization glossary
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 pr = context.payload.pull_request;
// List changed files once (mirrors the `localization/**` paths filter in check_locale.yml)
const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
per_page: 100
});
const touchesLocalization = files.some((file) => file.filename.startsWith('localization/'));
const onlyPoFiles = files.length > 0 && files.every((file) => file.filename.endsWith('.po'));
// If the PR changes only .po files, automatically apply the Localization label
if (onlyPoFiles) {
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['Localization']
});
core.info('Applied Localization label (PR changes only .po files).');
} catch (error) {
if (isPermissionDenied(error)) {
core.warning('Cannot add Localization label because token cannot write.');
} else {
throw error;
}
}
}
if (!touchesLocalization) {
core.info('No localization changes detected; skipping glossary reminder.');
return;
}
// Avoid posting the reminder twice (e.g. on reopen)
const marker = '<!-- localization-glossary-reminder -->';
const comments = await github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
per_page: 100
});
if (comments.some((comment) => (comment.body || '').includes(marker))) {
core.info('Glossary reminder already present; skipping.');
return;
}
try {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
body:
`${marker}\n` +
`Hi @${pr.user.login}, this PR changes translations (\`localization/**\`).\n\n` +
`Please make sure recurring terms follow the [Localization glossary](https://www.orcaslicer.com/wiki/localization_glossary), ` +
`so the same English term is always rendered the same way within a language and terms that must stay in English ` +
`(brand/product names, acronyms, file formats, G-code, macros/variables) are not translated.`
});
} catch (error) {
if (isPermissionDenied(error)) {
core.warning('Skipping glossary reminder because token cannot write comments.');
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}`);

View File

@@ -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'

View File

@@ -21,7 +21,7 @@ jobs:
steps: steps:
- name: Cache shellcheck download - name: Cache shellcheck download
id: cache-shellcheck-v0_11 id: cache-shellcheck-v0_11
uses: actions/cache@v6 uses: actions/cache@v5
with: with:
path: ~/shellcheck path: ~/shellcheck
key: ${{ runner.os }}-shellcheck-v0_11 key: ${{ runner.os }}-shellcheck-v0_11
@@ -36,7 +36,7 @@ jobs:
tar -xvf ~/sc.tar.xz -C ~ tar -xvf ~/sc.tar.xz -C ~
mv ~/shellcheck-"${INPUT_VERSION}"/shellcheck ~/shellcheck mv ~/shellcheck-"${INPUT_VERSION}"/shellcheck ~/shellcheck
- uses: actions/checkout@v7 - uses: actions/checkout@v6
with: with:
fetch-depth: 1 fetch-depth: 1

View File

@@ -1,77 +0,0 @@
name: Unit Tests
# Download a platform's test artifact, run ctest, and upload the JUnit
# results for aggregation. Called once per arch from build_all.yml.
on:
workflow_call:
inputs:
os:
required: true
type: string
artifact:
description: Test artifact uploaded by the build leg
required: true
type: string
test-dir:
description: Built tests dir; defaults to build/tests, override for arch-separated builds
required: false
type: string
default: build/tests
jobs:
unit_tests:
# Static "Unit Tests"; the per-arch label is the caller's job name, so the
# graph shows e.g. "Windows x64 / Unit Tests".
name: Unit Tests
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
# Tests reach outside tests/ at runtime: tests/data (TEST_DATA_DIR) and
# resources/profiles (PROFILES_DIR) by baked-in absolute path, plus
# resources/info (nozzle data) via resources_dir() during a real slice.
# Check out all of resources/ so no test hits a missing-file path.
sparse-checkout: |
.github
scripts
tests
resources
- name: Apt-Install Dependencies
if: runner.os == 'Linux' && !vars.SELF_HOSTED
uses: ./.github/actions/apt-install-deps
- name: Restore Test Artifact
uses: actions/download-artifact@v8
with:
name: ${{ inputs.artifact }}
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
useLocalCache: true
useCloudCache: true
- name: Unpackage and Run Unit Tests
timeout-minutes: 20
shell: bash
run: |
tar -xvf build_tests.tar
# Multi-config generators (Windows/macOS) need a config; Linux is single-config.
scripts/run_unit_tests.sh "${{ inputs.test-dir }}" "${{ runner.os != 'Linux' && 'Release' || '' }}"
- name: Upload Test Logs
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: unit-test-logs-${{ inputs.artifact }}
path: ${{ inputs.test-dir }}/**/*.log
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-${{ inputs.artifact }}
path: ctest_results.xml
retention-days: 5
if-no-files-found: warn
- name: Delete Test Artifact
if: success()
uses: geekyeggo/delete-artifact@v6
with:
name: ${{ inputs.artifact }}

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v7 uses: actions/checkout@v6
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6

View File

@@ -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
View File

@@ -36,7 +36,6 @@ src/OrcaSlicer-doc/
/deps/DL_CACHE/ /deps/DL_CACHE/
/deps/DL_CACHE /deps/DL_CACHE
**/.flatpak-builder/ **/.flatpak-builder/
*.no-debug.yml
resources/profiles/user/default resources/profiles/user/default
*.code-workspace *.code-workspace
deps_src/build/ deps_src/build/
@@ -44,8 +43,3 @@ test.js
/.cache/ /.cache/
.clangd .clangd
internal_docs/ internal_docs/
*.flatpak
/flatpak-repo/
# Python bytecode
__pycache__/
*.pyc

8
.idea/.gitignore generated vendored Normal file
View 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
View 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
View 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
View 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
View 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
View 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
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,65 +1,23 @@
# CLAUDE.md # Repository Guidelines
OrcaSlicer — open-source C++17 3D slicer. wxWidgets GUI, CMake build system. ## Project Structure & Module Organization
OrcaSlicers 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 ## Coding Style & Naming Conventions
# macOS `.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.
cmake --build build/arm64 --config RelWithDebInfo --target all --
# Linux ## Testing Guidelines
cmake --build build --config RelWithDebInfo --target all -- 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) ## Commit & Pull Request Guidelines
cmake --build . --config %build_type% --target ALL_BUILD -- -m 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 ## 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.
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.
- For translation changes (`localization/i18n/**/*.po`), check that recurring terms match the [Localization glossary](https://github.com/OrcaSlicer/OrcaSlicer_WIKI/blob/main/guides/localization_glossary.md) for that language.
## Localization & translations
- Translation catalogs live in `localization/i18n/<lang>/OrcaSlicer_<lang>.po`.
- When creating or reviewing translations, use the [Localization glossary](https://github.com/OrcaSlicer/OrcaSlicer_WIKI/blob/main/guides/localization_glossary.md) as the source of truth for recurring terms, so the same English term is always rendered the same way within a language and terms that must stay in English (brand/product names, acronyms, file formats, G-code, macros/variables) are not translated.
- If a term's established translation changes, update both the affected `.po` files and the glossary so they stay in sync.
- Only edit `msgstr` (never `msgid`); keep placeholders (`%s`, `%1%`, `\n`), context (`msgctxt`), and file encoding/line endings intact.

235
CLAUDE.md
View File

@@ -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

View File

@@ -1,9 +1,13 @@
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") 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() endif()
cmake_minimum_required(VERSION 3.13) 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 # 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/ # Having it there causes rebuilds of all targets on any CMakeLists.txt change under tests/
@@ -85,9 +89,10 @@ else ()
endif () endif ()
find_package(Git) find_package(Git)
if(DEFINED ENV{git_commit_hash} AND NOT "$ENV{git_commit_hash}" STREQUAL "") if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
message(STATUS "Specified git commit hash: $ENV{git_commit_hash}") if(DEFINED ENV{git_commit_hash} AND NOT "$ENV{git_commit_hash}" STREQUAL "")
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") message(STATUS "Specified git commit hash: $ENV{git_commit_hash}")
# Convert the given hash to short hash # Convert the given hash to short hash
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short "$ENV{git_commit_hash}" 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_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
else() else()
# No .git directory (e.g., Flatpak sandbox) — truncate directly # Check current Git commit hash
string(SUBSTRING "$ENV{git_commit_hash}" 0 7 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() 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() endif()
if(DEFINED ENV{SLIC3R_STATIC}) if(DEFINED ENV{SLIC3R_STATIC})
@@ -117,139 +119,15 @@ else()
set(SLIC3R_STATIC_INITIAL 1) set(SLIC3R_STATIC_INITIAL 1)
endif() endif()
option(SLIC3R_STATIC "Compile OrcaSlicer with static libraries (Boost, TBB)" ${SLIC3R_STATIC_INITIAL}) 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_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_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_PCH "Use precompiled headers" 1)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 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_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0) 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. # 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) 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) if (CMAKE_MACOSX_BUNDLE)
set(CMAKE_INSTALL_RPATH @executable_path/../Frameworks) set(CMAKE_INSTALL_RPATH @executable_path/../Frameworks)
endif() 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}") message(STATUS "Orca: IS_CROSS_COMPILE: ${IS_CROSS_COMPILE}")
endif () endif ()
@@ -293,7 +171,10 @@ option(BUILD_TESTS "Build unit tests" OFF)
option(ORCA_TOOLS "Build Orca tools" OFF) option(ORCA_TOOLS "Build Orca tools" OFF)
if (FLATPAK) 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(SLIC3R_FHS ON CACHE BOOL "" FORCE)
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SLIC3R_DESKTOP_INTEGRATION OFF CACHE BOOL "" FORCE) set(SLIC3R_DESKTOP_INTEGRATION OFF CACHE BOOL "" FORCE)
endif () endif ()
@@ -345,9 +226,7 @@ if (MSVC)
# /bigobj (Increase Number of Sections in .Obj file) # /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 # 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. # 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 add_compile_options(-bigobj -Zm520 /Zi)
# 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)
# Disable STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. # 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. #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) add_compile_options(-D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING)
@@ -358,11 +237,6 @@ if (MSVC)
# Disable warnings on comparison of unsigned and signed # Disable warnings on comparison of unsigned and signed
# C4018: signed/unsigned mismatch # C4018: signed/unsigned mismatch
add_compile_options(/wd4018) 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 () endif ()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15) 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. # 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 # 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(WIN32) if(NOT DEFINED WIN10SDK_PATH)
# if(NOT DEFINED WIN10SDK_PATH) if(DEFINED ENV{WIN10SDK_PATH})
# if(DEFINED ENV{WIN10SDK_PATH}) set(WIN10SDK_PATH "$ENV{WIN10SDK_PATH}")
# set(WIN10SDK_PATH "$ENV{WIN10SDK_PATH}") endif()
# endif() endif()
# endif() if(DEFINED WIN10SDK_PATH)
# if(DEFINED WIN10SDK_PATH) #BBS: modify win10sdk_path
# #BBS: modify win10sdk_path if (EXISTS "${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h")
# if (EXISTS "${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h") set(WIN10SDK_INCLUDE_PATH "${WIN10SDK_PATH}")
# set(WIN10SDK_INCLUDE_PATH "${WIN10SDK_PATH}") else()
# else() message("WIN10SDK_PATH is invalid: ${WIN10SDK_PATH}")
# message("WIN10SDK_PATH is invalid: ${WIN10SDK_PATH}") message("${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h was not found")
# message("${WIN10SDK_PATH}/winrt/windows.graphics.printing3d.h was not found") message("STL fixing by the Netfabb service will not be compiled")
# message("STL fixing by the Netfabb service will not be compiled") unset(WIN10SDK_PATH)
# unset(WIN10SDK_PATH) endif()
# endif() else()
# else() # Try to use the default Windows 10 SDK path.
# # Try to use the default Windows 10 SDK path. if (DEFINED ENV{WindowsSdkDir} AND DEFINED ENV{WindowsSDKVersion})
# if (DEFINED ENV{WindowsSdkDir} AND DEFINED ENV{WindowsSDKVersion}) set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}")
# set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}") else ()
# else () set(WIN10SDK_INCLUDE_PATH "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0")
# set(WIN10SDK_INCLUDE_PATH "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0") endif ()
# endif () if (NOT EXISTS "${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h")
# if (NOT EXISTS "${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h") message("${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h was not found")
# message("${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h was not found") message("STL fixing by the Netfabb service will not be compiled")
# message("STL fixing by the Netfabb service will not be compiled") unset(WIN10SDK_INCLUDE_PATH)
# unset(WIN10SDK_INCLUDE_PATH) endif()
# endif() endif()
# endif() if(WIN10SDK_INCLUDE_PATH)
# if(WIN10SDK_INCLUDE_PATH) message("Building with Win10 Netfabb STL fixing service support")
# message("Building with Win10 Netfabb STL fixing service support") add_definitions(-DHAS_WIN10SDK)
# add_definitions(-DHAS_WIN10SDK) include_directories(SYSTEM "${WIN10SDK_INCLUDE_PATH}")
# include_directories(SYSTEM "${WIN10SDK_INCLUDE_PATH}") else()
# else() message("Building without Win10 Netfabb STL fixing service support")
# message("Building without Win10 Netfabb STL fixing service support") endif()
# endif() endif()
# endif()
if (APPLE) if (APPLE)
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}") message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
@@ -506,6 +379,11 @@ endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(PkgConfig REQUIRED) 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. # Boost on Raspberry-Pi does not link to pthreads.
set(THREADS_PREFER_PTHREAD_FLAG ON) set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
@@ -558,11 +436,7 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
endif() endif()
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15) if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
include(CheckCXXCompilerFlag) add_compile_options(-Wno-error=enum-constexpr-conversion)
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()
endif() endif()
#GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see #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) add_compile_options(-Wno-unknown-pragmas)
endif() endif()
# Compress the debug info with zstd to save space in Flatpak CI builds # Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI
if(FLATPAK) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0) OR add_compile_options(-gz=zstd)
("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
add_compile_options(-gz=zstd)
endif()
endif() endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
@@ -616,8 +487,7 @@ if (APPLE)
endif () endif ()
if(MSVC) if(MSVC)
# Ignore truncating casts in initializers & constructors # 添加编译选项,忽略警告 C4305 (格式转换截断)
# https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4305
add_compile_options(/wd4305) add_compile_options(/wd4305)
endif() endif()
@@ -708,9 +578,6 @@ endif()
set(Boost_NO_SYSTEM_PATHS TRUE) 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_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_libs INTERFACE)
add_library(boost_headeronly INTERFACE) add_library(boost_headeronly INTERFACE)
@@ -795,6 +662,16 @@ endif()
## OPTIONAL packages ## 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 # Find expat or use bundled version
# Always use the system libexpat on Linux. # 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) set(OPENGL_LIBRARIES "-framework OpenGL" CACHE STRING "OpenGL framework" FORCE)
endif() 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_package(glfw3 REQUIRED)
# Find the Cereal serialization library # Find the Cereal serialization library
@@ -835,10 +722,10 @@ endif ()
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/i18n") set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/i18n")
set(BBL_L18N_DIR "${CMAKE_CURRENT_SOURCE_DIR}/localization/i18n") set(BBL_L18N_DIR "${CMAKE_CURRENT_SOURCE_DIR}/localization/i18n")
add_custom_target(gettext_make_pot add_custom_target(gettext_make_pot
COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_CTX:1,2c --keyword=_CTX_utf8:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost 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" -f "${BBL_L18N_DIR}/list.txt"
-o "${BBL_L18N_DIR}/OrcaSlicer.pot" -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} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate pot file from strings in the source tree" COMMENT "Generate pot file from strings in the source tree"
) )
@@ -875,86 +762,6 @@ endforeach()
find_package(NLopt 1.4 REQUIRED) 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) if(SLIC3R_STATIC)
set(OPENVDB_USE_STATIC_LIBS ON) set(OPENVDB_USE_STATIC_LIBS ON)
@@ -990,10 +797,8 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
set(_arch "x64") set(_arch "x64")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86") elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86")
set(_arch "x86") set(_arch "x86")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
set(_arch "arm64")
else () else ()
message(FATAL_ERROR "Unable to detect architecture: ${CMAKE_SYSTEM_PROCESSOR}") message(FATAL_ERROR "Unable to detect architecture")
endif () endif ()
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 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) configure_file(${LIBDIR}/dev-utils/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh USE_SOURCE_PERMISSIONS @ONLY)
endif() endif()
# Resources install target, configure fhs.hpp on UNIX # Resources install target, configure fhs.hpp on UNIX
if (WIN32) if (WIN32)
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources") 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) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries) include(InstallRequiredSystemLibraries)
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".") install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".")
@@ -1119,10 +922,7 @@ elseif (SLIC3R_FHS)
install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/ DESTINATION ${SLIC3R_FHS_RESOURCES} install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/ DESTINATION ${SLIC3R_FHS_RESOURCES}
PATTERN "*/udev" EXCLUDE PATTERN "*/udev" EXCLUDE
) )
if(ORCA_BUNDLED_UV_EXECUTABLE) install(FILES src/dev-utils/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
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)
foreach(SIZE 32 128 192) foreach(SIZE 32 128 192)
install(FILES ${SLIC3R_RESOURCES_DIR}/images/OrcaSlicer_${SIZE}px.png install(FILES ${SLIC3R_RESOURCES_DIR}/images/OrcaSlicer_${SIZE}px.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME OrcaSlicer.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME OrcaSlicer.png
@@ -1130,15 +930,9 @@ elseif (SLIC3R_FHS)
endforeach() endforeach()
elseif (CMAKE_MACOSX_BUNDLE) elseif (CMAKE_MACOSX_BUNDLE)
# install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/OrcaSlicer.app/Contents/resources") # 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 () 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") 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 () endif ()
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ".") 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_MINOR "${ORCA_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "${ORCA_VERSION_PATCH}") set (CPACK_PACKAGE_VERSION_PATCH "${ORCA_VERSION_PATCH}")
set (CPACK_PACKAGE_FILE_NAME "OrcaSlicer_Windows_Installer_V${SoftFever_VERSION}") 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_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_HOMEPAGE_URL "https://github.com/OrcaSlicer/OrcaSlicer")
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) 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_ICON "${CPACK_PACKAGE_ICON}")
set (CPACK_NSIS_MUI_UNIICON "${CPACK_PACKAGE_ICON}") set (CPACK_NSIS_MUI_UNIICON "${CPACK_PACKAGE_ICON}")
set (CPACK_NSIS_INSTALLED_ICON_NAME "$INSTDIR\\\\orca-slicer.exe") 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_CHECKSUM SHA256)
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OrcaSlicer") set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OrcaSlicer")
set (CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) set (CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)

View File

@@ -4,7 +4,7 @@
<img alt="OrcaSlicer logo" src="resources/images/OrcaSlicer.png" width="15%" height="15%"> <img alt="OrcaSlicer logo" src="resources/images/OrcaSlicer.png" width="15%" height="15%">
</picture> </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>
[![GitHub Repo stars](https://img.shields.io/github/stars/OrcaSlicer/OrcaSlicer)](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [![Build all](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml/badge.svg?branch=main)](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml) [![GitHub Repo stars](https://img.shields.io/github/stars/OrcaSlicer/OrcaSlicer)](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [![Build all](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml/badge.svg?branch=main)](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 links and community
#### Official Website: #### Official Website:
<a href="https://www.orcaslicer.com/" style="font-size:2em;">OrcaSlicer.com</a> <a href="https://www.orcaslicer.com/" style="font-size:2em;">OrcaSlicer.com</a>
#### Github Repository: #### 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> <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: #### 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://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>
#### Join our Discord community: #### 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> <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;"> <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 # 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. 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)** - **[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. 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. 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)** - **[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 # 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). 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> <details>
<summary>Troubleshooting</summary> <summary>Troubleshooting</summary>
- *If you have troubles to run the build, you might need to install following runtimes:* - *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) - [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
- [Details of this runtime](https://aka.ms/webview2) - [Details of this runtime](https://aka.ms/webview2)
- [Alternative Download Link Hosted by Microsoft](https://go.microsoft.com/fwlink/p/?LinkId=2124703) - [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) - [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) - [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` - This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142`
</details> </details>
Windows Package Manager Windows Package Manager
@@ -142,36 +137,14 @@ winget install --id=SoftFever.OrcaSlicer -e
![mac_security_setting](./SoftFever_doc/mac_security_setting.png) ![mac_security_setting](./SoftFever_doc/mac_security_setting.png)
</details> </details>
## Linux ## Linux (Ubuntu)
### Flathub (Recommended) 1. If you run into trouble executing it, try this command in the terminal:
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:
`chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage` `chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage`
# How to Compile # 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. 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. Their generous support enables me to purchase filaments and other essential 3D printing materials for the project.
Thank you! :) Thank you! :)
## Sponsors ## Sponsors:
<table> <table>
<tr> <tr>
@@ -217,21 +190,24 @@ Thank you! :)
## Support me ## 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://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://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> <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. [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
The OrcaSlicer logo was designed by community member [Justin Levine](https://github.com/jal-co). OrcaSlicer's logo is designed by community member Justin Levine (@freejstnalxndr).
# License # 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. - 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. - 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. - 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.

View File

@@ -5,7 +5,6 @@
# Based on the GitHub Actions workflow in .github/workflows/build_all.yml # Based on the GitHub Actions workflow in .github/workflows/build_all.yml
set -e set -e
SECONDS=0
# Colors for output # Colors for output
RED='\033[0;31m' RED='\033[0;31m'
@@ -22,8 +21,6 @@ INSTALL_RUNTIME=false
JOBS=$(nproc) JOBS=$(nproc)
FORCE_CLEAN=false FORCE_CLEAN=false
ENABLE_CCACHE=false ENABLE_CCACHE=false
DISABLE_ROFILES_FUSE=false
NO_DEBUGINFO=true
CACHE_DIR=".flatpak-builder" CACHE_DIR=".flatpak-builder"
# Help function # Help function
@@ -39,8 +36,6 @@ show_help() {
echo " -c, --cleanup Clean build directory before building" echo " -c, --cleanup Clean build directory before building"
echo " -f, --force-clean Force clean build (disables caching)" echo " -f, --force-clean Force clean build (disables caching)"
echo " --ccache Enable ccache for faster rebuilds (requires ccache in SDK)" 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 " --cache-dir DIR Flatpak builder cache directory [default: $CACHE_DIR]"
echo " -i, --install-runtime Install required Flatpak runtime and SDK" echo " -i, --install-runtime Install required Flatpak runtime and SDK"
echo " -h, --help Show this help message" echo " -h, --help Show this help message"
@@ -80,14 +75,6 @@ while [[ $# -gt 0 ]]; do
ENABLE_CCACHE=true ENABLE_CCACHE=true
shift shift
;; ;;
--disable-rofiles-fuse)
DISABLE_ROFILES_FUSE=true
shift
;;
--with-debuginfo)
NO_DEBUGINFO=false
shift
;;
--cache-dir) --cache-dir)
CACHE_DIR="$2" CACHE_DIR="$2"
shift 2 shift 2
@@ -199,22 +186,22 @@ echo -e "${GREEN}All required dependencies found${NC}"
# Install runtime and SDK if requested # Install runtime and SDK if requested
if [[ "$INSTALL_RUNTIME" == true ]]; then if [[ "$INSTALL_RUNTIME" == true ]]; then
echo -e "${YELLOW}Installing GNOME runtime and SDK...${NC}" 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.Platform//48
flatpak install --user -y flathub org.gnome.Sdk//50 flatpak install --user -y flathub org.gnome.Sdk//48
fi fi
# Check if required runtime is available # Check if required runtime is available
if ! flatpak info --user org.gnome.Platform//50 &> /dev/null; then if ! flatpak info --user org.gnome.Platform//48 &> /dev/null; then
echo -e "${RED}Error: GNOME Platform 50 runtime is not installed.${NC}" 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 "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 exit 1
fi fi
if ! flatpak info --user org.gnome.Sdk//50 &> /dev/null; then if ! flatpak info --user org.gnome.Sdk//48 &> /dev/null; then
echo -e "${RED}Error: GNOME SDK 50 is not installed.${NC}" echo -e "${RED}Error: GNOME SDK 48 is not installed.${NC}"
echo "Run with -i flag to install it automatically, or install manually:" 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 exit 1
fi fi
@@ -255,8 +242,8 @@ mkdir -p "$BUILD_DIR"
rm -rf "$BUILD_DIR/build-dir" rm -rf "$BUILD_DIR/build-dir"
# Check if flatpak manifest exists # Check if flatpak manifest exists
if [[ ! -f "./scripts/flatpak/com.orcaslicer.OrcaSlicer.yml" ]]; then if [[ ! -f "./scripts/flatpak/io.github.softfever.OrcaSlicer.yml" ]]; then
echo -e "${RED}Error: Flatpak manifest not found at scripts/flatpak/com.orcaslicer.OrcaSlicer.yml${NC}" echo -e "${RED}Error: Flatpak manifest not found at scripts/flatpak/io.github.softfever.OrcaSlicer.yml${NC}"
exit 1 exit 1
fi fi
@@ -292,7 +279,6 @@ BUILDER_ARGS=(
--verbose --verbose
--state-dir="$CACHE_DIR" --state-dir="$CACHE_DIR"
--jobs="$JOBS" --jobs="$JOBS"
--mirror-screenshots-url=https://dl.flathub.org/media/
) )
# Add force-clean only if explicitly requested (disables caching) # 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}" echo -e "${GREEN}Using ccache for compiler caching${NC}"
fi 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 \ if ! flatpak-builder \
"${BUILDER_ARGS[@]}" \ "${BUILDER_ARGS[@]}" \
"$BUILD_DIR/build-dir" \ "$BUILD_DIR/build-dir" \
"$MANIFEST"; then scripts/flatpak/io.github.softfever.OrcaSlicer.yml; then
echo -e "${RED}Error: flatpak-builder failed${NC}" echo -e "${RED}Error: flatpak-builder failed${NC}"
echo -e "${YELLOW}Check the build log above for details${NC}" echo -e "${YELLOW}Check the build log above for details${NC}"
rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
exit 1 exit 1
fi fi
# Clean up temp manifest
rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
# Create bundle # Create bundle
echo -e "${YELLOW}Creating Flatpak bundle...${NC}" echo -e "${YELLOW}Creating Flatpak bundle...${NC}"
if ! flatpak build-bundle \ if ! flatpak build-bundle \
"$BUILD_DIR/repo" \ "$BUILD_DIR/repo" \
"$BUNDLE_NAME" \ "$BUNDLE_NAME" \
com.orcaslicer.OrcaSlicer \ io.github.softfever.OrcaSlicer \
--arch="$ARCH"; then --arch="$ARCH"; then
echo -e "${RED}Error: Failed to create Flatpak bundle${NC}" echo -e "${RED}Error: Failed to create Flatpak bundle${NC}"
exit 1 exit 1
@@ -361,10 +328,10 @@ echo -e "${BLUE}To install the Flatpak:${NC}"
echo -e "flatpak install --user $BUNDLE_NAME" echo -e "flatpak install --user $BUNDLE_NAME"
echo "" echo ""
echo -e "${BLUE}To run OrcaSlicer:${NC}" echo -e "${BLUE}To run OrcaSlicer:${NC}"
echo -e "flatpak run com.orcaslicer.OrcaSlicer" echo -e "flatpak run io.github.softfever.OrcaSlicer"
echo "" echo ""
echo -e "${BLUE}To uninstall:${NC}" echo -e "${BLUE}To uninstall:${NC}"
echo -e "flatpak uninstall --user com.orcaslicer.OrcaSlicer" echo -e "flatpak uninstall --user io.github.softfever.OrcaSlicer"
echo "" echo ""
if [[ "$FORCE_CLEAN" != true ]]; then if [[ "$FORCE_CLEAN" != true ]]; then
echo -e "${BLUE}Cache Management:${NC}" 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 force a clean build: $0 -f"
echo -e "• To clean cache manually: rm -rf $CACHE_DIR" echo -e "• To clean cache manually: rm -rf $CACHE_DIR"
fi fi
elapsed=$SECONDS
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e # Exit immediately if a command exits with a non-zero status. set -e # Exit immediately if a command exits with a non-zero status.
SECONDS=0
SCRIPT_NAME=$(basename "$0") SCRIPT_NAME=$(basename "$0")
SCRIPT_PATH=$(dirname "$(readlink -f "${0}")") SCRIPT_PATH=$(dirname "$(readlink -f "${0}")")
@@ -8,7 +7,7 @@ SCRIPT_PATH=$(dirname "$(readlink -f "${0}")")
pushd "${SCRIPT_PATH}" > /dev/null pushd "${SCRIPT_PATH}" > /dev/null
function usage() { 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 " -1: limit builds to one core (where possible)"
echo " -j N: limit builds to N cores (where possible)" echo " -j N: limit builds to N cores (where possible)"
echo " -b: build in Debug mode" echo " -b: build in Debug mode"
@@ -17,8 +16,6 @@ function usage() {
echo " -d: download and build dependencies in ./deps/ (build prerequisite)" echo " -d: download and build dependencies in ./deps/ (build prerequisite)"
echo " -D: dry run" echo " -D: dry run"
echo " -e: build in RelWithDebInfo mode" 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 " -h: prints this help text"
echo " -i: build the Orca Slicer AppImage (optional)" echo " -i: build the Orca Slicer AppImage (optional)"
echo " -p: boost ccache hit rate by disabling precompiled headers (default: ON)" 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 " -L: use ld.lld as linker (if available)"
echo "For a first use, you want to './${SCRIPT_NAME} -u'" echo "For a first use, you want to './${SCRIPT_NAME} -u'"
echo " and then './${SCRIPT_NAME} -dsi'" 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" SLIC3R_PRECOMPILED_HEADERS="ON"
@@ -40,83 +34,60 @@ SLIC3R_PRECOMPILED_HEADERS="ON"
unset name unset name
BUILD_DIR=build BUILD_DIR=build
BUILD_CONFIG=Release BUILD_CONFIG=Release
FORWARDED_ARGS=() while getopts ":1j:bcCdDehiprstulL" opt ; do
while getopts ":1j:bcCdDeFghiprstulL" opt ; do
case ${opt} in case ${opt} in
1 ) 1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1 export CMAKE_BUILD_PARALLEL_LEVEL=1
FORWARDED_ARGS+=("-1")
;; ;;
j ) j )
export CMAKE_BUILD_PARALLEL_LEVEL=$OPTARG export CMAKE_BUILD_PARALLEL_LEVEL=$OPTARG
FORWARDED_ARGS+=("-j" "$OPTARG")
;; ;;
b ) b )
BUILD_DIR=build-dbg BUILD_DIR=build-dbg
BUILD_CONFIG=Debug BUILD_CONFIG=Debug
FORWARDED_ARGS+=("-b")
;; ;;
c ) c )
CLEAN_BUILD=1 CLEAN_BUILD=1
FORWARDED_ARGS+=("-c")
;; ;;
C ) C )
COLORED_OUTPUT="-DCOLORED_OUTPUT=ON" COLORED_OUTPUT="-DCOLORED_OUTPUT=ON"
FORWARDED_ARGS+=("-C")
;; ;;
d ) d )
BUILD_DEPS="1" BUILD_DEPS="1"
FORWARDED_ARGS+=("-d")
;; ;;
D ) D )
DRY_RUN="1" DRY_RUN="1"
FORWARDED_ARGS+=("-D")
;; ;;
e ) e )
BUILD_DIR=build-dbginfo BUILD_DIR=build-dbginfo
BUILD_CONFIG=RelWithDebInfo BUILD_CONFIG=RelWithDebInfo
FORWARDED_ARGS+=("-e")
;;
F )
CLEAN_DOCKER_IMAGE="1"
;;
g )
USE_DOCKER="1"
;; ;;
h ) usage h ) usage
exit 1 exit 1
;; ;;
i ) i )
BUILD_IMAGE="1" BUILD_IMAGE="1"
FORWARDED_ARGS+=("-i")
;; ;;
p ) p )
SLIC3R_PRECOMPILED_HEADERS="OFF" SLIC3R_PRECOMPILED_HEADERS="OFF"
FORWARDED_ARGS+=("-p")
;; ;;
r ) r )
SKIP_RAM_CHECK="1" SKIP_RAM_CHECK="1"
FORWARDED_ARGS+=("-r")
;; ;;
s ) s )
BUILD_ORCA="1" BUILD_ORCA="1"
FORWARDED_ARGS+=("-s")
;; ;;
t ) t )
BUILD_TESTS="1" BUILD_TESTS="1"
FORWARDED_ARGS+=("-t")
;; ;;
u ) u )
export UPDATE_LIB="1" export UPDATE_LIB="1"
FORWARDED_ARGS+=("-u")
;; ;;
l ) l )
USE_CLANG="1" USE_CLANG="1"
FORWARDED_ARGS+=("-l")
;; ;;
L ) L )
USE_LLD="1" USE_LLD="1"
FORWARDED_ARGS+=("-L")
;; ;;
* ) * )
echo "Unknown argument '${opt}', aborting." echo "Unknown argument '${opt}', aborting."
@@ -130,11 +101,6 @@ if [ ${OPTIND} -eq 1 ] ; then
exit 1 exit 1
fi fi
if [[ -n "${CLEAN_DOCKER_IMAGE}" ]] && [[ -z "${USE_DOCKER}" ]] ; then
echo "Error: -F requires -g."
exit 1
fi
function check_available_memory_and_disk() { function check_available_memory_and_disk() {
FREE_MEM_GB=$(free --gibi --total | grep 'Mem' | rev | cut --delimiter=" " --fields=1 | rev) FREE_MEM_GB=$(free --gibi --total | grep 'Mem' | rev | cut --delimiter=" " --fields=1 | rev)
MIN_MEM_GB=10 MIN_MEM_GB=10
@@ -172,275 +138,6 @@ function print_and_run() {
fi 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 # cmake 4.x compatibility workaround
export CMAKE_POLICY_VERSION_MINIMUM=3.5 export CMAKE_POLICY_VERSION_MINIMUM=3.5
@@ -454,8 +151,6 @@ elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" ==
DISTRIBUTION="debian" DISTRIBUTION="debian"
elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]] ; then elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]] ; then
DISTRIBUTION="arch" DISTRIBUTION="arch"
elif [[ "${DISTRIBUTION_LIKE}" == *"suse"* ]] ; then
DISTRIBUTION="suse"
fi fi
if [ ! -f "./scripts/linux.d/${DISTRIBUTION}" ] ; then if [ ! -f "./scripts/linux.d/${DISTRIBUTION}" ] ; then
@@ -504,26 +199,6 @@ if [[ -n "${USE_LLD}" ]] ; then
fi fi
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 if [[ -n "${BUILD_DEPS}" ]] ; then
echo "Configuring dependencies..." echo "Configuring dependencies..."
read -r -a BUILD_ARGS <<< "${DEPS_EXTRA_BUILD_ARGS}" 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}") BUILD_ARGS+=(-DCMAKE_BUILD_TYPE="${BUILD_CONFIG}")
fi 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 -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 -j1 print_and_run cmake --build deps/$BUILD_DIR
fi fi
if [[ -n "${BUILD_ORCA}" ]] || [[ -n "${BUILD_TESTS}" ]] ; then 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}") BUILD_ARGS+=(-DORCA_UPDATER_SIG_KEY="${ORCA_UPDATER_SIG_KEY}")
fi 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} \ -DSLIC3R_PCH=${SLIC3R_PRECOMPILED_HEADERS} \
-DORCA_TOOLS=ON \ -DORCA_TOOLS=ON \
"${COLORED_OUTPUT}" \ "${COLORED_OUTPUT}" \
@@ -591,7 +266,4 @@ if [[ -n "${BUILD_IMAGE}" || -n "${BUILD_ORCA}" ]] ; then
popd > /dev/null # build popd > /dev/null # build
fi fi
elapsed=$SECONDS
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))
popd > /dev/null # ${SCRIPT_PATH} popd > /dev/null # ${SCRIPT_PATH}

View File

@@ -2,9 +2,8 @@
set -e set -e
set -o pipefail 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 case "${opt}" in
d ) d )
export BUILD_TARGET="deps" export BUILD_TARGET="deps"
@@ -35,31 +34,23 @@ while getopts ":dpa:snt:xbc:i:1Tuh" opt; do
c ) c )
export BUILD_CONFIG="$OPTARG" export BUILD_CONFIG="$OPTARG"
;; ;;
i )
export CMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH:+$CMAKE_IGNORE_PREFIX_PATH;}$OPTARG"
;;
1 ) 1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1 export CMAKE_BUILD_PARALLEL_LEVEL=1
;; ;;
T ) T )
export BUILD_TESTS="1" export BUILD_TESTS="1"
;; ;;
u )
export BUILD_TARGET="universal"
;;
h ) echo "Usage: ./build_release_macos.sh [-d]" h ) echo "Usage: ./build_release_macos.sh [-d]"
echo " -d: Build deps only" echo " -d: Build deps only"
echo " -a: Set ARCHITECTURE (arm64 or x86_64 or universal)" echo " -a: Set ARCHITECTURE (arm64 or x86_64 or universal)"
echo " -s: Build slicer only" echo " -s: Build slicer only"
echo " -u: Build universal app only (requires existing arm64 and x86_64 app bundles)"
echo " -n: Nightly build" echo " -n: Nightly build"
echo " -t: Specify minimum version of the target platform, default is 11.3" 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 " -x: Use Ninja Multi-Config CMake generator, default is Xcode"
echo " -b: Build without reconfiguring CMake" echo " -b: Build without reconfiguring CMake"
echo " -c: Set CMake build configuration, default is Release" 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 " -1: Use single job for building"
echo " -T: Build and run tests (set ORCA_TESTS_BUILD_ONLY=1 to build without running)" echo " -T: Build and run tests"
exit 0 exit 0
;; ;;
* ) * )
@@ -98,10 +89,6 @@ if [ -z "$OSX_DEPLOYMENT_TARGET" ]; then
export OSX_DEPLOYMENT_TARGET="11.3" export OSX_DEPLOYMENT_TARGET="11.3"
fi 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/') CMAKE_VERSION=$(cmake --version | head -1 | sed 's/[^0-9]*\([0-9]*\).*/\1/')
if [ "$CMAKE_VERSION" -ge 4 ] 2>/dev/null; then if [ "$CMAKE_VERSION" -ge 4 ] 2>/dev/null; then
export CMAKE_POLICY_VERSION_MINIMUM=3.5 export CMAKE_POLICY_VERSION_MINIMUM=3.5
@@ -117,7 +104,6 @@ echo " - BUILD_CONFIG: $BUILD_CONFIG"
echo " - BUILD_TARGET: $BUILD_TARGET" echo " - BUILD_TARGET: $BUILD_TARGET"
echo " - CMAKE_GENERATOR: $SLICER_CMAKE_GENERATOR for Slicer, $DEPS_CMAKE_GENERATOR for deps" echo " - CMAKE_GENERATOR: $SLICER_CMAKE_GENERATOR for Slicer, $DEPS_CMAKE_GENERATOR for deps"
echo " - OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET" echo " - OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET"
echo " - CMAKE_IGNORE_PREFIX_PATH: $CMAKE_IGNORE_PREFIX_PATH"
echo echo
# if which -s brew; then # if which -s brew; then
@@ -161,7 +147,6 @@ function build_deps() {
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \ -DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
-DCMAKE_OSX_ARCHITECTURES:STRING="${_ARCH}" \ -DCMAKE_OSX_ARCHITECTURES:STRING="${_ARCH}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \
-DCMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH}" \
${CMAKE_POLICY_COMPAT} ${CMAKE_POLICY_COMPAT}
fi fi
cmake --build . --config "$BUILD_CONFIG" --target deps 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() { function build_slicer() {
# iterate over two architectures: x86_64 and arm64 # iterate over two architectures: x86_64 and arm64
for _ARCH in x86_64 arm64; do for _ARCH in x86_64 arm64; do
@@ -242,16 +188,18 @@ function build_slicer() {
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \ -DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
-DCMAKE_OSX_ARCHITECTURES="${_ARCH}" \ -DCMAKE_OSX_ARCHITECTURES="${_ARCH}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \
-DCMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH}" \
${CMAKE_POLICY_COMPAT} ${CMAKE_POLICY_COMPAT}
fi fi
cmake --build . --config "$BUILD_CONFIG" --target "$SLICER_BUILD_TARGET" cmake --build . --config "$BUILD_CONFIG" --target "$SLICER_BUILD_TARGET"
) )
# -T also runs the tests; ORCA_TESTS_BUILD_ONLY=1 builds them without if [ "1." == "$BUILD_TESTS". ]; then
# running, so CI can build here and run them in a dedicated job. echo "Running tests for $_ARCH..."
if [ "1." == "$BUILD_TESTS". ] && [ "1." != "$ORCA_TESTS_BUILD_ONLY". ]; then (
"$PROJECT_DIR/scripts/run_unit_tests.sh" "build/$_ARCH/tests" "$BUILD_CONFIG" set -x
cd "$PROJECT_BUILD_DIR"
ctest --build-config "$BUILD_CONFIG" --output-on-failure
)
fi fi
echo "Verify localization with gettext..." echo "Verify localization with gettext..."
@@ -275,8 +223,6 @@ function build_slicer() {
cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources
# delete .DS_Store file # delete .DS_Store file
find ./OrcaSlicer.app/ -name '.DS_Store' -delete find ./OrcaSlicer.app/ -name '.DS_Store' -delete
verify_python_runtime ./OrcaSlicer.app
# Copy OrcaSlicer_profile_validator.app if it exists # 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 if [ -f "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
@@ -285,7 +231,6 @@ function build_slicer() {
cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app" ./OrcaSlicer_profile_validator.app cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app" ./OrcaSlicer_profile_validator.app
# delete .DS_Store file # delete .DS_Store file
find ./OrcaSlicer_profile_validator.app/ -name '.DS_Store' -delete find ./OrcaSlicer_profile_validator.app/ -name '.DS_Store' -delete
verify_python_runtime ./OrcaSlicer_profile_validator.app
fi fi
) )
@@ -304,55 +249,48 @@ function build_slicer() {
done 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() { function build_universal() {
echo "Building universal binary..." echo "Building universal binary..."
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$ARCH" 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" mkdir -p "$PROJECT_BUILD_DIR/OrcaSlicer"
UNIVERSAL_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer.app" UNIVERSAL_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer.app"
rm -rf "$UNIVERSAL_APP" rm -rf "$UNIVERSAL_APP"
cp -R "$ARM64_APP" "$UNIVERSAL_APP" cp -R "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer.app" "$UNIVERSAL_APP"
echo "Creating universal binaries for OrcaSlicer.app..." # Get the binary path inside the .app bundle
lipo_dir "$UNIVERSAL_APP" "$X86_64_APP" BINARY_PATH="Contents/MacOS/OrcaSlicer"
echo "Universal OrcaSlicer.app created at $UNIVERSAL_APP"
verify_python_runtime "$UNIVERSAL_APP" # 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 # Create universal binary for profile validator if it exists
ARM64_VALIDATOR="$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app" if [ -f "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ] && \
X86_64_VALIDATOR="$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app" [ -f "$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
if [ -d "$ARM64_VALIDATOR" ] && [ -d "$X86_64_VALIDATOR" ]; then echo "Creating universal binary for OrcaSlicer_profile_validator..."
echo "Creating universal binaries for OrcaSlicer_profile_validator.app..."
UNIVERSAL_VALIDATOR_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer_profile_validator.app" UNIVERSAL_VALIDATOR_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer_profile_validator.app"
rm -rf "$UNIVERSAL_VALIDATOR_APP" rm -rf "$UNIVERSAL_VALIDATOR_APP"
cp -R "$ARM64_VALIDATOR" "$UNIVERSAL_VALIDATOR_APP" cp -R "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app" "$UNIVERSAL_VALIDATOR_APP"
lipo_dir "$UNIVERSAL_VALIDATOR_APP" "$X86_64_VALIDATOR"
echo "Universal OrcaSlicer_profile_validator.app created at $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 fi
} }
@@ -367,22 +305,16 @@ case "${BUILD_TARGET}" in
slicer) slicer)
build_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 exit 1
;; ;;
esac esac
if [ "$ARCH" = "universal" ] && { [ "$BUILD_TARGET" = "all" ] || [ "$BUILD_TARGET" = "slicer" ]; }; then if [ "$ARCH" = "universal" ] && [ "$BUILD_TARGET" != "deps" ]; then
build_universal build_universal
fi fi
if [ "1." == "$PACK_DEPS". ]; then if [ "1." == "$PACK_DEPS". ]; then
pack_deps pack_deps
fi fi
elapsed=$SECONDS
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))

View File

@@ -1,18 +1,6 @@
@REM OrcaSlicer build script for Windows with VS auto-detect @REM OrcaSlicer build script for Windows with VS auto-detect
@echo off @echo off
set WP=%CD% 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) @REM Check for Ninja Multi-Config option (-x)
set USE_NINJA=0 set USE_NINJA=0
@@ -20,12 +8,6 @@ for %%a in (%*) do (
if "%%a"=="-x" set USE_NINJA=1 if "%%a"=="-x" set USE_NINJA=1
) )
@REM Check for unit-tests option ("tests")
set BUILD_TESTS=OFF
for %%a in (%*) do (
if /I "%%a"=="tests" set BUILD_TESTS=ON
)
if "%USE_NINJA%"=="1" ( if "%USE_NINJA%"=="1" (
echo Using Ninja Multi-Config generator echo Using Ninja Multi-Config generator
set CMAKE_GENERATOR="Ninja Multi-Config" set CMAKE_GENERATOR="Ninja Multi-Config"
@@ -85,14 +67,13 @@ echo Using CMake generator: %CMAKE_GENERATOR%
@REM Pack deps @REM Pack deps
if "%1"=="pack" ( if "%1"=="pack" (
setlocal ENABLEDELAYEDEXPANSION setlocal ENABLEDELAYEDEXPANSION
cd %WP%/deps/build 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 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 %WP%/tools/7z.exe a OrcaSlicer_dep_win64_!build_date!_vs!VS_VERSION!.zip OrcaSlicer_dep
goto :done exit /b 0
) )
set debug=OFF set debug=OFF
@@ -113,10 +94,9 @@ if "%debug%"=="ON" (
set build_dir=build set build_dir=build
) )
) )
if "%arch%"=="ARM64" set build_dir=%build_dir%-arm64 echo build type set to %build_type%
echo build type set to %build_type%, arch=%arch%
setlocal DISABLEDELAYEDEXPANSION setlocal DISABLEDELAYEDEXPANSION
cd deps cd deps
mkdir %build_dir% mkdir %build_dir%
cd %build_dir% cd %build_dir%
@@ -135,12 +115,12 @@ if "%USE_NINJA%"=="1" (
cmake ../ -G %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%build_type% cmake ../ -G %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%build_type%
cmake --build . --config %build_type% --target deps cmake --build . --config %build_type% --target deps
) else ( ) 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 cmake --build . --config %build_type% --target deps -- -m
) )
@echo off @echo off
if "%1"=="deps" goto :done if "%1"=="deps" exit /b 0
:slicer :slicer
echo "building Orca Slicer..." echo "building Orca Slicer..."
@@ -151,10 +131,10 @@ cd %build_dir%
echo on echo on
set CMAKE_POLICY_VERSION_MINIMUM=3.5 set CMAKE_POLICY_VERSION_MINIMUM=3.5
if "%USE_NINJA%"=="1" ( if "%USE_NINJA%"=="1" (
cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DBUILD_TESTS=%BUILD_TESTS% -DCMAKE_BUILD_TYPE=%build_type% cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
cmake --build . --config %build_type% --target ALL_BUILD cmake --build . --config %build_type% --target ALL_BUILD
) else ( ) else (
cmake .. -G %CMAKE_GENERATOR% -A %arch% -DORCA_TOOLS=ON %SIG_FLAG% -DBUILD_TESTS=%BUILD_TESTS% -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 cmake --build . --config %build_type% --target ALL_BUILD -- -m
) )
@echo off @echo off
@@ -162,16 +142,3 @@ cd ..
call scripts/run_gettext.bat call scripts/run_gettext.bat
cd %build_dir% cd %build_dir%
cmake --build . --target install --config %build_type% 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

View File

@@ -15,18 +15,10 @@ if "%1"=="pack" (
set debug=OFF set debug=OFF
set debuginfo=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 "%1"=="debug" set debug=ON
if "%2"=="debug" set debug=ON if "%2"=="debug" set debug=ON
if "%1"=="debuginfo" set debuginfo=ON if "%1"=="debuginfo" set debuginfo=ON
if "%2"=="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" ( if "%debug%"=="ON" (
set build_type=Debug set build_type=Debug
set build_dir=build-dbg set build_dir=build-dbg
@@ -39,8 +31,7 @@ if "%debug%"=="ON" (
set build_dir=build set build_dir=build
) )
) )
if "%arch%"=="ARM64" set build_dir=%build_dir%-arm64 echo build type set to %build_type%
echo build type set to %build_type%, arch=%arch%
setlocal DISABLEDELAYEDEXPANSION setlocal DISABLEDELAYEDEXPANSION
cd deps cd deps
@@ -57,7 +48,7 @@ echo "building deps.."
echo on echo on
REM Set minimum CMake policy to avoid <3.5 errors REM Set minimum CMake policy to avoid <3.5 errors
set CMAKE_POLICY_VERSION_MINIMUM=3.5 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 cmake --build . --config %build_type% --target deps -- -m
@echo off @echo off
@@ -71,7 +62,7 @@ cd %build_dir%
echo on echo on
set CMAKE_POLICY_VERSION_MINIMUM=3.5 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 cmake --build . --config %build_type% --target ALL_BUILD -- -m
@echo off @echo off
cd .. cd ..

View 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)

View File

@@ -124,8 +124,6 @@ endif()
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64" OR "${CMAKE_GENERATOR}" MATCHES "Win64") if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64" OR "${CMAKE_GENERATOR}" MATCHES "Win64")
set(_arch "x64") set(_arch "x64")
elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "ARM64")
set(_arch "x64") # GLEW ships one header set; ARM64 uses the x64 import path
else() else()
set(_arch "Win32") set(_arch "Win32")
endif() endif()

View File

@@ -11,7 +11,7 @@
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string> <string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.orcaslicer.OrcaSlicer</string> <string>com.softfever3d.orca-slicer</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleLongVersionString</key> <key>CFBundleLongVersionString</key>

View File

@@ -10,22 +10,7 @@ if (APPLE AND CMAKE_OSX_ARCHITECTURES)
set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=${CMAKE_OSX_ARCHITECTURES}") set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=${CMAKE_OSX_ARCHITECTURES}")
endif () 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 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 "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz"
URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95 URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95
LIST_SEPARATOR | LIST_SEPARATOR |
@@ -33,11 +18,9 @@ orcaslicer_add_cmake_project(Boost
-DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|stacktrace|wave|test -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 -DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros
-DBUILD_TESTING:BOOL=OFF -DBUILD_TESTING:BOOL=OFF
-DBOOST_IOSTREAMS_ENABLE_BZIP2:BOOL=OFF # avoid libbz2 soname differences in AppImage builds
-DBOOST_IOSTREAMS_ENABLE_ZSTD:BOOL=OFF -DBOOST_IOSTREAMS_ENABLE_ZSTD:BOOL=OFF
"${_context_abi_line}" "${_context_abi_line}"
"${_context_arch_line}" "${_context_arch_line}"
"${_context_impl_line}"
) )
set(DEP_Boost_DEPENDS ZLIB) set(DEP_Boost_DEPENDS ZLIB)

View File

@@ -9,7 +9,7 @@ orcaslicer_add_cmake_project(
# For whatever reason, this keeps downloading forever (repeats downloads if finished) # 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 https://github.com/CGAL/cgal/releases/download/v5.6.3/CGAL-5.6.3.zip
URL_HASH SHA256=5d577acb4a9918ccb960491482da7a3838f8d363aff47e14d703f19fd84733d4 URL_HASH SHA256=5d577acb4a9918ccb960491482da7a3838f8d363aff47e14d703f19fd84733d4
DEPENDS dep_Boost dep_Eigen dep_GMP dep_MPFR DEPENDS dep_Boost dep_GMP dep_MPFR
) )
include(GNUInstallDirs) include(GNUInstallDirs)

72
deps/CMakeLists.txt vendored
View File

@@ -134,7 +134,7 @@ if (APPLE)
endif () 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: # FIXME:
# Enabling this option is not safe. IGL will compile itself with its own version of Eigen while # 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. # 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) 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) set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix)
if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE) if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
@@ -155,37 +155,22 @@ if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
endif () endif ()
function(orcaslicer_add_cmake_project projectname) 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}) set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
if (_is_multi OR MSVC) if (_is_multi OR MSVC)
if (P_ARGS_FORWARD_CONFIG) if (ORCA_INCLUDE_DEBUG_INFO AND NOT DEP_DEBUG)
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
elseif (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}") set(_configs_line "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
else () else ()
set(_configs_line "") set(_configs_line "")
endif () endif ()
endif () endif ()
if (P_ARGS_FORWARD_CONFIG) set(_gen "")
set(_target_config "$<CONFIG>") set(_build_j "-j${NPROC}")
else()
set(_target_config "Release")
endif()
if (MSVC) if (MSVC)
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}") set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
else() set(_build_j "/m")
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}")
endif () endif ()
if (NOT IS_CROSS_COMPILE OR NOT APPLE) 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_INSTALL_PREFIX:STRING=${DESTDIR}
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules -DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR} -DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
-DCMAKE_IGNORE_PREFIX_PATH:STRING=${CMAKE_IGNORE_PREFIX_PATH}
-DCMAKE_DEBUG_POSTFIX:STRING=d -DCMAKE_DEBUG_POSTFIX:STRING=d
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_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_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 -DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch} ${_cmake_osx_arch}
"${_configs_line}" "${_configs_line}"
${DEP_CMAKE_OPTS} ${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS} ${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS} ${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${_target_config} -- ${_build_j} BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${_target_config} INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
) )
if (FLATPAK) if (FLATPAK)
@@ -250,17 +229,14 @@ else()
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR} -DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
-DCMAKE_PREFIX_PATH: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 -DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch} ${_cmake_osx_arch}
"${_configs_line}" "${_configs_line}"
${DEP_CMAKE_OPTS} ${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS} ${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS} ${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${_target_config} -- ${_build_j} BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${_target_config} INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
) )
endif() endif()
@@ -277,12 +253,8 @@ if (MSVC)
message(STATUS "\nDetected X86 compiler => building X86 deps bundle\n") message(STATUS "\nDetected X86 compiler => building X86 deps bundle\n")
set(DEPS_ARCH "x86") set(DEPS_ARCH "x86")
include("deps-windows.cmake") 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 () else ()
message(FATAL_ERROR "Unable to detect architecture: ${CMAKE_SYSTEM_PROCESSOR}") message(FATAL_ERROR "Unable to detect architecture")
endif () endif ()
elseif (APPLE) elseif (APPLE)
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}") message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
@@ -324,26 +296,26 @@ if(FLATPAK)
endif() endif()
set(ZLIB_PKG "") set(ZLIB_PKG "")
if (NOT ZLIB_FOUND) if (NOT ZLIB_FOUND)
include(ZLIB/ZLIB.cmake) include(ZLIB/ZLIB.cmake)
set(ZLIB_PKG dep_ZLIB) set(ZLIB_PKG dep_ZLIB)
endif () endif ()
set(PNG_PKG "") set(PNG_PKG "")
if (NOT PNG_FOUND) if (NOT PNG_FOUND)
include(PNG/PNG.cmake) include(PNG/PNG.cmake)
set(PNG_PKG dep_PNG) set(PNG_PKG dep_PNG)
endif () endif ()
set(EXPAT_PKG "") set(EXPAT_PKG "")
find_package(EXPAT) find_package(EXPAT)
if (NOT EXPAT_FOUND) if (NOT EXPAT_FOUND)
include(EXPAT/EXPAT.cmake) include(EXPAT/EXPAT.cmake)
set(EXPAT_PKG dep_EXPAT) set(EXPAT_PKG dep_EXPAT)
endif () endif ()
# The order of includes respects the dependencies between libraries
set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time) set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time)
include(Boost/Boost.cmake) include(Boost/Boost.cmake)
# The order of includes respects the dependencies between libraries
include(Cereal/Cereal.cmake) include(Cereal/Cereal.cmake)
include(Qhull/Qhull.cmake) include(Qhull/Qhull.cmake)
include(GLEW/GLEW.cmake) include(GLEW/GLEW.cmake)
@@ -359,7 +331,6 @@ include(OpenVDB/OpenVDB.cmake)
include(GMP/GMP.cmake) include(GMP/GMP.cmake)
include(MPFR/MPFR.cmake) include(MPFR/MPFR.cmake)
include(Eigen/Eigen.cmake)
include(CGAL/CGAL.cmake) include(CGAL/CGAL.cmake)
include(NLopt/NLopt.cmake) include(NLopt/NLopt.cmake)
@@ -371,7 +342,7 @@ include(Draco/Draco.cmake)
# I *think* 1.1 is used for *just* md5 hashing? # 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 # 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 # 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 "") set(OPENSSL_PKG "")
if(NOT OPENSSL_FOUND) if(NOT OPENSSL_FOUND)
include(OpenSSL/OpenSSL.cmake) include(OpenSSL/OpenSSL.cmake)
@@ -379,7 +350,7 @@ if(NOT OPENSSL_FOUND)
endif() endif()
# we don't want to load a "wrong" openssl when loading curl # 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 # ...i think this is how it works? change if wrong
set(CURL_PKG "") set(CURL_PKG "")
if (NOT OPENSSL_FOUND OR NOT CURL_FOUND) if (NOT OPENSSL_FOUND OR NOT CURL_FOUND)
@@ -403,7 +374,7 @@ endif()
set(FREETYPE_PKG "") set(FREETYPE_PKG "")
if(NOT FREETYPE_FOUND) if(NOT FREETYPE_FOUND)
include(FREETYPE/FREETYPE.cmake) include(FREETYPE/FREETYPE.cmake)
set(FREETYPE_PKG "dep_FREETYPE") set(FREETYPE_PKG "dep_FREETYPE")
endif() endif()
execute_process( execute_process(
@@ -422,7 +393,6 @@ endif ()
include(OCCT/OCCT.cmake) include(OCCT/OCCT.cmake)
include(OpenCV/OpenCV.cmake) include(OpenCV/OpenCV.cmake)
include(python3/python3.cmake)
set(_dep_list set(_dep_list
dep_Boost dep_Boost
@@ -436,7 +406,6 @@ set(_dep_list
dep_OpenVDB dep_OpenVDB
dep_OpenCSG dep_OpenCSG
dep_OpenCV dep_OpenCV
dep_Eigen
dep_CGAL dep_CGAL
dep_GLFW dep_GLFW
dep_OCCT dep_OCCT
@@ -445,7 +414,6 @@ set(_dep_list
${ZLIB_PKG} ${ZLIB_PKG}
${EXPAT_PKG} ${EXPAT_PKG}
dep_libnoise dep_libnoise
dep_python3
) )
if (MSVC) if (MSVC)

View File

@@ -1,10 +1,4 @@
set(_options "")
if (MSVC AND DEP_DEBUG)
set(_options "FORWARD_CONFIG")
endif ()
orcaslicer_add_cmake_project(Draco orcaslicer_add_cmake_project(Draco
${_options}
URL https://github.com/google/draco/archive/refs/tags/1.5.7.zip URL https://github.com/google/draco/archive/refs/tags/1.5.7.zip
URL_HASH SHA256=27b72ba2d5ff3d0a9814ad40d4cb88f8dc89a35491c0866d952473f8f9416b77 URL_HASH SHA256=27b72ba2d5ff3d0a9814ad40d4cb88f8dc89a35491c0866d952473f8f9416b77
) )

View File

@@ -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
)

16
deps/GLFW/GLFW.cmake vendored
View File

@@ -6,20 +6,22 @@ else()
set(_build_static ON) set(_build_static ON)
endif() endif()
set(_glfw_platform_args "")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 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() endif()
orcaslicer_add_cmake_project(GLFW orcaslicer_add_cmake_project(GLFW
URL https://github.com/glfw/glfw/archive/refs/tags/3.4.zip URL https://github.com/glfw/glfw/archive/refs/tags/3.3.7.zip
URL_HASH SHA256=a133ddc3d3c66143eba9035621db8e0bcf34dba1ee9514a9e23e96afd39fd57a URL_HASH SHA256=e02d956935e5b9fb4abf90e2c2e07c9a0526d7eacae8ee5353484c69a2a76cd0
#DEPENDS dep_Boost
CMAKE_ARGS CMAKE_ARGS
-DBUILD_SHARED_LIBS=${_build_shared} -DBUILD_SHARED_LIBS=${_build_shared}
-DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_DOCS=OFF
-DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_EXAMPLES=OFF
-DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_TESTS=OFF
${_glfw_platform_args} ${_glfw_use_wayland}
) )
if (MSVC) if (MSVC)

2
deps/GMP/GMP.cmake vendored
View File

@@ -65,7 +65,7 @@ else ()
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
PATCH_COMMAND git apply ${GMP_DIRECTORY_FLAG} --verbose ${CMAKE_CURRENT_LIST_DIR}/0001-GMP_GCC15.patch PATCH_COMMAND git apply ${GMP_DIRECTORY_FLAG} --verbose ${CMAKE_CURRENT_LIST_DIR}/0001-GMP_GCC15.patch
BUILD_IN_SOURCE ON 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 BUILD_COMMAND make -j
INSTALL_COMMAND make install INSTALL_COMMAND make install
) )

Binary file not shown.

Binary file not shown.

View File

@@ -31,7 +31,7 @@ else ()
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
BUILD_IN_SOURCE ON BUILD_IN_SOURCE ON
CONFIGURE_COMMAND autoreconf -f -i && 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 BUILD_COMMAND make -j
INSTALL_COMMAND make install INSTALL_COMMAND make install
DEPENDS dep_GMP DEPENDS dep_GMP

Binary file not shown.

Binary file not shown.

View File

@@ -16,7 +16,6 @@ orcaslicer_add_cmake_project(OCCT
#DEPENDS dep_Boost #DEPENDS dep_Boost
DEPENDS ${FREETYPE_PKG} DEPENDS ${FREETYPE_PKG}
CMAKE_ARGS CMAKE_ARGS
-DCMAKE_CXX_STANDARD=17
-DBUILD_LIBRARY_TYPE=${library_build_type} -DBUILD_LIBRARY_TYPE=${library_build_type}
-DUSE_TK=OFF -DUSE_TK=OFF
-DUSE_TBB=OFF -DUSE_TBB=OFF

View File

@@ -1,13 +1,7 @@
# Intel IPP / IPP-ICV is x86/x64 only — there is no ARM64 build, so enabling it if (MSVC)
# leaves ~200 unresolved ippicv* externals at link time on Windows ARM64.
if (MSVC AND NOT "${DEPS_ARCH}" STREQUAL "arm64")
set(_use_IPP "-DWITH_IPP=ON") set(_use_IPP "-DWITH_IPP=ON")
if (DEP_DEBUG)
set(_options "FORWARD_CONFIG")
endif ()
else () else ()
set(_use_IPP "-DWITH_IPP=OFF") set(_use_IPP "-DWITH_IPP=OFF")
set(_options "")
endif () endif ()
if (IN_GIT_REPO) if (IN_GIT_REPO)
@@ -15,7 +9,6 @@ if (IN_GIT_REPO)
endif () endif ()
orcaslicer_add_cmake_project(OpenCV orcaslicer_add_cmake_project(OpenCV
${_options}
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277 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 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_VTK=OFF
-DWITH_JPEG=OFF -DWITH_JPEG=OFF
-DWITH_WEBP=OFF -DWITH_WEBP=OFF
-DWITH_TIFF=OFF
-DBUILD_TIFF=OFF
-DENABLE_PRECOMPILED_HEADERS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF
-DINSTALL_TESTS=OFF -DINSTALL_TESTS=OFF
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF

View File

@@ -32,17 +32,6 @@ else()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OpenEXR-GCC13.patch) 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 () else ()
set(_patch_cmd "") set(_patch_cmd "")
endif () endif ()
@@ -60,7 +49,6 @@ orcaslicer_add_cmake_project(OpenEXR
-DPYILMBASE_ENABLE:BOOL=OFF -DPYILMBASE_ENABLE:BOOL=OFF
-DOPENEXR_VIEWERS_ENABLE:BOOL=OFF -DOPENEXR_VIEWERS_ENABLE:BOOL=OFF
-DOPENEXR_BUILD_UTILS:BOOL=OFF -DOPENEXR_BUILD_UTILS:BOOL=OFF
${_openexr_arm64_args}
) )
endif() endif()

View File

@@ -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()

View File

@@ -6,11 +6,7 @@ if(DEFINED OPENSSL_ARCH)
set(_cross_arch ${OPENSSL_ARCH}) set(_cross_arch ${OPENSSL_ARCH})
else() else()
if(WIN32) if(WIN32)
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64") set(_cross_arch "VC-WIN64A")
set(_cross_arch "VC-WIN64-ARM")
else()
set(_cross_arch "VC-WIN64A")
endif()
elseif(APPLE) elseif(APPLE)
set(_cross_arch "darwin64-${CMAKE_OSX_ARCHITECTURES}-cc") set(_cross_arch "darwin64-${CMAKE_OSX_ARCHITECTURES}-cc")
endif() endif()
@@ -25,7 +21,7 @@ else()
if(APPLE) if(APPLE)
set(_conf_cmd export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} && ./Configure -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}) set(_conf_cmd export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} && ./Configure -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
else() else()
set(_conf_cmd env "CC=${CMAKE_C_COMPILER}" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" "./config") set(_conf_cmd "./config")
endif() endif()
set(_cross_comp_prefix_line "") set(_cross_comp_prefix_line "")
set(_make_cmd make -j${NPROC}) set(_make_cmd make -j${NPROC})

2
deps/TBB/TBB.cmake vendored
View File

@@ -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) set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake ./cmake/compilers/GNU.cmake)
else() else()
set(_patch_command "") set(_patch_command "")

View File

@@ -36,10 +36,8 @@ if ("${DEPS_ARCH}" STREQUAL "x86")
set(DEP_PLATFORM "Win32") set(DEP_PLATFORM "Win32")
elseif ("${DEPS_ARCH}" STREQUAL "x64") elseif ("${DEPS_ARCH}" STREQUAL "x64")
set(DEP_PLATFORM "x64") set(DEP_PLATFORM "x64")
elseif ("${DEPS_ARCH}" STREQUAL "arm64")
set(DEP_PLATFORM "ARM64")
else () else ()
message(FATAL_ERROR "Unsupported OS architecture: ${DEPS_ARCH}") message(FATAL_ERROR "Unsupported OS architecture")
endif () endif ()
if (${DEP_DEBUG}) if (${DEP_DEBUG})
@@ -66,11 +64,8 @@ if ("${DEPS_ARCH}" STREQUAL "x86")
elseif ("${DEPS_ARCH}" STREQUAL "x64") elseif ("${DEPS_ARCH}" STREQUAL "x64")
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64") set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib") 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 () else ()
message(FATAL_ERROR "Unsupported OS architecture: ${DEPS_ARCH}") message(FATAL_ERROR "Unsupported OS architecture")
endif () endif ()
find_package(Git REQUIRED) find_package(Git REQUIRED)

View File

@@ -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()

View File

@@ -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")

View File

@@ -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()

View File

@@ -1,6 +1,8 @@
set(_wx_toolkit "") set(_wx_toolkit "")
set(_wx_debug_postfix "") set(_wx_debug_postfix "")
set(_wx_shared -DwxBUILD_SHARED=OFF) set(_wx_shared -DwxBUILD_SHARED=OFF)
set(_wx_flatpak_patch "")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_gtk_ver 2) set(_gtk_ver 2)
@@ -12,6 +14,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (FLATPAK) if (FLATPAK)
set(_wx_debug_postfix "d") set(_wx_debug_postfix "d")
set(_wx_shared -DwxBUILD_SHARED=ON -DBUILD_SHARED_LIBS:BOOL=ON) 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 ()
endif() endif()
@@ -21,13 +24,22 @@ else ()
set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF") set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF")
endif () 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( orcaslicer_add_cmake_project(
wxWidgets wxWidgets
GIT_REPOSITORY "https://github.com/SoftFever/Orca-deps-wxWidgets" GIT_REPOSITORY "https://github.com/SoftFever/Orca-deps-wxWidgets"
GIT_TAG v3.3.2
GIT_SHALLOW ON GIT_SHALLOW ON
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${JPEG_PKG} DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${JPEG_PKG}
${_wx_flatpak_patch}
CMAKE_ARGS CMAKE_ARGS
${_wx_opengl_override}
-DwxBUILD_PRECOMP=ON -DwxBUILD_PRECOMP=ON
${_wx_toolkit} ${_wx_toolkit}
"-DCMAKE_DEBUG_POSTFIX:STRING=${_wx_debug_postfix}" "-DCMAKE_DEBUG_POSTFIX:STRING=${_wx_debug_postfix}"
@@ -36,9 +48,10 @@ orcaslicer_add_cmake_project(
${_wx_shared} ${_wx_shared}
-DwxUSE_MEDIACTRL=ON -DwxUSE_MEDIACTRL=ON
-DwxUSE_DETECT_SM=OFF -DwxUSE_DETECT_SM=OFF
-DwxUSE_UNICODE=ON
-DwxUSE_PRIVATE_FONTS=ON -DwxUSE_PRIVATE_FONTS=ON
-DwxUSE_OPENGL=ON -DwxUSE_OPENGL=ON
-DwxUSE_GLCANVAS_EGL=ON -DwxUSE_GLCANVAS_EGL=OFF
-DwxUSE_WEBREQUEST=ON -DwxUSE_WEBREQUEST=ON
-DwxUSE_WEBVIEW=ON -DwxUSE_WEBVIEW=ON
${_wx_edge} ${_wx_edge}
@@ -52,31 +65,7 @@ orcaslicer_add_cmake_project(
-DwxUSE_ZLIB=sys -DwxUSE_ZLIB=sys
-DwxUSE_LIBJPEG=sys -DwxUSE_LIBJPEG=sys
-DwxUSE_LIBTIFF=OFF -DwxUSE_LIBTIFF=OFF
-DwxUSE_LIBWEBP=builtin
-DwxUSE_EXPAT=sys -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) if (MSVC)

View File

@@ -27,9 +27,11 @@ add_subdirectory(libigl)
add_subdirectory(libnest2d) add_subdirectory(libnest2d)
add_subdirectory(mcut) add_subdirectory(mcut)
add_subdirectory(md4c) add_subdirectory(md4c)
add_subdirectory(mdns)
add_subdirectory(miniz) add_subdirectory(miniz)
add_subdirectory(minilzo) add_subdirectory(minilzo)
add_subdirectory(qhull) add_subdirectory(qhull)
add_subdirectory(qoi) add_subdirectory(qoi)
add_subdirectory(semver) # Semver static library add_subdirectory(semver) # Semver static library
# Eigen header-only library
add_subdirectory(eigen)

View File

@@ -18,6 +18,6 @@ target_include_directories(admesh SYSTEM
) )
target_link_libraries(admesh target_link_libraries(admesh
PUBLIC Eigen3::Eigen
PRIVATE boost_headeronly PRIVATE boost_headeronly
PUBLIC eigen
) )

View File

@@ -15,6 +15,6 @@ target_include_directories(clipper SYSTEM
) )
target_link_libraries(clipper target_link_libraries(clipper
PUBLIC Eigen3::Eigen PUBLIC eigen
PRIVATE TBB::tbb TBB::tbbmalloc PRIVATE TBB::tbb TBB::tbbmalloc
) )

View 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

View 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.

View 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")

View 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: */

View 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
View 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

View File

@@ -0,0 +1,7 @@
#include "Core"
#include "LU"
#include "Cholesky"
#include "QR"
#include "SVD"
#include "Geometry"
#include "Eigenvalues"

View File

@@ -0,0 +1,2 @@
#include "Dense"
#include "Sparse"

View 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: */

View 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: */

View 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: */

View 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

View 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
View 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: */

View 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

View 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

View 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

View 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
View 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: */

View 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: */

View 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
View 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: */

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -0,0 +1,673 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2011 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2009 Keir Mierle <mierle@gmail.com>
// Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
// Copyright (C) 2011 Timothy E. Holy <tim.holy@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_LDLT_H
#define EIGEN_LDLT_H
namespace Eigen {
namespace internal {
template<typename MatrixType, int UpLo> struct LDLT_Traits;
// PositiveSemiDef means positive semi-definite and non-zero; same for NegativeSemiDef
enum SignMatrix { PositiveSemiDef, NegativeSemiDef, ZeroSign, Indefinite };
}
/** \ingroup Cholesky_Module
*
* \class LDLT
*
* \brief Robust Cholesky decomposition of a matrix with pivoting
*
* \tparam _MatrixType the type of the matrix of which to compute the LDL^T Cholesky decomposition
* \tparam _UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper.
* The other triangular part won't be read.
*
* Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite
* matrix \f$ A \f$ such that \f$ A = P^TLDL^*P \f$, where P is a permutation matrix, L
* is lower triangular with a unit diagonal and D is a diagonal matrix.
*
* The decomposition uses pivoting to ensure stability, so that L will have
* zeros in the bottom right rank(A) - n submatrix. Avoiding the square root
* on D also stabilizes the computation.
*
* Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky
* decomposition to determine whether a system of equations has a solution.
*
* This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism.
*
* \sa MatrixBase::ldlt(), SelfAdjointView::ldlt(), class LLT
*/
template<typename _MatrixType, int _UpLo> class LDLT
{
public:
typedef _MatrixType MatrixType;
enum {
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
UpLo = _UpLo
};
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
typedef typename MatrixType::StorageIndex StorageIndex;
typedef Matrix<Scalar, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1> TmpMatrixType;
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime> TranspositionType;
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> PermutationType;
typedef internal::LDLT_Traits<MatrixType,UpLo> Traits;
/** \brief Default Constructor.
*
* The default constructor is useful in cases in which the user intends to
* perform decompositions via LDLT::compute(const MatrixType&).
*/
LDLT()
: m_matrix(),
m_transpositions(),
m_sign(internal::ZeroSign),
m_isInitialized(false)
{}
/** \brief Default Constructor with memory preallocation
*
* Like the default constructor but with preallocation of the internal data
* according to the specified problem \a size.
* \sa LDLT()
*/
explicit LDLT(Index size)
: m_matrix(size, size),
m_transpositions(size),
m_temporary(size),
m_sign(internal::ZeroSign),
m_isInitialized(false)
{}
/** \brief Constructor with decomposition
*
* This calculates the decomposition for the input \a matrix.
*
* \sa LDLT(Index size)
*/
template<typename InputType>
explicit LDLT(const EigenBase<InputType>& matrix)
: m_matrix(matrix.rows(), matrix.cols()),
m_transpositions(matrix.rows()),
m_temporary(matrix.rows()),
m_sign(internal::ZeroSign),
m_isInitialized(false)
{
compute(matrix.derived());
}
/** \brief Constructs a LDLT factorization from a given matrix
*
* This overloaded constructor is provided for \link InplaceDecomposition inplace decomposition \endlink when \c MatrixType is a Eigen::Ref.
*
* \sa LDLT(const EigenBase&)
*/
template<typename InputType>
explicit LDLT(EigenBase<InputType>& matrix)
: m_matrix(matrix.derived()),
m_transpositions(matrix.rows()),
m_temporary(matrix.rows()),
m_sign(internal::ZeroSign),
m_isInitialized(false)
{
compute(matrix.derived());
}
/** Clear any existing decomposition
* \sa rankUpdate(w,sigma)
*/
void setZero()
{
m_isInitialized = false;
}
/** \returns a view of the upper triangular matrix U */
inline typename Traits::MatrixU matrixU() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return Traits::getU(m_matrix);
}
/** \returns a view of the lower triangular matrix L */
inline typename Traits::MatrixL matrixL() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return Traits::getL(m_matrix);
}
/** \returns the permutation matrix P as a transposition sequence.
*/
inline const TranspositionType& transpositionsP() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return m_transpositions;
}
/** \returns the coefficients of the diagonal matrix D */
inline Diagonal<const MatrixType> vectorD() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return m_matrix.diagonal();
}
/** \returns true if the matrix is positive (semidefinite) */
inline bool isPositive() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return m_sign == internal::PositiveSemiDef || m_sign == internal::ZeroSign;
}
/** \returns true if the matrix is negative (semidefinite) */
inline bool isNegative(void) const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return m_sign == internal::NegativeSemiDef || m_sign == internal::ZeroSign;
}
/** \returns a solution x of \f$ A x = b \f$ using the current decomposition of A.
*
* This function also supports in-place solves using the syntax <tt>x = decompositionObject.solve(x)</tt> .
*
* \note_about_checking_solutions
*
* More precisely, this method solves \f$ A x = b \f$ using the decomposition \f$ A = P^T L D L^* P \f$
* by solving the systems \f$ P^T y_1 = b \f$, \f$ L y_2 = y_1 \f$, \f$ D y_3 = y_2 \f$,
* \f$ L^* y_4 = y_3 \f$ and \f$ P x = y_4 \f$ in succession. If the matrix \f$ A \f$ is singular, then
* \f$ D \f$ will also be singular (all the other matrices are invertible). In that case, the
* least-square solution of \f$ D y_3 = y_2 \f$ is computed. This does not mean that this function
* computes the least-square solution of \f$ A x = b \f$ is \f$ A \f$ is singular.
*
* \sa MatrixBase::ldlt(), SelfAdjointView::ldlt()
*/
template<typename Rhs>
inline const Solve<LDLT, Rhs>
solve(const MatrixBase<Rhs>& b) const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
eigen_assert(m_matrix.rows()==b.rows()
&& "LDLT::solve(): invalid number of rows of the right hand side matrix b");
return Solve<LDLT, Rhs>(*this, b.derived());
}
template<typename Derived>
bool solveInPlace(MatrixBase<Derived> &bAndX) const;
template<typename InputType>
LDLT& compute(const EigenBase<InputType>& matrix);
/** \returns an estimate of the reciprocal condition number of the matrix of
* which \c *this is the LDLT decomposition.
*/
RealScalar rcond() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return internal::rcond_estimate_helper(m_l1_norm, *this);
}
template <typename Derived>
LDLT& rankUpdate(const MatrixBase<Derived>& w, const RealScalar& alpha=1);
/** \returns the internal LDLT decomposition matrix
*
* TODO: document the storage layout
*/
inline const MatrixType& matrixLDLT() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return m_matrix;
}
MatrixType reconstructedMatrix() const;
/** \returns the adjoint of \c *this, that is, a const reference to the decomposition itself as the underlying matrix is self-adjoint.
*
* This method is provided for compatibility with other matrix decompositions, thus enabling generic code such as:
* \code x = decomposition.adjoint().solve(b) \endcode
*/
const LDLT& adjoint() const { return *this; };
inline Index rows() const { return m_matrix.rows(); }
inline Index cols() const { return m_matrix.cols(); }
/** \brief Reports whether previous computation was successful.
*
* \returns \c Success if computation was succesful,
* \c NumericalIssue if the factorization failed because of a zero pivot.
*/
ComputationInfo info() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
return m_info;
}
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<typename RhsType, typename DstType>
EIGEN_DEVICE_FUNC
void _solve_impl(const RhsType &rhs, DstType &dst) const;
#endif
protected:
static void check_template_parameters()
{
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
}
/** \internal
* Used to compute and store the Cholesky decomposition A = L D L^* = U^* D U.
* The strict upper part is used during the decomposition, the strict lower
* part correspond to the coefficients of L (its diagonal is equal to 1 and
* is not stored), and the diagonal entries correspond to D.
*/
MatrixType m_matrix;
RealScalar m_l1_norm;
TranspositionType m_transpositions;
TmpMatrixType m_temporary;
internal::SignMatrix m_sign;
bool m_isInitialized;
ComputationInfo m_info;
};
namespace internal {
template<int UpLo> struct ldlt_inplace;
template<> struct ldlt_inplace<Lower>
{
template<typename MatrixType, typename TranspositionType, typename Workspace>
static bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, SignMatrix& sign)
{
using std::abs;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef typename TranspositionType::StorageIndex IndexType;
eigen_assert(mat.rows()==mat.cols());
const Index size = mat.rows();
bool found_zero_pivot = false;
bool ret = true;
if (size <= 1)
{
transpositions.setIdentity();
if(size==0) sign = ZeroSign;
else if (numext::real(mat.coeff(0,0)) > static_cast<RealScalar>(0) ) sign = PositiveSemiDef;
else if (numext::real(mat.coeff(0,0)) < static_cast<RealScalar>(0)) sign = NegativeSemiDef;
else sign = ZeroSign;
return true;
}
for (Index k = 0; k < size; ++k)
{
// Find largest diagonal element
Index index_of_biggest_in_corner;
mat.diagonal().tail(size-k).cwiseAbs().maxCoeff(&index_of_biggest_in_corner);
index_of_biggest_in_corner += k;
transpositions.coeffRef(k) = IndexType(index_of_biggest_in_corner);
if(k != index_of_biggest_in_corner)
{
// apply the transposition while taking care to consider only
// the lower triangular part
Index s = size-index_of_biggest_in_corner-1; // trailing size after the biggest element
mat.row(k).head(k).swap(mat.row(index_of_biggest_in_corner).head(k));
mat.col(k).tail(s).swap(mat.col(index_of_biggest_in_corner).tail(s));
std::swap(mat.coeffRef(k,k),mat.coeffRef(index_of_biggest_in_corner,index_of_biggest_in_corner));
for(Index i=k+1;i<index_of_biggest_in_corner;++i)
{
Scalar tmp = mat.coeffRef(i,k);
mat.coeffRef(i,k) = numext::conj(mat.coeffRef(index_of_biggest_in_corner,i));
mat.coeffRef(index_of_biggest_in_corner,i) = numext::conj(tmp);
}
if(NumTraits<Scalar>::IsComplex)
mat.coeffRef(index_of_biggest_in_corner,k) = numext::conj(mat.coeff(index_of_biggest_in_corner,k));
}
// partition the matrix:
// A00 | - | -
// lu = A10 | A11 | -
// A20 | A21 | A22
Index rs = size - k - 1;
Block<MatrixType,Dynamic,1> A21(mat,k+1,k,rs,1);
Block<MatrixType,1,Dynamic> A10(mat,k,0,1,k);
Block<MatrixType,Dynamic,Dynamic> A20(mat,k+1,0,rs,k);
if(k>0)
{
temp.head(k) = mat.diagonal().real().head(k).asDiagonal() * A10.adjoint();
mat.coeffRef(k,k) -= (A10 * temp.head(k)).value();
if(rs>0)
A21.noalias() -= A20 * temp.head(k);
}
// In some previous versions of Eigen (e.g., 3.2.1), the scaling was omitted if the pivot
// was smaller than the cutoff value. However, since LDLT is not rank-revealing
// we should only make sure that we do not introduce INF or NaN values.
// Remark that LAPACK also uses 0 as the cutoff value.
RealScalar realAkk = numext::real(mat.coeffRef(k,k));
bool pivot_is_valid = (abs(realAkk) > RealScalar(0));
if(k==0 && !pivot_is_valid)
{
// The entire diagonal is zero, there is nothing more to do
// except filling the transpositions, and checking whether the matrix is zero.
sign = ZeroSign;
for(Index j = 0; j<size; ++j)
{
transpositions.coeffRef(j) = IndexType(j);
ret = ret && (mat.col(j).tail(size-j-1).array()==Scalar(0)).all();
}
return ret;
}
if((rs>0) && pivot_is_valid)
A21 /= realAkk;
else if(rs>0)
ret = ret && (A21.array()==Scalar(0)).all();
if(found_zero_pivot && pivot_is_valid) ret = false; // factorization failed
else if(!pivot_is_valid) found_zero_pivot = true;
if (sign == PositiveSemiDef) {
if (realAkk < static_cast<RealScalar>(0)) sign = Indefinite;
} else if (sign == NegativeSemiDef) {
if (realAkk > static_cast<RealScalar>(0)) sign = Indefinite;
} else if (sign == ZeroSign) {
if (realAkk > static_cast<RealScalar>(0)) sign = PositiveSemiDef;
else if (realAkk < static_cast<RealScalar>(0)) sign = NegativeSemiDef;
}
}
return ret;
}
// Reference for the algorithm: Davis and Hager, "Multiple Rank
// Modifications of a Sparse Cholesky Factorization" (Algorithm 1)
// Trivial rearrangements of their computations (Timothy E. Holy)
// allow their algorithm to work for rank-1 updates even if the
// original matrix is not of full rank.
// Here only rank-1 updates are implemented, to reduce the
// requirement for intermediate storage and improve accuracy
template<typename MatrixType, typename WDerived>
static bool updateInPlace(MatrixType& mat, MatrixBase<WDerived>& w, const typename MatrixType::RealScalar& sigma=1)
{
using numext::isfinite;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
const Index size = mat.rows();
eigen_assert(mat.cols() == size && w.size()==size);
RealScalar alpha = 1;
// Apply the update
for (Index j = 0; j < size; j++)
{
// Check for termination due to an original decomposition of low-rank
if (!(isfinite)(alpha))
break;
// Update the diagonal terms
RealScalar dj = numext::real(mat.coeff(j,j));
Scalar wj = w.coeff(j);
RealScalar swj2 = sigma*numext::abs2(wj);
RealScalar gamma = dj*alpha + swj2;
mat.coeffRef(j,j) += swj2/alpha;
alpha += swj2/dj;
// Update the terms of L
Index rs = size-j-1;
w.tail(rs) -= wj * mat.col(j).tail(rs);
if(gamma != 0)
mat.col(j).tail(rs) += (sigma*numext::conj(wj)/gamma)*w.tail(rs);
}
return true;
}
template<typename MatrixType, typename TranspositionType, typename Workspace, typename WType>
static bool update(MatrixType& mat, const TranspositionType& transpositions, Workspace& tmp, const WType& w, const typename MatrixType::RealScalar& sigma=1)
{
// Apply the permutation to the input w
tmp = transpositions * w;
return ldlt_inplace<Lower>::updateInPlace(mat,tmp,sigma);
}
};
template<> struct ldlt_inplace<Upper>
{
template<typename MatrixType, typename TranspositionType, typename Workspace>
static EIGEN_STRONG_INLINE bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, SignMatrix& sign)
{
Transpose<MatrixType> matt(mat);
return ldlt_inplace<Lower>::unblocked(matt, transpositions, temp, sign);
}
template<typename MatrixType, typename TranspositionType, typename Workspace, typename WType>
static EIGEN_STRONG_INLINE bool update(MatrixType& mat, TranspositionType& transpositions, Workspace& tmp, WType& w, const typename MatrixType::RealScalar& sigma=1)
{
Transpose<MatrixType> matt(mat);
return ldlt_inplace<Lower>::update(matt, transpositions, tmp, w.conjugate(), sigma);
}
};
template<typename MatrixType> struct LDLT_Traits<MatrixType,Lower>
{
typedef const TriangularView<const MatrixType, UnitLower> MatrixL;
typedef const TriangularView<const typename MatrixType::AdjointReturnType, UnitUpper> MatrixU;
static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
};
template<typename MatrixType> struct LDLT_Traits<MatrixType,Upper>
{
typedef const TriangularView<const typename MatrixType::AdjointReturnType, UnitLower> MatrixL;
typedef const TriangularView<const MatrixType, UnitUpper> MatrixU;
static inline MatrixL getL(const MatrixType& m) { return MatrixL(m.adjoint()); }
static inline MatrixU getU(const MatrixType& m) { return MatrixU(m); }
};
} // end namespace internal
/** Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of \a matrix
*/
template<typename MatrixType, int _UpLo>
template<typename InputType>
LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::compute(const EigenBase<InputType>& a)
{
check_template_parameters();
eigen_assert(a.rows()==a.cols());
const Index size = a.rows();
m_matrix = a.derived();
// Compute matrix L1 norm = max abs column sum.
m_l1_norm = RealScalar(0);
// TODO move this code to SelfAdjointView
for (Index col = 0; col < size; ++col) {
RealScalar abs_col_sum;
if (_UpLo == Lower)
abs_col_sum = m_matrix.col(col).tail(size - col).template lpNorm<1>() + m_matrix.row(col).head(col).template lpNorm<1>();
else
abs_col_sum = m_matrix.col(col).head(col).template lpNorm<1>() + m_matrix.row(col).tail(size - col).template lpNorm<1>();
if (abs_col_sum > m_l1_norm)
m_l1_norm = abs_col_sum;
}
m_transpositions.resize(size);
m_isInitialized = false;
m_temporary.resize(size);
m_sign = internal::ZeroSign;
m_info = internal::ldlt_inplace<UpLo>::unblocked(m_matrix, m_transpositions, m_temporary, m_sign) ? Success : NumericalIssue;
m_isInitialized = true;
return *this;
}
/** Update the LDLT decomposition: given A = L D L^T, efficiently compute the decomposition of A + sigma w w^T.
* \param w a vector to be incorporated into the decomposition.
* \param sigma a scalar, +1 for updates and -1 for "downdates," which correspond to removing previously-added column vectors. Optional; default value is +1.
* \sa setZero()
*/
template<typename MatrixType, int _UpLo>
template<typename Derived>
LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::rankUpdate(const MatrixBase<Derived>& w, const typename LDLT<MatrixType,_UpLo>::RealScalar& sigma)
{
typedef typename TranspositionType::StorageIndex IndexType;
const Index size = w.rows();
if (m_isInitialized)
{
eigen_assert(m_matrix.rows()==size);
}
else
{
m_matrix.resize(size,size);
m_matrix.setZero();
m_transpositions.resize(size);
for (Index i = 0; i < size; i++)
m_transpositions.coeffRef(i) = IndexType(i);
m_temporary.resize(size);
m_sign = sigma>=0 ? internal::PositiveSemiDef : internal::NegativeSemiDef;
m_isInitialized = true;
}
internal::ldlt_inplace<UpLo>::update(m_matrix, m_transpositions, m_temporary, w, sigma);
return *this;
}
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<typename _MatrixType, int _UpLo>
template<typename RhsType, typename DstType>
void LDLT<_MatrixType,_UpLo>::_solve_impl(const RhsType &rhs, DstType &dst) const
{
eigen_assert(rhs.rows() == rows());
// dst = P b
dst = m_transpositions * rhs;
// dst = L^-1 (P b)
matrixL().solveInPlace(dst);
// dst = D^-1 (L^-1 P b)
// more precisely, use pseudo-inverse of D (see bug 241)
using std::abs;
const typename Diagonal<const MatrixType>::RealReturnType vecD(vectorD());
// In some previous versions, tolerance was set to the max of 1/highest (or rather numeric_limits::min())
// and the maximal diagonal entry * epsilon as motivated by LAPACK's xGELSS:
// RealScalar tolerance = numext::maxi(vecD.array().abs().maxCoeff() * NumTraits<RealScalar>::epsilon(),RealScalar(1) / NumTraits<RealScalar>::highest());
// However, LDLT is not rank revealing, and so adjusting the tolerance wrt to the highest
// diagonal element is not well justified and leads to numerical issues in some cases.
// Moreover, Lapack's xSYTRS routines use 0 for the tolerance.
// Using numeric_limits::min() gives us more robustness to denormals.
RealScalar tolerance = (std::numeric_limits<RealScalar>::min)();
for (Index i = 0; i < vecD.size(); ++i)
{
if(abs(vecD(i)) > tolerance)
dst.row(i) /= vecD(i);
else
dst.row(i).setZero();
}
// dst = L^-T (D^-1 L^-1 P b)
matrixU().solveInPlace(dst);
// dst = P^-1 (L^-T D^-1 L^-1 P b) = A^-1 b
dst = m_transpositions.transpose() * dst;
}
#endif
/** \internal use x = ldlt_object.solve(x);
*
* This is the \em in-place version of solve().
*
* \param bAndX represents both the right-hand side matrix b and result x.
*
* \returns true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD.
*
* This version avoids a copy when the right hand side matrix b is not
* needed anymore.
*
* \sa LDLT::solve(), MatrixBase::ldlt()
*/
template<typename MatrixType,int _UpLo>
template<typename Derived>
bool LDLT<MatrixType,_UpLo>::solveInPlace(MatrixBase<Derived> &bAndX) const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
eigen_assert(m_matrix.rows() == bAndX.rows());
bAndX = this->solve(bAndX);
return true;
}
/** \returns the matrix represented by the decomposition,
* i.e., it returns the product: P^T L D L^* P.
* This function is provided for debug purpose. */
template<typename MatrixType, int _UpLo>
MatrixType LDLT<MatrixType,_UpLo>::reconstructedMatrix() const
{
eigen_assert(m_isInitialized && "LDLT is not initialized.");
const Index size = m_matrix.rows();
MatrixType res(size,size);
// P
res.setIdentity();
res = transpositionsP() * res;
// L^* P
res = matrixU() * res;
// D(L^*P)
res = vectorD().real().asDiagonal() * res;
// L(DL^*P)
res = matrixL() * res;
// P^T (LDL^*P)
res = transpositionsP().transpose() * res;
return res;
}
/** \cholesky_module
* \returns the Cholesky decomposition with full pivoting without square root of \c *this
* \sa MatrixBase::ldlt()
*/
template<typename MatrixType, unsigned int UpLo>
inline const LDLT<typename SelfAdjointView<MatrixType, UpLo>::PlainObject, UpLo>
SelfAdjointView<MatrixType, UpLo>::ldlt() const
{
return LDLT<PlainObject,UpLo>(m_matrix);
}
/** \cholesky_module
* \returns the Cholesky decomposition with full pivoting without square root of \c *this
* \sa SelfAdjointView::ldlt()
*/
template<typename Derived>
inline const LDLT<typename MatrixBase<Derived>::PlainObject>
MatrixBase<Derived>::ldlt() const
{
return LDLT<PlainObject>(derived());
}
} // end namespace Eigen
#endif // EIGEN_LDLT_H

Some files were not shown because too many files have changed in this diff Show More