Skip to content

Commit

Permalink
Deploy all of gcc including stdlib on new versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcurtin committed Aug 23, 2019
1 parent 417b5e9 commit 907cd45
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Generate Dockerfile/generate-dockerfile-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ arma_version=$1
boost_version=$2
gcc_version=$3

gcc_version_major=`echo ${gcc_version/gcc-} | sed 's/^\([0-9]\).*//'`;

cat > Dockerfile << EOF
# Using debian's latest image as base-image plus mlpack prereqs.
FROM mlpack-docker-base:latest
# Installing gcc from source.
# Installing gcc from source. On newer gcc versions than the system gcc, we
# have to move all the libraries and bootstrap.
RUN wget --no-check-certificate \
https://ftp.gnu.org/gnu/gcc/$gcc_version/$gcc_version.tar.gz && \
tar xvzf $gcc_version.tar.gz && \
Expand All @@ -17,10 +20,18 @@ RUN wget --no-check-certificate \
./contrib/download_prerequisites && \
mkdir objdir && \
cd objdir && \
../configure --prefix=/usr --enable-languages=c,c++,fortran \
--disable-multilib --disable-bootstrap && \
if [ $gcc_version_major -gt 6 ]; then \
../configure --prefix=/usr --enable-languages=c,c++,fortran \
--disable-multilib --enable-bootstrap \
else \
../configure --prefix=/usr --enable-languages=c,c++,fortran \
--disable-multilib --disable-bootstrap \
fi && \
make -j32 && \
make install && \
if [ $gcc_version_major -gt 6 ]; then \
mv /usr/lib64/* /usr/lib/x86_64-linux-gnu/ \
fi && \
cd ../../ && \
rm -rf $gcc_version
Expand Down

0 comments on commit 907cd45

Please sign in to comment.