[petsc-users] configuring on OSX

Smith, Barry F. bsmith at mcs.anl.gov
Wed Sep 4 01:09:04 CDT 2019


   Based on the config.log you just sent from c2html I see the problem: 

   You have an ancient gcc in your path installed by brew before the Apple "gcc wrapper" that is broken. This is picked up the c2html and sowing configures and thus ends up in failure. 

configure:1039: checking for gcc
configure:1054: found /usr/local/bin/gcc
configure:1062: result: gcc
configure:1290: checking for C compiler version
configure:1293: gcc --version </dev/null >&5
gcc (Homebrew GCC 5.5.0_2) 5.5.0

....

configure:1978: gcc -o conftest -g -O2   conftest.c   >&5
lex.yy.c:19:19: fatal error: stdio.h: No such file or directory
compilation terminated.
configure:1981: $? = 1

You can brew uninstall it, or if you like having broken compilers in your path you can leave it and add the options 

-download-sowing-cc=/usr/bin/gcc -download-sowing-cxx=/usr/bin/g++

to ./configure 

see more comments below. (As always please send configure.log immediately on failure; we don't expect users to debug our configure which is why we provide the service of helping decipher its behavior). 



> On Sep 4, 2019, at 12:41 AM, Brian Van Straalen <bvstraalen at lbl.gov> wrote:
> 
> Thanks Barry.  that gets me further.   now it seems the COPTFLAGS are not being propagated from PETSC to HYPRE.  I have -framework Accelerate in my COPTFLAGS, but HYPRE still fails looking for BLAS and LAPACK routines.  _dgetri, _dgetrs, and so on.

   Don't bother with the -framework stuff, on Apple PETSc just picks up the -lblas and -llapack automatically that point to the accelerate libraries. I suspect hypre's configure cannot handle the non-standard -framework  stuff.


>   Or does PETSc, and Hypre, and SUPERLU all pull in their own blas and lapack source code

   No, PETSc's configure tells all its child packages what blas/lapack to use to make sure they don't select different ones.

> and this is from me disabling Fortran?  I can't use Fortran in PETSc since sowing does not work on OSX as PETSc configures it (claims "configure: error: cannot run C compiled programs." but I know that is not true.  I suspect sowing has linux-isms  see attached log).  

   I was going to ask you to  send arch-macosx-gnu-g/externalpackages/git.sowing/config.log but I don't need it since the config.log for c2html provided the needed information.

> 
> is there some way to have PETSc configure just run through and configure things, and have a make command make things?

    Configure has to build the external packages as it runs because it needs information from the built packages to continue on to the next configure task; for example it cannot configure PETSc for hypre until hypre is built. 


>    I have to keep re-issuing the configure command, which prevents me from debugging a build errors.   I'm about two days into this port to OSX....  
> 
> Brian
> 
> 
> On Tue, Sep 3, 2019 at 9:35 PM Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
> 
>    Ahh,  the --download-c2html is not needed; it is used only when building all of the PETSc documentation including html versions of the source.
> 
>    For some reason it's configure is not doing a good job of selecting cpp. Over the years it has been amazingly portable, I guess Apple just went a bit too far.
> 
>    Anyways just run without that option,
> 
>     Barry
> 
> 
> 
> > On Sep 3, 2019, at 11:24 PM, Brian Van Straalen via petsc-users <petsc-users at mcs.anl.gov> wrote:
> > 
> > I can attach the config log.  mpi breaks for yet other reasons so I was trying to simplify things sufficiently.   
> > 
> > if I put mpi back in and take the compiler choices out, I still end up with failure on CPP.   It seems determined to look for "/lib/cpp" which is only correct for linux.
> > 
> > 
> > 
> > 
> > On Tue, Sep 3, 2019 at 9:11 PM Balay, Satish <balay at mcs.anl.gov> wrote:
> > On Wed, 4 Sep 2019, Balay, Satish via petsc-users wrote:
> > 
> > > On Tue, 3 Sep 2019, Brian Van Straalen via petsc-users wrote:
> > > 
> > > > pulling from git PETSC and on master branch.
> > > > 
> > > > ./configure CPP=/usr/bin/cpp
> > > > ===============================================================================
> > > >              Configuring PETSc to compile on your system
> > > > 
> > > > ===============================================================================
> > > > TESTING: checkCPreprocessor from
> > > > config.setCompilers(config/BuildSystem/config/setCompilers.py:592)
> > > > 
> > > > *******************************************************************************
> > > >          UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for
> > > > details):
> > > > -------------------------------------------------------------------------------
> > > > Cannot find a C preprocessor
> > > > *******************************************************************************
> > > 
> > > Its best to send configure.log
> > > 
> > > > 
> > > > 
> > > > 
> > > > Brian
> > > > 
> > > > my configure script
> > > > 
> > > > configure_options = [
> > > > #   '--with-mpi-dir=/usr/local/opt/open-mpi',
> > 
> > Hm - this is commented out anyway. So there is no mpi specified for this build (its a mandatory dependency)? 
> > 
> > > >    '--with-cc=/usr/bin/clang',
> > > >    '--with-cpp=/usr/bin/cpp',
> > > >    '--with-cxx=/usr/bin/clang++',
> > > 
> > > The above 3 options are redundant - when --with-mpi-dir is provided. PETSc configure will pick up mpicc etc from the specified location.
> > > 
> > > >    '--with-fc=0',
> > > 
> > > Hm - this conflicts with --download-mumps etc that require fortran
> > > 
> > > Satish
> > > 
> > > >     'COPTFLAGS=-g -framework Accelerate',
> > > >     'CXXOPTFLAGS=-g -framework Accelerate',
> > > >     'FOPTFLAGS=-g',
> > > > #  '--with-memalign=64',
> > > >   '--download-hypre=1',
> > > >   '--download-metis=1',
> > > >   '--download-parmetis=1',
> > > >   '--download-c2html=1',
> > > >   '--download-ctetgen',
> > > > #  '--download-viennacl',
> > > > #  '--download-ml=1',
> > > >   '--download-p4est=1',
> > > >   '--download-superlu_dist',
> > > >   '--download-superlu',
> > > >   '--with-cxx-dialect=C++11',
> > > >   '--download-mumps=1',
> > > >   '--download-scalapack=1',
> > > > #  '--download-exodus=1',
> > > > #  '--download-ctetgen=1',
> > > >   '--download-triangle=1',
> > > > #  '--download-pragmatic=1',
> > > > #  '--download-eigen=1',
> > > >   '--download-zlib',
> > > >   '--with-x=1',
> > > >   '--with-sowing=0',
> > > >   '--with-debugging=1',
> > > >   '--with-precision=double',
> > > >   'PETSC_ARCH=arch-macosx-gnu-g',
> > > >   '--download-chaco'
> > > >   ]
> > > > 
> > > > if __name__ == '__main__':
> > > >   import sys,os
> > > >   sys.path.insert(0,os.path.abspath('config'))
> > > >   import configure
> > > >   configure.petsc_configure(configure_options)
> > > > 
> > > > 
> > > > 
> > > 
> > 
> > 
> > 
> > -- 
> > Brian Van Straalen         Lawrence Berkeley Lab
> > BVStraalen at lbl.gov        Computational Research
> > (510) 486-4976            Division (crd.lbl.gov)
> > <configure.log>
> 
> 
> 
> -- 
> Brian Van Straalen         Lawrence Berkeley Lab
> BVStraalen at lbl.gov        Computational Research
> (510) 486-4976            Division (crd.lbl.gov)
> <configure.log>



More information about the petsc-users mailing list