#3621 closed defect (fixed)
Check for OpenMP in configure script is broken
Reported by: | tian | Owned by: | sjoelund.se |
---|---|---|---|
Priority: | high | Milestone: | 1.9.4 |
Component: | Build Environment | Version: | |
Keywords: | autoconf, build, OpenMP, Linux | Cc: |
Description
The macro AC_TRY_LINK for openMP in configure.in:379 is not working as intended. GCC fails silently while Clang blocks.
The reason is that the second argument to AC_TRY_LINK must not contain the whole main() function
[int main(){do();something();}] but rather its body [do();something();].
Change History (7)
comment:1 Changed 8 years ago by sjoelund.se
comment:2 Changed 8 years ago by sjoelund.se
- Status changed from new to accepted
comment:3 Changed 8 years ago by sjoelund.se
- Resolution set to fixed
- Status changed from accepted to closed
Fixed the reported issue in [71c220705ad90b3b3da205ce9b2dc44f1aaaf942/OMCompiler].
comment:4 Changed 8 years ago by tian
Too bad it doesn't seem to have a flag to disable it :)
That's -pedantic-errors. o_O
comment:5 Changed 8 years ago by dietmarw
- Milestone changed from Future to 1.9.4
Sorting these closed tickets away from "Future". Since they were closed after the last 1.9.3 release, it's very likely that they should have been part of the 1.9.4 release.
comment:6 Changed 8 years ago by sjoelund.se
- Milestone changed from 1.9.4 to 1.9.4-1.9.x
Milestone renamed
comment:7 Changed 8 years ago by sjoelund.se
- Milestone changed from 1.9.4-1.9.x to 1.9.4
Milestone renamed
GCC actually allows code like this (except if -Wall -Werror is given; and you won't be able to compile OMC if you use -Werror):
https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html ... Too bad it doesn't seem to have a flag to disable it :)
And clang is only an OpenMP compiler if you have clang-3.7 and libomp-dev installed. It also requires linking against libomp, which the configure script does not handle.