Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#313 closed bug (fixed)

Singular fails to build on OSX with 64bit kernel

Reported by: vbraun.name@… Owned by: somebody
Priority: major Milestone:
Component: singular-kernel Version: 3-1-2
Keywords: OSX 64bit Cc:

Description

This is a copy of the ticket #10739 on the Sage trac (trac.sagemath.org/sage_trac/ticket/10739):

OSX usually runs a 32bit kernel (uname -m == 'i386'), but very new Macs default to a 64bit kernel (uname -m == 'x86_64'). This breaks Singular, since the singuname.sh script is not aware of the possibility of x86_64.

From the OSX 10.6 wikipedia page wikipedia.org/wiki/Mac_OS_X_Snow_Leopard

Newer Xserve and Mac Pro machines will run a 64-bit kernel by default; newer iMac machines can run a 64-bit kernel, but will not do so by default. Users wishing to use the 64-bit kernel on those machines must hold down the numbers 6 and 4 on the keyboard while booting to get the 64-bit kernel to load.

Franco Saliola on sage-devel (https://groups.google.com/d/msg/sage-release/X1J1ciueT5A/doPR9vPVZVAJ) has checked that modifying singuname.sh to return ix86Mac-darwin (same as other OSX versions) allows Singular to build correctly.

Change History (5)

comment:1 Changed 13 years ago by hannes

Resolution: fixed
Status: newclosed

Thanks for the report. The result of singuname.sh is used for pathnames, for the name of the binary package and some modification which configure would not find. As 32bit OsX and 64bit OsX are quite similiar, this works well for (1) and (3). For (2), singuname should report something different, see http://www.singular.uni-kl.de:8002/trac/changeset/13821

comment:2 Changed 13 years ago by vbraun.name@…

Slightly OT, but I'm totally confused about the OSX (both 32 and 64 bit) entries in kernel/mod_raw.cc. OSX uses Mach-O and not ELF as its binary format. Though at least the changeset treats ix86Mac-Darwin and x86_64Mac-Darwin in the same way.

comment:3 Changed 13 years ago by Volker Braun <vbraun.name@…>

PS: The 32/64bit change in OSX 10.6 is only the kernel, not the userspace. OSX can always run 32 and 64 bit userspace programs (if the CPU supports it). And yes, so far the default was to run 64 bit programs on a 32 bit kernel %-)

comment:4 Changed 13 years ago by hannes

What we really need here are the routines dlopen, dlsym, dlerror, dlclose for handling dynamic libraries. Historically first used for ELF based system (therefore the name/test) but works also for mach-o based bundles once one know how to build them.

And: Singular was 32bit on OsX because gcc defaults (until lately?) to 32bit on it.

comment:5 Changed 13 years ago by anonymous

Ok, thanks!

It seems like gcc defaults to 64bit now on OSX 10.6, irregardless of whether its new hardware (uses 64bit kernel) or old hardware (uses 32bit kernel). Calling uname -m returns the kernel bitwidth and not the gcc default bitwidth.

Note: See TracTickets for help on using tickets.