Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add build script for intel oneapi and gcc compiler separately #88

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions examples/build_scripts/build_gaea_c5_gcc.sh
Copy link
Contributor

@fmalatino fmalatino Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions:

  • Do we want to continue to suport python 3.8?
  • Should we allow the user to pass the desired name for the conda environment to be used, or do we want to keep it as my_name in general?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, let me test python 3.11.9, and update the script

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

# Example bash script to install Pace to run bare-metal on Gaea's c4 cluster

set -e -x

# module load necessary system software
module rm PrgEnv-intel
module load PrgEnv-gnu
module rm gcc
module load gcc/12.2.0
module load boost/1.79.0
module load python/3.11.7

export CC=`which gcc`
export CXX=`which g++`
export MPICC=`which mpicc`
export MPICXX=`which mpicxx`
export DACE_compiler_cpu_executable=${CXX}
export GT4PY_EXTRA_COMPILE_ARGS="-O3 -ffast-math -fprefetch-loop-arrays -funroll-all-loops"
export OPENMP_CPPFLAGS="-fopenmp -fopenmp-simd"
export OPENMP_LDFLAGS="-fopenmp -fopenmp-simd"

# clone Pace and update submodules
git clone --recursive https://github.com/NOAA-GFDL/pace
cd pace

# create a conda environment for pace
conda create -y --name my_name python=3.11.7

# enter the environment and update it
conda activate my_name
pip3 install --upgrade pip setuptools wheel

# install the Pace dependencies, GT4Py, and Pace
pip3 install -r requirements_dev.txt -c constraints.txt
53 changes: 53 additions & 0 deletions examples/build_scripts/build_ppan_intel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -e

INSTALL_PREFIX=$1
ENVIRONMENT_NAME=$2

PACE_DIR=$(pwd)/../..
FV3NET_DIR=$INSTALL_PREFIX/fv3net

# module load necessary system software
module load conda
module load intel_compilers/2021.3.0

export CC=`which icpx`
export CXX=`which icpx`
export MPICC=`which mpiicx`
export MPICXX=`which mpiicpx`
export DACE_compiler_cpu_executable=${CXX}
export GT4PY_EXTRA_COMPILE_ARGS="-O3 -funroll-loops -qopt-prefetch=2 -align"
export OPENMP_CPPFLAGS="-qopenmp -qopenmp-simd"
export OPENMP_LDFLAGS="-qopenmp -qopenmp-simd"

CONDA_PREFIX=$INSTALL_PREFIX/conda
conda config --add pkgs_dirs $CONDA_PREFIX/pkgs
conda config --add envs_dirs $CONDA_PREFIX/envs

# enter the pace directory
cd $PACE_DIR

# create a conda environment with cartopy and its dependencies installed
conda create -c conda-forge -y --name $ENVIRONMENT_NAME python=3.11.7 matplotlib==3.5.2 cartopy==0.18.0

# enter the environment and update it
conda activate $ENVIRONMENT_NAME
pip3 install --upgrade --no-cache-dir pip setuptools wheel

# install the Pace dependencies, GT4Py, and Pace
pip3 install --no-cache-dir -r requirements_dev.txt -c constraints.txt

# clone fv3net
git clone https://github.com/ai2cm/fv3net.git $FV3NET_DIR

# install jupyter and ipyparallel
pip3 install --no-cache-dir \
ipyparallel==8.4.1 \
jupyterlab==3.4.4 \
jupyterlab_code_formatter==1.5.2 \
isort==5.10.1 \
black==22.3.0

# install vcm
python3 -m pip install $FV3NET_DIR/external/vcm
Loading