Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-fopenmp does not define _OPENMP macro #23866

Closed
llvmbot opened this issue May 12, 2015 · 4 comments
Closed

-fopenmp does not define _OPENMP macro #23866

llvmbot opened this issue May 12, 2015 · 4 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@llvmbot
Copy link
Member

llvmbot commented May 12, 2015

Bugzilla Link 23492
Resolution FIXED
Resolved on May 19, 2015 23:25
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @alexey-bataev

Extended Description

Following recent news of Clang is OpenMP 3.1 complete, which is wonderful, I tried to use clang with OpenMP support. Before I can run any more test, it seems that the _OPENMP macro is not properly defined at all.

The following is a minimal example

#ifndef _OPENMP
#error NO OPENMP defined
#endif

int main () {}

And on compile line clang++ -fopenmp -o test test.cpp (or clang)

The following is more details of the build of clang
OS : CentOS 7 (updated daily)

LLVM subprojects in the build tree: LLVM, clang, compiler-rt, polly, clang-extra-tools, libcxx, libcxxabi

CMake options:

args="$args -DCMAKE_BUILD_TYPE=Release"
args="$args -DCMAKE_INSTALL_PREFIX=/opt/LLVM/$prefix"
args="$args -DBUILD_SHARED_LIBS=ON"
args="$args -DLLVM_ENABLE_BACKTRACES=OFF"
args="$args -DLLVM_ENABLE_CRASH_OVERRIDES=OFF"
args="$args -DLLVM_ENABLE_PEDANTIC=OFF"
args="$args -DLLVM_ENABLE_WARNINGS=OFF"
args="$args -DLLVM_INCLUDE_DOCS=OFF"
args="$args -DLLVM_INCLUDE_EXAMPLES=OFF"
args="$args -DLLVM_INCLUDE_TESTS=OFF"
args="$args -DLLVM_TARGETS_TO_BUILD=host"

@llvmbot
Copy link
Member Author

llvmbot commented May 12, 2015

assigned to @alexey-bataev

@alexey-bataev
Copy link
Member

-fopenmp does not turn on OpenMP support by default. Will be fixed soon.
Use -fopenmp=libiomp5 for now.

@llvmbot
Copy link
Member Author

llvmbot commented May 13, 2015

-fopenmp=libiomp5
appears to have the same problem. And -fopenmp seems to turn on OpenMP but only it links to libgomp. In either case, the _OPENMP macro is not defined.

A minor issue, I also have Intel Compilers paths/ld_library_path in my environment, and it appears that -fopenmp=libiomp5 cause to executable to find Intel's libiomp5.so, which is in LD_LIBRARY_PATH. Surely I can avoid this issue by using rpath etc. But is the libiomp5.so runtime distribution with Intel compilers also supported? Or only the one compiled in the LLVM tree?

@alexey-bataev
Copy link
Member

Fixed in revision 237769.

I don't expect any troubles with bundled libiomp5. You can use it.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants