Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
rearranged dockerfile and updated the setting of the machine code for…
Browse files Browse the repository at this point in the history
… Intel processors
  • Loading branch information
MintoDA1 authored and MintoDA1 committed Aug 9, 2023
1 parent 317c8a1 commit 1f62eaf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
36 changes: 14 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,15 @@ ENV NETCDF_LIBRARY=${NETCDF_HOME}
ENV FOR_COARRAY_NUM_IMAGES=1
ENV OMP_NUM_THREADS=1
ENV FC="${ONEAPI_ROOT}/mpi/latest/bin/mpiifort"
ENV CC="${ONEAPI_ROOT}/mpi/latest/bin/mpicc -cc=icx"
ENV CXX="${ONEAPI_ROOT}/mpi/latest/bin/mpicc -cc=icpx"
ENV CC="${ONEAPI_ROOT}/mpi/latest/bin/mpicc"
ENV CXX="${ONEAPI_ROOT}/mpi/latest/bin/mpicxx"
ENV FFLAGS="-fPIC -standard-semantics"
ENV LDFLAGS="-L${INSTALL_DIR}/lib"
ENV LIBS="-lhdf5_hl -lhdf5 -lz"
ENV PATH /root/miniconda3/bin:$PATH

COPY --from=build_deps ${INSTALL_DIR}/. ${INSTALL_DIR}/
COPY ./cmake/ /swiftest/cmake/
COPY ./src/ /swiftest/src/
COPY ./CMakeLists.txt /swiftest/
COPY ./swiftest/ /swiftest/swiftest/
COPY ./version.txt /swiftest/
COPY ./setup.py /swiftest/
COPY ./requirements.txt /swiftest/
COPY ./pyproject.toml /swiftest/

COPY ./environment.yml /swiftest/

RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py311_23.5.2-0-Linux-x86_64.sh && \
Expand All @@ -122,25 +115,24 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py311_23.5.2-0-Linux-x86
source /root/.bashrc && conda update --all -y && \
conda install conda-libmamba-solver -y && \
conda config --set solver libmamba && \
cd swiftest && \
conda env create -f environment.yml && \
conda init bash && \
echo "conda activate swiftest-env" >> ~/.bashrc && \
source ~/.bashrc && \
conda install -c conda-forge scikit-build -y&& \
conda install -c anaconda cython -y

# RUN cd swiftest && \
# cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
# -DMACHINE_CODE_VALUE=${MACHINE_CODE_VALUE} \
# -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
# -DUSE_COARRAY=OFF \
# -DBUILD_SHARED_LIBS=OFF \
# ${EXTRA_CMAKE_OPTIONS} && \
# cmake --build build && \
# cmake --install build

# RUN cd swiftest && \
# pip install . -v
COPY ./cmake/ /swiftest/cmake/
COPY ./src/ /swiftest/src/
COPY ./CMakeLists.txt /swiftest/
COPY ./swiftest/ /swiftest/swiftest/
COPY ./version.txt /swiftest/
COPY ./setup.py /swiftest/
COPY ./requirements.txt /swiftest/
COPY ./pyproject.toml /swiftest/
RUN cd swiftest && \
pip install . -v

# This build target creates a container that executes just the driver program
FROM ubuntu:20.04 as driver
Expand Down
5 changes: 3 additions & 2 deletions cmake/Modules/SetFortranFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ IF (NOT BUILD_SHARED_LIBS)
ENDIF (NOT BUILD_SHARED_LIBS)

IF (USE_SIMD)
SET(MACHINE_CODE_VALUE "host" CACHE STRING "Tells the compiler which processor features it may target, including which instruction sets and optimizations it may generate.")
SET(MACHINE_CODE_VALUE "Host")

IF (COMPILER_OPTIONS STREQUAL "Intel")

IF (MACHINE_CODE_VALUE STREQUAL "generic")
SET(MACHINE_CODE_VALUE "SSE2")
SET(MACHINE_CODE_VALUE "SSE2" FORCE) # SSE2 is the Intel equivalent of generic
ENDIF()

# Enables OpenMP SIMD compilation when OpenMP parallelization is disabled.
Expand Down Expand Up @@ -195,6 +195,7 @@ IF (USE_SIMD)
ENDIF ()

ENDIF ()
SET(MACHINE_CODE_VALUE ${MACHINE_CODE_VALUE} CACHE STRING "Tells the compiler which processor features it may target, including which instruction sets and optimizations it may generate.")
ENDIF (USE_SIMD)


Expand Down

0 comments on commit 1f62eaf

Please sign in to comment.