-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build for Apple Silicon #1743
Merged
Merged
Build for Apple Silicon #1743
Changes from 108 commits
Commits
Show all changes
110 commits
Select commit
Hold shift + click to select a range
527166f
Updated conan file
rhinoella 307c4c3
Changing outdated ptsl references to dpl
rhinoella eb75f4c
Updating includes to latest standard
rhinoella ad8cc5a
Upgrading conan requirement to use latest oneDPL version
rhinoella 8c766d8
Changing cmake tbb reference to oneTBB
rhinoella 33dfdb1
Turn off QT moc keywords
rhinoella 5986e16
WIP - manually define QT keywords
rhinoella b7480ef
Manually define QT keywords
rhinoella 6f7fde2
CMakeLists: removed depreciated --noall_load and added fix for google…
rhinoella b1db066
Removed fix for google libs- maybe better in different PR
rhinoella 4721cc1
Merge branch 'develop' into upgrade-tbb
rhinoella 036ced4
Added arm64 to cmake architectures
rhinoella bd37965
Added arm64 to cmake architectures
rhinoella e0bef1b
Formatting
rhinoella 1bae25f
Get nix to install onetbb
rhinoella bad5edd
Get nix to install onetbb
rhinoella 9d135e6
Remove cross compillation- for now
3176175
Test- nix
81717ab
Upgrade tbb nix (#1716)
rprospero 5df824b
Upgrade ANTLR4 from 4.9.3 to 4.13.1 (#1721)
rhinoella 1e4de0f
Merge branch 'develop' into upgrade-tbb
rhinoella 120478f
Test silicon workflow
rhinoella f4eabce
Test silicon workflow
rhinoella 6cb702f
Test silicon workflow
rhinoella 9606dd0
Test silicon workflow
rhinoella 1b98421
Update 'emit'
rhinoella 974fc72
Merge branch 'upgrade-tbb' into apple-silicon
rhinoella 685f971
Unspecify ftgl
rhinoella c0afbaf
Fix ftgl linking
886352e
Install freetype through conan
1032cae
Install freetype through conan
a5c6415
Cmake fixes
68ed95e
FTGLFix
9825b1a
Fixing packaging ftgl path
rhinoella 0e73931
Fix linkage?
rhinoella a5e282b
Fix linkage?
rhinoella c34ff00
Fix ftgl include path
rhinoella 5b3aa08
Fix freetype & ftgl rpaths
rhinoella 41a7da3
Fix mistake
rhinoella b21c361
Update conan
rhinoella 004bceb
fix mistake
rhinoella ab73fd1
fix mistake
rhinoella 163ba18
fix mistake
rhinoella 3ed48d4
fix mistake
rhinoella 1ae723c
Sudo copying
rhinoella 025e454
fix rpaths
rhinoella c56d9d8
Uninstall Freetype first
rhinoella 00f7360
Merge branch 'develop' into apple-silicon
rhinoella 9686572
Fix indentation
rhinoella 18561f1
Fix indentation
rhinoella bf0686f
Fix lint
rhinoella 7164f2f
Fix yaml indentation
rhinoella ea51627
Fix build env vars
rhinoella f6c3ac3
Change uninstall to only freetype
rhinoella 3b73c0a
Uninstall force
rhinoella 4a63099
Fix linking onedpl
rhinoella 254423b
Try cleanup
rhinoella 522ffa7
Remove find freetype
rhinoella 482349e
Force remove freetype
rhinoella 93b58a4
Turn off rpath changing & fix freetype ref
rhinoella 3fb9365
Include freetype paths in cmake command
rhinoella 9c10947
Fix freetype include dirs
rhinoella 6d4cf84
Try get freetype from conan
rhinoella bf63e96
Find freetype
rhinoella 3dcb299
Try again to set freetype_dir env var
rhinoella ab6a2f2
Merge branch 'develop' into apple-silicon
rhinoella d2f8331
Forgot to commit conanfile
rhinoella 28bf090
Find freetype dependencies
rhinoella ad8b4e8
link brotli
rhinoella 2b50d37
Fix formatting
rhinoella 8afa3be
Fix formatting
rhinoella a735aab
FindBrotli
rhinoella b2d3362
Formatting
rhinoella a686f73
Format
rhinoella 0ebf70c
Format
rhinoella cf97860
Try use conan lib paths
rhinoella 9591312
Remove qc
rhinoella 31954b0
Freetype too
rhinoella 17d1ee6
Fix packaging
rhinoella e07ad9c
Fix tbb &dpl include dirs, include freetype as well
rhinoella 25ae7e9
Change order of linking
rhinoella b787177
Use arm64 brew prefix
rhinoella 9795456
Remove mkdir
rhinoella 4448f05
Sudo
rhinoella 81f73ee
Chown homebrew
rhinoella 3eb88f3
wait
rhinoella e9d3c49
Use intel brew and stop modifying ftgl rpath
rhinoella d91af35
Reintroduce shared libs
rhinoella 8b3772e
Fix lint cmakelist
rhinoella 9a70194
Fix prep dmg call
rhinoella 3bd0104
Try to include libs in bundle
rhinoella c1e4b63
Revert osx build workflow file
rhinoella 396007f
Revert osx build workflow file
rhinoella 512e217
Revert windows build workflow file
rhinoella 5c7252b
Fix apple silicon packaging
rhinoella 129cda1
Fix dissolve app path in packaging and change osx to osx-intel
rhinoella 827d940
Add homebrew rpath, fix cmakelists
rhinoella 095cd9f
Revert workflows to normal
rhinoella a6ef410
Remove indentation errors
rhinoella 814ea81
Remove indentation errors
rhinoella bc9d357
Remove indentation errors
rhinoella 7634c74
Upgrade onedpl version
rhinoella 5320783
Find dependencies for windows as well (ftgl deps)
rhinoella effbc6a
Separate intel and silicon packaging steps
rhinoella 6fad424
specify osx_ to vars
rhinoella 13b3767
Delete cmake/Modules/FindBrotli.cmake
rhinoella 8c918c4
Readd buildLinux to needs for package step
rhinoella da493ff
Undo changes to FindFTGL.cmake
rhinoella c5163ed
Remove if: false
rhinoella 69c2bb5
Remove install_name_tool
rhinoella File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
name: Build | ||
description: Build on OSX | ||
|
||
inputs: | ||
threading: | ||
default: true | ||
antlrVersion: | ||
default: "4.13.1" | ||
ftglVersion: | ||
default: "2.1.3-rc5" | ||
extraCMakeFlags: | ||
default: "" | ||
cacheOnly: | ||
type: boolean | ||
default: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
# | ||
# Setup / Install Dependencies | ||
# | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
|
||
- name: Install Homebrew Dependencies | ||
if: ${{ inputs.cacheOnly }} | ||
shell: bash | ||
run: | | ||
set -ex | ||
brew update-reset | ||
brew install ninja | ||
PACKAGES=(libpng freetype ftgl antlr) | ||
for PACKAGE in "${PACKAGES[@]}" | ||
do | ||
brew fetch --force --bottle-tag=arm64_monterey $PACKAGE | ||
brew install $(brew --cache --bottle-tag=arm64_monterey $PACKAGE) | ||
done | ||
|
||
- name: Install Python Dependencies | ||
shell: bash | ||
run: | | ||
pip3 install --user aqtinstall conan==1.58.0 | ||
|
||
- name: Retrieve Qt Cache | ||
id: cache-qt | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-qt-${{ env.qtVersion }} | ||
path: ${{ runner.temp }}/qt | ||
|
||
- name: Install Qt | ||
if: ${{ steps.cache-qt.outputs.cache-hit != 'true' }} | ||
shell: bash | ||
run: | | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
aqt install-qt --outputdir ${{ runner.temp }}/qt mac desktop ${{ env.qtVersion }} | ||
|
||
# | ||
# Main Build | ||
# | ||
|
||
- name: Install Conan Dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
|
||
# Setup paths | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
|
||
mkdir build && cd build | ||
conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache" | ||
conan install .. --build missing -s arch=armv8 | ||
|
||
- name: Build | ||
if: ${{ inputs.cacheOnly == 'false' }} | ||
shell: bash | ||
run: | | ||
set -ex | ||
|
||
# Setup paths | ||
# Must specify correct arm64 libs | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
Qt6_DIR=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos/lib/cmake/Qt6 | ||
QT_BASE_DIR=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos | ||
ANTLR_EXE=$(brew --prefix antlr)/antlr-${{ inputs.antlrVersion }}-complete.jar | ||
FTGL_INCLUDE_DIRS=$(brew --prefix ftgl)/include/ | ||
FTGL_LIBRARIES=$(brew --prefix ftgl)/lib/libftgl.2.dylib | ||
|
||
CMAKE_PARAMS=( | ||
-DGUI:bool=true | ||
-DMULTI_THREADING:bool=${{ inputs.threading }} | ||
-DJava_JAVA_EXECUTABLE:path=$JAVA_HOME_21_X64/bin/java | ||
-DANTLR_EXECUTABLE:string=$ANTLR_EXE | ||
-DFTGL_INCLUDE_DIRS:path=$FTGL_INCLUDE_DIRS | ||
-DFTGL_LIBRARIES:path=$FTGL_LIBRARIES | ||
-DCMAKE_OSX_ARCHITECTURES:string="arm64" | ||
-DQT_BASE_DIR=$QT_BASE_DIR | ||
) | ||
|
||
echo "Detected ANTLR exe as [$ANTLR_EXE]" | ||
echo "JAVA HOME: $JAVA_HOME_21_X64" | ||
|
||
# Build | ||
cd build | ||
cmake -G Ninja "${CMAKE_PARAMS[@]}" ${{ inputs.extraCMakeFlags }} ../ | ||
cmake --build . --config Release | ||
|
||
# Fix ftgl link path | ||
install_name_tool -change /usr/local/opt/ftgl/lib/libftgl.2.dylib @rpath/libftgl.2.dylib bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
|
||
cd ../ | ||
|
||
# Deploy Conan dependencies for ease | ||
mkdir deploy && cd deploy | ||
conan install .. -g deploy -s arch=armv8 | ||
|
||
# Copy over ftgl so it can be shipped with the bundle | ||
mkdir ftgl | ||
cp $(brew --prefix ftgl)/lib/libftgl.2.dylib ftgl | ||
cp $(brew --prefix ftgl)/lib/libftgl.2.1.3.dylib ftgl | ||
|
||
- name: Upload Raw Build Artifacts | ||
if: ${{ inputs.cacheOnly == 'false' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: osx-build-artifacts-silicon | ||
path: | | ||
${{ github.workspace }}/build | ||
${{ github.workspace }}/deploy | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Package | ||
description: Package OSX artifacts | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
|
||
- name: Retrieve Qt Cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-qt-${{ env.qtVersion }} | ||
path: ${{ runner.temp }}/qt | ||
|
||
- name: Download Raw Build Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: osx-build-artifacts | ||
path: ${{ github.workspace }} | ||
|
||
- name: Install Python Dependencies | ||
shell: bash | ||
run: | | ||
pip3 install --user dmgbuild biplist | ||
|
||
- name: Install Custom Dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
wget https://raw.githubusercontent.com/disorderedmaterials/scripts/master/prep-dmg | ||
chmod u+x ./prep-dmg | ||
|
||
- name: Prepare DMG Dirs | ||
shell: bash | ||
run: | | ||
set -ex | ||
Qt6_ROOT=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos/ | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
|
||
# Handle ANTLR & TBB | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.*.dylib /usr/local/lib | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.dylib /usr/local/lib/libantlr4-runtime.dylib | ||
|
||
for FILE in ./deploy/onetbb/lib/*.dylib; do | ||
FILENAME=$(basename $FILE) | ||
cp ./deploy/onetbb/lib/$FILENAME /usr/local/lib/$FILENAME | ||
done | ||
|
||
install_name_tool -add_rpath "@executable_path/../Frameworks/" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
install_name_tool -add_rpath "/usr/local/lib" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
./prep-dmg -a Dissolve-GUI -v ${{ env.dissolveVersion }} -b build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui -d ${Qt6_ROOT} -i icon/icon-1024x1024.png -p build/bin/dissolve-gui.app/Contents/Info.plist -L /usr/local/lib | ||
|
||
- name: Create Disk Image | ||
shell: bash | ||
run: | | ||
set -ex | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
|
||
# Fix icon link | ||
sed -i -e "s/Dissolve.icns/Dissolve-GUI.icns/g" Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Info.plist | ||
|
||
# Create DMG | ||
dmgbuild -s ci/osx/dmgbuild-settings.py -D app=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app -D icon=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Resources/Dissolve-GUI.icns "Dissolve GUI" Dissolve-GUI-${dissolveVersion}.dmg | ||
|
||
# Collect artifacts | ||
mkdir packages | ||
mv Dissolve-GUI-${dissolveVersion}.dmg packages/ | ||
|
||
- name: Upload Package Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: ${{ github.workspace }}/packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Package | ||
description: Package OSX artifacts | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
|
||
- name: Retrieve Qt Cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-qt-${{ env.qtVersion }} | ||
path: ${{ runner.temp }}/qt | ||
|
||
- name: Download Raw Build Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: osx-build-artifacts-silicon | ||
path: ${{ github.workspace }} | ||
|
||
- name: Install Python Dependencies | ||
shell: bash | ||
run: | | ||
pip3 install --user dmgbuild biplist | ||
|
||
- name: Install Custom Dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
wget https://raw.githubusercontent.com/disorderedmaterials/scripts/master/prep-dmg | ||
chmod u+x ./prep-dmg | ||
|
||
- name: Prepare DMG Dirs | ||
shell: bash | ||
run: | | ||
set -ex | ||
Qt6_ROOT=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos/ | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
|
||
install_name_tool -add_rpath "@executable_path/../Frameworks/" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
# Add homebrew rpath | ||
install_name_tool -add_rpath "/opt/homebrew/lib" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
|
||
./prep-dmg -a Dissolve-GUI -v ${{ env.dissolveVersion }} -b build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui -d ${Qt6_ROOT} -i icon/icon-1024x1024.png -p build/bin/dissolve-gui.app/Contents/Info.plist | ||
|
||
# Copy dependencies into Frameworks folder in app bundle | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.4.13.1.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libantlr4-runtime.4.13.1.dylib | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libantlr4-runtime.dylib | ||
|
||
cp ./deploy/ftgl/libftgl.2.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libftgl.2.dylib | ||
cp ./deploy/ftgl/libftgl.2.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libftgl.2.1.3.dylib | ||
|
||
for FILE in ./deploy/onetbb/lib/*.dylib; do | ||
FILENAME=$(basename $FILE) | ||
cp ./deploy/onetbb/lib/$FILENAME Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/$FILENAME | ||
done | ||
|
||
|
||
- name: Create Disk Image | ||
shell: bash | ||
run: | | ||
set -ex | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
|
||
# Fix icon link | ||
sed -i -e "s/Dissolve.icns/Dissolve-GUI.icns/g" Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Info.plist | ||
|
||
# Create DMG | ||
dmgbuild -s ci/osx/dmgbuild-settings.py -D app=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app -D icon=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Resources/Dissolve-GUI.icns "Dissolve GUI" Dissolve-GUI-${dissolveVersion}.dmg | ||
|
||
# Collect artifacts | ||
mkdir packages | ||
mv Dissolve-GUI-${dissolveVersion}.dmg packages/ | ||
|
||
- name: Upload Package Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: ${{ github.workspace }}/packages |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the rename and copy, would it be slightly neater to make our
ftgl
dir (at the end of the stage), copy the libs, and then applyinstall_name_tool
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually realised its best to remove the install_name_tool call as it will not work without notorisation!