gcc-4.8.5 is the default for RHEL7 - which is still widely deployed - and petsc does compile and work with it. So there must be some strange interaction with this compiler and conda env.
However newer gcc version is preferable.. Satish On Sun, 15 Nov 2020, Barry Smith wrote: > Ling, > > Configure is failing here. > > TESTING: checkCPreprocessor from > config.setCompilers(config/BuildSystem/config/setCompilers.py:699) > Locate a functional C preprocessor > Checking for program /Users/lzou/miniconda3/bin/gcc...found > Defined make macro "CPP" to "gcc -E" > Preprocessing source: > #include "confdefs.h" > #include "conffix.h" > #include <stdlib.h> > Executing: gcc -E > -I/var/folders/fd/yx1jblsj2rzb981kx8ksm03ssqvm65/T/petsc-2jvhontx/config.setCompilers > > /var/folders/fd/yx1jblsj2rzb981kx8ksm03ssqvm65/T/petsc-2jvhontx/config.setCompilers/conftest.c > > Possible ERROR while running preprocessor: exit code 1 > stdout: > # 1 > "/var/folders/fd/yx1jblsj2rzb981kx8ksm03ssqvm65/T/petsc-2jvhontx/config.setCompilers/conftest.c" > > So for some reason the gcc -E seems to work correctly but produces an > non-zero exit code? > > I notice something very concerning in your Conda environment. It seems to > have a gcc (GCC) 4.8.5 which is more ancient than my son who is in college. I > cannot imagine you would want to use such an old compiler. Perhaps if you > upgrade the Conda environment to use a recent gcc then the other problem will > go away. > > Please give that a try and let us know how it goes, send configure.log again > if configure still fails. > > Good luck, > > Barry > > > Locate a functional C compiler > Checking for program /Users/lzou/miniconda3/bin/gcc...found > Executing: gcc --version > stdout: > gcc (GCC) 4.8.5 > Copyright (C) 2015 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > > > On Nov 15, 2020, at 4:27 PM, Zou, Ling via petsc-users > > <[email protected]> wrote: > > > > Hi, > > > > I have installed PETSc many times before, so not so new to it. > > Recently, I have switched to conda system to manage my working environment, > > and would like to reinstall PETSc, and had some issue during the ‘config’ > > stage: > > > > ******************************************************************************* > > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for > > details): > > ------------------------------------------------------------------------------- > > Cannot find a C preprocessor > > ******************************************************************************* > > > > Config file is also attached. > > Appreciate your help. > > > > -Ling > > <configure.log> > >
