1.2 在Debian12的Conda环境下装置MOOSE
根据 MOOSE 的应用程序开发所需的依靠项的许多库首选办法是经过 Conda获取。依照以下阐明运用 Conda 在核算机上创立环境。
1. 装置Miniforge。
根据您的渠道,请依照以下过程装置 Miniforge。假如您在这些过程中遇到问题,请拜访Conda 毛病扫除攻略。
- Linux Users:
Linux用户:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh -b -p ~/miniforge
- Macintosh Users with Intel processors:
运用 Intel 处理器的 Macintosh 用户:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh
bash Miniforge3-MacOSX-x86_64.sh -b -p ~/miniforge
- Macintosh Users with Apple Silicon processors:
运用 Apple Silicon 处理器的 Macintosh 用户:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh -b -p ~/miniforge
将 Miniforge 装置在主目录中后,导出 PATH 以便能够运用:
点击检查代码export PATH=$HOME/miniforge/bin:$PATH
Now that we can execute conda, initialize it and then exit the terminal:
现在咱们能够履行 conda ,初始化它,然后退出终端:
点击检查代码conda init --all
exitCopy
Upon restarting your terminal, you should see your prompt prefixed with (base). This indicates you are in the base environment, and Conda is ready for operation:
重新启动终端后,您应该会看到以 (base) 为前缀的提示。这表明您处于根底环境中,而且 Conda 已准备好运转:
点击检查代码$ (base) ~>
The next thing you should do after a fresh install, is perform an update to the base Conda environment:
全新装置后,您应该做的下一件事是对根本 Conda 环境履行更新:
点击检查代码conda update --all --yes
Add INL's public channel to gain access to INL's Conda package library:
增加 INL 的公共通道以拜访 INL 的 Conda 包库:
点击检查代码conda config --add channels https://conda.software.inl.gov/public
正告:不要运用 sudo
假如您发现自己在运用 Conda 指令时运用了 sudo 指令...有些不对劲。需求 sudo 的最常见原因是由于 Conda 装置不妥。Conda 应该装置到您的主目录中,而不运用 sudo 。
注:Miniforge vs Miniconda vs Anaconda
他们的中心都是包括conda这一东西,来完成 python 环境(environment) 和 包(package) 办理的,(其实不仅仅能够用来办理python,许多言语R, Java, C都支撑)。
Anaconda 和 Miniconda 是一个公司的产品,商用是付费的,个人暂时免费;而Miniforge是由社区主导,用GitHub保管,完全免费。Miniconda 和 Miniforge 是差不多的产品,代表着轻量化,而Anaconda是完整版,就略显臃肿。
Miniforge 运用conda-forge 作为默许 channel,而 Miniconda 运用anaconda.org 作为默许channel。
注:conda channels (源)
conda channels (源)是 packages 存储的方位,也便是你是从哪个来历下载这个包,对应到conda内部处理则是下载文件的链接。由于不同源会有相同姓名的包,因而有必要指定来历,一起装置conda的时分也会有一个默许的channel。现在干流的便是 conda-forge,完全且更新快。假如有多个channel,他们会按次序确认优先级,优先的源上找不到,就会到下一个优先级的源上去找。还能够设置channel的优先级是否strict,假如是strict的话,则只会在这一个源上查找。
2.创立 MOOSE 环境
Create a unique conda environment for MOOSE, named moose, and install the MOOSE dependency packages:
为 MOOSE 创立名为 moose 的仅有 conda 环境,并装置 MOOSE 依靠项包:
conda create -n moose moose-dev=2023.12.20
After the installation completes, activate the new environment:
装置完成后,激活新环境:
conda activate moose
If you are running into errors, please see our troubleshooting guide for Conda.
假如您遇到过错,请参阅Conda 毛病扫除攻略
关于翻开的每个终端窗口,以及每非必须履行 MOOSE 相关作业时,都需求 conda activate moose 。假如您期望将其主动履行,能够将该指令增加到 shell 配置文件的结尾。
3. 克隆 MOOSE
MOOSE is hosted on GitHub and should be cloned directly from there using git. We recommend creating a directory ~/projects to contain all of your MOOSE related work.
MOOSE 保管在 GitHub 上,应运用 git 直接从那里克隆。咱们主张创立一个目录 ~/projects 来包括一切与 MOOSE 相关的作业。
To clone MOOSE, run the following commands in a terminal:
要克隆 MOOSE,请在终端中运转以下指令:
mkdir -p ~/projects
cd ~/projects
git clone https://github.com/idaholab/moose.git
cd moose
git checkout master
> MOOSE 的 master 分支是安稳分支,只要在一切测验经过后才会更新。这能够维护您免受 MOOSE 存储库中的日常更改的影响。
gitee镜像 https://gitee.com/mirrors/moose.git
4.构建和测验 MOOSE
To build MOOSE run the following commands:
要构建 MOOSE,请运转以下指令:
cd ~/projects/moose/test
make -j 6
To test MOOSE, run the following commands:
若要测验 MOOSE,请运转以下指令:
点击检查代码cd ~/projects/moose/test
./run_tests -j 6
Some tests are SKIPPED. This is normal as some tests are specific to available resources, or some other constraint your machine does not satisfy. If you see failures, or you see MAX FAILURES, thats a problem! And it needs to be addressed before continuing:
某些测验被越过。这是正常的,由于某些测验特定于可用资源,或许核算机不满足的其他一些束缚。假如您看到失利,或许您看到 MAX FAILURES ,那便是一个问题!在持续之前,需求处理它:
- Supply a report of the actual failure (scroll up a ways). For example the following snippet does not give the full picture (created with ./run_tests -i always_bad):
供给实践毛病的陈述(向上翻滚)。例如,以下代码片段没有给出全貌(运用 ./run_tests -i always_bad 创立):
点击检查代码Final Test Results:
--------------------------------------------------------------------------------
tests/test_harness.always_ok .................... FAILED (Application not found)
tests/test_harness.always_bad .................................. FAILED (CODE 1)
--------------------------------------------------------------------------------
Ran 2 tests in 0.2 seconds. Average test time 0.0 seconds, maximum test time 0.0 seconds.
0 passed, 0 skipped, 0 pending, 2 FAILED
- Instead, you need to scroll up and report the actual error:
相反,您需求向上翻滚并陈述实践过错:
点击检查代码materials/derivative_material_interface.required_property/allow_override .................................. OK
materials/derivative_material_interface.required_property/derivative_parsed_material ...................... OK
partitioners/petsc_partitioner.ptscotch_weight_elment ........................................ [min_cpus=4] OK
partitioners/petsc_partitioner.ptscotch_weight_side .......................................... [min_cpus=4] OK
partitioners/petsc_partitioner.ptscotch_weight_both .......................................... [min_cpus=4] OK
partitioners/petsc_partitioner.parmetis ...................................................... [min_cpus=4] OK
partitioners/petsc_partitioner.parmetis_weight_element ....................................... [min_cpus=4] OK
partitioners/petsc_partitioner.parmetis_weight_side .......................................... [min_cpus=4] OK
partitioners/petsc_partitioner.parmetis_weight_both .......................................... [min_cpus=4] OK
partitioners/petsc_partitioner.parmetis_presplit_mesh ........................................ [min_cpus=2] OK
meshgenerators/distributed_rectilinear/partition.1D_4 ........................................ [min_cpus=4] OK
meshgenerators/distributed_rectilinear/partition.3D_3 ........................................ [min_cpus=3] OK
meshgenerators/distributed_rectilinear/partition.3D_4 ........................................ [min_cpus=4] OK
meshgenerators/distributed_rectilinear/partition.3D_8 ................... [min_cpus=8,insufficient slots] SKIP
------------------------------------------------------------------------------------------
Ran 4100 tests in 393.7 seconds. Average test time 0.3 seconds, maximum test time 22.9 seconds.
4100 passed, 106 skipped, 0 pending, 0 failed
5.卸载
If you wish to remove the moose environment at any time, you may do so using the following commands:
假如您期望随时删去驼鹿环境,能够运用以下指令进行操作:
conda activate base
conda env remove -n moose
Now that you have a working MOOSE, proceed to 'New Users' to begin your tour of MOOSE!
现在您已经有了一个能够作业的 MOOSE,请前往“新用户”开端您的 MOOSE 之旅!