Opened 12 years ago

Closed 12 years ago

#4395 closed Bugs (fixed)

Intel 11.1 defines _GNU_SOURCE, breaking the get_nprocs test in thread.cpp

Reported by: Robert Lupton <rhl@…> Owned by: Anthony Williams
Milestone: Boost 1.44.0 Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

In a bug related to #2053, there's code in libs/thread/src/pthread/thread.cpp that attempts to only call get_nprocs on gnu platforms that define _GNU_SOURCE (cf. http://lists.boost.org/Archives/boost/2010/05/166414.php)

Unfortunately, intel 11.1 appears to define _GNU_SOURCE, but not provide get_nprocs:

$ icpc --version
icpc (ICC) 11.1 20100401
Copyright (C) 1985-2010 Intel Corporation.  All rights reserved.

$ icpc intelSymbols.cc 
intelSymbols.cc(2): catastrophic error: #error directive: "_GNU_SOURCE is defined"
  #error "_GNU_SOURCE is defined"
   ^

compilation aborted for intelSymbols.cc (code 4)
$ cat !$
cat intelSymbols.cc
#if defined(_GNU_SOURCE)
#error "_GNU_SOURCE is defined"
#endif

Change History (2)

comment:1 by anonymous, 12 years ago

i think the test for _GNU_SOURCE should come as the last, otherwise linking against uclibc is failing too

comment:2 by Anthony Williams, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.