Is 'arch -k' universally supported on all platforms?

72 views
Skip to first unread message

Dr. David Kirkby

unread,
Jul 16, 2009, 8:17:37 AM7/16/09
to sage-...@googlegroups.com
I need to create a patch which is only applied on the sun4v
architecture. The way to test for that on Solaris is use use 'arch -k'

On 't2'

kirkby@t2:[~] $ arch -k
sun4v

On my own Sun Blade 2000

drkirkby@kestrel:[~] $ arch -k
sun4u


Is 'arch -k' supported on all platforms - linux, FreeBSD, OS X or
anything else we want Sage to work on?


I could test for Solaris first, then use 'arch -k' but if it's
universally implemented, then I'll do it in one step.

Dave

Martin Albrecht

unread,
Jul 16, 2009, 8:24:22 AM7/16/09
to sage-...@googlegroups.com
On Thursday 16 July 2009, Dr. David Kirkby wrote:
> I need to create a patch which is only applied on the sun4v
> architecture. The way to test for that on Solaris is use use 'arch -k'
>
> On 't2'
>
> kirkby@t2:[~] $ arch -k
> sun4v
>
> On my own Sun Blade 2000
>
> drkirkby@kestrel:[~] $ arch -k
> sun4u
>
>
> Is 'arch -k' supported on all platforms - linux, FreeBSD, OS X or
> anything else we want Sage to work on?

Debian GNU/Linux:

$ arch -k
arch: invalid option -- 'k'
Try `arch --help' for more information.
$ arch --help
Usage: arch [OPTION]...
Print machine architecture.

--help display this help and exit
--version output version information and exit

Report arch bugs to bug-co...@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report arch translation bugs to <http://translationproject.org/team/>


Cheers,
Martin

--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinr...@jabber.ccc.de


Carlo Hamalainen

unread,
Jul 16, 2009, 8:26:25 AM7/16/09
to sage-...@googlegroups.com
On Thu, Jul 16, 2009 at 2:17 PM, Dr. David
Kirkby<david....@onetel.net> wrote:
> drkirkby@kestrel:[~] $ arch -k
> sun4u
>
>
> Is 'arch -k' supported on all platforms - linux, FreeBSD, OS X or
> anything else we want Sage to work on?

Not on Ubuntu, apparently it has been deprecated upstream (in Debian?):

https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/148511

They say to use "uname -m"

--
Carlo Hamalainen
http://carlo-hamalainen.net

Dr. David Kirkby

unread,
Jul 16, 2009, 8:35:56 AM7/16/09
to sage-...@googlegroups.com
Martin Albrecht wrote:
> On Thursday 16 July 2009, Dr. David Kirkby wrote:
>> I need to create a patch which is only applied on the sun4v
>> architecture. The way to test for that on Solaris is use use 'arch -k'
>>
>> On 't2'
>>
>> kirkby@t2:[~] $ arch -k
>> sun4v
>>
>> On my own Sun Blade 2000
>>
>> drkirkby@kestrel:[~] $ arch -k
>> sun4u
>>
>>
>> Is 'arch -k' supported on all platforms - linux, FreeBSD, OS X or
>> anything else we want Sage to work on?
>
> Debian GNU/Linux:
>
> $ arch -k
> arch: invalid option -- 'k'


No problem, I'll test for Solaris first - something like:

if [ `uname` - "SunOS" ]; then
if [ `arch -k` = "sun4v" ] ; then
<do what I to do>
fi
fi

I was going to ask on AIX and HP-UX groups too, just in case someone
decided to port to one of those platform. But there is no point if its
not even supported on some linux distros.

Dr. David Kirkby

unread,
Jul 16, 2009, 8:38:30 AM7/16/09
to sage-...@googlegroups.com
Carlo Hamalainen wrote:
> On Thu, Jul 16, 2009 at 2:17 PM, Dr. David
> Kirkby<david....@onetel.net> wrote:
>> drkirkby@kestrel:[~] $ arch -k
>> sun4u
>>
>>
>> Is 'arch -k' supported on all platforms - linux, FreeBSD, OS X or
>> anything else we want Sage to work on?
>
> Not on Ubuntu, apparently it has been deprecated upstream (in Debian?):
>
> https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/148511
>
> They say to use "uname -m"
>


Thank you. Under the circumstances, I think I'll test for Solaris first,
though 'uname -m' does in fact work on Solaris.

Reply all
Reply to author
Forward
0 new messages