Skip to content

Commit 94b4c6c

Browse files
authored
Add cross-compilation to x86_64 based on the Cirrus CI job
1 parent 10cf63e commit 94b4c6c

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/apple_m.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,67 @@ jobs:
155155
exit 1
156156
;;
157157
esac
158+
name: xbuild-x86_64
159+
on: [push, pull_request]
160+
161+
concurrency:
162+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
163+
cancel-in-progress: true
164+
165+
permissions:
166+
contents: read # to fetch code (actions/checkout)
167+
168+
jobs:
169+
build:
170+
if: "github.repository == 'OpenMathLib/OpenBLAS'"
171+
runs-on: macos-14
172+
173+
strategy:
174+
fail-fast: false
175+
176+
steps:
177+
- name: Checkout repository
178+
uses: actions/checkout@v6
179+
180+
- name: Print system information
181+
run: |
182+
if [ "$RUNNER_OS" == "macOS" ]; then
183+
sysctl -a | grep machdep.cpu
184+
else
185+
echo "::error::$RUNNER_OS not supported"
186+
exit 1
187+
fi
188+
189+
- name: Install Dependencies
190+
run: |
191+
if [ "$RUNNER_OS" == "Linux" ]; then
192+
sudo apt-get install -y gfortran cmake ccache libtinfo5
193+
elif [ "$RUNNER_OS" == "macOS" ]; then
194+
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
195+
brew reinstall gcc
196+
brew install coreutils ccache
197+
brew install llvm
198+
else
199+
echo "::error::$RUNNER_OS not supported"
200+
exit 1
201+
fi
202+
203+
- name: Crossbuild OpenBLAS
204+
run: |
205+
#export PATH=/opt/homebrew/opt/llvm/bin:$PATH
206+
#export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
207+
#export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
208+
export ARCHS="i386 x86_64"
209+
export ARCHS_STANDARD="i386 x86_64"
210+
export ARCHS_STANDARD_32_64_BIT="i386 x86_64"
211+
export ARCHS_STANDARD_64_BIT=x86_64
212+
export ARCHS_STANDARD_INCLUDING_64_BIT="i386 x86_64"
213+
export ARCHS_UNIVERSAL_IPHONE_OS="i386 x86_64"
214+
export VALID_ARCHS="i386 x86_64"
215+
xcrun --sdk macosx --show-sdk-path
216+
xcodebuild -version
217+
export CC=/Applications/Xcode_26.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
218+
export CFLAGS="-O2 -unwindlib=none -Wno-macro-redefined -isysroot /Applications/Xcode_26.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk -arch x86_64"
219+
make TARGET=CORE2 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 RANLIB="ls -l"
220+
221+

0 commit comments

Comments
 (0)