[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #FEZ-604468]: cputype error



Hi Matthew,

Sorry for the delay in responding.   A MacBook Pro can't compile or run 64-bit 
applications, they are currently only supported on PowerPC G5 platforms.  You 
can verify this by compiling and running the following C program, and noting 
that gcc won't accept the "-m64" option to compile for the LP64 model:

tmp$ cat sizeof.c
cat sizeof.c
#include <stdio.h>

main ()
{
int i=0;
long int li=0;
long long int lli=0;
double d=0;
char c;
char * p;

printf ("Size of Data Types on this System:\n\n");
/*---------------------------------------------*/
printf( "Char = %d bytes\n", sizeof(c) );
printf( "Integer = %d bytes\n", sizeof(i) );
printf( "Long Integer = %d bytes\n", sizeof(li) );
printf( "Long Long Integer = %d bytes\n", sizeof(lli) );
printf( "Double = %d bytes\n", sizeof(d) );
printf( "Pointer = %d bytes\n", sizeof(p) );
}
tmp$ gcc -o sizeof sizeof.c && ./sizeof
gcc -o sizeof sizeof.c && ./sizeof
Size of Data Types on this System:

Char = 1 bytes
Integer = 4 bytes
Long Integer = 4 bytes
Long Long Integer = 8 bytes
Double = 8 bytes
Pointer = 4 bytes
tmp$ gcc -m64 -o sizeof sizeof.c && ./sizeof
gcc -m64 -o sizeof sizeof.c && ./sizeof
sizeof.c:1: sorry, unimplemented: 64-bit mode not compiled in

For a MacBook Pro, you have to use 32-bit libraries, so there is no way to 
enable 64-bit objects when building the netCDF libraries.

> This is my error:
> 
> ld: warning /usr/lib///libnetcdf.a archive's cputype (18, architecture ppc)
> does not match cputype (7) for specified -arch flag: i686 (can't load from
> it)

That error indicates you are trying to link with a library built for a PowerPC, 
which won't work on the i686 architecture of a MacBook Pro.  But note that if 
you build the netCDF library from source on the MacBook Pro, it will work fine 
and it can still read and write all netCDF files, including those with 64-bit 
file offsets.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: FEZ-604468
Department: Support netCDF
Priority: Normal
Status: Closed