Skip to content

Commit

Permalink
Merge pull request #4462 from ESMCI/update_docker
Browse files Browse the repository at this point in the history
- Adds missing conda compiler packages
- Cleans up docker.cmake, removes redundant cmake variables found in gnu.cmake
- Fixes compiling/running cases with active components

Test suite: pytest
Test baseline: n/a
Test namelist changes: n/a
Test status: n/a

Fixes n/a
User interface changes?: N
Update gh-pages html (Y/N)?: N
  • Loading branch information
jasonb5 authored Jul 25, 2023
2 parents a8e8e79 + 283988c commit 8a023ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 64 deletions.
7 changes: 6 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,19 @@ RUN mamba install --yes -c conda-forge \
rm -rf /opt/conda/pkgs/*

# Install version locked packages
# gcc, gxx, gfortran provide symlinks for x86_64-conda-linux-gnu-*
# ar and ranlib are not symlinked
RUN mamba install --yes -c conda-forge \
libnetcdf=${LIBNETCDF_VERSION}=*openmpi* \
netcdf-fortran=${NETCDF_FORTRAN_VERSION}=*openmpi* \
esmf=${ESMF_VERSION}=*openmpi* \
gcc_linux-64=${GCC_VERSION} \
gxx_linux-64=${GCC_VERSION} \
openmpi-mpifort \
gfortran_linux-64=${GCC_VERSION} && \
gfortran_linux-64=${GCC_VERSION} \
gcc \
gxx \
gfortran && \
rm -rf /opt/conda/pkgs/* && \
ln -sf /opt/conda/bin/x86_64-conda-linux-gnu-ar /opt/conda/bin/ar && \
ln -sf /opt/conda/bin/x86_64-conda-linux-gnu-ranlib /opt/conda/bin/ranlib
Expand Down
66 changes: 3 additions & 63 deletions docker/docker.cmake
Original file line number Diff line number Diff line change
@@ -1,71 +1,11 @@
set(AR "/opt/conda/bin/x86_64-conda-linux-gnu-ar")
string(APPEND CFLAGS " -mcmodel=medium")
if (compile_threaded)
string(APPEND CFLAGS " -fopenmp")
endif()
if (DEBUG)
string(APPEND CFLAGS " -g -Wall -fbacktrace -fcheck=bounds -ffpe-trap=invalid,zero,overflow")
endif()
if (NOT DEBUG)
string(APPEND CFLAGS " -O")
endif()
if (COMP_NAME STREQUAL csm_share)
string(APPEND CFLAGS " -std=c99")
endif()
string(APPEND CXXFLAGS " -std=c++14")
if (compile_threaded)
string(APPEND CXXFLAGS " -fopenmp")
endif()
if (DEBUG)
string(APPEND CXXFLAGS " -g -Wall -fbacktrace")
endif()
if (NOT DEBUG)
string(APPEND CXXFLAGS " -O")
endif()
if (COMP_NAME STREQUAL cism)
string(APPEND CMAKE_OPTS " -D CISM_GNU=ON")
endif()
string(APPEND CMAKE_OPTS " -D CMAKE_AR=/opt/conda/bin/x86_64-conda-linux-gnu-ar")
string(APPEND CMAKE_OPTS " -DCMAKE_Fortran_COMPILER_RANLIB=/opt/conda/bin/x86_64-conda-linux-gnu-ranlib")
string(APPEND CMAKE_OPTS " -DCMAKE_C_COMPILER_RANLIB=/opt/conda/bin/x86_64-conda-linux-gnu-ranlib")
string(APPEND CMAKE_OPTS " -DCMAKE_CXX_COMPILER_RANLIB=/opt/conda/bin/x86_64-conda-linux-gnu-ranlib")
string(APPEND CPPDEFS " -DFORTRANUNDERSCORE -DNO_R16 -DCPRGNU")
if (DEBUG)
string(APPEND CPPDEFS " -DYAKL_DEBUG")
endif()
set(SLIBS "-L/opt/conda/lib -lnetcdf -lnetcdff")
set(CXX_LIBS "-lstdc++")
set(CXX_LINKER "FORTRAN")
string(APPEND FC_AUTO_R8 " -fdefault-real-8")
string(APPEND FFLAGS " -I/opt/conda/include -mcmodel=medium -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none")
if (compile_threaded)
string(APPEND FFLAGS " -fopenmp")
endif()
if (DEBUG)
string(APPEND FFLAGS " -g -Wall -fbacktrace -fcheck=bounds -ffpe-trap=zero,overflow")
endif()
if (NOT DEBUG)
string(APPEND FFLAGS " -O")
endif()
string(APPEND FFLAGS_NOOPT " -O0")
string(APPEND FIXEDFLAGS " -ffixed-form")
string(APPEND FREEFLAGS " -ffree-form")
set(HAS_F2008_CONTIGUOUS "FALSE")
if (compile_threaded)
string(APPEND LDFLAGS " -fopenmp")
endif()
set(SLIBS " -L/opt/conda/lib -lnetcdff -lnetcdf")
string(APPEND CXX_LIBS " -lstdc++")
string(APPEND SLIBS " -L/opt/conda/lib -lnetcdf -lnetcdff")
string(APPEND FFLAGS " -I/opt/conda/include")
set(MPI_PATH "/opt/conda")
set(MPICC "/opt/conda/bin/mpicc")
set(MPICXX "/opt/conda/bin/mpicxx")
set(MPIFC "/opt/conda/bin/mpif90")
set(NETCDF_C_PATH "/opt/conda")
set(NETCDF_FORTRAN_PATH "/opt/conda")
set(PNETCDF_PATH "/opt/conda")
set(SCC "/opt/conda/bin/x86_64-conda-linux-gnu-gcc")
set(SCXX "/opt/conda/bin/x86_64-conda-linux-gnu-g++")
set(SFC "/opt/conda/bin/x86_64-conda-linux-gnu-gfortran")
set(SUPPORTS_CXX "TRUE")
if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
string(APPEND FFLAGS " -fallow-argument-mismatch -fallow-invalid-boz ")
endif()

0 comments on commit 8a023ee

Please sign in to comment.