Issue compiling on snow leopard

Niall Moran nmoran at thphys.nuim.ie
Fri Sep 18 04:10:41 CDT 2009


Hi,

I am trying to compile petsc on snow leopard. I need to have complex  
support and support for C++. I am using the gcc and g++ compilers that  
come packaged with the developers tools

i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
Copyright (C) 2007 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.

and the gfortran compiler from http://hpc.sourceforge.net/. The  
configuration file I am using is

#!/usr/bin/env python

configure_options = [
   '--FFLAGS=-m64',
   '--CFLAGS=-m64',
   '--CXXFLAGS=-m64',
   '--LDFLAGS=-L/usr/lib',
   '--with-python=0',
   '--with-shared=0',
   '--with-dynamic=0',
   '--with-mpi-dir=/Users/nmoran/local/openmpi',
   '--with-clanguage=C++',
   '--with-scalar-type=complex',
   '--with-debugging=yes',
   '--with-gcov=0'
   ]

if __name__ == '__main__':
   import sys,os
   sys.path.insert(0,os.path.abspath('config'))
   import configure
   configure.petsc_configure(configure_options)


I am getting errors that the macros isinf and isnan cannot be found in  
the scope for various files. The first one listed is src/sys/ftn- 
custom/zutils.c on the lines

  return (PetscTruth) PetscIsInfOrNanScalar(*v);
and
  return (PetscTruth) PetscIsInfOrNanReal(*v);

These macros are defined in /usr/include/architecture/i386/math.h. No  
errors are found if scalar-type is real. It seems the  
#include<complex> somehow undefines these macros. I have got petsc to  
compile by redefining these macros at the top of each of the problem  
files but this is not a very elegant solution.

Regards.

Niall. 


More information about the petsc-users mailing list