diff --git a/docker/Dockerfile b/docker/Dockerfile index b2499b47ce5..7b4e2260cea 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -44,6 +44,8 @@ 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* \ @@ -51,7 +53,10 @@ RUN mamba install --yes -c conda-forge \ 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 diff --git a/docker/docker.cmake b/docker/docker.cmake index eb95c7113ce..cf367dcfd9e 100644 --- a/docker/docker.cmake +++ b/docker/docker.cmake @@ -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()