You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

bash/terminal reports i386 but should be x86_64?

Hello all,

I come from the Linux and true UNIX world, so things on my new mac are taking a bit of time to get used to. I've read around the web that I can boot into a full x86_64 bit kernel by apply the flag using nvram and or by the 6 and 4 keys durning boot. However, both of these don't seem to do it for me. I load up the terminal, type 'arch' and I get i386 😟
I've checked under 'more about this mac' and it does say ' 64-bit Kernel and Extensions: Yes' . However, when I compile my programs such as netCDF/R/etc I get :
configure: netCDF 4.0.1
checking build system type... i386-apple-darwin10.2.0
checking host system type... i386-apple-darwin10.2.0


Any ideas ?

Thanks in advance 🙂

Message was edited by: appleTux

Macbook Pro 15', Mac OS X (10.6.2)

Posted on Nov 25, 2009 9:48 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 25, 2009 10:04 AM

Try ->

uname -a


Make your source code clean. Then read thru the Configure file and any README's or INSTALL's. You probably need an -arch flag. Sometimes ./Configure -h will help you sort it out.
7 replies

Nov 25, 2009 10:42 AM in response to appleTux

appleTux wrote:
I come from the Linux and true UNIX world


You come from the hacked-up world of Linux and are entering the true UNIX world. Linux is not UNIX and never has been. Apple MacOS X is certified UNIX.

so things on my new mac are taking a bit of time to get used to. I've read around the web that I can boot into a full x86_64 bit kernel by apply the flag using nvram and or by the 6 and 4 keys durning boot.


This is only possible on some machines. Plus, very few popular programs come with 64-bit kernel extensions. Even if you do get it running with a 64-bit kernel, you are unlikely to notice any difference.

I've checked under 'more about this mac' and it does say ' 64-bit Kernel and Extensions: Yes' . However, when I compile my programs such as netCDF/R/etc I get :
configure: netCDF 4.0.1
checking build system type... i386-apple-darwin10.2.0
checking host system type... i386-apple-darwin10.2.0


How are you building this code? I wouldn't trust any random configure-based open-source package to work properly. It is likely hacked up to do just "-arch ppc -arch i386". What happens when you build a "Hello" world program with no options? Run "file" on the result.

Nov 25, 2009 7:25 PM in response to etresoft

etresoft wrote:
appleTux wrote:
I come from the Linux and true UNIX world


You come from the hacked-up world of Linux and are entering the true UNIX world. Linux is not UNIX and never has been. Apple MacOS X is certified UNIX.


I never said linux was UNIX, thats just silly, but openBSD, freeBSD and IBM AIX are UNIX.

so things on my new mac are taking a bit of time to get used to. I've read around the web that I can boot into a full x86_64 bit kernel by apply the flag using nvram and or by the 6 and 4 keys durning boot.


This is only possible on some machines. Plus, very few popular programs come with 64-bit kernel extensions. Even if you do get it running with a 64-bit kernel, you are unlikely to notice any difference.

I should notice a difference with memory limits and blast librarys.
I've checked under 'more about this mac' and it does say ' 64-bit Kernel and Extensions: Yes' . However, when I compile my programs such as netCDF/R/etc I get :
configure: netCDF 4.0.1
checking build system type... i386-apple-darwin10.2.0
checking host system type... i386-apple-darwin10.2.0


How are you building this code? I wouldn't trust any random configure-based open-source package to work properly. It is likely hacked up to do just "-arch ppc -arch i386". What happens when you build a "Hello" world program with no options? Run "file" on the result.


The 'hacked' up program that I'm trying to compile is the netCDF library
http://www.unidata.ucar.edu/software/netcdf/index.html

As I said in my post I checked under the apple about this computer and it said that 64bit was enabled. If I do uname -a I see 'x86_64'. However, it's a bit messed up that 'arch' reports the wrong arch. What's odd is that this certified UNIX platform doesn't do what IBM AIX allows, ie to compile the netCDF library as x86_64.

Any ideas or should I just install something like fink or darwinports? 🙂

Nov 25, 2009 9:49 PM in response to appleTux

What's odd is that this certified UNIX platform doesn't do what IBM AIX allows, ie to compile the netCDF library as x86_64.

Did you mean to say that AIX generates x86_64 code, or that AIX compiles a 64 bit application by default? I was under the impression that AIX only runs on the IBM Power chip set (not counting any emulators that may or may not exist for the Power series of chips).

1st) you do not need the Mac OS X 64bit kernel to run a 64bit application. Unless you have something like 32GB of real physical memory, the 32 bit Mac OS X kernel will do the job. Running a 64bit Mac OS X kernel is just a "Red Herring", with respect to your question.

2nd) you need to tell the compiler to generate a 64 bit application. Because Mac OS X (32 or 64 bit kernels) can and do run both 32 and 64 bit applications concurrently, and because there are still some 32 bit only Macs on the supported list, the compilers most likely default to the safest build model.

I'm willing to bet that AIX also defaults to the safest compile options so the resulting program will run on any of the currently supported IBM Power line of RISC processors. If you want to optimize for a specific Power system, you most likely have to add compiler options.

Anyway, you most likely need to add something like

gcc -arch x86_64
# -OR-
gcc -m64

And just adding these compiler options may or may not allow your library to work, as porting code to a new platform or from 32 bits to 64 bits on any platform is not always as easy as changing a few command line switches. Been there, done that, still getting paid to do it. So it would be good if the package you are using has already been ported to Mac OS X 64 bit, and you just need to throw a ./configure switch.

I have to deal with AIX, Solaris, Linux, and Windows at work (who knows what they will throw at us next week; I hope it isn't HP-UX 😟 ). When you are writing portable code you quickly learn that each and every Operating System vendor (even those that are branded UNIX(tm)) have their own annoying qualities. You don't even want to see our Makefiles and all the crazy different compiler options we have to have for each different OS. And if the OS has a separate 32 bit vs 64 bit kernel (Linux and Windows) it just adds to the complexity.

Message was edited by: BobHarris

Nov 26, 2009 6:35 AM in response to appleTux

appleTux wrote:
I never said linux was UNIX, thats just silly, but openBSD, freeBSD and IBM AIX are UNIX.


Sorry, I see what you mean now.

I should notice a difference with memory limits and blast librarys.


You can compile 64-bit software, it is just the kernel that still runs in 32-bit mode.

I've checked under 'more about this mac' and it does say ' 64-bit Kernel and Extensions: Yes' . However, when I compile my programs such as netCDF/R/etc I get :
configure: netCDF 4.0.1
checking build system type... i386-apple-darwin10.2.0
checking host system type... i386-apple-darwin10.2.0


Did you check the result? They all look like 64-bit to me:
ncgen: Mach-O 64-bit executable x86_64

As I said in my post I checked under the apple about this computer and it said that 64bit was enabled. If I do uname -a I see 'x86_64'. However, it's a bit messed up that 'arch' reports the wrong arch. What's odd is that this certified UNIX platform doesn't do what IBM AIX allows, ie to compile the netCDF library as x86_64.


I wouldn't worry too much about what 'arch' says. MacOS X compiles netCDF as x86_64.

Any ideas or should I just install something like fink or darwinports? 🙂


If you do that, you're sure to be back here when it all gets screwed up.

Nov 26, 2009 9:38 AM in response to etresoft

Think I got it sorted. I had to compile gfortran and not from the dmg package. This seems to be happy now. The configure was also doing sizeof checks and it still was thinking that it was 32bit, however after getting gfortran ie gcc-4.2-5566-darwin8-all.tar.gz (which I guess isn't true compiling) the sizeof return true 64bit size's. Thanks you all for being helpful.
Just on a total side note I love my mac, is it different yes. Different is good, linux is different, I don't care what OS I use but it's just nice to understand the differences between the OS's and that's what an OS specific forum is for, no? 🙂

bash/terminal reports i386 but should be x86_64?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.