[petsc-dev] [petsc-maint #50087] Re: why does PETSc BuildSystem hate me?

Aron Ahmadia aja2111 at columbia.edu
Tue Jul 27 03:01:28 CDT 2010


Just another note.  The reason I use LDFLAGS by default is because
./configure help (as generated by autoconf 2.59) does not mention
LIBS..

<typical configure help output>
Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
              headers in a nonstandard directory <include dir>
  CPP         C preprocessor

However, if you actually set the environment variables, trial and
error reveals that although LDLIBS is ignored by configure, LIBS and
LDFLAGS are respected.

I guess that's another confirmation for the use of LIBS/LDFLAGS, but
I'd like to note this inconsistency in their documentation:

http://www.gnu.org/software/hello/manual/autoconf/Preset-Output-Variables.html

"LDFLAGS can be set from the environment according to the manual,
whereas LIBS defaults to empty."

A recent autoconf seems to play a little more correctly:

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CXXCPP      C++ preprocessor
  F77         Fortran 77 compiler command
  FFLAGS      Fortran 77 compiler flags
  FC          Fortran compiler command
  FCFLAGS     Fortran compiler flags

Hope this was useful/enlightening.

Aron

On Tue, Jul 27, 2010 at 2:48 AM, Satish Balay <petsc-maint at mcs.anl.gov> wrote:
> Both MPI_DIR and LDFLAGS added now.
>
> Satish
>
> On Mon, 26 Jul 2010, Barry Smith wrote:
>
>>
>>   Satish,
>>
>>     Please add that one as well. MPI_DIR
>>
>>
>>    Barry
>>
>> On Jul 26, 2010, at 12:55 PM, Lisandro Dalcin wrote:
>>
>> > On 26 July 2010 14:45, Barry Smith <bsmith at mcs.anl.gov> wrote:
>> >>
>> >>  Satish,
>> >>
>> >>   It is missing Aron's favorite. Could you please add it LDFLAGS
>> >>
>> >>   I was expecting it up in config/configure.py before anything else? Won't that be a better place for it?
>> >>
>> >
>> > Just a week ago, I had trouble to build PETSc with ML. The reason was
>> > a stale MPI_DIR environ var I had in my .bashrc.
>> >
>> >
>> > --
>> > Lisandro Dalcin
>> > ---------------
>> > CIMEC (INTEC/CONICET-UNL)
>> > Predio CONICET-Santa Fe
>> > Colectora RN 168 Km 472, Paraje El Pozo
>> > Tel: +54-342-4511594 (ext 1011)
>> > Tel/Fax: +54-342-4511169
>> >
>>
>>
>>
>
>



More information about the petsc-dev mailing list