Skip to content

Commit

Permalink
Separate Spack builds for gcc and intel
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Oct 28, 2024
1 parent 7a47d18 commit 7b79244
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 5 deletions.
27 changes: 22 additions & 5 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
# Makefile for building, pulling, running, and pushing Docker images for GISS-GC
# development environment.
#
# The GNU compilers will be used by default. To build with Intel compilers, call
#
# make build COMPILER=intel

# Default target
all: build

DOCKERFILE = ${GISS_HOME}/docker/Dockerfile.devenv
NAMESPACE = ghcr.io/fetch4
IMAGE_NAME = giss-gc-dev-env
TAG = latest
# Variables
COMPILER ?= gcc
DOCKERFILE = Dockerfile.$(COMPILER)
NAMESPACE = ghcr.io/fetch4
IMAGE_NAME = giss-gc-dev-env-$(COMPILER)
TAG = latest

IMAGE = $(NAMESPACE)/$(IMAGE_NAME):$(TAG)
# Full image name
IMAGE = $(NAMESPACE)/$(IMAGE_NAME):$(TAG)

# Pull the Docker image from the registry
pull:
docker pull $(IMAGE)

# Build the Docker image using the specified Dockerfile
build:
docker build -f $(DOCKERFILE) -t $(IMAGE) .

# Run the Docker container interactively with the home directory mounted
# NOTE: This exposes your home directory to the Docker image and should be used
# with caution.
run:
docker run --rm -it -v ${HOME}:${HOME} $(IMAGE)

# Push the Docker image to the registry
push:
docker push $(IMAGE)
30 changes: 30 additions & 0 deletions docker/spack_gcc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
spack:
packages:
all:
compiler: [gcc@13.2.0]
specs:
- cmake
- gmake
- hdf5
- netcdf-c+mpi+parallel-netcdf
- netcdf-fortran
- openmpi
concretizer:
unify: true
config:
install_missing_compilers: true
install_tree: /opt/software
view: /opt/views/view
compiler:
spec: gcc@=13.2.0
paths:
cc: /usr/bin/gcc
cxx: /usr/bin/g++
f77: /usr/bin/gfortran
fc: /usr/bin/gfortran
flags: {}
operating_system: ubuntu24.04
target: x86_64
modules: []
environment: {}
extra_rpaths: []
30 changes: 30 additions & 0 deletions docker/spack_intel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
spack:
packages:
all:
compiler: [intel@2024.0]
specs:
- cmake
- gmake
- hdf5
- netcdf-c+mpi+parallel-netcdf
- netcdf-fortran
- openmpi
concretizer:
unify: true
config:
install_missing_compilers: true
install_tree: /opt/software
view: /opt/views/view
compiler:
spec: intel@=2024.0
paths:
cc: /opt/intel/oneapi/compiler/2024.0/bin/icx
cxx: /opt/intel/oneapi/compiler/2024.0/bin/icpx
f77: /opt/intel/oneapi/compiler/2024.0/bin/ifx
fc: /opt/intel/oneapi/compiler/2024.0/bin/ifx
flags: {}
operating_system: ubuntu24.04
target: x86_64
modules: []
environment: {}
extra_rpaths: []

0 comments on commit 7b79244

Please sign in to comment.