本文记录在Linux下编译MUMPS的流程。
零、环境
操作系统 | Ubuntu 22.04.4 LTS |
VS Code | 1.92.1 |
Git | 2.34.1 |
GCC | 11.4.0 |
CUDA | V13.0.48 |
CMake | 3.22.1 |
oneAPI | 2024.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 Varaible | Value |
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"
}
]
}
]
}