Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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();].

https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fTRY_005fLINK-2208

Change History (7)

comment:1 Changed 8 years ago by sjoelund.se

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):

int main() {
  int main() {
    return 1;
  }
  return main();
}

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.

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
Last edited 8 years ago by sjoelund.se (previous) (diff)

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

Note: See TracTickets for help on using tickets.