在 Red Hat Enterprise Linux 服务器版本 6.10(圣地亚哥)上构建 MultiNest 时安装失败

Installation fails when building MultiNest on Red Hat Enterprise Linux Server release 6.10 (Santiago)

在按照设置说明安装 PyMultiNest 的过程中,我遇到了障碍。以下是我遵循的步骤顺序,但在构建库(第 2 步)时失败了,并且出现了以下错误:

(envsam) [user@comp-ic-0018 build]$ module unload   
(envsam) [user@comp-ic-0018 build]$ module load gcc/7.3.1
(envsam) [user@comp-ic-0018 build]$ module load mkl 
(envsam) [user@comp-ic-0018 build]$ module load openmpi 
(envsam) [user@comp-ic-0018 build]$ pip install mpi4py 
Collecting mpi4py
Installing collected packages: mpi4py
Successfully installed mpi4py-3.0.3
You are using pip version 9.0.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(envsam) [user@comp-ic-0018 build]$ cmake ..
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Detected gfortran, adding -ffree-line-length-none compiler flag.
-- Configuring done
-- Generating done
-- Build files have been written to: /storage/home/user/work/MultiNest/build
(envsam) [user@comp-ic-0018 build]$ make
[  1%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/utils.f90.o
[  3%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/utils1.f90.o
[  5%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/kmeans_clstr.f90.o
[  6%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/xmeans_clstr.f90.o
[  8%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/posterior.F90.o
[ 10%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/priors.f90.o
[ 12%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/nested.F90.o
mpif-sizeof.h:18.48:
    Included at mpif.h:61:
    Included at /storage/home/user/work/MultiNest/src/nested.F90:14:

        USE, INTRINSIC :: iso_fortran_env, ONLY: REAL128
                                                1
Error: Symbol 'real128' referenced at (1) does not exist in intrinsic module ISO_FORTRAN_ENV
mpif-sizeof.h:19.14:
    Included at mpif.h:61:
    Included at /storage/home/user/work/MultiNest/src/nested.F90:14:

      COMPLEX(REAL128)::x
              1
Error: Parameter 'real128' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpif-sizeof.h:25.48:
    Included at mpif.h:61:
    Included at /storage/home/user/work/MultiNest/src/nested.F90:14:

        USE, INTRINSIC :: iso_fortran_env, ONLY: REAL128
                                                1
Error: Symbol 'real128' referenced at (1) does not exist in intrinsic module ISO_FORTRAN_ENV
mpif-sizeof.h:26.14:
    Included at mpif.h:61:
    Included at /storage/home/user/work/MultiNest/src/nested.F90:14:

      COMPLEX(REAL128), DIMENSION(*)::x
              1
Error: Parameter 'real128' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpif-sizeof.h:32.48:
    Included at mpif.h:61:
    Included at /storage/home/user/work/MultiNest/src/nested.F90:14:

        USE, INTRINSIC :: iso_fortran_env, ONLY: REAL128
                                                1

..

Error: Symbol 'real32' referenced at (1) does not exist in intrinsic module ISO_FORTRAN_ENV
Fatal Error: Error count reached limit of 25.
make[3]: *** [src/CMakeFiles/multinest_mpi_shared.dir/build.make:149: src/CMakeFiles/multinest_mpi_shared.dir/nested.F90.o] Error 1
make[2]: *** [src/CMakeFiles/multinest_mpi_shared.dir/build.make:155: src/CMakeFiles/multinest_mpi_shared.dir/nested.F90.o.provides] Error 2
make[1]: *** [CMakeFiles/Makefile2:108: src/CMakeFiles/multinest_mpi_shared.dir/all] Error 2
make: *** [Makefile:117: all] Error 2

post 建议使用 gfortran 6 或 7。我也在做同样的事情,但仍然遇到错误。

寻求帮助解决这个问题。

按照作者的建议清除 build/ 文件夹 here 解决了问题。