From 2367de39aa535d596155a2c2bc029066d9f3736b Mon Sep 17 00:00:00 2001 From: Peter German Date: Wed, 8 Jan 2025 17:39:14 -0700 Subject: [PATCH 1/5] Add first working compilation. (#29661) --- apptainer/moose-dev.def | 170 ++++++++++++++++++++++------------------ 1 file changed, 93 insertions(+), 77 deletions(-) diff --git a/apptainer/moose-dev.def b/apptainer/moose-dev.def index 0df39422fad5..1da2f20bfcb8 100644 --- a/apptainer/moose-dev.def +++ b/apptainer/moose-dev.def @@ -85,54 +85,37 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB CODE_SERVER_VERSION=4.92.2 # Install code-server - CODE_SERVER_FILE=code-server-${CODE_SERVER_VERSION}-amd64.rpm - cd ${ROOT_BUILD_DIR} - curl -fOL https://github.com/coder/code-server/releases/download/v${CODE_SERVER_VERSION}/${CODE_SERVER_FILE} - rpm -i ${CODE_SERVER_FILE} - rm ${CODE_SERVER_FILE} + # CODE_SERVER_FILE=code-server-${CODE_SERVER_VERSION}-amd64.rpm + # cd ${ROOT_BUILD_DIR} + # curl -fOL https://github.com/coder/code-server/releases/download/v${CODE_SERVER_VERSION}/${CODE_SERVER_FILE} + # rpm -i ${CODE_SERVER_FILE} + # rm ${CODE_SERVER_FILE} # Setup directory for code-server extensions. The extensions folder can be # filled by other applications as they wish to have extensions auto installed # by the "setup-code-server-extensions" script (in PATH) - mkdir /opt/code-server/extensions + # mkdir /opt/code-server/extensions # Download extensions for code-server, currently just moose language support - MOOSE_LANGUAGE_SUPPORT_VERSION=1.1.2 - cd /opt/code-server/extensions - curl -L -O https://github.com/idaholab/moose-language-support/releases/download/v${MOOSE_LANGUAGE_SUPPORT_VERSION}/DanielSchwen.moose-language-support-${MOOSE_LANGUAGE_SUPPORT_VERSION}.vsix + # MOOSE_LANGUAGE_SUPPORT_VERSION=1.1.2 + # cd /opt/code-server/extensions + # curl -L -O https://github.com/idaholab/moose-language-support/releases/download/v${MOOSE_LANGUAGE_SUPPORT_VERSION}/DanielSchwen.moose-language-support-${MOOSE_LANGUAGE_SUPPORT_VERSION}.vsix # Setup permissions for the code server extras - find /opt/code-server -type d -exec chmod 755 {} + - chmod 755 /opt/code-server/bin/* - chmod 644 /opt/code-server/extensions/* - - # Clone WASP - cd ${ROOT_BUILD_DIR} - WASP_SRC_DIR=${ROOT_BUILD_DIR}/wasp - git clone ${WASP_GIT_REMOTE} ${WASP_SRC_DIR} - cd ${WASP_SRC_DIR} - git checkout ${WASP_GIT_SHA} - git submodule update --init --recursive - -{%- if WITH_LIBTORCH %} - # Libtorch-related vars - LIBTORCH_DEST={{ LIBTORCH_DEST }} - LIBTORCH_VER=2.1.0 - LIBTORCH_DISTRIBUTION={{ WITH_LIBTORCH }} - - # Install libtorch from a precompiled package - ${ROOT_BUILD_DIR}/setup_libtorch.sh --version=${LIBTORCH_VER} --libtorch-dest=${LIBTORCH_DEST} --libtorch-distribution=${LIBTORCH_DISTRIBUTION} --cleanup - -{%- if WITH_LIBTORCH.startswith('cu') %} - # We install CUDA Toolkit if the user wants cuda-based libtorch. - # Right now this assumes that cuda-based distributions start with -cu- - dnf -y install epel-release - CUDA_RPM=${BUILD_DIR}/cuda.rpm - curl -L https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda-repo-rhel8-11-4-local-11.4.0_470.42.01-1.x86_64.rpm -o ${CUDA_RPM} - rpm -i ${CUDA_RPM} - dnf -y install cuda - rm -rf ${CUDA_RPM} -{%- endif %} -{%- endif %} + # find /opt/code-server -type d -exec chmod 755 {} + + # chmod 755 /opt/code-server/bin/* + # chmod 644 /opt/code-server/extensions/* + + # # Clone WASP + # cd ${ROOT_BUILD_DIR} + # WASP_SRC_DIR=${ROOT_BUILD_DIR}/wasp + # git clone ${WASP_GIT_REMOTE} ${WASP_SRC_DIR} + # cd ${WASP_SRC_DIR} + # git checkout ${WASP_GIT_SHA} + # git submodule update --init --recursive + + # # Build and install wasp + # # This is redundant; hopefully we can use the one from conda in the future + # WASP_SRC_DIR=${WASP_SRC_DIR} ${WASP_BUILD_SCRIPT} -D CMAKE_INSTALL_PREFIX:STRING=${WASP_DIR} # Install miniforge in MOOSE_MINIFORGE MINIFORGE_SCRIPT=${ROOT_BUILD_DIR}/miniforge3.sh @@ -156,46 +139,79 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB # Needed for coverage pip3 --no-cache install lcov-cobertura - # Build and install wasp - # This is redundant; hopefully we can use the one from conda in the future - WASP_SRC_DIR=${WASP_SRC_DIR} ${WASP_BUILD_SCRIPT} -D CMAKE_INSTALL_PREFIX:STRING=${WASP_DIR} - - # Install node.js. Requested by dschwen for bison - dnf install -y nodejs npm +{%- if WITH_LIBTORCH %} + # Libtorch-related vars + LIBTORCH_DEST={{ LIBTORCH_DEST }} + LIBTORCH_VER=2.1.0 + LIBTORCH_DISTRIBUTION={{ WITH_LIBTORCH }} -{% if PROFILING is defined %} - # Install gperftools - GPERFTOOLS_VERSION=gperftools-2.15 cd ${ROOT_BUILD_DIR} - git clone -b ${GPERFTOOLS_VERSION} --single-branch https://github.com/gperftools/gperftools.git - GPERFTOOLS_SRC=${ROOT_BUILD_DIR}/gperftools - cd ${GPERFTOOLS_SRC} - ./autogen.sh - ./configure --prefix={{ GPERF_DIR }} --enable-frame-pointers - make -j ${MOOSE_JOBS} - make install - cd ~ - rm -rf ${GPERFTOOLS_SRC} - - # Install go for building pprof; to be removed - GO_VERSION=1.23.1 - GO_TAR=${ROOT_BUILD_DIR}/go.tar.gz - curl -L https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -o ${GO_TAR} - tar -C ${ROOT_BUILD_DIR} -xf ${GO_TAR} - rm -rf ${GO_TAR} - export PATH=${ROOT_BUILD_DIR}/go/bin:${PATH} - export GOPATH=${ROOT_BUILD_DIR}/gopath - mkdir ${GOPATH} - - # Install pprof - PPROF_VERSION=a0b0bb1d4134f37be44de6c328680339b0fc13ad - GOBIN={{ PPROF_DIR }}/bin go install github.com/google/pprof@${PPROF_VERSION} - - # Remove go now that pprof is installed - go clean -cache -modcache - rm -rf ${GOPATH} ${ROOT_BUILD_DIR}/go + TORCH_SRC_DIR=${ROOT_BUILD_DIR}/pytorch + + conda install -yq python=${PYTHON_VERSION} "numpy<2.0" astunparse expecttest hypothesis types-dataclasses typing-extensions filelock networkx fsspec mkl-static mkl-include + + git clone -b v${LIBTORCH_VER} --recursive https://github.com/pytorch/pytorch "${TORCH_SRC_DIR}" + cd ${TORCH_SRC_DIR} + + curl -L https://github.com/pytorch/pytorch/pull/99468.patch > 99468.patch + git apply 99468.patch + + export CFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-error=nonnull" + export CXXFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-error=nonnull" + export CMAKE_PREFIX_PATH="${CONDA_PREFIX:-'$(dirname $(which conda))/../'}:${CMAKE_PREFIX_PATH}" + python setup.py develop + +# # Install libtorch from a precompiled package +# ${ROOT_BUILD_DIR}/setup_libtorch.sh --version=${LIBTORCH_VER} --libtorch-dest=${LIBTORCH_DEST} --libtorch-distribution=${LIBTORCH_DISTRIBUTION} --cleanup + +# {%- if WITH_LIBTORCH.startswith('cu') %} +# # We install CUDA Toolkit if the user wants cuda-based libtorch. +# # Right now this assumes that cuda-based distributions start with -cu- +# dnf -y install epel-release +# CUDA_RPM=${BUILD_DIR}/cuda.rpm +# curl -L https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda-repo-rhel8-11-4-local-11.4.0_470.42.01-1.x86_64.rpm -o ${CUDA_RPM} +# rpm -i ${CUDA_RPM} +# dnf -y install cuda +# rm -rf ${CUDA_RPM} +# {%- endif %} {%- endif %} + # Install node.js. Requested by dschwen for bison + # dnf install -y nodejs npm + +# {% if PROFILING is defined %} +# # Install gperftools +# GPERFTOOLS_VERSION=gperftools-2.15 +# cd ${ROOT_BUILD_DIR} +# git clone -b ${GPERFTOOLS_VERSION} --single-branch https://github.com/gperftools/gperftools.git +# GPERFTOOLS_SRC=${ROOT_BUILD_DIR}/gperftools +# cd ${GPERFTOOLS_SRC} +# ./autogen.sh +# ./configure --prefix={{ GPERF_DIR }} --enable-frame-pointers +# make -j ${MOOSE_JOBS} +# make install +# cd ~ +# rm -rf ${GPERFTOOLS_SRC} + +# # Install go for building pprof; to be removed +# GO_VERSION=1.23.1 +# GO_TAR=${ROOT_BUILD_DIR}/go.tar.gz +# curl -L https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -o ${GO_TAR} +# tar -C ${ROOT_BUILD_DIR} -xf ${GO_TAR} +# rm -rf ${GO_TAR} +# export PATH=${ROOT_BUILD_DIR}/go/bin:${PATH} +# export GOPATH=${ROOT_BUILD_DIR}/gopath +# mkdir ${GOPATH} + +# # Install pprof +# PPROF_VERSION=a0b0bb1d4134f37be44de6c328680339b0fc13ad +# GOBIN={{ PPROF_DIR }}/bin go install github.com/google/pprof@${PPROF_VERSION} + +# # Remove go now that pprof is installed +# go clean -cache -modcache +# rm -rf ${GOPATH} ${ROOT_BUILD_DIR}/go +# {%- endif %} + # Clean up conda clean -ya dnf clean all From 0ef2288745fa8a74dd8116933871b77642e2f687 Mon Sep 17 00:00:00 2001 From: Peter German Date: Thu, 9 Jan 2025 15:32:44 -0700 Subject: [PATCH 2/5] Limit processor count in pytorch compilation. (#29661) --- apptainer/moose-dev.def | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apptainer/moose-dev.def b/apptainer/moose-dev.def index 1da2f20bfcb8..1e67fa4479cb 100644 --- a/apptainer/moose-dev.def +++ b/apptainer/moose-dev.def @@ -156,10 +156,13 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB curl -L https://github.com/pytorch/pytorch/pull/99468.patch > 99468.patch git apply 99468.patch - export CFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-error=nonnull" - export CXXFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-error=nonnull" + export CFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict" + export CXXFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict" export CMAKE_PREFIX_PATH="${CONDA_PREFIX:-'$(dirname $(which conda))/../'}:${CMAKE_PREFIX_PATH}" - python setup.py develop + MAX_JOBS=${MOOSE_JOBS} python setup.py install + +# cd test +# python run_test.py # # Install libtorch from a precompiled package # ${ROOT_BUILD_DIR}/setup_libtorch.sh --version=${LIBTORCH_VER} --libtorch-dest=${LIBTORCH_DEST} --libtorch-distribution=${LIBTORCH_DISTRIBUTION} --cleanup From a3ab37b4bcc5bc0b83268dd264efb4c4a466ed6e Mon Sep 17 00:00:00 2001 From: Peter German Date: Thu, 9 Jan 2025 17:22:49 -0700 Subject: [PATCH 3/5] Restore other parts of the def file. (#29661) --- apptainer/moose-dev.def | 116 ++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/apptainer/moose-dev.def b/apptainer/moose-dev.def index 1e67fa4479cb..15571de12d93 100644 --- a/apptainer/moose-dev.def +++ b/apptainer/moose-dev.def @@ -85,37 +85,37 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB CODE_SERVER_VERSION=4.92.2 # Install code-server - # CODE_SERVER_FILE=code-server-${CODE_SERVER_VERSION}-amd64.rpm - # cd ${ROOT_BUILD_DIR} - # curl -fOL https://github.com/coder/code-server/releases/download/v${CODE_SERVER_VERSION}/${CODE_SERVER_FILE} - # rpm -i ${CODE_SERVER_FILE} - # rm ${CODE_SERVER_FILE} + CODE_SERVER_FILE=code-server-${CODE_SERVER_VERSION}-amd64.rpm + cd ${ROOT_BUILD_DIR} + curl -fOL https://github.com/coder/code-server/releases/download/v${CODE_SERVER_VERSION}/${CODE_SERVER_FILE} + rpm -i ${CODE_SERVER_FILE} + rm ${CODE_SERVER_FILE} # Setup directory for code-server extensions. The extensions folder can be # filled by other applications as they wish to have extensions auto installed # by the "setup-code-server-extensions" script (in PATH) - # mkdir /opt/code-server/extensions + mkdir /opt/code-server/extensions # Download extensions for code-server, currently just moose language support - # MOOSE_LANGUAGE_SUPPORT_VERSION=1.1.2 - # cd /opt/code-server/extensions - # curl -L -O https://github.com/idaholab/moose-language-support/releases/download/v${MOOSE_LANGUAGE_SUPPORT_VERSION}/DanielSchwen.moose-language-support-${MOOSE_LANGUAGE_SUPPORT_VERSION}.vsix + MOOSE_LANGUAGE_SUPPORT_VERSION=1.1.2 + cd /opt/code-server/extensions + curl -L -O https://github.com/idaholab/moose-language-support/releases/download/v${MOOSE_LANGUAGE_SUPPORT_VERSION}/DanielSchwen.moose-language-support-${MOOSE_LANGUAGE_SUPPORT_VERSION}.vsix # Setup permissions for the code server extras - # find /opt/code-server -type d -exec chmod 755 {} + - # chmod 755 /opt/code-server/bin/* - # chmod 644 /opt/code-server/extensions/* - - # # Clone WASP - # cd ${ROOT_BUILD_DIR} - # WASP_SRC_DIR=${ROOT_BUILD_DIR}/wasp - # git clone ${WASP_GIT_REMOTE} ${WASP_SRC_DIR} - # cd ${WASP_SRC_DIR} - # git checkout ${WASP_GIT_SHA} - # git submodule update --init --recursive - - # # Build and install wasp - # # This is redundant; hopefully we can use the one from conda in the future - # WASP_SRC_DIR=${WASP_SRC_DIR} ${WASP_BUILD_SCRIPT} -D CMAKE_INSTALL_PREFIX:STRING=${WASP_DIR} + find /opt/code-server -type d -exec chmod 755 {} + + chmod 755 /opt/code-server/bin/* + chmod 644 /opt/code-server/extensions/* + + # Clone WASP + cd ${ROOT_BUILD_DIR} + WASP_SRC_DIR=${ROOT_BUILD_DIR}/wasp + git clone ${WASP_GIT_REMOTE} ${WASP_SRC_DIR} + cd ${WASP_SRC_DIR} + git checkout ${WASP_GIT_SHA} + git submodule update --init --recursive + + # Build and install wasp + # This is redundant; hopefully we can use the one from conda in the future + WASP_SRC_DIR=${WASP_SRC_DIR} ${WASP_BUILD_SCRIPT} -D CMAKE_INSTALL_PREFIX:STRING=${WASP_DIR} # Install miniforge in MOOSE_MINIFORGE MINIFORGE_SCRIPT=${ROOT_BUILD_DIR}/miniforge3.sh @@ -180,40 +180,40 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB {%- endif %} # Install node.js. Requested by dschwen for bison - # dnf install -y nodejs npm - -# {% if PROFILING is defined %} -# # Install gperftools -# GPERFTOOLS_VERSION=gperftools-2.15 -# cd ${ROOT_BUILD_DIR} -# git clone -b ${GPERFTOOLS_VERSION} --single-branch https://github.com/gperftools/gperftools.git -# GPERFTOOLS_SRC=${ROOT_BUILD_DIR}/gperftools -# cd ${GPERFTOOLS_SRC} -# ./autogen.sh -# ./configure --prefix={{ GPERF_DIR }} --enable-frame-pointers -# make -j ${MOOSE_JOBS} -# make install -# cd ~ -# rm -rf ${GPERFTOOLS_SRC} - -# # Install go for building pprof; to be removed -# GO_VERSION=1.23.1 -# GO_TAR=${ROOT_BUILD_DIR}/go.tar.gz -# curl -L https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -o ${GO_TAR} -# tar -C ${ROOT_BUILD_DIR} -xf ${GO_TAR} -# rm -rf ${GO_TAR} -# export PATH=${ROOT_BUILD_DIR}/go/bin:${PATH} -# export GOPATH=${ROOT_BUILD_DIR}/gopath -# mkdir ${GOPATH} - -# # Install pprof -# PPROF_VERSION=a0b0bb1d4134f37be44de6c328680339b0fc13ad -# GOBIN={{ PPROF_DIR }}/bin go install github.com/google/pprof@${PPROF_VERSION} - -# # Remove go now that pprof is installed -# go clean -cache -modcache -# rm -rf ${GOPATH} ${ROOT_BUILD_DIR}/go -# {%- endif %} + dnf install -y nodejs npm + +{% if PROFILING is defined %} + # Install gperftools + GPERFTOOLS_VERSION=gperftools-2.15 + cd ${ROOT_BUILD_DIR} + git clone -b ${GPERFTOOLS_VERSION} --single-branch https://github.com/gperftools/gperftools.git + GPERFTOOLS_SRC=${ROOT_BUILD_DIR}/gperftools + cd ${GPERFTOOLS_SRC} + ./autogen.sh + ./configure --prefix={{ GPERF_DIR }} --enable-frame-pointers + make -j ${MOOSE_JOBS} + make install + cd ~ + rm -rf ${GPERFTOOLS_SRC} + + # Install go for building pprof; to be removed + GO_VERSION=1.23.1 + GO_TAR=${ROOT_BUILD_DIR}/go.tar.gz + curl -L https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -o ${GO_TAR} + tar -C ${ROOT_BUILD_DIR} -xf ${GO_TAR} + rm -rf ${GO_TAR} + export PATH=${ROOT_BUILD_DIR}/go/bin:${PATH} + export GOPATH=${ROOT_BUILD_DIR}/gopath + mkdir ${GOPATH} + + # Install pprof + PPROF_VERSION=a0b0bb1d4134f37be44de6c328680339b0fc13ad + GOBIN={{ PPROF_DIR }}/bin go install github.com/google/pprof@${PPROF_VERSION} + + # Remove go now that pprof is installed + go clean -cache -modcache + rm -rf ${GOPATH} ${ROOT_BUILD_DIR}/go +{%- endif %} # Clean up conda clean -ya From ac918e668b9a48ca6f5d527f6d5ba12ac903952f Mon Sep 17 00:00:00 2001 From: Peter German Date: Tue, 14 Jan 2025 07:14:04 -0700 Subject: [PATCH 4/5] Add first working version. (#29661) --- apptainer/moose-dev.def | 68 +++++++++++++++++++-------------------- scripts/setup_libtorch.sh | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/apptainer/moose-dev.def b/apptainer/moose-dev.def index 15571de12d93..1a7b74ec2675 100644 --- a/apptainer/moose-dev.def +++ b/apptainer/moose-dev.def @@ -29,8 +29,8 @@ {%- set GPERF_DIR = '/opt/gperftools' -%} {#- The installation location for pprof -#} {%- set PPROF_DIR = '/opt/pprof' -%} -{#- The installation location for libtorch -#} -{%- set LIBTORCH_DEST = '/opt' -%} +{#- We need this here because more than one block will use it +{%- set MOOSE_PYTHON_VERSION = '3.11' -%} {#- The script used to install wasp -#} {%- set WASP_BUILD_SCRIPT = 'update_and_rebuild_wasp.sh' -%} @@ -52,7 +52,7 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB {%- if WITH_LIBTORCH %} # Make libtorch visible to moose - export LIBTORCH_DIR={{ LIBTORCH_DEST }}/libtorch + export LIBTORCH_DIR={{ MOOSE_MINIFORGE }}/lib/python{{ MOOSE_PYTHON_VERSION }}/site-packages/torch # Adding this to not get GPU initialization errors from MPICH export MPIR_CVAR_ENABLE_GPU=0 {%- endif %} @@ -81,7 +81,8 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB # Pinned versions MINIFORGE_VERSION=23.3.1-1 - PYTHON_VERSION=3.11 + PYTHON_VERSION={{ MOOSE_PYTHON_VERSION }} + echo $PYTHON_VERSION CODE_SERVER_VERSION=4.92.2 # Install code-server @@ -141,42 +142,44 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB {%- if WITH_LIBTORCH %} # Libtorch-related vars - LIBTORCH_DEST={{ LIBTORCH_DEST }} - LIBTORCH_VER=2.1.0 + LIBTORCH_VER=2.3.0 LIBTORCH_DISTRIBUTION={{ WITH_LIBTORCH }} + # Clone pytorch cd ${ROOT_BUILD_DIR} - TORCH_SRC_DIR=${ROOT_BUILD_DIR}/pytorch + git clone -b v${LIBTORCH_VER} --recursive https://github.com/pytorch/pytorch + cd pytorch - conda install -yq python=${PYTHON_VERSION} "numpy<2.0" astunparse expecttest hypothesis types-dataclasses typing-extensions filelock networkx fsspec mkl-static mkl-include + # Install the python requirements + pip install -r requirements.txt - git clone -b v${LIBTORCH_VER} --recursive https://github.com/pytorch/pytorch "${TORCH_SRC_DIR}" - cd ${TORCH_SRC_DIR} + # Below a certain version we need to downgrade our numpy + if { echo ${LIBTORCH_VER}; echo "2.2.0"; } | sort --version-sort --check=quiet; then + conda install -yq "numpy<2.0" + fi + # Fetch the patch that enables the successful compilation on this linux distro curl -L https://github.com/pytorch/pytorch/pull/99468.patch > 99468.patch git apply 99468.patch - export CFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict" - export CXXFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict" - export CMAKE_PREFIX_PATH="${CONDA_PREFIX:-'$(dirname $(which conda))/../'}:${CMAKE_PREFIX_PATH}" - MAX_JOBS=${MOOSE_JOBS} python setup.py install - -# cd test -# python run_test.py - -# # Install libtorch from a precompiled package -# ${ROOT_BUILD_DIR}/setup_libtorch.sh --version=${LIBTORCH_VER} --libtorch-dest=${LIBTORCH_DEST} --libtorch-distribution=${LIBTORCH_DISTRIBUTION} --cleanup - -# {%- if WITH_LIBTORCH.startswith('cu') %} -# # We install CUDA Toolkit if the user wants cuda-based libtorch. -# # Right now this assumes that cuda-based distributions start with -cu- -# dnf -y install epel-release -# CUDA_RPM=${BUILD_DIR}/cuda.rpm -# curl -L https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda-repo-rhel8-11-4-local-11.4.0_470.42.01-1.x86_64.rpm -o ${CUDA_RPM} -# rpm -i ${CUDA_RPM} -# dnf -y install cuda -# rm -rf ${CUDA_RPM} -# {%- endif %} + # We have to diasble some errors considering they emerge as some optimization of the compiler on certain distributuins (sadly on this one to) + export CFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict" + export CXXFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict" + + # Build and install + export CMAKE_PREFIX_PATH="${CONDA_PREFIX:-'$(dirname $(which conda))/../'}:${CMAKE_PREFIX_PATH}" + MAX_JOBS=${MOOSE_JOBS} python setup.py install + +{%- if WITH_LIBTORCH.startswith('cu') %} + # We install CUDA Toolkit if the user wants cuda-based libtorch. + # Right now this assumes that cuda-based distributions start with -cu- + dnf -y install epel-release + CUDA_RPM=${BUILD_DIR}/cuda.rpm + curl -L https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda-repo-rhel8-11-4-local-11.4.0_470.42.01-1.x86_64.rpm -o ${CUDA_RPM} + rpm -i ${CUDA_RPM} + dnf -y install cuda + rm -rf ${CUDA_RPM} +{%- endif %} {%- endif %} # Install node.js. Requested by dschwen for bison @@ -225,6 +228,3 @@ Fingerprints: 0CFFCAB55E806363601C442D211817B01E0911DB {{ FILES_DIR }}/opt/code-server/bin/code-server-start /opt/code-server/bin/code-server-start {{ MOOSE_DIR }}/scripts/{{ WASP_BUILD_SCRIPT }} {{ ROOT_BUILD_DIR }}/{{ WASP_BUILD_SCRIPT }} {{ MOOSE_DIR }}/scripts/configure_wasp.sh {{ ROOT_BUILD_DIR }}/configure_wasp.sh -{%- if WITH_LIBTORCH %} - {{ MOOSE_DIR }}/scripts/setup_libtorch.sh {{ ROOT_BUILD_DIR }}/setup_libtorch.sh -{%- endif %} diff --git a/scripts/setup_libtorch.sh b/scripts/setup_libtorch.sh index 6fe725e2c6f5..a9bb631902d2 100755 --- a/scripts/setup_libtorch.sh +++ b/scripts/setup_libtorch.sh @@ -80,7 +80,7 @@ version_check() { loc_2=$1 ;; *) - echo "'version_check' function does only supports '-g' and '-l' for comparison!" + echo "'version_check' function does only support '-g' and '-l' for comparison!" exit 0 ;; esac From 9ec061df41df381a0249d8a781afe7dd9b26f7b6 Mon Sep 17 00:00:00 2001 From: Logan Harbour Date: Tue, 14 Jan 2025 07:20:02 -0700 Subject: [PATCH 5/5] Add missing comment terminator --- apptainer/moose-dev.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apptainer/moose-dev.def b/apptainer/moose-dev.def index 1a7b74ec2675..97cfb1d53ee9 100644 --- a/apptainer/moose-dev.def +++ b/apptainer/moose-dev.def @@ -29,7 +29,7 @@ {%- set GPERF_DIR = '/opt/gperftools' -%} {#- The installation location for pprof -#} {%- set PPROF_DIR = '/opt/pprof' -%} -{#- We need this here because more than one block will use it +{#- We need this here because more than one block will use it -#} {%- set MOOSE_PYTHON_VERSION = '3.11' -%} {#- The script used to install wasp -#}