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

Move to using a CentOS6 container.

parent 047b7efc
FROM debian:7
MAINTAINER Utkarsh Ayachit <>
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 \
ENV CC gcc-4.7
ENV CXX g++-4.7
WORKDIR /opt/tools/src
RUN wget
RUN tar xf cmake-3.4.1-Linux-x86_64.tar.gz
WORKDIR /opt/tools/src
RUN wget
RUN tar xf llvm-3.7.0.src.tar.xz
WORKDIR /opt/tools/
RUN /opt/tools/src/cmake-3.4.1-Linux-x86_64/bin/cmake \
RUN make -j 8
ENV PATH /opt/tools/$PATH
WORKDIR /opt/tools/src
run wget
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/ . && \
ln -s && \
ln -s
RUN cp /opt/tools/src/mesa-11.1.0/build/linux-x86_64/gallium/targets/osmesa/ ./ && \
ln -s && \
ln -s
WORKDIR /opt/tools/src/
RUN git clone 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/ . && \
ln -s && \
ln -s
RUN cp /opt/tools/src/mesa-swr-avx/build/linux-x86_64/gallium/targets/osmesa/ ./ && \
ln -s && \
ln -s
WORKDIR /opt/tools/src/
RUN git clone 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/ . && \
ln -s && \
ln -s
RUN cp /opt/tools/src/mesa-swr-avx2/build/linux-x86_64/gallium/targets/osmesa/ ./ && \
ln -s && \
ln -s
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 <>
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 && \
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 && \
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_INSTALL_PREFIX=/opt/llvm-3.8.0 \
/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 \
# Install Mako templates (needed for Mesa)
RUN cd /opt && \
wget && \
tar -xvf Mako-1.0.4.tar.gz && \
rm -f Mako-1.0.4.tar.gz
# Add the Mesa build script
ADD /opt/
RUN chmod +x /opt/
# 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/
......@@ -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 Then executing the script will clone the latest Mesa GIT repository, build it with LLVMPipe and OpenSWR, and copy the resulting tarball into your current directory.
docker build --rm -t mesa-el6-build .
export PATH=/opt/llvm-3.8.0/bin:$PATH
export PYTHONPATH=/opt/Mako-1.0.4:$PYTHONPATH
cd /opt
git clone git:// mesa-source
cd mesa-source
VER=$(cat VERSION)-$(git log --pretty=format:"%h %ci" | head -1 | sed 's|-||g' | awk '{print $2"-"$1}')
# 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 \
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}" ]
chown ${HOSTUID} /mnt/shared/mesa-${VER}.tar.bz2
if [ -n "${HOSTGID}" ]
chgrp ${HOSTGID} /mnt/shared/mesa-${VER}.tar.bz2
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