Skip to content

Commit

Permalink
Updated emsdk Dockerfile to 1.38.20, added yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Nov 21, 2018
1 parent 98463e8 commit 30a6a31
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 92 deletions.
165 changes: 79 additions & 86 deletions docker/emsdk/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,90 +1,83 @@
# Liberally copied from trzeci/emscripten

ARG EMSCRIPTEN_SDK=sdk-tag-1.38.11-64bit
FROM trzeci/emscripten-slim:${EMSCRIPTEN_SDK}

# ------------------------------------------------------------------------------

ARG VCS_REF
ARG BUILD_DATE
ARG EMSCRIPTEN_SDK

# ------------------------------------------------------------------------------

RUN echo "\n## Start building" \
\
&& echo "\n## Update and install packages" \
&& apt-get -qq -y update && apt-get -qq install -y --no-install-recommends \
wget \
curl \
zip \
unzip \
git \
ssh-client \
ca-certificates \
build-essential \
libboost-all-dev \
make \
ant \
libidn11 \
\
&& echo "\n## Installing JRE 8" \
&& echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list \
&& apt-get -qq -y update && apt-get -qq install -y --no-install-recommends -t jessie-backports openjdk-8-jre-headless \
\
&& echo "\n## Installing CMake" \
&& wget https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.sh -q \
&& mkdir /opt/cmake \
&& printf "y\nn\n" | sh cmake-3.7.2-Linux-x86_64.sh --prefix=/opt/cmake > /dev/null \
&& rm -fr cmake*.sh /opt/cmake/doc \
&& rm -fr /opt/cmake/bin/cmake-gui \
&& rm -fr /opt/cmake/bin/ccmake \
&& rm -fr /opt/cmake/bin/cpack \
&& ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \
&& ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest \
\
&& printf "JAVA='$(which java)'\n" >> $EM_CONFIG \
\
&& sleep 2 \
&& touch ${EM_CONFIG}_sanity \
\
&& emcc --version \
\
&& emcc --clear-cache --clear-ports \
\
&& echo "\n## Compile sample code" \
&& mkdir -p /tmp/emscripten_test && cd /tmp/emscripten_test \
&& printf '#include <iostream>\nint main(){std::cout<<"HELLO FROM DOCKER C++"<<std::endl;return 0;}' > test.cpp \
&& em++ -O2 test.cpp -o test.js && nodejs test.js \
&& em++ test.cpp -o test.js && nodejs test.js \
&& em++ test.cpp -o test.js --closure 1 && nodejs test.js \
\
&& cd / \
&& rm -fr /tmp/emscripten_test \
\
&& echo "\n## Moving Boost locally" \
\
&& mkdir /boost_includes \
&& cp -r /usr/include/boost /boost_includes/ \
\
&& echo "\n## Cleaning up" \
&& apt-mark manual make openjdk-8-jre-headless wget gcc git \
&& apt-get -y remove openjdk-7-jre-headless \
&& apt-get -y clean \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
\
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/debconf/*-old \
&& rm -rf /usr/share/doc/* \
&& rm -rf /usr/share/man/?? \
&& rm -rf /usr/share/man/??_* \
&& cp -R /usr/share/locale/en\@* /tmp/ && rm -rf /usr/share/locale/* && mv /tmp/en\@* /usr/share/locale/ \
\
&& echo "\n## Installed packages:" \
&& apt-mark showmanual | xargs -I % sh -c 'echo " * \`%\` : **"$(xargs dpkg -s % | grep Version | sed "s/Version: //")"**"' \
\
&& chmod -R 777 ${EM_DATA} \
&& echo "\n## Done"
FROM trzeci/emscripten-slim:sdk-tag-1.38.20-64bit

RUN apt-get -qq -y update
RUN apt-get -qq install -y --no-install-recommends \
wget \
curl \
zip \
unzip \
git \
ssh-client \
ca-certificates \
build-essential \
libboost-all-dev \
make \
ant \
libidn11


RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list
RUN apt-get -qq -y update && apt-get -qq install -y --no-install-recommends -t jessie-backports openjdk-8-jre-headless

RUN wget https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.sh -q
RUN mkdir /opt/cmake
RUN printf "y\nn\n" | sh cmake-3.7.2-Linux-x86_64.sh --prefix=/opt/cmake > /dev/null
RUN rm -fr cmake*.sh /opt/cmake/doc
RUN rm -fr /opt/cmake/bin/cmake-gui
RUN rm -fr /opt/cmake/bin/ccmake
RUN rm -fr /opt/cmake/bin/cpack
RUN ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
RUN ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest

RUN printf "JAVA='$(which java)'\n" >> $EM_CONFIG

RUN sleep 2
RUN touch ${EM_CONFIG}_sanity

RUN emcc --version

RUN emcc --clear-cache --clear-ports

RUN mkdir -p /tmp/emscripten_test
RUN cd /tmp/emscripten_test
RUN printf '#include <iostream>\nint main(){std::cout<<"HELLO FROM DOCKER C++"<<std::endl;return 0;}' > test.cpp

RUN em++ -O2 test.cpp -o test.js
RUN node test.js

RUN em++ test.cpp -o test.js
RUN node test.js

RUN em++ test.cpp -o test.js --closure 1
RUN node test.js

RUN cd /
RUN rm -fr /tmp/emscripten_test

RUN mkdir /boost_includes
RUN cp -r /usr/include/boost /boost_includes/

RUN apt-mark manual make openjdk-8-jre-headless wget gcc git
RUN apt-get -y remove openjdk-7-jre-headless
RUN apt-get -y clean
RUN apt-get -y autoclean
RUN apt-get -y autoremove

RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf /var/cache/debconf/*-old
RUN rm -rf /usr/share/doc/*
RUN rm -rf /usr/share/man/??
RUN rm -rf /usr/share/man/??_*
RUN cp -R /usr/share/locale/en\@* /tmp/
RUN rm -rf /usr/share/locale/*
RUN mv /tmp/en\@* /usr/share/locale/

RUN chmod -R 777 ${EM_DATA}

ENV PATH="/emsdk_portable/node/bin:${PATH}"
RUN npm install --global yarn
RUN yarn --version

ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre
1 change: 0 additions & 1 deletion packages/perspective/src/js/perspective.asmjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const perspective = require("./perspective.js").default;

const Module = load_perspective({
wasmJSMethod: "asmjs",
filePackagePrefixURL: "",
printErr: x => console.error(x),
print: x => console.log(x)
});
Expand Down
3 changes: 1 addition & 2 deletions packages/perspective/src/js/perspective.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const buffer = fs.readFileSync(path.join(__dirname, wasm)).buffer;
module.exports = perspective(
load_perspective({
wasmBinary: buffer,
wasmJSMethod: "native-wasm",
ENVIRONMENT: "NODE"
wasmJSMethod: "native-wasm"
})
);

Expand Down
1 change: 0 additions & 1 deletion packages/perspective/test/js/perspective.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const RUNTIMES = {
ASMJS: perspective(
asmjs.load_perspective({
wasmJSMethod: "asmjs",
filePackagePrefixURL: "",
printErr: x => console.error(x),
print: x => console.log(x)
})
Expand Down
1 change: 0 additions & 1 deletion packages/perspective/test/js/test_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const RUNTIMES = {
ASMJS: perspective(
asmjs.load_perspective({
wasmJSMethod: "asmjs",
filePackagePrefixURL: "",
printErr: x => console.error(x),
print: x => console.log(x)
})
Expand Down
1 change: 0 additions & 1 deletion scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ if (PSP_WASM_BUILD)
-s NO_EXIT_RUNTIME=1 \
-s NO_FILESYSTEM=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s NO_DYNAMIC_EXECUTION=2 \
-s EXPORTED_FUNCTIONS=\"['_main']\" \
")

Expand Down

0 comments on commit 30a6a31

Please sign in to comment.