Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3621 closed defect (fixed)

Check for OpenMP in configure script is broken

Reported by: tian Owned by: Martin Sjölund
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 by Martin Sjölund, 9 years ago

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 by Martin Sjölund, 9 years ago

Status: newaccepted

comment:3 by Martin Sjölund, 9 years ago

Resolution: fixed
Status: acceptedclosed
Last edited 9 years ago by Martin Sjölund (previous) (diff)

comment:4 by tian, 9 years ago

Too bad it doesn't seem to have a flag to disable it :)

That's -pedantic-errors. o_O

comment:5 by Dietmar Winkler, 9 years ago

Milestone: Future1.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 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.