From ea259038e48254f72850cc1f9ae132b30c781b6f Mon Sep 17 00:00:00 2001 From: Jiwon Gim Date: Tue, 28 Nov 2023 17:16:02 -0700 Subject: [PATCH 1/2] specify architecture type --- docker/Dockerfile.musica | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.musica b/docker/Dockerfile.musica index b02cf7b6..bcbb9222 100644 --- a/docker/Dockerfile.musica +++ b/docker/Dockerfile.musica @@ -1,6 +1,6 @@ # parts of CAM require x86 architecture (gptl, which relies on the rdtsc x86 assembly instruction) # esmf is am image you are expected to have built. Read the README file for instructions -FROM esmf:latest +FROM --platform=linux/amd64 esmf:latest ################################################### ## Install necessary packages From dfa6eaaabccbf04638766a6ea1c225c32f1c2c02 Mon Sep 17 00:00:00 2001 From: Jiwon Gim Date: Fri, 15 Dec 2023 20:26:10 -0700 Subject: [PATCH 2/2] case.build works; wait for the other PRs approved --- Externals_CAM.cfg | 3 ++- cime_config/buildlib | 3 ++- docker/Dockerfile.musica | 33 ++++++++++++++++++++++----------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 60154f2b..38a0a227 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -9,7 +9,8 @@ required = True local_path = src/physics/ncar_ccpp protocol = git repo_url = https://github.com/ESCOMP/atmospheric_physics -tag = atmos_phys0_01_000 +# tag = atmos_phys0_01_000 +branch = update_micm_interface # TODO(jiwon) required = True [externals_description] diff --git a/cime_config/buildlib b/cime_config/buildlib index 7eb30164..d9343bfd 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -97,7 +97,8 @@ def _build_cam(): case.get_value("COMP_INTERFACE")), os.path.join(atm_root, "src", "dynamics", "utils"), os.path.join(atm_root, "src", "physics", "utils"), - os.path.join(atm_root, "src", "utils")] + os.path.join(atm_root, "src", "utils"), + os.path.join("/usr/local/musica-0.4.0/fortran_include/")] for path in phys_dirs: if path not in paths: paths.append(path) diff --git a/docker/Dockerfile.musica b/docker/Dockerfile.musica index bcbb9222..aa7153b1 100644 --- a/docker/Dockerfile.musica +++ b/docker/Dockerfile.musica @@ -1,5 +1,7 @@ # parts of CAM require x86 architecture (gptl, which relies on the rdtsc x86 assembly instruction) # esmf is am image you are expected to have built. Read the README file for instructions +# TODO(jiwon): Update readme and remove system architecture +# FROM esmf:latest FROM --platform=linux/amd64 esmf:latest ################################################### @@ -11,13 +13,20 @@ RUN dnf -y update \ git \ hostname \ m4 \ - python \ + python3.11 \ sudo \ svn \ tree \ vim \ + json-devel \ && dnf clean all +################################################## +# Set symlink to the specific python version +# that supports a deprecated pacakge for cime (distuitls) +################################################## +RUN ln -fs /usr/bin/python3.11 /usr/bin/python3 + ################################################### ## Make sure the mpi compilers can be found ################################################### @@ -54,22 +63,24 @@ RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib/l ## Build and install MUSICA ################################################### -RUN git clone https://github.com/NCAR/musica.git +# TODO(jiwon): update after musica & atmospheric_phys PRs are approved +# RUN git clone https://github.com/NCAR/musica.git +RUN git clone -b update_for_ccpp_wrapper --depth 1 https://github.com/NCAR/musica.git RUN mkdir /musica/build \ && cd /musica/build \ && export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \ && cmake \ - -D ENABLE_TESTS=OFF \ - -D ENABLE_TUVX=OFF \ - .. \ + -D MAKE_MUSICA_FORTRAN_INSTALLABLE=ON \ + -D ENABLE_TESTS=OFF \ + -D ENABLE_TUVX=OFF \ + .. \ && make install -j 8 -# add a symlink -RUN ln -s /usr/local/musica-0.3.0/lib64/libmusica.a /usr/local/lib/libmusica.a +RUN ln -s /usr/local/musica-0.4.0/lib64/libmusica.a /usr/local/lib/libmusica.a -################################################### -## Build CAM-SIMA -################################################### +################################################## +# Build CAM-SIMA +################################################## # create a user to run the case RUN adduser cam_sima_user \ @@ -116,4 +127,4 @@ RUN /home/cam_sima_user/CAM-SIMA/docker/ftp_download.sh # # add the snapshot file RUN echo "ncdata='/home/cam_sima_user/run_heldsuarez_cam6_nt2_bigg_try005.cam.h5.0001-01-01-00000.nc'" >> user_nl_cam -RUN ./case.build +RUN ./case.build \ No newline at end of file