Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #41508] [BUG] Configure losing flags...

5 views
Skip to first unread message

Will Coleda

unread,
Feb 14, 2007, 12:09:14 PM2/14/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Will Coleda
# Please include the string: [perl #41508]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41508 >


Trying to build with GMP support on OSX intel. I have libgmp in
/opt/local/bin/

if I run:

CC="ccache gcc-4.0"
CX="ccache g++-4.0"
perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" --ld="$CX"
--ccflags="-L/opt/local/lib -I/opt/local/include"
--ldflags="-L/opt/local/lib" --step=auto::gmp --verbose=auto:gmp

Then I get:

<SNIP>
Determining if your platform supports GMP...Argument "auto::gmp" isn't
numeric in numeric eq (==) at lib/Parrot/Configure.pm line 258.
Argument "auto::gmp" isn't numeric in numeric eq (==) at
lib/Parrot/Configure/Data.pm line 107.
ccache gcc-4.0 -L/opt/local/lib -I/opt/local/include -pipe -fno-common
-Wno-long-double -I/opt/local/include -I /opt/local/include -I./include -c
test.c
c++ -L/opt/local/lib test.o -o test -lm -lreadline -lgmp
./test
6864797660130609714981900799081393217269435300143305409394463459185543183397
6560521225596406614545549772963113914808580371219879997166438125740282911150
57151 0
(yes) Argument "auto::gmp" isn't numeric in numeric eq (==) at
lib/Parrot/Configure/Data.pm line 107.
...........................yes.Argument "auto::gmp" isn't numeric in numeric
eq (==) at lib/Parrot/Configure/Data.pm line 107.

So it finds it.

However, if i remove the option '--step=auto::gmp' from the Configure run,
I'm told it *can't* find the lib. Looking at the debug output, I see:

ccache gcc-4.0 -L/opt/local/lib -I/opt/local/include -pipe -fno-common
-Wno-long-double -I./include -c test.c
c++ test.o -o test -lm -lgmp
/usr/bin/ld: can't locate file for: -lgmp

Note the linker step no longer specifies /opt/local/lib ... Something is
stripping it out.

Will Coleda

unread,
Feb 14, 2007, 7:38:53 PM2/14/07
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
Turns out the bug isn't quite what I described. You need to use --
linkflags to specify for the linker: when doing this, the library is
correctly found in a full run of Configure.pl

For some reason, specifying ccflags/ldflags is enough when running
the single step.

Regards.

--
Will "Coke" Coleda
wi...@coleda.com


James Keenan via RT

unread,
Jan 11, 2008, 4:46:04 PM1/11/08
to perl6-i...@perl.org
On Wed Feb 14 16:38:10 2007, coke wrote:
> Turns out the bug isn't quite what I described. You need to use --
> linkflags to specify for the linker: when doing this, the library is
> correctly found in a full run of Configure.pl
>
> For some reason, specifying ccflags/ldflags is enough when running
> the single step.
>

Coke: Can this ticket be closed?

Will Coleda via RT

unread,
Jan 23, 2008, 9:47:04 PM1/23/08
to perl6-i...@perl.org

No. I still can't get configure to find GMP on my platform when running a full config.

James Keenan via RT

unread,
Jan 23, 2008, 11:15:03 PM1/23/08
to perl6-i...@perl.org
On Wed Feb 14 09:09:14 2007, coke wrote:
> Trying to build with GMP support on OSX intel. I have libgmp in
> /opt/local/bin/
>
> if I run:
>
> CC="ccache gcc-4.0"
> CX="ccache g++-4.0"
> perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" --ld="$CX"
> --ccflags="-L/opt/local/lib -I/opt/local/include"
> --ldflags="-L/opt/local/lib" --step=auto::gmp --verbose=auto:gmp
>

Coke: I happened to re-read the first post to this ticket, now nearly a
year old. I want to make sure that you're *not* calling Configure.pl
these days in the manner above. The --step option is now only used with
tools/dev/reconfigure.pl; it's used when you want to rerun just one
config step after Configure.pl has completed. Also, if you want to run
a particular step with verbose output, the phrasing is now:
--verbose-step=auto::gmp.

Does that clear up any of your problems?

kid51

Andy Dougherty

unread,
Jan 24, 2008, 8:42:26 PM1/24/08
to James Keenan via RT

> On Thu Jan 24 10:31:46 2008, coke wrote:
>
> >
> > Here's my current Config script:
> >
> > CCACHE="ccache "
> > CC="${CCACHE}gcc-4.0"
> > CX="${CCACHE}g++-4.0"

> > perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" --ld="$CX"
> > --ccflags="-L/opt/local/lib -I/opt/local/include"
> > --ldflags="-L/opt/local/lib" --verbose-step=auto::gmp $@
> >
> > Running this step verbosely shows as the attached. Notice that the
> > flags that I specified on the command line for Configure for
> > cclflags/ldflags are missing, so the build fails, and GMP is reported
> > as not available.

This sounds like a problem in the hints file. I don't know what platform
this is, but I'd look in the hints file to see if it unconditionally
sets ccflags and ldflags without checking the command line options.

On Thu, 24 Jan 2008, James Keenan via RT wrote:

> *without* GMP on Darwin. Here's my regular script (with configuration
> step tests):
>
> #!/bin/sh
> CC="/usr/bin/gcc-3.3"
> CX="/usr/bin/g++-3.3"
> /usr/local/bin/perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" \
> --ld="$CX" --without-icu --without-gmp \
> --test \
> --configure_trace \
> $@

Note that this test doesn't try setting ccflags or ldflags, so it is
irrelevant to the problem at hand.

--
Andy Dougherty doug...@lafayette.edu

James Keenan via RT

unread,
Jan 24, 2008, 9:56:32 PM1/24/08
to perl6-i...@perl.org
On Thu Jan 24 17:43:06 2008, doughera wrote:
>
> This sounds like a problem in the hints file. I don't know what platform
> this is, but I'd look in the hints file to see if it unconditionally
> sets ccflags and ldflags without checking the command line options.
>

It's Darwin, whose hints file does indeed make no check of command-line
options. By analogy with the hints files for Linux and Win32, I propose
the patch attached: hints.darwin.patch.txt


>
> Note that this test doesn't try setting ccflags or ldflags, so it is
> irrelevant to the problem at hand.
>

True enough. So since I don't try setting the flags, the most I can
prove is that checking them with option_or_data() in init::hints::darwin
does no harm. Coke will have to try it and see if it actually benefits him.


hints.darwin.patch.txt

James Keenan via RT

unread,
Jan 25, 2008, 8:35:53 PM1/25/08
to perl6-i...@perl.org
On Thu Jan 24 10:31:46 2008, coke wrote:

>
> I think this helps verify my original claim, but how to address it?
>


What would happen if in config/auto/gmp.pm we had some code similar to
that found in config/auto/readline.pm?

sub _init {
my $self = shift;
my %data;
$data{description} = q{Determining if your platform supports readline};
$data{result} = q{};
$data{macports_root} = File::Spec->catdir( '/', 'opt', 'local' );
return \%data;
}

...

$self->_handle_darwin_for_macports($conf, $osname,
q{readline/readline.h});

...

sub _handle_darwin_for_macports {
my $self = shift;
my ($conf, $osname, $file) = @_;
if ( $osname =~ /darwin/ ) {
my $macports_root = $self->{macports_root};
my $macports_lib_dir = qq{$macports_root/lib};
my $macports_include_dir = qq{$macports_root/include};
if ( -f qq{$macports_include_dir/$file} ) {
$conf->data->add( ' ', linkflags => "-L$macports_lib_dir" );
$conf->data->add( ' ', ldflags => "-L$macports_lib_dir" );
$conf->data->add( ' ', ccflags => "-I$macports_include_dir" );
}
}
return 1;
}

Would that help?

0 new messages