-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Naming Convention - Emscripten support - Web server for visualization - Minor bug fixes
- Loading branch information
Showing
282 changed files
with
8,434 additions
and
6,626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: REBOUND (emscripten) | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
name: Compiling with emscripten | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Download and install emscripten | ||
run: | | ||
git clone https://github.com/emscripten-core/emsdk.git | ||
emsdk/emsdk install latest | ||
emsdk/emsdk activate latest | ||
- name: Compile web client | ||
run: | | ||
bash web_client/compile.bash | ||
- name: Archive web client | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: web_client | ||
path: web_client/rebound.html | ||
- name: Compile all C examples | ||
run: | | ||
bash docs/c_examples/compile_emcc.bash 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
source emsdk/emsdk_env.sh | ||
READTHEDOCS_OUTPUT="${READTHEDOCS_OUTPUT:-.}" | ||
OPTIMI="${1:-3}" | ||
|
||
echo "Compiling C examples with emscripten." | ||
echo "Output dir: $READTHEDOCS_OUTPUT" | ||
echo "" | ||
|
||
for dir in examples/*/ | ||
do | ||
echo "Working on $dir ..." | ||
mpi_enabled=$(cat $dir/Makefile | grep -c "export MPI=1") | ||
openmp_enabled=$(cat $dir/Makefile | grep -c "export OPENMP=1") | ||
server_used=$(cat $dir/problem.c | grep -c "reb_simulation_start_server") | ||
if [ $mpi_enabled -eq 0 ] && [ $openmp_enabled -eq 0 ]; then | ||
mkdir -p $READTHEDOCS_OUTPUT/html/emscripten_c_$dir/ | ||
echo "Compiling... " | ||
if [ $server_used -eq 0 ]; then | ||
emcc -O$OPTIMI -Isrc/ src/*.c $dir/problem.c -DSERVERHIDEWARNING -sSTACK_SIZE=655360 -s -sASYNCIFY --shell-file web_client/shell_console_rebound.html -o $READTHEDOCS_OUTPUT/html/emscripten_c_$dir/index.html || exit 1 | ||
else | ||
emcc -O$OPTIMI -Isrc/ src/*.c $dir/problem.c -DSERVERHIDEWARNING -DOPENGL=1 -sSTACK_SIZE=655360 -s USE_GLFW=3 -s FULL_ES3=1 -sASYNCIFY --shell-file web_client/shell_rebound.html -o $READTHEDOCS_OUTPUT/html/emscripten_c_$dir/index.html || exit 1 | ||
fi | ||
echo "Done. " | ||
else | ||
echo "Skipping." | ||
fi | ||
echo "" | ||
|
||
done |
Oops, something went wrong.