用迭代求解器库-QUAD PRECINY未启用AppTainer构建问题 IM试图构建一个包含LIS库的构建的容器(带有Apptainer)。这是我的脚本: Bootstrap:Docker 来自:Ubuntu:22.04 %环境 导出intel_mpi_dir =“/tmp/

问题描述 投票:0回答:1
Bootstrap: docker From: ubuntu:22.04 %environment export INTEL_MPI_DIR="/tmp/intel" export INCLUDE_DIR="$INTEL_MPI_DIR/include" export LIB_DIR="$INTEL_MPI_DIR/lib" %post -c /bin/bash export DEBIAN_FRONTEND=noninteractive export TZ=Etc/UTC # Install necessary dependencies apt update && apt upgrade -y apt install -y build-essential wget gfortran cmake unzip gcc g++ libgcc-10-dev libx11-dev libxext-dev libxft-dev libxmu-dev libboost-all-dev libquadmath0 source /tmp/intel/oneapi/setvars.sh wget https://www.ssisc.org/lis/dl/lis-2.1.7.zip -O /tmp/lis-2.1.7.zip unzip /tmp/lis-2.1.7.zip -d /tmp/ cd /tmp/lis-2.1.7 ./configure --prefix=/usr/local --enable-f90 --enable-mpi --enable-shared --enable-saamg --enable-quad --enable-sse2 --enable-fma 'CFLAGS=-O3 -march=x86-64 -mtune=generic -frounding-math -fsignaling-nans' 'FCFLAGS=-O3 -march=x86-64 -mtune=generic -frounding-math -fsignaling-nans' make make check make install
使用

建造的

(base) bash-4.4$ apptainer build --bind /opt/intel:/tmp/intel min_example.sif min_example.def
im在Quad Precision(我需要的)中遇到特定问题。当它到达构建的制作检查部分时

=== Running test test.sh checking linear solvers... number of processes = 2 matrix size = 100 x 100 (460 nonzero entries) initial vector x : all components set to 0 precision : double linear solver : BiCG preconditioner : none convergence condition : ||b-Ax||_2 <= 1.0e-12 * ||b-Ax_0||_2 matrix storage format : CSR linear solver status : normal end BiCG: number of iterations = 15 BiCG: double = 15 BiCG: quad = 0 BiCG: elapsed time = 1.502484e-04 sec. BiCG: preconditioner = 1.370907e-06 sec. BiCG: matrix creation = 2.086163e-07 sec. BiCG: linear solver = 1.488775e-04 sec. BiCG: relative residual = 2.035749e-16 checking eigensolvers... number of processes = 2 matrix size = 100 x 100 (460 nonzero entries) initial vector x : all components set to 1 precision : double eigensolver : CR convergence condition : ||lx-(B^-1)Ax||_2 <= 1.0e-12 * ||lx||_2 matrix storage format : CSR shift : 0.000000e+00 linear solver : BiCG preconditioner : none eigensolver status : normal end CR: mode number = 0 CR: eigenvalue = 1.620281e-01 CR: number of iterations = 45 CR: elapsed time = 1.337633e-03 sec. CR: preconditioner = 2.384186e-07 sec. CR: matrix creation = 2.384186e-07 sec. CR: linear solver = 1.117587e-05 sec. CR: relative residual = 5.478047e-13 checking Fortran interface... number of processes = 2 initial vector x : all components set to 0 precision : double linear solver : BiCG preconditioner : none convergence condition : ||b-Ax||_2 <= 1.0e-12 * ||b-Ax_0||_2 matrix storage format : CSR linear solver status : normal end number of iterations = 6 1 1.000000e+00 2 1.000000e+00 3 1.000000e+00 4 1.000000e+00 5 1.000000e+00 6 1.000000e+00 7 1.000000e+00 8 1.000000e+00 9 1.000000e+00 10 1.000000e+00 11 1.000000e+00 12 1.000000e+00 checking double-double precision operations... number of processes = 2 n = 200, gamma = 2.000000 initial vector x : all components set to 0 precision : double linear solver : BiCG preconditioner : none convergence condition : ||b-Ax||_2 <= 1.0e-12 * ||b-Ax_0||_2 matrix storage format : CSR linear solver status : LIS_MAXITER(code=4) BiCG: number of iterations = 1001 BiCG: double = 1001 BiCG: quad = 0 BiCG: elapsed time = 6.739244e-03 sec. BiCG: preconditioner = 1.043081e-07 sec. BiCG: matrix creation = 1.043081e-07 sec. BiCG: linear solver = 6.739140e-03 sec. BiCG: relative residual = 1.159273e+00 number of processes = 2 n = 200, gamma = 2.000000 lis_solver.c(527) : lis_solve_kernel : error ILL_ARG :Quad precision is not enabled checking SAAMG preconditioner... number of processes = 2 matrix size = 100 x 100 (460 nonzero entries) initial vector x : all components set to 0 precision : double linear solver : CG preconditioner : SAAMG convergence condition : ||b-Ax||_2 <= 1.0e-12 * ||b-Ax_0||_2 matrix storage format : CSR linear solver status : normal end CG: number of iterations = 15 CG: double = 15 CG: quad = 0 CG: elapsed time = 1.426786e-04 sec. CG: preconditioner = 1.490116e-06 sec. CG: matrix creation = 2.235174e-07 sec. CG: linear solver = 1.411885e-04 sec. CG: relative residual = 2.177091e-16 PASS: test.sh ============= 1 test passed

请参阅错误代码
lis_solver.c(527):lis_solve_kernel:错误ill_arg:未启用Quad Precision 我尝试了一堆不同的配置变体,并与Ubuntu:20.04一起运行,没有成功。让我知道是否有人有任何想法!

错误指示LIS库不是在Quad Precision支持的情况下构建的,即使您在
lis_solver.c(527) : lis_solve_kernel : error ILL_ARG : Quad precision is not enabled

命令中包括了--enable-quad标志。由于缺少依赖关系或不正确的配置,可能会出现此问题。这是解决问题和解决问题的分步指南:

1。验证Quad Precision依赖项

LIS中的四分之一的精度支持需要特定的库和编译器支持。确保已安装以下依赖关系:
ubuntu fortran solver apptainer
1个回答
0
投票

libquadmath
:此库提供Quad-precision Math函数。
GCC带有四边形精度支持:确保您的GCC版本支持Quad Precision(
./configure
)。

将以下内容添加到您的

__float128

部分以安装以下依赖项:

    %post
  • 2。检查编译器标志 确保正确设置了四边形精度的编译器标志。
  • apt install -y libquadmath0 libquadmath-dev gcc gfortran
  • 标志应启用Quad Precision,但您可能需要明确指定四元精度库(--enable-quad)。
    修改您的
    -lquadmath
  • 命令如下:

./configure

3。验证Quad Precision支持

运行后,请检查输出以确保启用四边形精度支持。寻找类似:

./configure --prefix=/usr/local --enable-f90 --enable-mpi --enable-shared --enable-saamg --enable-quad --enable-sse2 --enable-fma \ 'CFLAGS=-O3 -march=x86-64 -mtune=generic -frounding-math -fsignaling-nans -lquadmath' \ 'FCFLAGS=-O3 -march=x86-64 -mtune=generic -frounding-math -fsignaling-nans -lquadmath'

如果说

./configure
,配置或依赖项存在问题。
4。调试构建过程

如果仍未启用Quad Precision,则可以调试构建过程:

  

检查:运行
checking for quad-precision support... yes
后,检查

no

文件是否是否存在与四Quad精度有关的错误或警告。寻找包含

config.log

./configure

的行。
config.log

手动测试QuadPrecision

:通过编译小型测试程序来验证您的编译器是否支持Quad Precision:

quad

如果失败,则您的编译器或

__float128

安装存在问题。
  • 5。更新容器定义文件
    there是更新的容器定义文件,具有必要的更改:
    grep -i quad /tmp/lis-2.1.7/config.log grep -i float128 /tmp/lis-2.1.7/config.log
    6。构建容器
    用更新的定义文件重新构建容器:
    echo -e '#include <quadmath.h>\nint main() { __float128 x = 1.0Q; return 0; }' > test.c
    gcc -o test test.c -lquadmath
    ./test
    7。验证容器中的Quad精度
    
    构建容器后,验证Quad Precision已启用:
  • 进入容器: libquadmath
      
    运行一个测试程序以检查四方精度支持:
    Bootstrap: docker
    From: ubuntu:22.04
    
    %environment
        export INTEL_MPI_DIR="/tmp/intel"
        export INCLUDE_DIR="$INTEL_MPI_DIR/include"
        export LIB_DIR="$INTEL_MPI_DIR/lib"
    
    %post -c /bin/bash
        export DEBIAN_FRONTEND=noninteractive
        export TZ=Etc/UTC
    
        # Install necessary dependencies
        apt update && apt upgrade -y
        apt install -y build-essential wget gfortran cmake unzip gcc g++ libgcc-10-dev libx11-dev libxext-dev libxft-dev libxmu-dev libboost-all-dev libquadmath0 libquadmath-dev
    
        source /tmp/intel/oneapi/setvars.sh
    
        # Download and build LIS
        wget https://www.ssisc.org/lis/dl/lis-2.1.7.zip -O /tmp/lis-2.1.7.zip
        unzip /tmp/lis-2.1.7.zip -d /tmp/
        cd /tmp/lis-2.1.7
        ./configure --prefix=/usr/local --enable-f90 --enable-mpi --enable-shared --enable-saamg --enable-quad --enable-sse2 --enable-fma \
          'CFLAGS=-O3 -march=x86-64 -mtune=generic -frounding-math -fsignaling-nans -lquadmath' \
          'FCFLAGS=-O3 -march=x86-64 -mtune=generic -frounding-math -fsignaling-nans -lquadmath'
        make
        make check
        make install
    如果成功运行,则启用了四边形精度。

8。重新运行的LIS测试

运行容器内的LIS测试,以确保四边形精度正常:

apptainer build --bind /opt/intel:/tmp/intel min_example.sif min_example.def

如果现在启用了四边形的精度,则不再发生错误。 summary

安装
apptainer shell min_example.sif

echo -e '#include <quadmath.h>\n#include <stdio.h>\nint main() { __float128 x = 1.0Q; printf("Quad precision supported!\\n"); return 0; }' > test.c gcc -o test test.c -lquadmath ./test

确保编译器支持四边形精度(

cd /tmp/lis-2.1.7 make check
    )。
  1. verify Quad Precision在
    lis_solver.c(527)
    输出中启用了。 使用
  2. libquadmath
  3. 和小型测试程序的debug。
    重新建立容器并验证Quad Precision支持。
    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.