当前位置: 首页 > article >正文

Linux下编译Kratos

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

零、环境

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

一、依赖与代码

1.1 安装依赖

apt-get update
apt-get install vim openssh-server openssh-client ssh \
  build-essential cmake git doxygen \
  libboost-all-dev intel-basekit intel-hpckit
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py

1.2 下载代码

git clone --progress --recursive -v https://github.com/KratosMultiphysics/Kratos.git
cd ./Kratos/
git checkout -b Kratos-v9.5 v9.5

二、VS Code

下载VS Code,然后安装以下插件,

Task Explorer

Output Colorizer

Git Extension Pack

Remote Developement

Remote X11

C/C++ Extension Pack

C++ TestMate

Modern Fortran

FORTRAN InstelliSense

Fortran Breakpoint Support

Python Extension Pack

Environment Configurator for Intel Software Developer Tools

Extension Pack for Intel Software Developer Tools

三、编译

按附录I新建CMakeUserPrersets.json,在CMake Tools中,选择'GCC 11.4.0 x86_64-linux-gnu' Kit,完成Kratos编译与安装。

EXCLUDE_KRATOS_COREON

四、测试

附录I: CMakeUserPresets.json

{
    "version": 4,
    "configurePresets": [
        {
            "name": "linux_default",
            "hidden": true,
            "displayName": "Default Linux Config",
            "description": "Default build using Unix Makefiles generator",
            "generator": "Unix Makefiles",
            "binaryDir": "${sourceDir}/out/build/${presetName}",
            "cacheVariables": {
                "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
                "CMAKE_BUILD_TYPE": "Debug"
            }
        },
        {
            "name": "linux_gcc",
            "inherits": "linux_default",
            "displayName": "linux_gcc",
            "description": "Using compilers: C = /usr/bin/gcc, CXX = /usr/bin/g++",
            "cacheVariables": {
                "CMAKE_C_COMPILER": "/usr/bin/gcc",
                "CMAKE_CXX_COMPILER": "/usr/bin/g++",
                "CMAKE_MAKE_PROGRAM": "/usr/bin/make",
                "MKL_INTERFACE": "lp64"
            },
            "environment": {
                "KRATOS_APPLICATIONS": "applications/FluidDynamicsApplication;applications/FreeSurfaceApplication"
            }
        }
    ],
    "buildPresets": [
        {
            "name": "linux_gcc",
            "displayName": "linux_gcc",
            "description": "Using compilers: C = /usr/bin/gcc, CXX = /usr/bin/g++",
            "configurePreset": "linux_gcc"
        }
    ]
}

附录II:cmake-tools-kits.json 

[
  {
    "name": "GCC 11.4.0 x86_64-linux-gnu",
    "compilers": {
      "C": "/usr/bin/gcc",
      "CXX": "/usr/bin/g++"
    },
    "isTrusted": true
  }
]

参考资料

  • Pooyan Dadvand. A Framework for Developing Finite Element Codes for Multi-Disciplinary Applications. Monograph CIMNE, January 2008.

网络资料

Kratosicon-default.png?t=O83Ahttps://github.com/KratosMultiphysics/Kratos

Using Visual Studio Code with Intel® oneAPI Toolkits User Guideicon-default.png?t=O83Ahttps://www.intel.com/content/www/us/en/docs/oneapi/user-guide-vs-code/2024-2/overview.html


http://www.kler.cn/a/308631.html

相关文章:

  • 若依笔记(八):芋道的Docker容器化部署
  • MySql结合element-plus pagination的分页查询
  • STM32单片机WIFI语音识别智能衣柜除湿消毒照明
  • unity基础,点乘叉乘。
  • Gsensor加速度传感器数据异常及概率性卡死
  • wafw00f源码详细解析
  • 如何动态获取路由上的参数
  • 最短路径算法
  • 详解QT元对象系统用法
  • webpack原理简述
  • java实现真值表代码(不完善)恳求大佬指导
  • 利用AI驱动智能BI数据可视化-深度评测Amazon Quicksight(三)
  • 使用 Visual Studio Code 配置 C++ 开发环境的详细指南
  • sqlx1.3.4版本的问题
  • 【MySQL】Windows下重启MySQL服务时,报错:服务名无效
  • 语言模型与人类反馈的深度融合:Chain of Hindsight技术
  • 主流日志框架Logback与Log4j2
  • 【TS】TypeScript配置详解【三】
  • HarmonyOS axios 拦截器处理token 及异常
  • js的书写位置和css的书写位置的区别?为什么要这样写?
  • dedecms(四种webshell姿势)
  • 微服务之间远程调用实现思路
  • pdf文件转图片,base64或保存到本地
  • django 通过地址访问本地文件
  • Java原生HttpURLConnection实现Get、Post、Put和Delete请求完整工具类分享
  • 高级I/O知识分享【5种IO模型 || select || poll】