Linux下编译MUMPS

本文记录在Linux下编译MUMPS的流程。

零、环境

操作系统Ubuntu 22.04.4 LTS
VS Code1.92.1
Git2.34.1
GCC11.4.0
CUDAV13.0.48
CMake3.22.1
oneAPI2024.2.1

一、安装依赖

1.1 安装oneAPI

参见:Get the Intel® oneAPI Base Toolkit , Get the Intel® oneAPI HPC Toolkit 

二、编译

2.1 下载

git clone https://github.com/scivision/mumps.git
cd ./mumps/
git submodule update --init --recursive
git checkout v5.8.0.0

2.2 构建

按照下表配置CMake,或者使用附录Ⅰ中的CMakeUserPresets.json文件,

CMake VaraibleValue

CMAKE_BUILD_TYPE

Debug
CMAKE_INSTALL_PREFIX/data/3rdparty/intel-dbg-zmo

MUMPS_intsize64

true

BUILD_SHARED_LIBS

true

2.3 编译

使用linux_intel presets,进行编译。

附录Ⅰ: CMakeUserPresets.json

{
    "version": 9,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 20,
        "patch": 0
    },
    "configurePresets": [
        {
            "name": "default",
            "hidden": true,
            "displayName": "Default Config",
            "description": "Default build configuration",
            "binaryDir": "${sourceDir}/out/build/${presetName}",
            "cacheVariables": {
                "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
                "CMAKE_BUILD_TYPE": "Debug"
            }
        },
        {
            "name": "vs2022",
            "hidden": false,
            "inherits": "default",
            "displayName": "Visual Studio 17 2022",
            "description": "This build is using Visual Studio 17 2022 generator",
            "generator": "Visual Studio 17 2022",
            "toolset": "host=x64",
            "architecture": "x64",
            "cacheVariables": {},
            "environment": {},
            "condition": {
                "type": "equals",
                "lhs": "${hostSystemName}",
                "rhs": "Windows"
            }
        },
        {
            "name": "mingw64",
            "hidden": false,
            "inherits": "default",
            "displayName": "MinGW-w64",
            "description": "This build is using MinGW generator",
            "generator": "MinGW Makefiles",
            "cacheVariables": {},
            "environment": {}
        },
        {
            "name": "cygwin64",
            "hidden": false,
            "inherits": "default",
            "displayName": "Cygwin64",
            "description": "This build is using Unix Makefiles generator",
            "generator": "Unix Makefiles",
            "cacheVariables": {},
            "environment": {}
        },
        {
            "name": "linux_gcc",
            "hidden": false,
            "inherits": "default",
            "displayName": "Linux GCC",
            "description": "Default build using Unix Makefiles generator",
            "generator": "Unix Makefiles",
            "cacheVariables": {
                "CMAKE_C_COMPILER": "/usr/bin/gcc",
                "CMAKE_CXX_COMPILER": "/usr/bin/g++",
                "CMAKE_INSTALL_PREFIX": "${sourceParentDir}/gcc-dbg-zmo",
                "CMAKE_BUILD_TYPE": "Debug",
                "MKL_INTERFACE": "ilp64",
                "ENABLE_BLACS": true,
                "MUMPS_intsize64": true,
                "BUILD_SHARED_LIBS": true                                
            },
            "environment": {}
        },
        {
            "name": "linux_intel",
            "hidden": false,
            "inherits": "default",
            "displayName": "Linux Intel",
            "description": "Intel(R) oneAPI DPC++/C++ Compiler",
            "generator": "Unix Makefiles",
            "cacheVariables": {
                "CMAKE_C_COMPILER": "/opt/intel/oneapi/compiler/latest/bin/icx",
                "CMAKE_CXX_COMPILER": "/opt/intel/oneapi/compiler/latest/bin/icpx",
                "CMAKE_INSTALL_PREFIX": "/data/3rdparty/intel-dbg-zmo",
                "CMAKE_BUILD_TYPE": "Debug",
                "MKL_INTERFACE": "ilp64",
                "ENABLE_BLACS": true,                
                "MUMPS_intsize64": true,
                "BUILD_SHARED_LIBS": true
            },
            "environment": {}
        }
    ],
    "buildPresets": [
        {
            "name": "default",
            "configurePreset": "default"
        },
        {
            "name": "vs2022",
            "hidden": false,
            "inherits": "default",
            "displayName": "Visual Studio 17 2022",
            "configurePreset": "vs2022"
        },
        {
            "name": "mingw64",
            "hidden": false,
            "inherits": "default",
            "displayName": "MinGW-w64",
            "configurePreset": "mingw64"
        },
        {
            "name": "cygwin64",
            "hidden": false,
            "inherits": "default",
            "displayName": "Cygwinw64",
            "configurePreset": "cygwin64"
        },
        {
            "name": "linux_gcc",
            "hidden": false,
            "inherits": "default",
            "displayName": "Linux GCC",
            "configurePreset": "linux_gcc"
        },
        {
            "name": "linux_intel",
            "hidden": false,
            "inherits": "default",
            "displayName": "Linux Intel",
            "configurePreset": "linux_intel"
        }
    ],
    "testPresets": [
        {
            "name": "default",
            "configurePreset": "default",
            "output": {
                "outputOnFailure": true
            },
            "execution": {
                "noTestsAction": "error",
                "stopOnFailure": true
            }
        },
        {
            "name": "vs2022",
            "hidden": false,
            "inherits": "default",
            "displayName": "Visual Studio 17 2022",
            "configurePreset": "vs2022"
        },
        {
            "name": "mingw64",
            "hidden": false,
            "inherits": "default",
            "displayName": "MinGW-w64",
            "configurePreset": "mingw64"
        },
        {
            "name": "cygwin64",
            "hidden": false,
            "inherits": "default",
            "displayName": "Cygwin64",
            "configurePreset": "cygwin64"
        },
        {
            "name": "linux_gcc",
            "displayName": "Linux GCC",
            "configurePreset": "linux_gcc"
        },
        {
            "name": "linux_intel",
            "displayName": "Linux Intel",
            "configurePreset": "linux_intel"
        }
    ],
    "packagePresets": [
        {
            "name": "default",
            "configurePreset": "default",
            "generators": [
                "TGZ"
            ]
        },
        {
            "name": "vs2022",
            "hidden": false,
            "inherits": "default",
            "displayName": "Visual Studio 17 2022",
            "configurePreset": "vs2022",
            "generators": [
                "TGZ"
            ]
        },
        {
            "name": "mingw64",
            "hidden": false,
            "inherits": "default",
            "displayName": "MinGW-w64",
            "configurePreset": "mingw64",
            "generators": [
                "TGZ"
            ]
        },
        {
            "name": "linux_gcc",
            "hidden": false,
            "inherits": "default",
            "displayName": "Linux GCC",
            "configurePreset": "linux_gcc",
            "generators": [
                "RPM"
            ]
        },
        {
            "name": "linux_intel",
            "hidden": false,
            "inherits": "default",
            "displayName": "Linux Intel",
            "configurePreset": "linux_intel",
            "generators": [
                "RPM"
            ]
        }
    ],
    "workflowPresets": [
        {
            "name": "default",
            "steps": [
                {
                    "type": "configure",
                    "name": "default"
                },
                {
                    "type": "build",
                    "name": "default"
                },
                {
                    "type": "test",
                    "name": "default"
                },
                {
                    "type": "package",
                    "name": "default"
                }
            ]
        },
        {
            "name": "vs2022",
            "displayName": "Visual Studio 17 2022",
            "steps": [
                {
                    "type": "configure",
                    "name": "vs2022"
                },
                {
                    "type": "build",
                    "name": "vs2022"
                },
                {
                    "type": "test",
                    "name": "vs2022"
                },
                {
                    "type": "package",
                    "name": "vs2022"
                }
            ]
        },
        {
            "name": "mingw64",
            "displayName": "MinGW-w64",
            "steps": [
                {
                    "type": "configure",
                    "name": "mingw64"
                },
                {
                    "type": "build",
                    "name": "mingw64"
                },
                {
                    "type": "test",
                    "name": "mingw64"
                },
                {
                    "type": "package",
                    "name": "mingw64"
                }
            ]
        },
        {
            "name": "linux_gcc",
            "displayName": "Linux GCC",
            "steps": [
                {
                    "type": "configure",
                    "name": "linux_gcc"
                },
                {
                    "type": "build",
                    "name": "linux_gcc"
                },
                {
                    "type": "test",
                    "name": "linux_gcc"
                },
                {
                    "type": "package",
                    "name": "linux_gcc"
                }
            ]
        },
        {
            "name": "linux_intel",
            "displayName": "Linux Intel",
            "steps": [
                {
                    "type": "configure",
                    "name": "linux_intel"
                },
                {
                    "type": "build",
                    "name": "linux_intel"
                },
                {
                    "type": "test",
                    "name": "linux_intel"
                },
                {
                    "type": "package",
                    "name": "linux_intel"
                }
            ]
        }
    ]
}

网络

MUMPS

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值