Commit 718d0911 authored by Chuck Atkins's avatar Chuck Atkins

Move to using a CentOS6 container.

parent 047b7efc
mesa-*.tar.bz2
*.s??
FROM debian:7
MAINTAINER Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
RUN apt-get update && \
apt-get install -y \
build-essential \
pkg-config \
libx11-dev libxext-dev libxdamage-dev x11proto-gl-dev \
libx11-xcb-dev \
libdrm-dev \
libudev-dev \
bison flex \
gcc-4.7 \
python \
python-mako \
git \
wget \
scons \
procps \
bash
ENV CC gcc-4.7
ENV CXX g++-4.7
#-------------------------------------------------------------------------------
WORKDIR /opt/tools/src
RUN wget https://cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.tar.gz
RUN tar xf cmake-3.4.1-Linux-x86_64.tar.gz
#-------------------------------------------------------------------------------
WORKDIR /opt/tools/src
RUN wget http://llvm.org/releases/3.7.0/llvm-3.7.0.src.tar.xz
RUN tar xf llvm-3.7.0.src.tar.xz
WORKDIR /opt/tools/llvm-3.7.0.build
RUN /opt/tools/src/cmake-3.4.1-Linux-x86_64/bin/cmake \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DLLVM_ENABLE_RTTI:BOOL=ON \
-DLLVM_TARGETS_TO_BUILD:STRING=X86 \
/opt/tools/src/llvm-3.7.0.src/
RUN make -j 8
ENV PATH /opt/tools/llvm-3.7.0.build/bin:$PATH
#-------------------------------------------------------------------------------
WORKDIR /opt/tools/src
run wget ftp://ftp.freedesktop.org/pub/mesa/11.1.0/mesa-11.1.0.tar.xz
RUN tar xf mesa-11.1.0.tar.xz
WORKDIR /opt/tools/src/mesa-11.1.0
RUN scons build=release texture_float=no libgl-xlib osmesa
WORKDIR /opt/tools/inst/mesa-llvm
RUN cp /opt/tools/src/mesa-11.1.0/build/linux-x86_64/gallium/targets/libgl-xlib/libGL.so.1.5 . && \
ln -s libGL.so.1 libGL.so && \
ln -s libGL.so.1.5 libGL.so.1
RUN cp /opt/tools/src/mesa-11.1.0/build/linux-x86_64/gallium/targets/osmesa/libosmesa.so ./libOSMesa.so.8.0.0 && \
ln -s libOSMesa.so.8.0.0 libOSMesa.so.8 && \
ln -s libOSMesa.so.8 libOSMesa.so
#-------------------------------------------------------------------------------
WORKDIR /opt/tools/src/
RUN git clone https://github.com/OpenSWR/openswr-mesa.git mesa-swr-avx -b 11.0-openswr
WORKDIR /opt/tools/src/mesa-swr-avx
RUN scons build=release texture_float=no swr_arch=avx libgl-xlib osmesa
WORKDIR /opt/tools/inst/mesa-swr-avx
RUN cp /opt/tools/src/mesa-swr-avx/build/linux-x86_64/gallium/targets/libgl-xlib/libGL.so.1.5 . && \
ln -s libGL.so.1.5 libGL.so.1 && \
ln -s libGL.so.1 libGL.so
RUN cp /opt/tools/src/mesa-swr-avx/build/linux-x86_64/gallium/targets/osmesa/libosmesa.so ./libOSMesa.so.8.0.0 && \
ln -s libOSMesa.so.8.0.0 libOSMesa.so.8 && \
ln -s libOSMesa.so.8 libOSMesa.so
#-------------------------------------------------------------------------------
WORKDIR /opt/tools/src/
RUN git clone https://github.com/OpenSWR/openswr-mesa.git mesa-swr-avx2 -b 11.0-openswr
WORKDIR /opt/tools/src/mesa-swr-avx2
RUN scons build=release texture_float=no swr_arch=core-avx2 libgl-xlib osmesa
WORKDIR /opt/tools/inst/mesa-swr-avx2
RUN cp /opt/tools/src/mesa-swr-avx2/build/linux-x86_64/gallium/targets/libgl-xlib/libGL.so.1.5 . && \
ln -s libGL.so.1.5 libGL.so.1 && \
ln -s libGL.so.1 libGL.so
RUN cp /opt/tools/src/mesa-swr-avx2/build/linux-x86_64/gallium/targets/osmesa/libosmesa.so ./libOSMesa.so.8.0.0 && \
ln -s libOSMesa.so.8.0.0 libOSMesa.so.8 && \
ln -s libOSMesa.so.8 libOSMesa.so
#-------------------------------------------------------------------------------
WORKDIR /opt/tools/inst
RUN tar zcvf mesa-llvm.tar.gz mesa-llvm
RUN tar zcvf mesa-swr-avx.tar.gz mesa-swr-avx
RUN tar zcvf mesa-swr-avx2.tar.gz mesa-swr-avx2
CMD /bin/bash
FROM centos:6
MAINTAINER Chuck Atkins <chuck.atkins@kitware.com>
RUN yum install -y tar xz bzip2 wget
# Install development tools and X libraries
RUN yum install -y \
git libtool automake libX11-devel libXext-devel libxcb-devel \
bison flex
# Install a newer set of compilers from the Software Collections repos
RUN yum install -y centos-release-scl && \
yum install -y \
devtoolset-4-gcc devtoolset-4-gcc-c++ python27
# Cleanup
RUN yum clean all
RUN mkdir -p /opt
# Install the most recent CMake release
RUN cd /opt && \
wget https://cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz && \
tar -xvf cmake-3.5.2-Linux-x86_64.tar.gz && \
rm -f cmake-3.5.2-Linux-x86_64.tar.gz
# Build and install LLVM
RUN cd /opt && \
wget http://llvm.org/releases/3.8.0/llvm-3.8.0.src.tar.xz && \
tar -xvf llvm-3.8.0.src.tar.xz && \
mkdir llvm-3.8.0.bld && \
cd llvm-3.8.0.bld && \
/usr/bin/scl enable devtoolset-4 python27 -- \
/opt/cmake-3.5.2-Linux-x86_64/bin/cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/llvm-3.8.0 \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_INSTALL_UTILS=ON \
/opt/llvm-3.8.0.src && \
/usr/bin/scl enable devtoolset-4 python27 -- make -j8 install && \
cd /opt && \
rm -rf llvm-3.8.0.src.tar.xz llvm-3.8.0.src llvm-3.8.0.bld \
cmake-3.5.2-Linux-x86_64
# Install Mako templates (needed for Mesa)
RUN cd /opt && \
wget https://pypi.python.org/packages/7a/ae/925434246ee90b42e8ef57d3b30a0ab7caf9a2de3e449b876c56dcb48155/Mako-1.0.4.tar.gz && \
tar -xvf Mako-1.0.4.tar.gz && \
rm -f Mako-1.0.4.tar.gz
# Add the Mesa build script
ADD build-mesa.sh /opt/build-mesa.sh
RUN chmod +x /opt/build-mesa.sh
# Setup the shared mount point
RUN mkdir /mnt/shared
# Run the Mesa build script with new compilers enabled
ENTRYPOINT /usr/bin/scl enable devtoolset-4 python27 /opt/build-mesa.sh
......@@ -2,3 +2,5 @@
Building various configurations of Mesa3D
This project builds a collection of binaries for Mesa3D with various software renderers to be packaged with ParaView binaries. This also shows the configuration flags to use for building each of the renderers.
To use this, first setup the build environment with build-container.sh. Then executing the run-container.sh script will clone the latest Mesa GIT repository, build it with LLVMPipe and OpenSWR, and copy the resulting tarball into your current directory.
#!/bin/bash
docker build --rm -t mesa-el6-build .
#!/bin/bash
export PATH=/opt/llvm-3.8.0/bin:$PATH
export PYTHONPATH=/opt/Mako-1.0.4:$PYTHONPATH
cd /opt
git clone git://anongit.freedesktop.org/git/mesa/mesa mesa-source
cd mesa-source
VER=$(cat VERSION)-$(git log --pretty=format:"%h %ci" | head -1 | sed 's|-||g' | awk '{print $2"-"$1}')
NOCONFIGURE=1 ./autogen.sh
##########
# Option summary:
##########
# Enable GL APIs
# --enable-opengl --disable-gles1 --disable-gles2
# Disable extra state trackers that we don't care about
# --disable-va --disable-gbm --disable-xvmc --disable-vdpau
# Turn on GLdispatch
# --enable-shared-glapi
# Set up desired library features
# --disable-texture-float
# Turn off DRI (we're not using any of it)
# --disable-dri --with-dri-drivers=
# Turn on the Gallium infrastructure
# --enable-gallium-llvm
# Use LLVM's shared libraries so we don't bloat the binaries too much
# --enable-llvm-shared-libs
# Turn on only software rasterizers
# --with-gallium-drivers=swrast,swr
# Turn off EGL
# --disable-egl --disable-gbm --with-egl-platforms=
# Turn on Gallium based OSMesa
# --enable-gallium-osmesa
# Turn on GLX (auto-determined backend)
# --enable-glx
# Setup flags for LTO to shrink resultng binaries
export CFLAGS="-flto -ffat-lto-objects -flto-odr-type-merging"
export CXXFLAGS="-flto -ffat-lto-objects -flto-odr-type-merging"
./configure \
--enable-opengl --disable-gles1 --disable-gles2 \
--disable-va --disable-gbm --disable-xvmc --disable-vdpau \
--enable-shared-glapi \
--disable-texture-float \
--disable-dri --with-dri-drivers= \
--enable-gallium-llvm --enable-llvm-shared-libs \
--with-gallium-drivers=swrast,swr \
--disable-egl --disable-gbm --with-egl-platforms= \
--enable-gallium-osmesa \
--enable-glx \
--prefix=/opt/mesa-${VER}
make -j8
make install
cd /opt
# Before packaging up the install, get rid of the location-specific files
rm -rf /opt/mesa-${VER}/lib/pkgconfig /opt/mesa-${VER}/lib/*.la
# Copy in the nexessary LLVM dependencies
cp -P /opt/llvm-3.8.0/lib/libLLVM*.so* /opt/mesa-${VER}/lib
cp -P /opt/llvm-3.8.0/lib/libLTO*.so* /opt/mesa-${VER}/lib
# Make the archive
tar -cvf mesa-${VER}.tar.bz2 mesa-${VER}
cp mesa-${VER}.tar.bz2 /mnt/shared
if [ -n "${HOSTUID}" ]
then
chown ${HOSTUID} /mnt/shared/mesa-${VER}.tar.bz2
fi
if [ -n "${HOSTGID}" ]
then
chgrp ${HOSTGID} /mnt/shared/mesa-${VER}.tar.bz2
fi
#!/bin/bash
docker run -i \
--volume="${PWD}:/mnt/shared:rw" \
-e HOSTUID=$(id -u) -e HOSTGID=$(id -g) \
-t mesa-el6-build
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment