public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Using MPC Library with GCC
@ 2009-04-27 18:54 Mark Mitchell
  2009-04-28 18:13 ` Kaveh R. Ghazi
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Mitchell @ 2009-04-27 18:54 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: GCC

At Kaveh's request, the SC has considered whether or not GCC can rely
upon the MPC library.  As Kaveh knows (as an SC member) the SC has
reviewed this decision and does not feel that the SC or the FSF need to
explicitly permit the use of a library whose license is compatible with
GPLv3, even if the library is not part of the GNU project.  In other
words, if the technical consensus is that such a library provides value,
then we can use it, without explicitly asking the FSF to sign off on
each individual library.

That is not a decision, however, on whether using MPC is or is not a
good idea.  There have been objections raised to MPC, on the grounds
that it may not build on all host systems, or that the costs it brings
in terms of complexity of building GCC outweigh its benefits.  We should
reach consensus on those issues before making a decision about whether
to depend upon it.  The SC could be involved there, if no decision can
be reached, but I hope that we can reach consensus and therefore avoid
having to ask the SC to arbitrate.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
  2009-04-27 18:54 Using MPC Library with GCC Mark Mitchell
@ 2009-04-28 18:13 ` Kaveh R. Ghazi
  2009-05-05 15:15   ` Kaveh R. GHAZI
  0 siblings, 1 reply; 11+ messages in thread
From: Kaveh R. Ghazi @ 2009-04-28 18:13 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: GCC

From: "Mark Mitchell" <mark@codesourcery.com>

> That is not a decision, however, on whether using MPC is or is not a
> good idea.  There have been objections raised to MPC, on the grounds
> that it may not build on all host systems, or that the costs it brings
> in terms of complexity of building GCC outweigh its benefits.  We should
> reach consensus on those issues before making a decision about whether
> to depend upon it.

Thanks Mark.  Although I personally felt that the GPLv3-compatible license
terms were sufficient from a legal and policy perspective, it's good to
clarify this officially for future circumstances as well as retroactively
for the libraries we already depend on.  Also I agree that the remainder of
the discussion (i.e. whether it's a "good idea" in this particular case)
should be conducted in the public forum and that's what I asked for in my
proposal to the SC.

So to address the remaining concerns, I'll first note that the portability
issue has been dealt with.  The MPC developers adopted GCC's primary and
secondary platform list to aid in the integration with GCC.  Thanks to the
participation of many developers on this list, MPC version 0.6 has been
tested successfully on all of them as well as a long list of tertiary
systems.  One or two minor nits arose in mpc-0.6 however they are in parts
of the library that I don't use inside GCC and anyway will be fixed in the
forthcoming mpc-0.6.1.  See:
http://www.multiprecision.org/index.php?prog=mpc&page=platforms

The second issue related to "cost" MPC brings vs "benefits".  To fully
explore this you have to compare it to the cost of not using MPC.  If we
don't use MPC, the fortran maintainers will have to replicate much of MPC's
functionality to support intrinsics.  It's already partially implemented for
the "easy" cases so far but several harder bits remain.  When I compare the
fortran implementation with the MPC copies, the MPC versions include extra
code to ensure last-bit accuracy whereas the fortran cases don't.  IMHO we
should leave these special math cases to experts in the field instead of
rolling our own versions of this code.  The second cost of not using MPC
means that we'll have to fix bugs in the middle end ourselves in the folding
of complex expressions.  Again, we're not best equipped to understand the
corner cases of this and why duplicate code that's already out there?  After
that, the optimizations I provided for complex builtins becomes gravy, and
that doesn't even begin to explore future uses of MPC that I haven't thought
of yet.

Sure, if you don't use complex numbers in your code you probably won't care
about this and everything becomes a "cost".  But since complex numbers are
part of the languages specs, we need to deal with it.  So from a
code-duplication standpoint, from a language conformance standpoint, from a
bugfix standpoint, and finally from an optimization standpoint, all of these
would be a win.  The downside is that you have to build and install MPC one
time, or unpack it in your GCC source dir since I provided support for
in-tree building.  Either way, it's not that hard. :-)

        --Kaveh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
  2009-04-28 18:13 ` Kaveh R. Ghazi
@ 2009-05-05 15:15   ` Kaveh R. GHAZI
  2009-05-05 17:04     ` Mark Mitchell
  0 siblings, 1 reply; 11+ messages in thread
From: Kaveh R. GHAZI @ 2009-05-05 15:15 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: GCC

On Tue, 28 Apr 2009, Kaveh R. Ghazi wrote:

> From: "Mark Mitchell" <mark@codesourcery.com>
>
> > That is not a decision, however, on whether using MPC is or is not a
> > good idea.  There have been objections raised to MPC, on the grounds
> > that it may not build on all host systems, or that the costs it brings
> > in terms of complexity of building GCC outweigh its benefits.  We should
> > reach consensus on those issues before making a decision about whether
> > to depend upon it.
>
> Thanks Mark.  Although I personally felt that the GPLv3-compatible license
> terms were sufficient from a legal and policy perspective, it's good to
> clarify this officially for future circumstances as well as retroactively
> for the libraries we already depend on.  Also I agree that the remainder of
> the discussion (i.e. whether it's a "good idea" in this particular case)
> should be conducted in the public forum and that's what I asked for in my
> proposal to the SC.
>
> So to address the remaining concerns, ...


I didn't hear back from anyone opposing (or supporting!) MPC.  Does that
mean it's no longer controversial?  Hopefully I've addressed the
outstanding issues raised.

http://gcc.gnu.org/ml/gcc/2009-04/msg00741.html

		--Kaveh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
  2009-05-05 15:15   ` Kaveh R. GHAZI
@ 2009-05-05 17:04     ` Mark Mitchell
  2009-05-13  8:41       ` Kaveh R. GHAZI
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Mitchell @ 2009-05-05 17:04 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: GCC

Kaveh R. GHAZI wrote:

> I didn't hear back from anyone opposing (or supporting!) MPC.  Does that
> mean it's no longer controversial?  Hopefully I've addressed the
> outstanding issues raised.
> 
> http://gcc.gnu.org/ml/gcc/2009-04/msg00741.html

I personally think relying on MPC is a reasonable choice, given the fact
that (as you say) the language specifications do in some cases require
support for these kinds of manipulations of complex numbers at compile-time.

In the past, however, other people have had objections.  I'd like to
give them more time (let's say one more week) to comment.  If that week
passes without negative comment, let's start coordinating how to move
forward with it.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
  2009-05-05 17:04     ` Mark Mitchell
@ 2009-05-13  8:41       ` Kaveh R. GHAZI
  2009-05-13 11:51         ` Dave Korn
  2009-05-13 15:42         ` Mark Mitchell
  0 siblings, 2 replies; 11+ messages in thread
From: Kaveh R. GHAZI @ 2009-05-13  8:41 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: GCC

On Tue, 5 May 2009, Mark Mitchell wrote:

> I personally think relying on MPC is a reasonable choice, given the fact
> that (as you say) the language specifications do in some cases require
> support for these kinds of manipulations of complex numbers at compile-time.
>
> In the past, however, other people have had objections.  I'd like to
> give them more time (let's say one more week) to comment.  If that week
> passes without negative comment, let's start coordinating how to move
> forward with it.

Okay, nobody spoke up so let's proceed.

The remaining issue is how and when to arrange for the MPC dependency to
be activated.  I think the consensus was to make MPC a hard-requirement.
However I'd also like to make the pain of getting the appropriate library
version to occur only once for GCC developers (or at most once per GCC
release cycle).

The current release mpc-0.6 has most but not all of the c99 complex
functions finished.  The remaining ones are supposed to be done in a
couple of months.  That should be in time for the 4.5 release, if not I'll
go with whatever we have and get the remainder for gcc-4.6.  We did
something similar for MPFR functions (like lgamma) that became available
in later versions of that library.

Here are options on how to proceed:

1.  Consider MPC as an optional library now, install all the code and make
    it hard-required only when all the complex math functions are made
    available in a future released version of the library or sometime in
    stage3, whichever is first.

2.  Hard-require mpc-0.6 now and hard require later versions when the
    remaining functions are done.  Requires at least two installs of MPC
    by everyone, possibly more.

3.  Hard-require mpc-0.6 now, future complex functions could be wrapped by
    #ifdef MPC_VERSION >= foo.  We did this with MPFR functions for a
    while until we eventually upgraded to later versions and got rid of
    the conditionals.

I prefer option 1 since it allows me to commit the majority of the patches
and get wider testing now without creating the installation pain more than
once.

Option 2 is fine with me but will make other developers complain more.

Option 3 has the disadvantage that some optimizations will depend on the
version of MPC installed.  We have historical precedent for that with MPFR
but people expresed that they don't like it.  I like this one the least.

		Thoughts?
		--Kaveh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
  2009-05-13  8:41       ` Kaveh R. GHAZI
@ 2009-05-13 11:51         ` Dave Korn
  2009-05-13 15:42         ` Mark Mitchell
  1 sibling, 0 replies; 11+ messages in thread
From: Dave Korn @ 2009-05-13 11:51 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: Mark Mitchell, GCC

Kaveh R. GHAZI wrote:

> 1.  Consider MPC as an optional library now, install all the code and make
>     it hard-required only when all the complex math functions are made
>     available in a future released version of the library or sometime in
>     stage3, whichever is first.

> I prefer option 1 

   Me too, since you're soliciting opinions.  Having it present-but-optional
on HEAD for a while lets us get any potential build/configury glitches exposed
while still giving people a way to carry on working if something tricky or
that might take a few days to fix crops up.

    cheers,
      DaveK


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
  2009-05-13  8:41       ` Kaveh R. GHAZI
  2009-05-13 11:51         ` Dave Korn
@ 2009-05-13 15:42         ` Mark Mitchell
  2009-05-30 18:07           ` Kaveh R. GHAZI
  1 sibling, 1 reply; 11+ messages in thread
From: Mark Mitchell @ 2009-05-13 15:42 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: GCC

Kaveh R. GHAZI wrote:

> 1.  Consider MPC as an optional library now, install all the code and make
>     it hard-required only when all the complex math functions are made
>     available in a future released version of the library or sometime in
>     stage3, whichever is first.

I think this is the best option.

Please make sure to open a P1 PR for 4.5.0 indicating that we should
throw the hard-requirement switch.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
  2009-05-13 15:42         ` Mark Mitchell
@ 2009-05-30 18:07           ` Kaveh R. GHAZI
       [not found]             ` <4A28B124.50201@archlinux.org>
       [not found]             ` <BAY102-DAV10E7F9FA21B920680D391986480@phx.gbl>
  0 siblings, 2 replies; 11+ messages in thread
From: Kaveh R. GHAZI @ 2009-05-30 18:07 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: GCC

On Wed, 13 May 2009, Mark Mitchell wrote:

> Kaveh R. GHAZI wrote:
>
> > 1.  Consider MPC as an optional library now, install all the code and make
> >     it hard-required only when all the complex math functions are made
> >     available in a future released version of the library or sometime in
> >     stage3, whichever is first.
>
> I think this is the best option.
>
> Please make sure to open a P1 PR for 4.5.0 indicating that we should
> throw the hard-requirement switch.

The last patch to enable use of MPC in GCC was reviewed today and
installed.  I'm sure other updates will come, but the base functionality
is now there.

I've opened PR 40302 as you requested (and assigned myself).

		Thanks,
		--Kaveh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
       [not found]             ` <4A28B124.50201@archlinux.org>
@ 2009-06-05  5:46               ` Allan McRae
  0 siblings, 0 replies; 11+ messages in thread
From: Allan McRae @ 2009-06-05  5:46 UTC (permalink / raw)
  To: GCC

Kaveh R. GHAZI wrote:
> On Wed, 13 May 2009, Mark Mitchell wrote:
>
>   
>> Kaveh R. GHAZI wrote:
>>
>>     
>>> 1.  Consider MPC as an optional library now, install all the code and make
>>>     it hard-required only when all the complex math functions are made
>>>     available in a future released version of the library or sometime in
>>>     stage3, whichever is first.
>>>       
>> I think this is the best option.
>>
>> Please make sure to open a P1 PR for 4.5.0 indicating that we should
>> throw the hard-requirement switch.
>>     
>
> The last patch to enable use of MPC in GCC was reviewed today and
> installed.  I'm sure other updates will come, but the base functionality
> is now there.
>
> I've opened PR 40302 as you requested (and assigned myself).
>   

I have noticed that mpc is not automatically detected even when 
installed in the standard library path (with gcc-4.5-20090604). This 
means that building with mpc always requires using the 
--with-mpc-lib=/usr/lib flag.
This is fixed by adjusting configure{.ac} to have:
mpclibs="-lmpc"

Allan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
       [not found]             ` <BAY102-DAV10E7F9FA21B920680D391986480@phx.gbl>
@ 2009-06-08  6:25               ` Kaveh R. Ghazi
  0 siblings, 0 replies; 11+ messages in thread
From: Kaveh R. Ghazi @ 2009-06-08  6:25 UTC (permalink / raw)
  To: Allan McRae; +Cc: gcc

From: "Allan McRae" <allan@archlinux.org>

> I have noticed that mpc is not automatically detected even when 
> installed in the standard library path (with gcc-4.5-20090604). This 
> means that building with mpc always requires using the 
> --with-mpc-lib=/usr/lib flag. 
> 
> This is fixed by adjusting configure{.ac} to have:
> mpclibs="-lmpc"

See: http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00615.html


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using MPC Library with GCC
@ 2009-05-13 10:12 FX
  0 siblings, 0 replies; 11+ messages in thread
From: FX @ 2009-05-13 10:12 UTC (permalink / raw)
  To: gcc, ghazi; +Cc: Fortran List

Thanks Kaveh for taking care of this. The Fortran front-end will  
really benefit from the use of MPC. Regarding your options, #1 seems  
the most reasonable to me; I'm forwarding to the Fortran list to hear  
to opinion of Fortran maintainers.

FX

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-06-08  6:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-27 18:54 Using MPC Library with GCC Mark Mitchell
2009-04-28 18:13 ` Kaveh R. Ghazi
2009-05-05 15:15   ` Kaveh R. GHAZI
2009-05-05 17:04     ` Mark Mitchell
2009-05-13  8:41       ` Kaveh R. GHAZI
2009-05-13 11:51         ` Dave Korn
2009-05-13 15:42         ` Mark Mitchell
2009-05-30 18:07           ` Kaveh R. GHAZI
     [not found]             ` <4A28B124.50201@archlinux.org>
2009-06-05  5:46               ` Allan McRae
     [not found]             ` <BAY102-DAV10E7F9FA21B920680D391986480@phx.gbl>
2009-06-08  6:25               ` Kaveh R. Ghazi
2009-05-13 10:12 FX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).