diff --git a/ci/Dockerfile b/ci/Dockerfile index 2292538a..dbda4209 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,10 +1,21 @@ -FROM rust:latest -LABEL maintainer "Toshiki Teramura " +ARG RUST_VERSION +FROM rust:${RUST_VERSION} +ARG MKL_VERSION -COPY install.sh / -RUN /install.sh && apt-get clean && rm -rf /var/lib/apt/lists/* +WORKDIR /mkl -ENV PKG_CONFIG_PATH /opt/intel/compilers_and_libraries/linux/mkl/bin/pkgconfig -ENV LD_LIBRARY_PATH /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64 +RUN apt update \ + && apt install -y cpio \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY ./silent.cfg /mkl/ +RUN curl -sfLO http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16533/l_mkl_${MKL_VERSION}.tgz \ + && tar xf l_mkl_${MKL_VERSION}.tgz \ + && cd l_mkl_${MKL_VERSION} \ + && ./install.sh -s ../silent.cfg \ + && rm -rf /mkl +ENV PKG_CONFIG_PATH /opt/intel/mkl/bin/pkgconfig +RUN sed -i "s/MKLROOT/prefix/g" ${PKG_CONFIG_PATH}/*.pc WORKDIR /src diff --git a/ci/Makefile b/ci/Makefile index 28ada308..6305fc6e 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -1,12 +1,18 @@ -REGISTRY := rustmath/mkl +REGISTRY := rustmath/mkl-rust +RUST_VERSION := 1.43.0 +MKL_VERSION := 2020.1.217 +IMAGE := $(REGISTRY):$(RUST_VERSION)-$(MKL_VERSION) -all: image +all: test -image: - docker build . -t $(REGISTRY) +build: + docker build . \ + --build-arg "RUST_VERSION=$(RUST_VERSION)" \ + --build-arg "MKL_VERSION=$(MKL_VERSION)" \ + -t $(IMAGE) -push: image - docker push $(REGISTRY) +push: build + docker push $(IMAGE) -run: image - docker run -it --rm $(REGISTRY) +test: build + docker run -it --rm $(IMAGE) pkg-config --libs mkl-dynamic-lp64-iomp diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100755 index c0e2152b..00000000 --- a/ci/install.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# Intel MKL installer for ubuntu/debian -set -eux - -apt-get update -apt-get install -y wget apt-transport-https -curl -sfL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | apt-key add - -curl -sfL https://apt.repos.intel.com/setup/intelproducts.list -o /etc/apt/sources.list.d/intelproducts.list -apt-get update -apt-get install -y intel-mkl-core-rt-2019.5 # Please update version number diff --git a/ci/silent.cfg b/ci/silent.cfg new file mode 100644 index 00000000..afec7a43 --- /dev/null +++ b/ci/silent.cfg @@ -0,0 +1,34 @@ +# Patterns used to check silent configuration file +# +# anythingpat - any string +# filepat - the file location pattern (/file/location/to/license.lic) +# lspat - the license server address pattern (0123@hostname) +# snpat - the serial number pattern (ABCD-01234567) +# comppat - the component abbreviation (intel-component-0123.4-567__arch), use installer command line option to get it + +# Accept EULA, valid values are: {accept, decline} +ACCEPT_EULA=accept + +# Optional error behavior, valid values are: {yes, no} +CONTINUE_WITH_OPTIONAL_ERROR=yes + +# Install location, valid values are: {/opt/intel, filepat} +PSET_INSTALL_DIR=/opt/intel + +# Continue with overwrite of existing installation directory, valid values are: {yes, no} +CONTINUE_WITH_INSTALLDIR_OVERWRITE=yes + +# List of components to install (use semicolon to separate the components), valid values are: {ALL, DEFAULTS, comppat} +COMPONENTS=DEFAULTS + +# Installation mode, valid values are: {install, repair, uninstall} +PSET_MODE=install + +# Path to the cluster description file, valid values are: {filepat} +#CLUSTER_INSTALL_MACHINES_FILE=filepat + +# Perform validation of digital signatures of RPM files, valid values are: {yes, no} +SIGNING_ENABLED=yes + +# Select target architecture of your applications, valid values are: {IA32, INTEL64, ALL} +ARCH_SELECTED=INTEL64