From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30849 invoked by alias); 22 Apr 2009 08:43:05 -0000 Received: (qmail 30840 invoked by uid 22791); 22 Apr 2009 08:43:04 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Apr 2009 08:42:58 +0000 Received: by wf-out-1314.google.com with SMTP id 25so2428738wfc.14 for ; Wed, 22 Apr 2009 01:42:56 -0700 (PDT) Received: by 10.143.163.12 with SMTP id q12mr5093050wfo.224.1240389776057; Wed, 22 Apr 2009 01:42:56 -0700 (PDT) Received: from executor.local (124-168-209-69.dyn.iinet.net.au [124.168.209.69]) by mx.google.com with ESMTPS id 32sm317597wfc.16.2009.04.22.01.42.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Apr 2009 01:42:55 -0700 (PDT) Message-ID: <49EED88C.3060603@gmail.com> Date: Wed, 22 Apr 2009 08:43:00 -0000 From: Tiago Pereira User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: More than 2Gb of static memory with powerpc64 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2009-04/txt/msg00294.txt.bz2 Hi, I am using gfortran/gcc and need to run a fortran program that needs to create a block with more than 2Gb static memory. (I know this is not optimal, but it's not my code and it's too hard to change.) This is not possible in 32-bit systems due to addressing limitations, but is possible in 64-bit. For x86-64 systems I have managed to get around this problem by using the compiler flag -mcmodel=medium. However, I'm having problems compiling the same program in a PowerPC system (64-bit). It seems to me that the -mcmodel=medium only applies for x86-64 systems. Compiling the code without any special options will fail at linking, with this message: ld: total output size exceeds 2GB (2065MB) If I include the -mcmodel=medium option then gfortran says it doesn't know it: $ gfortran -O2 -mpowerpc64 -mcmodel=medium -c -o msline.o msline.f f951: error: unrecognized command line option "-mcmodel=medium" I have been using -mpowerpc64 to ensure it compiles a 64-bit version for the PowerPC, but I don't know how (or if it's possible) to address more than 2Gb of static memory in this architecture. I am using Mac OS X 10.5.6, with gcc/gfortran from hpc.sourceforge.net. The gcc version is 4.4: $ gfortran --version GNU Fortran (GCC) 4.4.0 20080801 (experimental) (I also tried with gcc 4.3 compiled in the same machine with MacPorts, but the problem persists.) Anyone have any ideas on how to do this in PowerPC? Thanks! Tiago