[Openmp-commits] [PATCH] D40386: [OpenMP] Add entry for Intel Compiler 18
Jonas Hahnfeld via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Dec 5 09:19:02 PST 2017
Hahnfeld added a comment.
In https://reviews.llvm.org/D40386#944942, @protze.joachim wrote:
I didn't want to block this revision, I agree that this needs to be done with the current code.
> In https://reviews.llvm.org/D40386#940428, @Hahnfeld wrote:
>> For released versions (at least for the current way of defining the macros) the following should be possible (not tested):
>> #define KMP_COMPILER "Intel C++ Compiler " stringer(__INTEL_COMPILER / 100) "." stringer(__INTEL_COMPILER % 100) "." stringer(__INTEL_COMPILER_UPDATE)
>> Maybe you need to assign the temporary values to other defines for the macro magic to work, I'm not too familiar with how it works...
> The preprocessor cannot do arithmetic replacements. So stringer will not work.
> One way would be to calculate the value on execution.
> Since CMake has the information, we could configure the source and let CMake provide the compiler version.
You are right, my code doesn't work as intended. So maybe @omalyshe can convince the compiler team to add the macros that would simplify life? :-) (just found out where this information is printed, never used `KMP_VERSION=1` before...)
More information about the Openmp-commits