安装 petcs 时出现错误。如何解决?

There has been an error in the installation of petcs. How to solve it?

电脑配置:我的电脑是maosx系统,在虚拟机里安装了ubuntu,原来的系统安装了梯子(VPN),Linux没有安装成功梯子(VPN)。

环境配置:在虚拟机中安装petsc,下载并解压petsc软件包,安装GCC,gfortran,之前分别下载了MPI和BLAS/LAPACK,但是安装MPI时出现错误。 .

./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack

命令行执行,结果提示无法从官网下载MPI(我试过下载url,安装梯子(VPN)后可以下载。下面是输入命令和结果:

<pre><font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/petsc-3.13.0</b></font>$ ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
===============================================================================       Trying to download https://www.mpich.org/static/downloads/3.3.2/mpich-3.3.=============================================================================== ===============================================================================       Trying to download http://ftp.mcs.anl.gov/pub/petsc/externalpackages/mpich=============================================================================== ===============================================================================       Trying to download ftp://ftp.mcs.anl.gov/pub/petsc/externalpackages/mpich-=============================================================================== ===============================================================================       Trying to download https://www.mcs.anl.gov/petsc/mirror/externalpackages/m===============================================================================                                                                                 *******************************************************************************
         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):
-------------------------------------------------------------------------------
Error during download/extract/detection of MPICH:
Unable to download package MPICH from: https://www.mpich.org/static/downloads/3.3.2/mpich-3.3.2.tar.gz
* If URL specified manually - perhaps there is a typo?
* If your network is disconnected - please reconnect and rerun ./configure
* Or perhaps you have a firewall blocking the download
* You can run with --with-packages-download-dir=/adirectory and ./configure will instruct you what packages to download manually
* or you can download the above URL manually, to /yourselectedlocation/mpich-3.3.2.tar.gz
  and use the configure option:
  --download-mpich=/yourselectedlocation/mpich-3.3.2.tar.gz
Unable to download package MPICH from: http://ftp.mcs.anl.gov/pub/petsc/externalpackages/mpich-3.3.2.tar.gz
* If URL specified manually - perhaps there is a typo?
* If your network is disconnected - please reconnect and rerun ./configure
* Or perhaps you have a firewall blocking the download
* You can run with --with-packages-download-dir=/adirectory and ./configure will instruct you what packages to download manually
* or you can download the above URL manually, to /yourselectedlocation/mpich-3.3.2.tar.gz
  and use the configure option:
  --download-mpich=/yourselectedlocation/mpich-3.3.2.tar.gz
Unable to download package MPICH from: ftp://ftp.mcs.anl.gov/pub/petsc/externalpackages/mpich-3.3.2.tar.gz
* If URL specified manually - perhaps there is a typo?
* If your network is disconnected - please reconnect and rerun ./configure
* Or perhaps you have a firewall blocking the download
* You can run with --with-packages-download-dir=/adirectory and ./configure will instruct you what packages to download manually
* or you can download the above URL manually, to /yourselectedlocation/mpich-3.3.2.tar.gz
  and use the configure option:
  --download-mpich=/yourselectedlocation/mpich-3.3.2.tar.gz
Unable to download package MPICH from: https://www.mcs.anl.gov/petsc/mirror/externalpackages/mpich-3.3.2.tar.gz
* If URL specified manually - perhaps there is a typo?
* If your network is disconnected - please reconnect and rerun ./configure
* Or perhaps you have a firewall blocking the download
* You can run with --with-packages-download-dir=/adirectory and ./configure will instruct you what packages to download manually
* or you can download the above URL manually, to /yourselectedlocation/mpich-3.3.2.tar.gz
  and use the configure option:
  --download-mpich=/yourselectedlocation/mpich-3.3.2.tar.gz
*******************************************************************************
</pre>

按照提示:提前下载mpich包。我知道mpich包的存放位置,但是结果显示我的下载位置无效。是我选错地方了吗?下面是我第二次输入命令和结果,请大家帮我看看哪里有问题。

<pre><font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/DummyFolder/PETSC</b></font>$ ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich=/Downloads/mpich-3.3.2.tar.gz --download-fblaslapack
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
*******************************************************************************
                ERROR in COMMAND LINE ARGUMENT to ./configure 
-------------------------------------------------------------------------------
Invalid download location: /Downloads/mpich-3.3.2.tar.gz for key download-mpich
*******************************************************************************


  File &quot;./config/configure.py&quot;, line 390, in petsc_configure
    framework = config.framework.Framework([&apos;--configModules=PETSc.Configure&apos;,&apos;--optionsModule=config.compilerOptions&apos;]+sys.argv[1:], loadArgDB = 0)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 110, in __init__
    self.createChildren()
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 321, in createChildren
    self.getChild(moduleName)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 306, in getChild
    config.setupDependencies(self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/PETSc/Configure.py&quot;, line 95, in setupDependencies
    self.blasLapack    = framework.require(&apos;config.packages.BlasLapack&apos;,self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 326, in require
    config = self.getChild(moduleName, keywordArgs)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 306, in getChild
    config.setupDependencies(self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/packages/BlasLapack.py&quot;, line 22, in setupDependencies
    config.package.Package.setupDependencies(self, framework)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/package.py&quot;, line 119, in setupDependencies
    self.mpi         = framework.require(&apos;config.packages.MPI&apos;,self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 326, in require
    config = self.getChild(moduleName, keywordArgs)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 306, in getChild
    config.setupDependencies(self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/packages/MPI.py&quot;, line 62, in setupDependencies
    self.mpich   = framework.require(&apos;config.packages.MPICH&apos;, self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 326, in require
    config = self.getChild(moduleName, keywordArgs)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/framework.py&quot;, line 304, in getChild
    config.setup()
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/script.py&quot;, line 101, in setup
    logger.Logger.setup(self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/logger.py&quot;, line 85, in setup
    args.ArgumentProcessor.setup(self)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/args.py&quot;, line 75, in setup
    self.setupArguments(self.argDB)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/script.py&quot;, line 85, in setupArguments
    self.setupHelp(self.help)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/packages/MPICH.py&quot;, line 24, in setupHelp
    config.package.GNUPackage.setupHelp(self,help)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/package.py&quot;, line 1224, in setupHelp
    config.package.Package.setupHelp(self,help)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/config/package.py&quot;, line 132, in setupHelp
    help.addArgument(self.PACKAGE, &apos;-download-&apos;+self.package+&apos;=&lt;no,yes,filename,url&gt;&apos;, nargs.ArgDownload(None, 0, &apos;Download and install &apos;+self.name))
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/help.py&quot;, line 107, in addArgument
    self.argDB.setType(self.getArgName(name), argType, forceLocal = 1)
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/RDict.py&quot;, line 213, in setType
    value.setValue(v.getValue())
  File &quot;/home/parallels/DummyFolder/PETSC/config/BuildSystem/nargs.py&quot;, line 500, in setValue
    raise ValueError(&apos;Invalid download location: &apos;+str(value)+&apos; for key &apos;+str(self.key))
<font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/DummyFolder/PETSC</b></font>$ 
</pre>


相反,我直接进入配置命令行。/configure stage complete.now build PETSc libraries with

<pre><font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/DummyFolder/PETSC</b></font>$ ./configure
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
Compilers:                                                                      
  C Compiler:         mpicc  -fPIC  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -g3 
  C++ Compiler:       mpicxx  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -g   -fPIC   
  Fortran Compiler:   mpif90  -fPIC -Wall -ffree-line-length-0 -Wno-unused-dummy-argument -g  
Linkers:
  Shared linker:   mpicc  -shared  -fPIC  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -g3
  Dynamic linker:   mpicc  -shared  -fPIC  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -g3
make:
BLAS/LAPACK: -llapack -lblas
MPI:
cmake:
  Arch:     
valgrind:
pthread:
PETSc:
  PETSC_ARCH: arch-linux2-c-debug
  PETSC_DIR: /home/parallels/DummyFolder/PETSC
  Scalar type: real
  Precision: double
  Clanguage: C
  Integer size: 32
  shared libraries: enabled
  Memory alignment: 16
xxx=========================================================================xxx
 Configure stage complete. Now build PETSc libraries with (gnumake build):
   make PETSC_DIR=/home/parallels/DummyFolder/PETSC PETSC_ARCH=arch-linux2-c-debug all
xxx=========================================================================xxx
<font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/DummyFolder/PETSC</b></font>$ make PETSC_DIR=/home/parallels/DummyFolder/PETSC PETSC_ARCH=arch-linux2-c-debug all
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The version of PETSc you are using is out-of-date, we recommend updating to the new release
 Available Version: 3.12.4   Installed Version: 3.8.3
http://www.mcs.anl.gov/petsc/download/index.html
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
make[1]: 进入目录“/home/parallels/DummyFolder/PETSC”
==========================================
 
See documentation/faq.html and documentation/bugreporting.html
for help with installation problems.  Please send EVERYTHING
printed out below when reporting problems.  Please check the
mailing list archives and consider subscribing.
 
  http://www.mcs.anl.gov/petsc/miscellaneous/mailing-lists.html
 
==========================================
Starting on parallels-Parallels-Virtual-Platform at Thu Apr 16 10:33:08 CST 2020
Machine characteristics: Linux parallels-Parallels-Virtual-Platform 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
-----------------------------------------
Using PETSc directory: /home/parallels/DummyFolder/PETSC
Using PETSc arch: arch-linux2-c-debug
-----------------------------------------
PETSC_VERSION_RELEASE    1
PETSC_VERSION_MAJOR      3
PETSC_VERSION_MINOR      8
PETSC_VERSION_SUBMINOR   3
</pre>
……
……
……
<pre>     FC arch-linux2-c-debug/obj/src/ksp/f90-mod/petsckspmod.o
          FC arch-linux2-c-debug/obj/src/snes/f90-mod/petscsnesmod.o
          FC arch-linux2-c-debug/obj/src/ts/f90-mod/petsctsmod.o
          FC arch-linux2-c-debug/obj/src/tao/f90-mod/petsctaomod.o
     CLINKER /home/parallels/DummyFolder/PETSC/arch-linux2-c-debug/lib/libpetsc.so.3.8.3
make[2]: 离开目录“/home/parallels/DummyFolder/PETSC”
=========================================
make[1]: 离开目录“/home/parallels/DummyFolder/PETSC”
Now to check if the libraries are working do:
make PETSC_DIR=/home/parallels/DummyFolder/PETSC PETSC_ARCH=arch-linux2-c-debug test
=========================================
<font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/DummyFolder/PETSC</b></font>$ ^C
<font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/DummyFolder/PETSC</b></font>$ make PETSC_DIR=/home/parallels/DummyFolder/PETSC PETSC_ARCH=arch-linux2-c-debug test
Running test examples to verify correct installation
Using PETSC_DIR=/home/parallels/DummyFolder/PETSC and PETSC_ARCH=arch-linux2-c-debug
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 MPI process
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 2 MPI processes
Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 MPI process
Completed test examples
=========================================
Now to evaluate the computer systems you plan use - do:
make PETSC_DIR=/home/parallels/DummyFolder/PETSC PETSC_ARCH=arch-linux2-c-debug streams
<font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Platform</b></font>:<font color="#729FCF"><b>~/DummyFolder/PETSC</b></font>$ make PETSC_DIR=/home/parallels/DummyFolder/PETSC PETSC_ARCH=arch-linux2-c-debug streams
cd src/benchmarks/streams; /usr/bin/make  --no-print-directory PETSC_DIR=/home/parallels/DummyFolder/PETSC PETSC_ARCH=arch-linux2-c-debug streams
mpicc -o MPIVersion.o -c -fPIC  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -g3   -I/home/parallels/DummyFolder/PETSC/include -I/home/parallels/DummyFolder/PETSC/arch-linux2-c-debug/include    `pwd`/MPIVersion.c
Running streams with &apos;mpiexec &apos; using &apos;NPMAX=2&apos; 
Number of MPI processes 1 Processor names  parallels-Parallels-Virtual-Platform 
Triad:        15990.2886   Rate (MB/s) 
Number of MPI processes 2 Processor names  parallels-Parallels-Virtual-Platform parallels-Parallels-Virtual-Platform 
Triad:        31023.1764   Rate (MB/s) 
------------------------------------------------
np  speedup
1 1.0
2 1.94
Estimation of possible speedup of MPI programs based on Streams benchmark.
It appears you have 1 node(s)
<font color="#8AE234"><b>parallels@parallels-Parallels-Virtual-Pla</b></font></pre>

我尝试将 GCC 升级到最新版本,但没有任何变化

正如 Satish 在电子邮件中所说,您的机器可能 运行 内存不足。 gfort运行 在编译时可以占用更多的 2GB 内存。如果您不需要 Fort运行,另一种方法是使用 --with-fc=0.

进行配置