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.
For some reason, specifying ccflags/ldflags is enough when running
the single step.
Regards.
--
Will "Coke" Coleda
wi...@coleda.com
Coke: Can this ticket be closed?
No. I still can't get configure to find GMP on my platform when running a full config.
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
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
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.
>
> 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?