Karim BELABAS on Thu, 23 Jul 1998 14:52:22 +0200 (MET DST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: build report/bug report/suggestions


[John Jones wrote:]
>  - the INSTALL guide mentions building with g++, but it doesn't come
>    out and say how to do it.  It seems that "Configure -a" is the only 
>    way.  It would be better if the C/C++ compiler can be given as an
>    argument to Configure (like prefix).

Configure checks the standard environment variable CC, hence you can do the
following:

  setenv CC g++; Configure         [csh syntax]

  export CC; CC="g++"; Configure [sh syntax]

[This should be documented, you're right...] 

>  - setting of prefix on the command line with Configure does not seem
>    to be standard.  I am not an expert on configure programs, but I
>    seem to recall --prefix=/usr/local/test as being the more standard
>    syntax.

Ok, I can support that also.

>  - since the C and C++ versions of libpari are not compatible, maybe
>    they should be given different names.  Then it would be easier for
>    someone to have both installed.  I admit that not very many users
>    use libpari.a directly, and even fewer would want both the C and
>    C++ versions, but this seems like it would make more sense to give
>    them different names.
[makes sense, but see below]

> Now for the diff file from the BUG warning.

This is somehow documented in INSTALL.tex as Gerhard said. But see also
note (7) in the MACHINES file (the only line corresponding to a C++
compiler). We look for the symbol "addii" in the library, which doesn't
exist since it's been mangled by the C++ compiler. If you want to install
symbols from a C++ library, you have to declare them as extern "C" in your
header file.

In any case, I'm not sure it's a very good idea to compile libpari with a
C++ compiler, since the routines will be slower (about 10% compared to
plain gcc for the generic bench files). It's probably a better idea to
compile with gcc, and brace paridecl.h by BEGINEXTERN / ENDEXTERN
statements (declare all symbols as extern "C").

Opinions ? (I don't use C++ myself...).

   Karim.
--
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://pari.home.ml.org