FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 06-16-2011, 11:28 PM
Jan Medlock
 
Default Cross-platform detection of multiarch

What is the recommended way to detect the presence of multiarch in a
cross-platform build?

I'm trying to fix up the Sage <http://www.sagemath.org/> build, which
seems to need to set a search path on multiarch systems:
<http://trac.sagemath.org/sage_trac/ticket/11243>

Currently, there's an explicit check for Ubuntu 11.04, which doesn't
work for Debian and its other derivatives, will break with the next
version of Ubuntu, etc.

So, what's the best way to check whether the OS has multiarch?

I though about using dpkg-architecture. Another way would be
preferred since dpkg-dev, the package containing dpkg-architecture,
might not be installed.

Thanks,
Jan Medlock


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110616232841.GA5426@ralph.turboshower.net">http://lists.debian.org/20110616232841.GA5426@ralph.turboshower.net
 
Old 06-17-2011, 12:02 AM
Brian May
 
Default Cross-platform detection of multiarch

On 17 June 2011 09:28, Jan Medlock <medlock-debian@turboshower.net> wrote:
> I though about using dpkg-architecture. *Another way would be
> preferred since dpkg-dev, the package containing dpkg-architecture,
> might not be installed.

Is that likely?

dpkg-dev is required by build-essential and contains a number of
important programs required for building Debian packages.
--
Brian May <brian@microcomaustralia.com.au>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTi=xeQUTq2miVBg+uyEYa2FgnrAKjw@mail.gmail.com ">http://lists.debian.org/BANLkTi=xeQUTq2miVBg+uyEYa2FgnrAKjw@mail.gmail.com
 
Old 06-17-2011, 01:51 AM
Jan Medlock
 
Default Cross-platform detection of multiarch

On 17 June 2011 10:002, Brian May <brian@microcomaustralia.com.au>
wrote:
> On 17 June 2011 09:28, Jan Medlock <medlock-debian@turboshower.net>
> wrote:
>> I though about using dpkg-architecture. Another way would be
>> preferred since dpkg-dev, the package containing dpkg-architecture,
>> might not be installed.
>
> Is that likely?
>
> dpkg-dev is required by build-essential and contains a number of
> important programs required for building Debian packages.

I don't know. Is dpkg-dev installed by default on Debian, Ubuntu,
Mint, etc.? (I'd guess the answer is no to all of them.)

Sage is designed to be built easily (just 'make') on a wide variety of
platforms. I'd like a solution that as robust as possible to optional
packages the user might not have installed, since that's what Sage
tries to provide with its build system.

And in case there's confusion, I'm not talking about building a Debian
package: smarter people than me haven't yet solved that problem
because of all of its included dependencies, some of which are
required to be very specific versions. The way to install Sage is to
build it from source, which now fails on multiarch Debian and
derivatives (except for Ubuntu 11.04).


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110617015148.GA2947@turboshower.net">http://lists.debian.org/20110617015148.GA2947@turboshower.net
 
Old 06-17-2011, 01:58 AM
Jonathan Nieder
 
Default Cross-platform detection of multiarch

Hi Jan,

Jan Medlock wrote:

> What is the recommended way to detect the presence of multiarch in a
> cross-platform build?
[...]
> Currently, there's an explicit check for Ubuntu 11.04

Thanks for raising this. Of course, multiarch in Debian is young so
there is still a chance to make changes to improve this kind of use
case before a release. As you hinted, other platforms may have other
ways to solve the same problems.

I would be very interested to hear about how the presence of multiarch
affects sage's build, and maybe we can come up with a generic solution
(like adding a new variable to getconf, things like that). After
reading the bug log you linked to, it's still unclear to me where
multiarch fits in (as not ld's change in defaults to
--no-copy-dt-needed, say).

For example: the best practice for installing a library for a long
time has been to write to $prefix/lib by default and allow this to be
overridden (for example to /usr/lib64 or /usr/lib/$(dpkg-architecture
-qDEB_HOST_MULTIARCH)) at build time. I don't think multiarch changes
that.

To give another example: if you want to see where gcc looks for
libraries for some reason, there is "gcc -print-search-dirs".

Looking forward to your thoughts,
Jonathan


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110617015812.GA27902@elie">http://lists.debian.org/20110617015812.GA27902@elie
 
Old 06-17-2011, 02:01 AM
Jonathan Nieder
 
Default Cross-platform detection of multiarch

Jonathan Nieder wrote:

> After
> reading the bug log you linked to, it's still unclear to me where
> multiarch fits in (as not ld's change in defaults to
> --no-copy-dt-needed, say).

Ah, stupid me: here's a link so others can start where I left off.

http://groups.google.com/group/sage-devel/msg/e60dc9297efebeaa

Perhaps Python should be making use of "gcc -print-search-dirs"
output.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110617020141.GA2769@elie">http://lists.debian.org/20110617020141.GA2769@elie
 
Old 06-17-2011, 04:17 AM
Jan Medlock
 
Default Cross-platform detection of multiarch

Jonathan Nieder wrote:
> Jonathan Nieder wrote:
>> After
>> reading the bug log you linked to, it's still unclear to me where
>> multiarch fits in (as not ld's change in defaults to
>> --no-copy-dt-needed, say).
>
> Ah, stupid me: here's a link so others can start where I left off.
>
> http://groups.google.com/group/sage-devel/msg/e60dc9297efebeaa
>
> Perhaps Python should be making use of "gcc -print-search-dirs"
> output.

I just dug through this and understand better now.

Debian uses a different solution for building Python 2.6 than that
used by Sage (and it looks like Ubuntu). There's a patch in Debian's
packages of Python 2.6 that essential adds
{/lib,/usr/lib}/$(DEB_HOST_MULTIARCH) to the library search path.
This solution is included in upstream Python 2.7.

Python's distutils (or whatever is setting the default library paths)
seems to be not using the compiler's ideas about the library path
(i.e. gcc -print-search-dirs). That seems broken to me... Parsing
the library directory paths across multiple compilers must be hard.

Thanks for sending me down the right path. It looks like I should
just patch my local versions until Sage upgrades to Python 2.7. (And
even then, it'll require dpkg-dev to compile.) And multiarch was not
really involved...

JM


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110617041720.GA26861@ralph.turboshower.net">http ://lists.debian.org/20110617041720.GA26861@ralph.turboshower.net
 
Old 06-17-2011, 08:57 AM
Jonathan Nieder
 
Default Cross-platform detection of multiarch

Jan Medlock wrote:

> Thanks for sending me down the right path. It looks like I should
> just patch my local versions until Sage upgrades to Python 2.7. (And
> even then, it'll require dpkg-dev to compile.) And multiarch was not
> really involved...

On the contrary, it has everything to do with multiarch, and I was just
slow to see it.

Anyway, you seem to understand well. Glad I could help in some small
way.

Regards,
Jonathan

gcc -print-search-dirs | grep ^libraries | cut -d= -f2- | sed -e 's/:/
/g' | while read line; do readlink -f $line; done


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110617085735.GA24533@elie">http://lists.debian.org/20110617085735.GA24533@elie
 
Old 07-09-2011, 01:22 PM
Matthias Klose
 
Default Cross-platform detection of multiarch

On 06/17/2011 10:57 AM, Jonathan Nieder wrote:
> Jan Medlock wrote:
>
>> Thanks for sending me down the right path. It looks like I should
>> just patch my local versions until Sage upgrades to Python 2.7. (And
>> even then, it'll require dpkg-dev to compile.) And multiarch was not
>> really involved...
>
> On the contrary, it has everything to do with multiarch, and I was just
> slow to see it.
>
> Anyway, you seem to understand well. Glad I could help in some small
> way.
>
> Regards,
> Jonathan
>
> gcc -print-search-dirs | grep ^libraries | cut -d= -f2- | sed -e 's/:/
> /g' | while read line; do readlink -f $line; done

see http://bugs.python.org/issue12418

the downside is that only the directories are in that output if they exist.

so maybe it would be time for some new autoconf macros AC_CC_INCLUDE_PATH and
AC_CC_LIB_PATH, and maybe a more specific AC_MULTIARCH_NAME.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4E185612.3020004@debian.org">http://lists.debian.org/4E185612.3020004@debian.org
 

Thread Tools




All times are GMT. The time now is 07:09 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org