clang-omp / clang

clang with OpenMP 3.1 and some elements of OpenMP 4.0 support
clang-omp.github.com
Other
91 stars 15 forks source link

Instructions for using clang-omp with XCode 9 #82

Open alk3ovation opened 7 years ago

alk3ovation commented 7 years ago

I've updated the instructions for using clang-omp with XCode 9.

Using OpenMP with XCode 9

  1. Install clang-omp using homebrew: brew install llvm.
  2. Add llvm binaries to your path using : echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile.
  3. Create a new Xcode project.
  4. Create a symlink - /usr/local/bin/clang-omp -> /usr/local/Cellar/llvm/5.0.0/bin/clang
  5. Create a symlink in the same directory - clang++-omp -> /usr/local/Cellar/llvm/5.0.0/bin/clang++
  6. Under Build Settings A. Add a new user-defined setting CC with the value /usr/local/bin/clang-omp -> B. Add -fopenmp to Other C Flags C. Add /usr/local/include to Header Search Paths D. Set Enable Modules (C and Objective-C) to No. E. Set Enable Index-While-Building Functionality to No
  7. Under Build Phases A. Add /usr/local/lib/libiomp5.dylib to Link Binary With Libraries
alexey-bataev commented 7 years ago

Best regards, Alexey Bataev

10.11.2017 0:54, alk3ovation пишет:

I've updated the instructions for using clang-omp with XCode 9.

Using OpenMP with XCode 9

  1. Install clang-omp using homebrew: brew install llvm.
  2. Add llvm binaries to your path using : echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile.
  3. Create a new Xcode project.
  4. Create a symlink - /usr/local/bin/clang-omp -> /usr/local/Cellar/llvm/5.0.0/bin/clang
  5. Create a symlink in the same directory - clang++-omp -> /usr/local/Cellar/llvm/5.0.0/bin/clang++
  6. Under Build Settings A. Add a new user-defined setting CC with the value /usr/local/bin/clang-omp -> B. Add -fopenmp to Other C Flags C. Add /usr/local/include to Header Search Paths D. Set Enable Modules (C and Objective-C) to No. E. Set Enable Index-While-Building Functionality to No
  7. Under Build Phases A. Add /usr/local/lib/libiomp5.dylib to Link Binary With Libraries

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clang-omp/clang/issues/82, or mute the thread https://github.com/notifications/unsubscribe-auth/AFHOjhiWkheTbBimMgwBemlggSb6fBGyks5s0-UXgaJpZM4QZGb2.

Hi, I don't think we need to update the instructions. clang-omp is discontinued, you'd better to use official clang/llvm.

Moreover, you an use Apple's clang to compile OpenMP programs. Though they disabled driver's -fopenmp option, you can use the frontend option this way: clang -Xclang -fopenmp -L -lomp

RoyiAvital commented 6 years ago

Where can one find a compiled version of OpenMP to link with your command:

clang -Xclang -fopenmp <your_program> -L <path to libomp> -lomp