annotate Applications/StoneWebViewer/WebAssembly/NOTES.txt @ 2001:e943a84da9ac

creation of text annotations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Nov 2022 14:56:35 +0100
parents 18384efed33d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1537
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
1
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
2 Building WebAssembly samples using Docker
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
3 =========================================
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
4
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
5 The script "./docker-build.sh" can be used to quickly build the
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
6 WebAssembly samples on any GNU/Linux distribution equipped with
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
7 Docker. This avoids newcomers to install Emscripten and learn the
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
8 CMake options. Just type:
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
9
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
10 $ ./docker-build.sh Release
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
11
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
12 After successful build, the binaries will be installed in the
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
13 following folder (i.e. in the folder "wasm-binaries" at the root of
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
14 the source distribution):
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
15
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
16 $ ls -l ../../wasm-binaries
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
17
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
18
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
19 NB: The source code of the Docker build environment can be found at
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
20 the following location:
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
21 https://github.com/jodogne/OrthancDocker/tree/master/wasm-builder
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
22
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
23
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
24 Native compilation (without Docker)
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
25 ===================================
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
26
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
27 Install Emscripten:
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
28 https://emscripten.org/docs/getting_started/downloads.html
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
29
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
30 Then, if the installation path is "~/Downloads/emsdk/":
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1531
diff changeset
31
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 # source ~/Downloads/emsdk/emsdk_env.sh
1658
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
33 # mkdir Build && cd Build
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
34 # cmake .. -DCMAKE_BUILD_TYPE=Release \
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
35 -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
36 -DALLOW_DOWNLOADS=ON -G Ninja
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1544
diff changeset
37 # ninja install
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1544
diff changeset
38
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1544
diff changeset
39 => The binaries will be put in "../../../wasm-binaries/StoneWebViewer/"
1658
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
40
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
41
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
42 Debian unstable
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
43 ===============
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
44
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
45 Last update: 2020-11-18
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
46
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
47 IMPORTANT - Currently broken: The linker fails on Debian Sid with the
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
48 default package. A workaround is available using "experimental"
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
49 packages:
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
50 https://github.com/emscripten-core/emscripten/issues/11895#issuecomment-729840497
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
51 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975069
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
52
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
53
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
54 # sudo apt-get install emscripten python3-clang python3-pystache ninja-build
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
55 # mkdir Build && cd Build
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
56 # EMSCRIPTEN=/usr/bin/ cmake .. -DCMAKE_BUILD_TYPE=Release \
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
57 -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake \
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
58 -DLIBCLANG=/usr/lib/x86_64-linux-gnu/libclang-9.so \
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
59 -DALLOW_DOWNLOADS=ON -G Ninja
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
60 # ninja install
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
61
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
62 => The binaries will be put in "../../../wasm-binaries/StoneWebViewer/"
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
63
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
64 The invokation of CMake will give the following warning, that can be safely ignored:
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
65
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
66 "System is unknown to cmake, create:
18384efed33d debian unstable instructions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
67 Platform/Emscripten to use this system, please post your config file on discourse.cmake.org so it can be added to cmake"