public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Problems with in-tree host libraries (gmp, ppl, etc)
@ 2009-05-02 14:24 Anthony Green
  2009-05-03  7:01 ` Kaveh R. GHAZI
  0 siblings, 1 reply; 7+ messages in thread
From: Anthony Green @ 2009-05-02 14:24 UTC (permalink / raw)
  To: gcc

The top level configury suggests that you can simply drop gmp, ppl, etc
into the top level source dir and they will get configured and used.
Does this really work?

At the very least, I think ppl requires that gmp be configured with
--enable-cxx, like so:

Index: Makefile.def
===================================================================
--- Makefile.def        (revision 146995)
+++ Makefile.def        (working copy)
@@ -60,7 +60,7 @@
 host_modules= { module= gawk; };
 host_modules= { module= gettext; };
 host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
-               extra_configure_flags='--disable-shared';
+               extra_configure_flags='--disable-shared --enable-cxx';
                no_install= true; 
                host="none-${host_vendor}-${host_os}";
                target="none-${host_vendor}-${host_os}"; };

Even then, the ppl configury isn't detecting the gmp we just built.  It
seems as though we should install gmp in a local temporary install tree
and point ppl at that.  See below for a trace of the ppl configury as it
attempts to detect an in-tree gmp (after applying the patch above).

AG



+ test -n /builddir/build/BUILD/gcc/build/./gmp/
+ test -z /builddir/build/BUILD/gcc/build/./gmp/
+ test -n /builddir/build/BUILD/gcc/build/./gmp/
+ test -z /builddir/build/BUILD/gcc/build/./gmp/
+ printf '%s\n' 'configure:15514: checking how to link with libgmp'
+ printf %s 'checking how to link with libgmp... '
checking how to link with libgmp... + test '' = set
+ use_additional=yes
+ acl_save_prefix=/usr
+ prefix=/usr
+ acl_save_exec_prefix=/usr
+ exec_prefix=/usr
+ eval 'additional_includedir="/usr/include"'
++ additional_includedir=/usr/include
+ eval 'additional_libdir="/usr/lib"'
++ additional_libdir=/usr/lib
+ exec_prefix=/usr
+ prefix=/usr
+ test set = set
+ withval=/builddir/build/BUILD/gcc/build/./gmp/
+ test X/builddir/build/BUILD/gcc/build/./gmp/ = Xno
+ test X/builddir/build/BUILD/gcc/build/./gmp/ = X
+ additional_includedir=/builddir/build/BUILD/gcc/build/./gmp//include
+ additional_libdir=/builddir/build/BUILD/gcc/build/./gmp//lib
+ LIBGMP=
+ LTLIBGMP=
+ INCGMP=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='gmp '
+ test -n 'gmp '
+ names_this_round='gmp '
+ names_next_round=
+ for name in '$names_this_round'
+ already_handled=
+ test -z ''
+ names_already_handled=' gmp'
++ echo gmp
++ sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|
ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'
+ uppername=GMP
+ eval 'value="$HAVE_LIBGMP"'
++ value=
+ test -n ''
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ test yes = yes
+ test -n so
+ test -f /builddir/build/BUILD/gcc/build/./gmp//lib/libgmp.so
+ test -f /builddir/build/BUILD/gcc/build/./gmp//lib/libgmp.a
+ test X = X
+ test X '!=' X
+ LIBGMP=-lgmp
+ LTLIBGMP=-lgmp
+ test -n ''
+ test X '!=' X
+ test X '!=' X
+ ac_cv_libgmp_libs=-lgmp
+ ac_cv_libgmp_ltlibs=-lgmp
+ ac_cv_libgmp_cppflags=
+ printf '%s\n' 'configure:15903: result: -lgmp'
+ printf '%s\n' -lgmp
-lgmp
+ LIBGMP=-lgmp
+ LTLIBGMP=-lgmp
+ INCGMP=
+ HAVE_LIBGMP=yes
+ printf '%s\n' 'configure:15943: checking how to link with libgmpxx'
+ printf %s 'checking how to link with libgmpxx... '
checking how to link with libgmpxx... + test '' = set
+ use_additional=yes
+ acl_save_prefix=/usr
+ prefix=/usr
+ acl_save_exec_prefix=/usr
+ exec_prefix=/usr
+ eval 'additional_includedir="/usr/include"'
++ additional_includedir=/usr/include
+ eval 'additional_libdir="/usr/lib"'
++ additional_libdir=/usr/lib
+ exec_prefix=/usr
+ prefix=/usr
+ test set = set
+ withval=/builddir/build/BUILD/gcc/build/./gmp/
+ test X/builddir/build/BUILD/gcc/build/./gmp/ = Xno
+ test X/builddir/build/BUILD/gcc/build/./gmp/ = X
+ additional_includedir=/builddir/build/BUILD/gcc/build/./gmp//include
+ additional_libdir=/builddir/build/BUILD/gcc/build/./gmp//lib
+ LIBGMPXX=
+ LTLIBGMPXX=
+ INCGMPXX=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='gmpxx gmp'
+ test -n 'gmpxx gmp'
+ names_this_round='gmpxx gmp'
+ names_next_round=
+ for name in '$names_this_round'
+ already_handled=
+ test -z ''
+ names_already_handled=' gmpxx'
++ echo gmpxx
++ sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|
ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'
+ uppername=GMPXX
+ eval 'value="$HAVE_LIBGMPXX"'
++ value=
+ test -n ''
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ test yes = yes
+ test -n so
+ test -f /builddir/build/BUILD/gcc/build/./gmp//lib/libgmpxx.so
+ test -f /builddir/build/BUILD/gcc/build/./gmp//lib/libgmpxx.a
+ test X = X
+ test X '!=' X
+ LIBGMPXX=-lgmpxx
+ LTLIBGMPXX=-lgmpxx
+ for name in '$names_this_round'
+ already_handled=
+ for n in '$names_already_handled'
+ test gmpxx = gmp
+ test -z ''
+ names_already_handled=' gmpxx gmp'
++ echo gmp
++ sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|
ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'
+ uppername=GMP
+ eval 'value="$HAVE_LIBGMP"'
++ value=yes
+ test -n yes
+ test yes = yes
+ eval 'value="$LIBGMP"'
++ value=-lgmp
+ test -z -lgmp
+ LIBGMPXX='-lgmpxx -lgmp'
+ eval 'value="$LTLIBGMP"'
++ value=-lgmp
+ test -z -lgmp
+ LTLIBGMPXX='-lgmpxx -lgmp'
+ test -n ''
+ test X '!=' X
+ test X '!=' X
+ ac_cv_libgmpxx_libs='-lgmpxx -lgmp'
+ ac_cv_libgmpxx_ltlibs='-lgmpxx -lgmp'
+ ac_cv_libgmpxx_cppflags=
+ printf '%s\n' 'configure:16332: result: -lgmpxx -lgmp'
+ printf '%s\n' '-lgmpxx -lgmp'
-lgmpxx -lgmp
+ LIBGMPXX='-lgmpxx -lgmp'
+ LTLIBGMPXX='-lgmpxx -lgmp'
+ INCGMPXX=
+ HAVE_LIBGMPXX=yes
+ ac_save_LIBS=
+ LIBS=' -lgmpxx -lgmp'
+ ac_ext=cpp
+ ac_cpp='$CXXCPP $CPPFLAGS'
+ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=yes
+ printf '%s\n' 'configure:16376: checking for the GMP library version
4.1.3 or above'
+ printf %s 'checking for the GMP library version 4.1.3 or above... '
checking for the GMP library version 4.1.3 or above... + test yes = yes
+ cat
+ cat confdefs.h
+ cat
+ rm -f conftest.o
+ ac_try='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ case "(($ac_try" in
+ ac_try_echo='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ eval 'ac_try_echo="$as_me:16404: $CXX -c $CXXFLAGS $CPPFLAGS
conftest.$ac_ext >&5"'
++ ac_try_echo='configure:16404: g++ -c  -g -O2 -frounding-math -g -O2
conftest.cpp >&5'
+ printf '%s\n' 'configure:16404: g++ -c  -g -O2 -frounding-math -g -O2
conftest.cpp >&5'
+ ac_status=1
+ grep -v '^ *+' conftest.er1
+ rm -f conftest.er1
+ cat conftest.err
+ printf '%s\n' 'configure:16411: $? = 1'
+ exit 1
+ printf '%s\n' 'configure: failed program was:'
+ sed 's/^/| /' conftest.cpp
+ printf '%s\n' 'configure:16423: result: no'
+ printf '%s\n' no
no
+ ac_cv_have_gmp=no
+ rm -f core conftest.err conftest.o conftest.cpp
+ have_gmp=no
+ test xno = xyes
+ ac_ext=cpp
+ ac_cpp='$CXXCPP $CPPFLAGS'
+ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=yes
+ LIBS=
+ gmp_library_option='-lgmpxx -lgmp'
+ test xno = xno
+ printf '%s\n' 'configure:17018: error: Cannot find GMP version 4.1.3
or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++
interface:
add --enable-cxx to the configuration options.'
+ printf '%s\n' 'configure: error: Cannot find GMP version 4.1.3 or
higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++
interface:
add --enable-cxx to the configuration options.'
configure: error: Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++
interface:
add --enable-cxx to the configuration options.
+ exit 1


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

* Re: Problems with in-tree host libraries (gmp, ppl, etc)
  2009-05-02 14:24 Problems with in-tree host libraries (gmp, ppl, etc) Anthony Green
@ 2009-05-03  7:01 ` Kaveh R. GHAZI
  2009-05-04  7:17   ` Paolo Bonzini
  2009-05-06  8:11   ` Roberto Bagnara
  0 siblings, 2 replies; 7+ messages in thread
From: Kaveh R. GHAZI @ 2009-05-03  7:01 UTC (permalink / raw)
  To: Anthony Green; +Cc: gcc

On Sat, 2 May 2009, Anthony Green wrote:

> The top level configury suggests that you can simply drop gmp, ppl, etc
> into the top level source dir and they will get configured and used.
> Does this really work?

It is supposed to.  I haven't worked on or tested the ppl machinery so I
don't know what shape it is in.


> Index: Makefile.def
> ===================================================================
> --- Makefile.def        (revision 146995)
> +++ Makefile.def        (working copy)
> @@ -60,7 +60,7 @@
>  host_modules= { module= gawk; };
>  host_modules= { module= gettext; };
>  host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
> -               extra_configure_flags='--disable-shared';
> +               extra_configure_flags='--disable-shared --enable-cxx';
>                 no_install= true;
>                 host="none-${host_vendor}-${host_os}";
>                 target="none-${host_vendor}-${host_os}"; };


I would only pass in this flag if ppl is being used.  Look at what I did
with extra_mpfr_configure_flags in the top level directory.  You can use a
similar mechanism to have a flag passed in to the gmp build conditionally.


> Even then, the ppl configury isn't detecting the gmp we just built.  It
> seems as though we should install gmp in a local temporary install tree
> and point ppl at that.  See below for a trace of the ppl configury as it
> attempts to detect an in-tree gmp (after applying the patch above).
> AG

I don't know if ppl was ever setup to detect/use an in-tree gmp.  It would
need to be able to specify --with-gmp-build= or something equivalent to
get the header and library from a build tree rather than an install tree.
They're laid out slightly differently.

		--Kaveh

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

* Re: Problems with in-tree host libraries (gmp, ppl, etc)
  2009-05-03  7:01 ` Kaveh R. GHAZI
@ 2009-05-04  7:17   ` Paolo Bonzini
  2009-05-04 22:45     ` Mark Mitchell
  2009-05-06  8:11   ` Roberto Bagnara
  1 sibling, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2009-05-04  7:17 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: Anthony Green, gcc


> 
>> Even then, the ppl configury isn't detecting the gmp we just built.  It
>> seems as though we should install gmp in a local temporary install tree
>> and point ppl at that.  See below for a trace of the ppl configury as it
>> attempts to detect an in-tree gmp (after applying the patch above).
>> AG
> 
> I don't know if ppl was ever setup to detect/use an in-tree gmp.

No, it was not.  So you can drop in gmp/mpfr, or ppl/cloog, but not all
four.

Paolo

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

* Re: Problems with in-tree host libraries (gmp, ppl, etc)
  2009-05-04  7:17   ` Paolo Bonzini
@ 2009-05-04 22:45     ` Mark Mitchell
  2009-05-05  6:20       ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Mitchell @ 2009-05-04 22:45 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Kaveh R. GHAZI, Anthony Green, gcc

Paolo Bonzini wrote:
>>> Even then, the ppl configury isn't detecting the gmp we just built.  It
>>> seems as though we should install gmp in a local temporary install tree
>>> and point ppl at that.  See below for a trace of the ppl configury as it
>>> attempts to detect an in-tree gmp (after applying the patch above).
>>> AG
>> I don't know if ppl was ever setup to detect/use an in-tree gmp.
> 
> No, it was not.  So you can drop in gmp/mpfr, or ppl/cloog, but not all
> four.

I would like to again suggest that we declare in-tree builds of this
stuff out of scope.  Build them up front, pass configure options to say
where they can be found, and declare victory.

As GCC depends on more external libraries, it gets harder and harder for
us to maintain this build system.  We all want to get the build system
to the point where we're doing "staged installs", instead of the current
mess -- but the more we put into the build system the more complex it
becomes.  I think we should leave the process of building and installing
components to packaging systems like RPM or .deb or Cygwin.

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

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

* Re: Problems with in-tree host libraries (gmp, ppl, etc)
  2009-05-04 22:45     ` Mark Mitchell
@ 2009-05-05  6:20       ` Paolo Bonzini
  0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2009-05-05  6:20 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Kaveh R. GHAZI, Anthony Green, gcc

>> No, it was not.  So you can drop in gmp/mpfr, or ppl/cloog, but not all
>> four.
>
> I would like to again suggest that we declare in-tree builds of this
> stuff out of scope.

For ppl/cloog which are not mandatory I agree.  I think in-tree
GMP/MPFR however is especially useful for people who build on
non-GNU/Linux systems, where packaging of free software libraries is
not as well developed as RPM/DEB/ports.

Paolo

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

* Re: Problems with in-tree host libraries (gmp, ppl, etc)
  2009-05-03  7:01 ` Kaveh R. GHAZI
  2009-05-04  7:17   ` Paolo Bonzini
@ 2009-05-06  8:11   ` Roberto Bagnara
  2009-05-06 10:50     ` Paolo Bonzini
  1 sibling, 1 reply; 7+ messages in thread
From: Roberto Bagnara @ 2009-05-06  8:11 UTC (permalink / raw)
  To: Kaveh R. GHAZI
  Cc: Anthony Green, gcc, The Parma Polyhedra Library developers' list

Kaveh R. GHAZI wrote:
> On Sat, 2 May 2009, Anthony Green wrote:
> 
>> The top level configury suggests that you can simply drop gmp, ppl, etc
>> into the top level source dir and they will get configured and used.
>> Does this really work?
> 
> It is supposed to.  I haven't worked on or tested the ppl machinery so I
> don't know what shape it is in.
> 
> 
>> Index: Makefile.def
>> ===================================================================
>> --- Makefile.def        (revision 146995)
>> +++ Makefile.def        (working copy)
>> @@ -60,7 +60,7 @@
>>  host_modules= { module= gawk; };
>>  host_modules= { module= gettext; };
>>  host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
>> -               extra_configure_flags='--disable-shared';
>> +               extra_configure_flags='--disable-shared --enable-cxx';
>>                 no_install= true;
>>                 host="none-${host_vendor}-${host_os}";
>>                 target="none-${host_vendor}-${host_os}"; };
> 
> 
> I would only pass in this flag if ppl is being used.  Look at what I did
> with extra_mpfr_configure_flags in the top level directory.  You can use a
> similar mechanism to have a flag passed in to the gmp build conditionally.
> 
> 
>> Even then, the ppl configury isn't detecting the gmp we just built.  It
>> seems as though we should install gmp in a local temporary install tree
>> and point ppl at that.  See below for a trace of the ppl configury as it
>> attempts to detect an in-tree gmp (after applying the patch above).
>> AG
> 
> I don't know if ppl was ever setup to detect/use an in-tree gmp.  It would
> need to be able to specify --with-gmp-build= or something equivalent to
> get the header and library from a build tree rather than an install tree.
> They're laid out slightly differently.

The PPL configure script offers the following options:

   --with-libgmp-prefix[=DIR]  search for libgmp in DIR/include and DIR/lib
   --without-libgmp-prefix     don't search for libgmp in includedir and libdir
   --with-libgmpxx-prefix[=DIR]  search for libgmpxx in DIR/include and DIR/lib
   --without-libgmpxx-prefix     don't search for libgmpxx in includedir and libdir

If the C and the C++ interface of GMP have been installed in the same places,
specifying --with-libgmp-prefix[=DIR] is enough.

If you think that being able to use a non-installed GMP build tree is important,
we can add an option to that effect.

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it

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

* Re: Problems with in-tree host libraries (gmp, ppl, etc)
  2009-05-06  8:11   ` Roberto Bagnara
@ 2009-05-06 10:50     ` Paolo Bonzini
  0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2009-05-06 10:50 UTC (permalink / raw)
  To: Roberto Bagnara
  Cc: Kaveh R. GHAZI, Anthony Green, gcc,
	The Parma Polyhedra Library developers' list


> If the C and the C++ interface of GMP have been installed in the same
> places,
> specifying --with-libgmp-prefix[=DIR] is enough.
> 
> If you think that being able to use a non-installed GMP build tree is
> important, we can add an option to that effect.

Yes, that would help.  mpfr is using --with-gmp-build as the option name.

Paolo

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

end of thread, other threads:[~2009-05-06 10:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-02 14:24 Problems with in-tree host libraries (gmp, ppl, etc) Anthony Green
2009-05-03  7:01 ` Kaveh R. GHAZI
2009-05-04  7:17   ` Paolo Bonzini
2009-05-04 22:45     ` Mark Mitchell
2009-05-05  6:20       ` Paolo Bonzini
2009-05-06  8:11   ` Roberto Bagnara
2009-05-06 10:50     ` Paolo Bonzini

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).