Skip to content

Commit

Permalink
Merge pull request janjongboom#13 from Arm-Debug/fix-emcc-installation
Browse files Browse the repository at this point in the history
Fix emcc installation
  • Loading branch information
thegecko authored Sep 13, 2021
2 parents df35b90 + f81767e commit 71513e5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ ENV EMSCRIPTEN="/emsdk/emscripten/tag-1.38.21"
ENV EMSCRIPTEN_NATIVE_OPTIMIZER="/emsdk/emscripten/tag-1.38.21_64bit_optimizer/optimizer"

RUN apt-get update -qq && apt-get -qqy install \
cmake git python-dev python-pip net-tools && \
pip install mbed-cli mercurial && \
git clone https://github.com/emscripten-core/emsdk
cmake git curl unzip python-dev python-pip && \
pip install mbed-cli mercurial

ENV EMSDK_REVISION="50df5a2983d1b793f189c674ad588d8df5f9b2f4"
RUN curl -LO https://github.com/emscripten-core/emsdk/archive/${EMSDK_REVISION}.zip && \
unzip ${EMSDK_REVISION}.zip && \
mv emsdk-${EMSDK_REVISION} emsdk

RUN emsdk/emsdk install fastcomp-clang-e1.38.21-64bit && \
emsdk/emsdk activate fastcomp-clang-e1.38.21-64bit && \
emsdk/emsdk install emscripten-tag-1.38.21-64bit && \
emsdk/emsdk activate emscripten-tag-1.38.21-64bit

ADD . /app

WORKDIR /app

ENV DEMOS_DIRECTORY="demos"

RUN npm install && npm run build-demos

EXPOSE 7829
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@ To make this feedback loop much shorter, we're releasing an alpha version of the

## Installation

There are two ways of installing and running the simulator: either using Docker
or installing a locally hosted version.
There are two ways of installing and running the simulator: using either Docker
or a native installation.

### Docker installation

1. Install Docker
1. Build the Docker image:
`docker build -t mbed/simulator .`
1. Run the Docker image with hot reload:
`docker run -v $PWD/server:/app/server -v $PWD/viewer:/app/viewer -p 7829:7829 mbed/simulator npm run watch`
`docker compose build`
1. Run the Docker image:
1. normally:
`docker compose up`
2. or with watcher:
`docker compose run mbed-sim npm run watch`
1. The simulator can now be accessed at:
http://localhost:7829
1. To stop the Docker image:
`docker ps -a -q --filter ancestor=mbed/simulator`


### Local installation
### Native installation

#### Prerequisites

Expand Down
1 change: 1 addition & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@ fn(program.inputDir || program.inputFile, program.outputFile, extraArgs, program
.catch(err => {
console.error(err);
console.error('Building application failed');
process.exit(1);
});
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3"

services:
mbed-sim:
build:
context: .
ports:
- "7829:7829"
volumes:
- "./server:/app/server"
- "./viewer:/app/viewer"

0 comments on commit 71513e5

Please sign in to comment.