make Dockerfile match OpenROAD and require swig 3

This commit is contained in:
Matt Liberty
2020-02-13 09:39:26 -08:00
parent e6fc9b3dc6
commit 1d32e40a86
2 changed files with 22 additions and 21 deletions

View File

@@ -41,7 +41,7 @@ add_subdirectory(src/tm)
################################# SWIG #####################################
############################################################################
set(SWIG_REQUIRED_VERSION "2.0")
set(SWIG_REQUIRED_VERSION "3.0")
find_package(SWIG REQUIRED)
if(${SWIG_VERSION} VERSION_LESS ${SWIG_REQUIRED_VERSION})
message(FATAL_ERROR "SWIG version ${SWIG_VERSION} must be at least ${SWIG_REQUIRED_VERSION}")

View File

@@ -1,18 +1,25 @@
FROM centos:centos7 AS base-dependencies
LABEL maintainer "Abdelrahman Hosny <abdelrahman_hosny@brown.edu>"
LABEL maintainer="Abdelrahman Hosny <abdelrahman_hosny@brown.edu>"
# Install Development Environment
RUN yum group install -y "Development Tools"
RUN yum install -y wget git pcre-devel
RUN yum -y install centos-release-scl && \
yum -y install devtoolset-8 devtoolset-8-libatomic-devel
# Install dev and runtime dependencies
RUN yum group install -y "Development Tools" \
&& yum install -y https://centos7.iuscommunity.org/ius-release.rpm \
&& yum install -y wget git centos-release-scl devtoolset-8 \
devtoolset-8-libatomic-devel tcl-devel tcl tk libstdc++ tk-devel pcre-devel \
python36u python36u-libs python36u-devel python36u-pip && \
yum clean -y all && \
rm -rf /var/lib/apt/lists/*
# Install CMake
RUN wget https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.sh && \
chmod +x cmake-3.14.0-Linux-x86_64.sh && \
./cmake-3.14.0-Linux-x86_64.sh --skip-license --prefix=/usr/local
./cmake-3.14.0-Linux-x86_64.sh --skip-license --prefix=/usr/local && rm -rf cmake-3.14.0-Linux-x86_64.sh \
&& yum clean -y all
# Install epel repo
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install -y epel-release-latest-7.noarch.rpm
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
yum install -y epel-release-latest-7.noarch.rpm && rm -rf epel-release-latest-7.noarch.rpm \
&& yum clean -y all
# Install SWIG
RUN yum remove -y swig \
@@ -24,16 +31,10 @@ RUN yum remove -y swig \
&& cd .. \
&& rm -rf swig-rel-4.0.1
# Install dev and runtime dependencies
RUN yum install -y tcl-devel tcl tk libstdc++ boost-devel \
zlib-devel
# Install python dev
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm && \
yum update -y && \
yum install -y python36u python36u-libs python36u-devel python36u-pip
RUN mkdir /.local && chmod 777 /.local && chmod 777 /usr/lib/python3.6/site-packages/
# Install boost
RUN yum install -y boost-devel && \
yum clean -y all && \
rm -rf /var/lib/apt/lists/*
FROM base-dependencies AS builder
@@ -43,4 +44,4 @@ WORKDIR /OpenDB
# Build
RUN mkdir build
RUN cd build && cmake .. && make
RUN cd build && cmake .. && make -j 4