Skip to content

Commit 715ea2f

Browse files
committed
Update readme and sample build script.
1 parent 1fca910 commit 715ea2f

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

javascript/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ This folder contains tests and examples that leverage the JavaScript bindings fo
88

99
The emscripten SDK is required to generate the JavaScript bindings. There are several ways of using the SDK on different platforms. In general, we recommend to install the SDK directly, following the instructions below. Alternative options are explained [below](#alternative-options-to-use-the-emscripten-sdk).
1010

11-
To install the SDK directly, follow the instructions of the [emscripten SDK installation Guide](https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended). Make sure to install prerequisites depending on your platform and read usage hints first (e.g. differences between Unix / Windows scripts).
11+
To install the SDK directly, follow the instructions of the [emscripten SDK installation Guide](https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended). Make sure to install prerequisites depending on your platform and read usage hints first (e.g. differences between Unix / Windows scripts).
1212

13-
Note that following the instructions will set some environment variables that are required to use the SDK. These variables are only set temporarily for the current terminal, though. Setting the environment variables in other terminals can be achieved by running
13+
The current supported version is `2.0.20`. Do not automatically update to the latest version to avoid build issues.
14+
15+
Note that following the instructions will set some environment variables that are required to use the SDK. These variables are only set temporarily for the current terminal, though. Setting the environment variables in other terminals can be achieved by running
1416
```sh
1517
source ./emsdk_env.sh
1618
```
1719
inside of the `emsdk` folder (check the documentation for the Windows equivalent). In case of the MaterialX project, it is not required to have these environment variables set. You can also use a CMake build flag instead, as described in the [build instructions](#build-steps) below.
1820

21+
By default emsripten `2.0.20` will use an older version of NodeJs (`14.15.0`). It is recommended to use the version of NodeJs used to build the official release to avoid package compatibility or runtime issues.
22+
The packages used are not currently compatible with version `18` of NodeJS.
23+
1924
Setting the environment variables permanently is also possible, either by adding a `--permanent` flag to the `activate` command, or by sourcing the `emsdk_env` script every time a shell is launched, e.g. by adding the `source` call to `~/.bash_profile` or an equivalent file. Note however, that the environment variables set by the emscripten SDK might override existing system settings, like the default Python, Java or NodeJs version, so setting them permanently might not be desired on all systems.
2025

2126
### Alternative options to use the emscripten SDK
@@ -66,7 +71,7 @@ After building the project the `JsMaterialXCore.wasm`, `JsMaterialXCore.js`, `Js
6671
JavaScript unit tests are located in the `MaterialXTest` folder and use the `.spec.js` suffix. A sample browser is located in the `MaterialXView` folder which allows preview of some of provided sample MaterialX materials.
6772

6873
### Unit Tests
69-
These tests require `node.js`, which is shipped with the emscripten environment. Make sure to `source` the `emsdk/emsdk_env.sh` script before running the steps described below, if you don't have NodeJs installed on your system already (running the command is not required otherwise).
74+
These tests require `node.js`, which is shipped with the emscripten environment. Make sure to `source` the `emsdk/emsdk_env.sh` script before running the steps described below, if you don't have NodeJs installed on your system already (running the command is not required otherwise).
7075

7176
1. From the `MaterialXTest` directory, install the npm packages.
7277
```sh

javascript/build_javascript_win.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
@rem Edit the following paths to match your local locations for the Emscripten and MaterialX projects.
66
set EMSDK_LOCATION=C:/GitHub/emsdk
77
set MATERIALX_LOCATION=C:/GitHub/MaterialX
8-
call %EMSDK_LOCATION%/emsdk.bat install latest
9-
call %EMSDK_LOCATION%/emsdk.bat activate latest
8+
call %EMSDK_LOCATION%/emsdk.bat install 2.0.20
9+
call %EMSDK_LOCATION%/emsdk.bat activate 2.0.20
1010
if NOT ["%errorlevel%"]==["0"] pause
1111
@echo --------------------- Build MaterialX With JavaScript ---------------------
1212
@echo on

0 commit comments

Comments
 (0)