[Openmp-dev] LLVM 3.9 openmp build failure on linux -- cannot find atomic

Riyaz Puthiyapurayil via Openmp-dev openmp-dev at lists.llvm.org
Mon Sep 12 08:00:15 PDT 2016

Thank you for confirming the issue. I did work around it. Btw, I had to set LIBOMP_CFLAGS and not LIBOMP_CXXFLAGS.

On Sep 11, 2016, at 11:03 PM, Hahnfeld, Jonas <Hahnfeld at itc.rwth-aachen.de<mailto:Hahnfeld at itc.rwth-aachen.de>> wrote:


-stdlib=libc++ is needed if you wish to use libc++ on a Linux system that would otherwise require a recent version of libstdc++ from GCC.
The flag is currently passed in by the LLVM root build system but probably does not work because the .c files are compiled as C++.
Intel’s plan was to clean that up by the end of September which should fix the problem.

In the meantime, could you try to specify LIBOMP_CXXFLAGS which should inject the parameters to the right places?
Note: The runtime does not really use or link against libc++ nor libstdc++ but clang requires the flag to actually find the atomic header…


From: Openmp-dev [mailto:openmp-dev-bounces at lists.llvm.org] On Behalf Of Paul Osmialowski via Openmp-dev
Sent: Friday, September 09, 2016 8:25 PM
To: openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org>
Subject: Re: [Openmp-dev] LLVM 3.9 openmp build failure on linux -- cannot find atomic

Hi Riyaz,

I'm always building LLVM OpenMP runtime with latest LLVM and Clang (from git master) and I on every of my Linux machines I never had to set any additional flags. What system are you building it on?

On 09/03/16 05:07, Riyaz Puthiyapurayil via Openmp-dev wrote:
With Release 3.9, kmp_lock.h is now including <atomic> under #ifdef __cplusplus. This wasn’t the case with Release 3.8.1. However, there are ‘.c’ files that are compiled as C++ files with ‘-x c++’ but they are not compiled with -stdlib=libc++. As a result, clang does not find <atomic> and gives the following error:

… Building C object projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_error.c.o
In file included from /remote/vgsource7/riyaz/llvm/projects/openmp/runtime/src/kmp_error.c:16:
In file included from /remote/vgsource7/riyaz/llvm/projects/openmp/runtime/src/kmp.h:92:
/remote/vgsource7/riyaz/llvm/projects/openmp/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
1 error generated.




Openmp-dev mailing list

Openmp-dev at lists.llvm.org<mailto:Openmp-dev at lists.llvm.org>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20160912/3b64138a/attachment.html>

More information about the Openmp-dev mailing list