-
-
Save ijleesw/4f863543a50294e3ba54acf588a4a421 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# Install | |
brew install llvm | |
brew install libomp | |
# Compile | |
# clang++ test.cpp -o test -Xpreprocessor -fopenmp -lomp |
@rinibhasin have you successfully installed openmp in MacOS?
You have to add Homebrew's include and lib directories to Clang's header and library search paths:
-L/opt/homebrew/opt/libomp/lib -I/opt/homebrew/opt/libomp/include
(base) antongryban@Antons-MacBook-Air ~ % brew install llvm
brew install libomp
zsh: command not found: brew
zsh: command not found: brew
This is how it worked for me:
install https://brew.sh/
Install required packages
brew install llvm libomp
in command line set variables that will be used for compilation (can be done by editing .zprofile):
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
compile program
clang++ -fopenmp --std=c++11 -stdlib=libc++ lab04.cpp -o lab04 && ./lab04
@antongryban install https://brew.sh
This is how it worked for me:
install https://brew.sh/
Install required packages
brew install llvm libomp
in command line set variables that will be used for compilation (can be done by editing .zprofile):
export PATH="/opt/homebrew/opt/llvm/bin:$PATH" export LDFLAGS="-L/opt/homebrew/opt/llvm/lib" export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
compile program
clang++ -fopenmp --std=c++11 -stdlib=libc++ lab04.cpp -o lab04 && ./lab04
worked perfectly for me.
clang++ -fopenmp proj.cpp -o proj
yeah works perfect
omp.h file not found while using open mp