agorararmard | 790b952 | 2020-10-21 19:39:39 +0200 | [diff] [blame] | 1 | # Copyright 2020 Efabless Corporation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # syntax = docker/dockerfile:1.0-experimental |
| 16 | FROM centos:centos6 as build |
| 17 | |
| 18 | # Common development tools and libraries (kitchen sink approach) |
| 19 | RUN yum groupinstall -y "Development Tools" "Development Libraries" |
| 20 | RUN yum -y install centos-release-scl && \ |
| 21 | yum -y install devtoolset-8 devtoolset-8-libatomic-devel |
| 22 | |
| 23 | # python 3.6 |
| 24 | RUN yum install -y https://repo.ius.io/ius-release-el6.rpm |
| 25 | RUN yum install -y python36u python36u-libs python36u-devel python36u-pip python36u-tkinter |
| 26 | RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 60 |
| 27 | |
| 28 | # magic dependencies |
| 29 | RUN yum install -y csh wget tcl-devel tk-devel libX11-devel cairo-devel ncurses-devel |
| 30 | |
| 31 | #General utils |
| 32 | RUN yum install -y tcllib |
| 33 | RUN yum install -y git tcl tk libjpeg libgomp libXext libSM libXft libffi cairo gettext Xvfb |
| 34 | |
| 35 | RUN git clone git://opencircuitdesign.com/magic magic_15102020 |
| 36 | |
| 37 | WORKDIR magic_15102020 |
| 38 | |
| 39 | RUN git checkout 4bbe4ef74e5eac98c503bf6483ee7a40dbb0547a |
| 40 | |
| 41 | # build |
| 42 | RUN ./configure --prefix=/build && \ |
| 43 | make -j4 && \ |
| 44 | make install |
| 45 | |
| 46 | |
| 47 | ENV MAGIC_ROOT=/magic_root |
| 48 | ENV BUILD_PATH=/build/ |
| 49 | |
| 50 | ENV PATH=$MAGIC_ROOT:$MAGIC_ROOT/scripts:$BUILD_PATH/bin:$BUILD_PATH/bin/Linux-x86_64:$BUILD_PATH/pdn/scripts:$PATH |
| 51 | ENV LD_LIBRARY_PATH=$BUILD_PATH/lib:$BUILD_PATH/lib/Linux-x86_64:$LD_LIBRARY_PATH |
| 52 | ENV MANPATH=$BUILD_PATH/share/man:$MANPATH |
| 53 | |
| 54 | |
| 55 | RUN mkdir -p /build/version/ |
| 56 | |
| 57 | RUN date +"Build Timestamp: %Y-%m-%d_%H-%M-%S" > /build/version/magic.version |
| 58 | RUN git rev-parse HEAD >> /build/version/magic.version |
| 59 | RUN tar -czf /build.tar.gz /build |
| 60 | |
| 61 | WORKDIR /magic_root |