[Openmp-commits] [PATCH] LLVM OpenMP CMake Overhaul

Chandler Carruth chandlerc at google.com
Thu Jun 25 00:30:17 PDT 2015


On Tue, Jun 23, 2015 at 10:06 AM Jonathan Peyton <
jonathan.l.peyton at intel.com> wrote:

> Chris,
>
> > I am strongly apposed to this change. This was designed specifically to
> ensure that each set of compilers can easily set their own specific flags.
> Do not remove this feature.
>
> > Why - who cares? fwiw - most cmake files are named CMakeLists.txt
>
> >  .cmake is typically used for cmake files which are meant to be reused
> as "modules".
>
> >  I am a bit annoyed with the history of the cmake build system. My
> original system worked and was removed without much justification "just
> because". Now it's being refactored again and it's unclear to me the
> driving motivation.
>
>
> Maybe I can help answer these questions with the aid of the email message
> below.  To get the LLVM OpenMP Runtime set as the default OpenMP runtime
> library linked when using the -fopenmp flag, we have to get our CMake build
> to use LLVM conventions/standards.  This meant putting everything in its
> own pseudo namespace Libomp, libomp_ , or LIBOMP_ and creating a real
> configuration step which checks for compiler flags, features, etc.  I've
> followed what libcxx and compiler-rt do by having a config-ix.cmake file
> which does all this.  Although the compiler flags approach I had worked for
> gcc,clang,icc,and msvc, this method of checking the compiler flags is more
> generic and allows any compiler that supports the flag to use it.


FWIW, I don't think we should have two ways of configuring compiler flags
in the LLVM project. If someone wants to work to change all of them to a
more elegant solution than the current pattern, I'm not opposed to that,
but it does seem to provide the necessary functionality.


>   Also, there are at least three other methods of adding custom flags
> (-DLIBOMP_${LANG}FLAGS=' ... ' , -DCMAKE_${LANG}_FLAGS=' ... ' , or good
> ole CFLAGS=' ... ' envirable).


I want to emphasize that AFAICT, different compilers can still use
different flag sets. We even have logic in LLVM's variant of this which
handles *the same flag name* differently for different compilers, so we
shouldn't be losing any functionality.


>   The ultimate goal here is to get the LLVM OpenMP Runtime set as the
> default, so I have!
>   to do whatever it takes to achieve that.


I don't think this is a good approach or a healthy approach. I also don't
think it is necessary.

The ultimate goal should be to get the LLVM OpenMP runtimes with a
maintainable, consistent, *and functional* CMake build as part of the
larger LLVM project. If there are features that need to be added (or fixed,
or changed) in the larger CMake bits, we should do that. If the way LLVM is
doing things elsewhere is *wrong* or *bad*, we should fix that, not just
conform with it.

But yes, a really important consequence is getting to move everyone over to
building the runtime by default and Clang over to using it by default.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20150625/57a726b8/attachment.html>


More information about the Openmp-commits mailing list