-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from hgb-bin-proteomics/macos
add support for macos
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build for macOS | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Build-for-macOS: | ||
runs-on: macos-14 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Copy and unzip eigen | ||
run: | | ||
cp eigen-3.4.0.zip VectorSearch | ||
cd VectorSearch | ||
unzip eigen-3.4.0.zip | ||
- name: Build VectorSearch.dll dynamic library | ||
run: | | ||
cd VectorSearch | ||
g++-13 -Wl,-ld_classic -shared -I eigen-3.4.0 -fPIC -fopenmp -O3 -o VectorSearch.dll dllmainUnix.cpp | ||
cp VectorSearch.dll .. | ||
- name: Install NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '6' | ||
- name: Build DataLoader | ||
run: | | ||
cd DataLoader | ||
dotnet publish DataLoader.csproj --runtime osx-arm64 --self-contained --configuration Release | ||
- name: Copy VectorSearch.dll to Release | ||
run: | | ||
cp VectorSearch.dll DataLoader/bin/Release/net6.0/osx-arm64 | ||
- name: Zip Release | ||
run: | | ||
cd DataLoader/bin/ | ||
zip -r Release.zip Release | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-macos-arm64-cpu-only | ||
path: DataLoader/bin/Release.zip |
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,36 @@ | ||
# Compilation on macOS (macOS 14 on M-Series Macs) | ||
|
||
## Installing dependencies | ||
|
||
The following dependencies are required for compilation: | ||
- Xcode Command Line Tools: `xcode-select --install` | ||
- [Homebrew](https://brew.sh/): `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` | ||
- gcc / g++: `brew install gcc` | ||
- .NET 6.0: [Install .NET on macOS](https://learn.microsoft.com/en-us/dotnet/core/install/macos) | ||
|
||
## Building the matrix multiplication backend (C++) | ||
|
||
To build the C++ library used for matrix multiplication the following steps are | ||
required: | ||
- Navigate to the `VectorSearch` directory: `cd VectorSearch` | ||
- Build the DLL: `g++-13 -shared -I eigen-3.4.0 -fPIC -fopenmp -O3 -o VectorSearch.dll dllmainUnix.cpp` | ||
- In case you get an error from the linker, you might want to try this instead: `g++-13 -Wl,-ld_classic -shared -I eigen-3.4.0 -fPIC -fopenmp -O3 -o VectorSearch.dll dllmainUnix.cpp` | ||
|
||
## Building the prototype testing suite (C#) | ||
|
||
To build the C# testing application the following steps need to be carried out: | ||
- Navigate to the `DataLoader` directory: `cd DataLoader` | ||
- Build the executable: `dotnet publish DataLoader.csproj --runtime osx-arm64 --self-contained --configuration Release` | ||
|
||
## Running the executable | ||
|
||
- Copy `VectorSearch.dll` to the build directory of `DataLoader`. | ||
- Run the executable. For example with `./DataLoader EigenSIntB 10000`. | ||
- Note that we only supply the compiled binaries for CPU-based search. GPU-based search is not available because Macs don't support Nvidia GPUs! | ||
|
||
# Running the executable without building / compiling yourself | ||
|
||
We provide compiled binaries in `DataLoaderExecutable/macos-arm` and in the | ||
`Releases` tab. Please again note that we only supply the compiled binaries for | ||
CPU-based search. Running the compiled binaries requires [.NET 6.0](https://learn.microsoft.com/en-us/dotnet/core/install/macos) | ||
and [g++](#Installing-dependencies). |