* fix(deps): build the dependencies from scratch with clang-cl
Six dependencies fail once the superbuild compiles them with clang-cl instead
of cl:
- OpenSSL never goes through CMake. Its VC-WIN64A makefile only works with cl,
and an unquoted clang-cl path with spaces produces no .obj files at all, so
the lib step dies with LNK1181. Pin the upstream toolchain.
- Boost.Container's bundled dlmalloc passes int* to the Interlocked API. cl
warns, clang rejects it.
- curl 7.75's configure probes rely on C laxness clang rejects. The results
flip and nonblock.c ends up in the AmigaOS IoctlSocket branch.
- OCCT installs RelWithDebInfo into bini/libi while find_package looks in lib.
It also prepends -Wl,-s to the shared linker flags for every Clang build,
which the MSVC-style linker gets as an argument it does not know. Both
patched hunks sit inside if (MSVC) in the OCCT sources.
- wxWidgets lands in lib/clang_x64_lib, so wxWidgetsConfig.cmake falls back to
the layout that exists instead of assuming vc_x64_lib. It tries the derived
path first, so a cl-built tree consumed by clang-cl keeps resolving the way
it does today. The patch step also resets the one file it touches, so it can
run again after an interrupted build or after the patch itself changed.
- wxInspector goes through FindwxWidgets, which only searches lib/vc*_lib
because _WX_TOOL is hardcoded to vc. It now gets the root and lib dir
derived the same way wxWidgetsConfig.cmake derives them.
Eigen is the seventh, and it breaks on the generator rather than the compiler.
Its test, lapack and blas/testing subdirectories all call
enable_language(Fortran), and they default to ON because the dependency
configures as its own top-level project. Whether that hurts depends on what
CMake finds: the Visual Studio generator supports no Fortran and finds nothing,
clang-cl sits next to the LLVM toolset's flang and works, while MSVC with Ninja
finds Strawberry Perl's MinGW gfortran, which this build already requires for
OpenSSL, and hands it the MSVC-style /machine:x64 that MinGW's ld reads as a
missing input file. The configure dies there and takes every dependency still
in flight with it. Only the headers are consumed here, so the three subprojects
are off.
* fix(deps): honor the superbuild's generator and compiler in sub-builds
orcaslicer_add_cmake_project pinned every dependency sub-build to the Visual
Studio generator whenever MSVC was true, which is also true for clang-cl. That
generator selects its compiler by toolset and ignores the CMAKE_C_COMPILER and
CMAKE_CXX_COMPILER this file already forwards, so the dependencies were built
with cl.exe no matter which generator or compiler the superbuild was given.
Key the three affected decisions on the generator instead: which generator the
sub-builds use, whether CMAKE_BUILD_TYPE is forwarded, and /m versus -j. A
Visual Studio superbuild is unchanged, so the default path and CI behave
exactly as they do today.
build_release_vs.bat now accepts -l to select clang-cl, alongside the existing
-x for Ninja, so the generator and the compiler can be chosen independently. On
the Visual Studio generator -l reaches the slicer only, through the ClangCL
toolset, because the dependency sub-builds have no toolset to inherit; a deps
build in that combination says so rather than quietly using MSVC.
* fix(deps): use upstream wxWidgets compiler layout fix
The compiler-prefix layout fix now comes from SoftFever/Orca-deps-wxWidgets#7, so remove the duplicated local patch and apply step.
* fix(deps): stop Assimp enabling ccache on the RC rule
ASSIMP_BUILD_USE_CCACHE defaults on and applies the launcher through the
global RULE_LAUNCH_COMPILE property, so it wraps the resource-compiler rule
as well. Under Ninja that rule goes through cmcldeps, which does not survive
being launched by ccache, and the build fails with clang-cl reporting /fo as
a missing file.
The superbuild already forwards CMAKE_<LANG>_COMPILER_LAUNCHER, which CMake
applies per language and so keeps clear of the RC rule.
---------
Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
Co-authored-by: raistlin7447 <kris.austin@gmail.com>
On Linux the bundled CPython silently links the system OpenSSL instead of
the one built in deps/, and the dependency build then fails:
install: cannot stat 'Modules/_ssl.cpython-312-x86_64-linux-gnu.so':
No such file or directory
The chain:
* OpenSSL's linux-x86_64 target sets multilib=64, so 'make install_sw'
installs the static libs to <prefix>/lib64 while every other dependency
in the prefix uses <prefix>/lib.
* CPython's --with-openssl=<dir> only ever emits -L<dir>/lib. It does not
look in lib64, so -lssl resolves to the system OpenSSL.
* gcc -shared does not error on unresolved symbols, so the link appears to
succeed. _ssl.c was compiled against the bundled 1.1.1w headers, which
map SSL_get1_peer_certificate onto the pre-3.0 SSL_get_peer_certificate
-- a symbol OpenSSL 3.x removed. The module then fails to import:
_ssl failed to import: undefined symbol: SSL_get_peer_certificate
Could not build the ssl module!
* With no _ssl built, 'make install' cannot stat it and the build stops.
Passing --libdir=lib keeps the prefix single-layout, so CPython's -L<dir>/lib
finds the bundled static libraries and links against the headers it was
compiled with.
CMake-based dependencies were unaffected throughout, because CMake's
FindOpenSSL searches lib64 on its own; only CPython's autoconf path is
sensitive to this.
Affects any distribution where OpenSSL selects the lib64 layout, which is the
Fedora, openSUSE and Arch families. Debian and Ubuntu are unaffected, which is
why CI has not seen it.
Verified on Arch (GCC 16.1.1, CMake 4.4.2): the dependency build completes and
the bundled interpreter reports the bundled OpenSSL rather than the system one:
$ deps/build/OrcaSlicer_dep/usr/local/libpython/bin/python3.12 \
-c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.1.1w 11 Sep 2023
Not verified on macOS or Windows. The flag is accepted by OpenSSL's Configure
on all platforms and Darwin targets do not set multilib, so it should be a
no-op there, but CI is the check.
* feat: native Windows ARM64 build support
Builds on the merged DEPS_ARCH=arm64 plumbing (#13424) by adding the
dependency and source fixes needed for a green native ARM64 build on the
windows-11-arm runner. Validated end-to-end on Snapdragon X Elite hardware
(via a downstream fork using the same fixes); see OrcaSlicer/OrcaSlicer#8271
for the full writeup.
Dependencies:
- OpenEXR 2.5.5: ImfSimd.h hard-codes IMF_HAVE_SSE2 for any MSVC, pulling in
<emmintrin.h> (x86-only) -> C1189. Patch the header to require an x86 target
and force SSE cache vars off on ARM64.
- Boost.Context: use the winfib implementation on ARM64 (Windows Fiber API)
to avoid the armasm64 / CMake ASM_ARMASM linker-module bug, while keeping
the Boost::context target Boost.Asio needs.
- OpenCV: disable WITH_IPP on ARM64 (Intel IPP/IPP-ICV is x86/x64 only;
otherwise ~200 unresolved ippicv* externals at link).
- OpenSSL: use VC-WIN64-ARM on ARM64.
- FindGLEW: add an ARM64 arch branch.
Sources:
- clipper Int128.hpp: _mul128 is an x64-only intrinsic guarded by _WIN64
(true on ARM64); guard on _M_X64 and use the portable path.
- imgui imgui_widgets.cpp: fix va_start(vaList, &text) -> va_start(vaList, text)
(the &-form compiled on x64 but is invalid on ARM64).
- crash reporter: StackWalker.cpp gains an _M_ARM64 branch; BaseException.cpp
uses Cpsr instead of the x86-only EFlags on ARM64.
CI:
- New build_windows_arm64.yml on windows-11-arm: pins CMake 3.31.x, stages
ARM64 GMP/MPFR from MSYS2 clangarm64 (with llvm-dlltool import libs),
caches deps with a fixed-depth hashFiles key, builds and uploads the binary.
OCCT/STEP, SVG-to-3D and text emboss all build and work on ARM64 (no stubs
needed). Full feature parity with x64.
* fix(ci): use forward-slash DESTDIR to avoid CMake '\a' escape error
deps configure failed at GMP/GMP.cmake: "Invalid character escape '\a'"
because DESTDIR carried Windows backslashes (C:\a\...) and is re-parsed
when re-set with the /usr/local suffix. Pass DESTDIR (and the slicer's
DEPS prefix) with forward slashes via %CD:\=/%.
* fix(ci): don't export DESTDIR env var (CMake staged-install doubles paths)
Setting a DESTDIR *environment* variable made CMake treat it as the staged
install prefix and prepend it to every dependency's install path, so e.g.
FreeType installed to <DESTDIR>/a/.../OrcaSlicer_dep/usr/local and OCCT
then couldn't find its headers. Compute the forward-slash path into a
differently-named var (ORCA_DESTDIR) and pass it only via -DDESTDIR.
* ci(windows-arm64): fold ARM64 build into the standard Windows matrix
Replace the standalone build_windows_arm64.yml with a matrix entry on the
existing build_windows job, so x64 and ARM64 share one reusable workflow
chain (build_all -> build_check_cache -> build_deps -> build_orca), per
review feedback on #14059.
- build_all.yml: build_windows now matrices over {x64: windows-latest,
arm64: windows-11-arm} and threads `arch` through. Self-hosted runner
stays x64-only.
- build_check_cache.yml: cache key and dep-prefix path are now
architecture-specific on Windows (deps/build-arm64/OrcaSlicer_dep).
- build_release_vs.bat: accept an `arm64` argument (mirrors
build_release_vs2022.bat) -> uses `-A ARM64` and the build-arm64 tree.
The top-level CMake auto-derives CMAKE_PREFIX_PATH from the build dir,
so no explicit prefix is needed.
- build_deps.yml / build_orca.yml: gate the ARM64-only prep behind
`inputs.arch == 'arm64'` -- pin CMake 3.31.x, and stage MSYS2
clangarm64 GMP/MPFR import libs. NSIS installer/PDB/profile_validator
remain x64-only; ARM64 ships the portable zip. Artifact names get an
arch suffix to avoid collisions between the two Windows jobs.
https://claude.ai/code/session_0164c7ZhCLsYBmCiVN9pWDjK
* ci(temp): generate GMP/MPFR win-arm64 blobs to commit to repo
* feat(deps): add prebuilt GMP/MPFR win-arm64 blobs
The repo ships prebuilt GMP/MPFR import libs + DLLs for win-x64 and
win-x86; the Windows ARM64 build path copies from win-${DEPS_ARCH}
(CMakeLists.txt) but the win-arm64 blobs were missing, so the slicer
configure failed at "file COPY cannot find .../win-arm64/libgmp-10.dll".
Add win-arm64 libgmp-10.{dll,lib} and libmpfr-4.{dll,lib}, generated from
the MSYS2 clangarm64 gmp/mpfr packages with MSVC-compatible import libs via
llvm-dlltool. Headers are shared across arches and unchanged.
* simplify OpenEXR.cmake
* set default arch
* support msix
* ship installer
* try to fix webview2runtime issue
---------
Co-authored-by: Adam Behrman <adam.behrman@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Adam Behrman <abehrman@users.noreply.github.com>
* Auto generate CMAKE_PREFIX_PATH/DESTDIR
* Auto set CMAKE_INSTALL_PREFIX
* Always default SLIC3R_STATIC to on
* Only allow one value for CMAKE_OSX_ARCHITECTURES
* Set arch for OpenSSL from CMAKE_OSX_ARCHITECTURES
* Set CMAKE_INSTALL_RPATH from CMAKE_PREFIX_PATH
* Default CMAKE_MACOSX_RPATH and CMAKE_MACOSX_BUNDLE to on
* Auto set BBL_RELEASE_TO_PUBLIC based on build config
* Default to GTK 3
* Fix linux debug build
Update find modules to also look for the debug variant of the libraries
* Set DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO based on CMAKE_BUILD_TYPE
* Add a fallback value for Windows SDK if the env variables are not set
* Reflect CMake changes in the build scripts
* Add missing line
* Fix auto setting DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO
* Update dep folder name for linux in GH actions
* Invert dep-folder-name conditions
`''` is considered a falsy value, which was causing the value to always be set to 'OrcaSlicer_dep'
* Properly handle finding the debug version of libnoise
* Convert FindNLopt.cmake to a config mode wrapper
* Use separate build directory for debug builds on Linux
* Move find_package for libnoise
* Cleanup and improve linux build script
- Add dry run
- Add build in RelWithDebInfo
- Add function to print and run commands
* Remove linux destdir deprecation and cleanup
* Fix flatpak build
* Disable fail fast for flatpak builds
* Flatpak improvements
- Build wxWidgets using deps cmake
- Improve handling of space freeing commands while building deps
- Allow cmake to directly download deps
- Set needed flags within cmake instead of the build manifest
* Print clean build commands
* Implement shellcheck recommendations
* Cleanup
* Fix CMakeLists.txt syntax by replacing empty elseif with else statement
---------
Co-authored-by: SoftFever <softfeverever@gmail.com>
* Initial commit for the builder
* fix wx, use hack to install into /app
* add some workarounds for /usr/local
* fix up rest of paths
* attempt to fix wxwebview undef
* figure out why wxwidgets isnt getting its patches applied
* do "proper" patching of wxwidgets
* Flip the flag
* actually append the /usr/local
* restrict package finding to flatpak only
* Update the destdir stuff for mpfr, gmp
* Transfer over all the _destdir, again
* update patch command for all other plats
* initial ci check
* what even happened
* clear ci image
* I doubt this will do anything
* do cleanup after running each step
* remove build objects for flatpak ci
* compress debug info
* Fix MacOS build
* Try saving space after building deps
* No debug info for now
* Do debug info, use thin static archives
* use BSD flag, not --thin
* try building with lto
* Use release, no debug info
* remove lto
* Revert the last 5 commits
* It might require write perms
* Revert "It might require write perms"
This reverts commit 44cec58a57.
* Import fixes for merge
* remove some patch stuff
* the worst hack!
* remove uneeded patches
* Initial commit for the builder
* note to self, go back to regular wx
* attempt to fix wxwebview undef
* do "proper" patching of wxwidgets
* update patch command for all other plats
* what even happened
* -ldep_name-NOTFOUND is still here
* concat patches
* Build wx with flatpak
* more wx shenatigans
* fix a missing import
* build wx with proper flags
* fix imports and libs
* trigger ci
* try fixing mac and windows ci
* remove duplicate definition of freetype
* curl may not have openssl for a dep
* has openssl been found?
* force building
* build images on apple
* cleanup for review
* cleanup cmake files
---------
Co-authored-by: SoftFever <softfeverever@gmail.com>