From: Dr. David Kirkby on
If one has a shared library (foobar.so), it is easy to tell if this is
a 32-bit or 64-bit library simply by using 'file'.

How can I do the same with a static library? I have a maths
application (linbox) which tries to link to an ATLAS static library,
but fails as it reports the library is 32-bit. I doubt this is true,
as I know ATLAS was compiled as 64-bit. But in general, how can one
tell if a static library is 32-bit or 64-bit?

I want to solve the problem on both Solaris and OpenSolaris - both
SPARC and x64, though I suspect the solution to one system will work
on another.

Dave
From: Casper H.S. Dik on
"Dr. David Kirkby" <david.kirkby(a)onetel.net> writes:

>If one has a shared library (foobar.so), it is easy to tell if this is
>a 32-bit or 64-bit library simply by using 'file'.

>How can I do the same with a static library? I have a maths
>application (linbox) which tries to link to an ATLAS static library,
>but fails as it reports the library is 32-bit. I doubt this is true,
>as I know ATLAS was compiled as 64-bit. But in general, how can one
>tell if a static library is 32-bit or 64-bit?

>I want to solve the problem on both Solaris and OpenSolaris - both
>SPARC and x64, though I suspect the solution to one system will work
>on another.


Unpack with "ar x" and use file on the extracted members.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
From: Chris Ridd on
On 2010-07-14 11:56:45 +0100, Dr. David Kirkby said:

> If one has a shared library (foobar.so), it is easy to tell if this is
> a 32-bit or 64-bit library simply by using 'file'.
>
> How can I do the same with a static library? I have a maths
> application (linbox) which tries to link to an ATLAS static library,
> but fails as it reports the library is 32-bit. I doubt this is true,
> as I know ATLAS was compiled as 64-bit. But in general, how can one
> tell if a static library is 32-bit or 64-bit?

It probably isn't a good idea, but it certainly is possible to have a
static library with a mixture of 32- and 64-bit objects. At least it is
possible on OpenSolaris...

Like Casper said, you'll need to extract the objects and run file on them.

--
Chris

From: Dr. David Kirkby on
On Jul 14, 12:21 pm, Casper H.S. Dik <Casper....(a)Sun.COM> wrote:
> "Dr. David Kirkby" <david.kir...(a)onetel.net> writes:
>
> >If one has a shared library (foobar.so), it is easy to tell if this is
> >a 32-bit or 64-bit library simply by using 'file'.
> >How can I do the same with a static library? I have a maths
> >application (linbox) which tries to link to an ATLAS static library,
> >but fails as it reports the library is 32-bit. I doubt this is true,
> >as I know ATLAS was compiled as 64-bit. But in general, how can one
> >tell if a static library is 32-bit or 64-bit?
> >I want to solve the problem on both Solaris and OpenSolaris - both
> >SPARC and x64, though I suspect the solution to one system will work
> >on another.
>
> Unpack with "ar x" and use file on the extracted members.

Thank you. That sounds easy enough.
From: Dr. David Kirkby on
On Jul 14, 3:45 pm, Chris Ridd <chrisr...(a)mac.com> wrote:
> On 2010-07-14 11:56:45 +0100, Dr. David Kirkby said:
>
> > If one has a shared library (foobar.so), it is easy to tell if this is
> > a 32-bit or 64-bit library simply by using 'file'.
>
> > How can I do the same with a static library? I have a maths
> > application (linbox) which tries to link to an ATLAS static library,
> > but fails as it reports the library is 32-bit. I doubt this is true,
> > as I know ATLAS was compiled as 64-bit. But in general, how can one
> > tell if a static library is 32-bit or 64-bit?
>
> It probably isn't a good idea, but it certainly is possible to have a
> static library with a mixture of 32- and 64-bit objects. At least it is
> possible on OpenSolaris...

OK, thank you. I was not aware of that. I'll have to sort out what's
happening with this. It's a bit annoying, as it takes about 8 hours to
build the library, so debugging is not a lot of fun. That's due to a
combination of an unsuitable architecture (sun4v) and the fact the
version of ATLAS I'm using has no tuning parameters for sun4v.

I'll probably perform the debugging on a sun4u machine first.

> Like Casper said, you'll need to extract the objects and run file on them..

Yes, that's one to remember.

> --
> Chris

Dave