OpenToonz - An open-source full-featured 2D animation creation software
C
ci: fix macOS 15 build issues with SuperLU
Anderson Pradoae0da5a1fa08
diff --git a/.github/workflows/workflow_macos.yml b/.github/workflows/workflow_macos.ymlindex b3875497d..b6506e337 100644--- a/.github/workflows/workflow_macos.yml+++ b/.github/workflows/workflow_macos.yml@@ -20,9 +20,7 @@ on:jobs:macOS:- timeout-minutes: 90- # runs-on: macos-latest- # avoid the headache of arm64 builds?+ timeout-minutes: 90 # Stop job if it exceeds expected build timeruns-on: macos-15steps:- uses: actions/checkout@v4@@ -48,16 +46,14 @@ jobs:fidone}-brew updatebrew cleanup-- checkPkgAndInstall pkg-config glew lz4 libjpeg libpng lzo boost libusb libmypaint ccache jpeg-turbo ninja opencv qt@5+ checkPkgAndInstall pkg-config glew lz4 libjpeg libpng lzo boost libusb libmypaint ccache jpeg-turbo ninja opencv superlu qt@5brew unlink qt- name: Set up cacherun: |- export PATH="/usr/local/opt/ccache/libexec:$PATH"+ export PATH="/opt/homebrew/opt/ccache/libexec:$PATH"mkdir -p /Users/runner/.ccache- uses: actions/cache@v4@@ -74,7 +70,7 @@ jobs:- name: Buildrun: |- export PKG_CONFIG_PATH="/usr/local/opt/jpeg-turbo/lib/pkgconfig:$PKG_CONFIG_PATH"+ export PKG_CONFIG_PATH="$(brew --prefix jpeg-turbo)/lib/pkgconfig:$PKG_CONFIG_PATH"cd toonzmkdir -p buildcd build@@ -83,6 +79,7 @@ jobs:-DQT_PATH=$(brew --prefix qt@5)/lib \-DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 \-DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)/lib/cmake/Qt5 \+ -DWITH_SYSTEM_SUPERLU=ON \-DWITH_TRANSLATION=OFFninja -j $(sysctl -n hw.ncpu)@@ -90,7 +87,9 @@ jobs:run: |cd toonz/build/toonzcp -pr ../../../stuff OpenToonz.app/portablestuff- /usr/local/opt/qt@5/bin/macdeployqt OpenToonz.app -verbose=0 -always-overwrite \+ QT_DEPLOY=$(brew --prefix qt@5)/bin/macdeployqt+ echo "Using macdeployqt from: $QT_DEPLOY"+ $QT_DEPLOY OpenToonz.app -verbose=0 -always-overwrite \-executable=OpenToonz.app/Contents/MacOS/lzocompress \-executable=OpenToonz.app/Contents/MacOS/lzodecompress \-executable=OpenToonz.app/Contents/MacOS/tcleanup \@@ -116,20 +115,18 @@ jobs:cd toonz/build/toonzecho "Creating DMG..."+ QT_DEPLOY=$(brew --prefix qt@5)/bin/macdeployqtATTEMPT=1- until /usr/local/opt/qt@5/bin/macdeployqt OpenToonz.app -dmg -verbose=0 && [ -f OpenToonz.dmg ]; do+ until $QT_DEPLOY OpenToonz.app -dmg -verbose=0 && [ -f OpenToonz.dmg ]; doecho "Attempt $ATTEMPT failed to build DMG."-if [ $ATTEMPT -eq 10 ]; thenecho ">>> DMG file creation failed after 10 attempts. Aborting!"exit 1fi-ATTEMPT=$((ATTEMPT + 1))- echo "Retrying in 5 seconds..."- sleep 5+ echo "Retrying in 10 seconds..."+ sleep 10done-echo "DMG created successfully."- uses: actions/upload-artifact@v4diff --git a/toonz/cmake/FindSuperLU.cmake b/toonz/cmake/FindSuperLU.cmakeindex 3a2494b09..cba4cf761 100644--- a/toonz/cmake/FindSuperLU.cmake+++ b/toonz/cmake/FindSuperLU.cmake@@ -1,6 +1,5 @@-if(WITH_SYSTEM_SUPERLU)- # depend on CMake's defaults+ # Depend on CMake's default settingsset(_header_hints)set(_header_suffixessuperlu@@ -8,7 +7,7 @@ if(WITH_SYSTEM_SUPERLU))set(_lib_suffixes)else()- # preferred homebrew's directories.+ # Preferred directories for Homebrew installationset(_header_hints${THIRDPARTY_LIBS_HINTS})@@ -24,6 +23,41 @@ else())endif()+# Check for macOS with Homebrew+if(APPLE)+ # Detect Homebrew installation (different paths for Intel and ARM systems)+ if(EXISTS "/opt/homebrew")+ # For Apple Silicon systems (M1/M2)+ set(_header_hints+ /opt/homebrew/include+ /usr/local/include+ ${THIRDPARTY_LIBS_HINTS}+ )+ set(_lib_hints+ /opt/homebrew/lib+ /usr/local/lib+ ${THIRDPARTY_LIBS_HINTS}+ )+ message("***** Using Homebrew for Apple Silicon (M1/M2)")+ elseif(EXISTS "/usr/local")+ # For Intel systems+ set(_header_hints+ /opt/homebrew/include+ /usr/local/include+ ${THIRDPARTY_LIBS_HINTS}+ )+ set(_lib_hints+ /opt/homebrew/lib+ /usr/local/lib+ ${THIRDPARTY_LIBS_HINTS}+ )+ message("***** Using Homebrew for Intel")+ else()+ message(FATAL_ERROR "Homebrew not installed or path not found")+ endif()+endif()++# Find the path to the SuperLU header filesfind_path(SUPERLU_INCLUDE_DIRNAMES@@ -34,10 +68,12 @@ find_path(${_header_suffixes})+# Find the path to the SuperLU libraryfind_library(SUPERLU_LIBRARYNAMESlibsuperlu.so+ libsuperlu.dyliblibsuperlu.alibsuperlu_4.1.aHINTS@@ -46,25 +82,31 @@ find_library(${_lib_suffixes})+# Output the paths for debugging purposesmessage("***** SuperLU Header path:" ${SUPERLU_INCLUDE_DIR})message("***** SuperLU Library path:" ${SUPERLU_LIBRARY})+# Set the SuperLU namesset(SUPERLU_NAMES ${SUPERLU_NAMES} SuperLU)+# Handle standard package search argumentsinclude(FindPackageHandleStandardArgs)FIND_PACKAGE_HANDLE_STANDARD_ARGS(SuperLUDEFAULT_MSG SUPERLU_LIBRARY SUPERLU_INCLUDE_DIR)+# If SuperLU is found, set the librariesif(SUPERLU_FOUND)set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARY})endif()+# Mark the library and include directories as advanced for the usermark_as_advanced(SUPERLU_LIBRARYSUPERLU_INCLUDE_DIR)+# Unset temporary variables used during the configurationunset(_header_hints)unset(_header_suffixes)unset(_lib_hints)-unset(_lib_suffixes)+unset(_lib_suffixes)\ No newline at end of file