From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10124 invoked by alias); 20 Jan 2011 15:53:23 -0000 Received: (qmail 10114 invoked by uid 22791); 20 Jan 2011 15:53:22 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 15:53:16 +0000 Received: by iwn8 with SMTP id 8so727789iwn.20 for ; Thu, 20 Jan 2011 07:53:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.10.200 with SMTP id q8mr2705655ibq.122.1295538794809; Thu, 20 Jan 2011 07:53:14 -0800 (PST) Received: by 10.231.152.143 with HTTP; Thu, 20 Jan 2011 07:53:14 -0800 (PST) In-Reply-To: References: Date: Thu, 20 Jan 2011 15:53:00 -0000 Message-ID: Subject: Re: g++ cross distro compilation problem From: Nick Stokes To: Jonathan Wakely Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00308.txt.bz2 On Wed, Jan 19, 2011 at 7:47 PM, Jonathan Wakely wr= ote: > On 19 January 2011 23:27, Nick Stokes wrote: >> >> Ian, =A0you are right on. The versions are different: >> compute node (where gcc is built): =A0/lib64/libc-2.5.so >> login node (where gcc is used): =A0/lib64/libc-2.11.2.so >> >> Jonathan, I looked at the config.logs (attached). Both seem to use gnu. > > Yes, both your distros have a new enough glibc, so the problem might be s= impler: > does it make any difference if you define _GNU_SOURCE when compiling? > Assuming you are referring to compiling a code with g++ (and not compiling gcc itself), then no it doesn't make a difference. (in fact, g++ -v shows that _GNU_SOURCE is already defined). Could it be some other silly mistake on my part, e.g forgetting to set an environment variable or something? Indeed there is the distro's g++ compiler installed on the login node, and most of these headers -- that are potentially incompatible with the gcc versions I am trying to install under /opt -- are under common places /usr/include etc. > > The GNU model, which requires glibc 2.3 or later, supports a > per-thread locale (via the uselocale function) so that the locale can > be changed temporarily by the C++ runtime library without affecting > the global process-wide locale. =A0I believe this avoids possible race > conditions in multithreaded programs which make use of locales. > I see. Thanks for this info, it seems I should not be using generic locale then. - Nick