[petsc-dev] Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 MPI process

Satish Balay balay at mcs.anl.gov
Tue Oct 11 14:39:40 CDT 2016


On Tue, 11 Oct 2016, Antonio Trande wrote:

> 'configure' does not recognize '-D_FORTIFY_SOURCE=2' flag (it says that
> should be -D-FORTIFY-SOURCE=2) that comes from default flags used on
> Fedora and automatically set when package is built. I'm forced to
> exclude it with 'configure' and re-introduce it with 'make'.
> This is the reason because flags are set more times.
> It's good if you can fix this problem with 'configure'.

I suspect thats hapenning because you are missing quotes for CFLAGS=""
[as mentioned earlier] - so configure it treating -D_FORTIFY_SOURCE=2
as an argument to configure - and not as the text inside CFLAGS argument.

Satish

---------

balay at asterix /home/balay/petsc (maint=)
$ ./configure CFLAGS=-O2 -D_FORTIFY_SOURCE=2
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
*******************************************************************************
                ERROR in COMMAND LINE ARGUMENT to ./configure 
-------------------------------------------------------------------------------
The option -D_FORTIFY_SOURCE should probably be -D-FORTIFY-SOURCE
*******************************************************************************

balay at asterix /home/balay/petsc (maint=)
$ ./configure CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
Compilers:                                                                                                                                                                                       
  C Compiler:         mpicc -O2 -D_FORTIFY_SOURCE=2 -fPIC  
  C++ Compiler:       mpicxx  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fvisibility=hidden -g   -fPIC   
  Fortran Compiler:   mpif90  -fPIC -Wall -ffree-line-length-0 -Wno-unused-dummy-argument -g  
Linkers:
  Shared linker:   mpicc  -shared -O2 -D_FORTIFY_SOURCE=2 -fPIC 
  Dynamic linker:   mpicc  -shared -O2 -D_FORTIFY_SOURCE=2 -fPIC 
MPI:
make:
BLAS/LAPACK: -llapack -lblas
cmake:
  Arch:     
X:
  Library:  -lX11
valgrind:
sowing:
c2html:
pthread:
  Library:  -lpthread
PETSc:
  PETSC_ARCH: arch-linux2-c-debug
  PETSC_DIR: /home/balay/petsc
  Scalar type: real
  Precision: double
  Clanguage: C
  shared libraries: enabled
  Integer size: 32
  Memory alignment: 16
xxx=========================================================================xxx
 Configure stage complete. Now build PETSc libraries with (gnumake build):
   make PETSC_DIR=/home/balay/petsc PETSC_ARCH=arch-linux2-c-debug all
xxx=========================================================================xxx
balay at asterix /home/balay/petsc (maint=)                                                                                                                                                         
$ 









More information about the petsc-dev mailing list