Skip to content

Commit

Permalink
Merge pull request #16 from debbiemarkslab/fix/12/compilation
Browse files Browse the repository at this point in the history
Remove need to link libomp with homebrew
  • Loading branch information
aaronkollasch authored Jan 14, 2023
2 parents 2d6e482 + 7c4ecdf commit 905011f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ jobs:
submodules: 'recursive'

- name: Install prerequisites
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
case ${{ matrix.job.target }} in
*-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install libomp-dev ;;
*-apple-darwin) brew update --preinstall ; env HOMEBREW_NO_AUTO_UPDATE=1 brew install gcc libomp; brew link libomp --force ;;
*-apple-darwin) brew install gcc libomp; ;;
esac
- name: Compile default
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ all-mac32:
clang $(SOURCES) -o bin/plmc $(CLANGFLAGS) -D USE_FLOAT

# If using homebrew for openMP (libomp)
all-mac-openmp: BREW_PREFIX=$(shell brew --prefix)
all-mac-openmp: LIBOMP_PREFIX=$(shell brew --prefix libomp)
all-mac-openmp:
$(CC) $(SOURCES) -o bin/plmc -Xpreprocessor -fopenmp $(GCCFLAGS) -lomp -L$(BREW_PREFIX)/lib/ -I$(BREW_PREFIX)/include/
$(CC) $(SOURCES) -o bin/plmc -Xpreprocessor -fopenmp $(GCCFLAGS) -lomp -L$(LIBOMP_PREFIX)/lib/ -I$(LIBOMP_PREFIX)/include/

clean:
rm -rf bin/*

0 comments on commit 905011f

Please sign in to comment.