无法在Mac OS X上安装PETSc

时间:2012-03-14 12:20:51

标签: gcc fortran scientific-computing gfortran

我正在尝试在Mac OS X 10.6.8上安装 PETSc 科学计算库。

配置项目时,我遇到以下错误消息:

cls ~/Downloads/petsc-3.2-p6 $ ./configure
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
TESTING: checkFortranNameMangling from config.compilers(config/BuildSystem/config/compilers.py:589)                              *******************************************************************************
         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):
-------------------------------------------------------------------------------
Unknown Fortran name mangling: Are you sure the C and Fortran compilers are compatible?
  Perhaps one is 64 bit and one is 32 bit?
  See http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#gfortran
*******************************************************************************

我有以下版本gcc

cls ~/Downloads/petsc-3.2-p6 $ gcc --version
i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.

和gfortran

cls ~/Downloads/petsc-3.2-p6 $ gfortran --version
GNU Fortran (GCC) 4.2.3
Copyright (C) 2007 Free Software Foundation, Inc.

为什么那些不相容?

1 个答案:

答案 0 :(得分:2)

这两个编译器似乎来自两个不同的包。也许你应该告诉我们他们的二进制文件驻留在哪里,例如使用which gccwhich gfortran。尝试在gcc的构建中找到伴随的gfortran构建,它来自LLVM。您的gfortran可能不是由LLVM提供的,但它是正常的gcc构建。安装程序表明它们甚至可能是32位和64位。