OpenCOR is a frontend to libOpenCOR, a library that can be used to organise, edit, simulate, and analyse CellML files.
There are two versions of OpenCOR:
- OpenCOR: a desktop application that can be run on Windows, Linux, and macOS on Intel/ARM; and
- OpenCOR's Web app: a Web app that can be run using a Web browser.
The main difference between the two versions is that models in OpenCOR are, by default, compiled while they can only be interpreted in OpenCOR's Web app.
To build OpenCOR and OpenCOR's Web app, you need to install Node.js and npm, which you can do from here. Then, you need to install pnpm:
npm -g install pnpm
To build OpenCOR, you also need a C/C++ toolchain:
- Windows:
- Intel:
- Visual Studio Community 2019 (
Desktop development with C++
withMSVC v142 - VS 2019 C++ x64/x86 build tools
andWindows 10 SDK
); or - Visual Studio Community 2022 (
Desktop development with C++
withMSVC v143 - VS 2022 C++ x64/x86 build tools
andWindows 11 SDK
);
- Visual Studio Community 2019 (
- ARM:
- Visual Studio Community 2019 (
Desktop development with C++
withMSVC v142 - VS 2019 C++ ARM64 build tools
andWindows 10 SDK
);
- Visual Studio Community 2019 (
- Intel:
- Linux: G++ (
g++
package) on Ubuntu 22.04 LTS/Ubuntu 24.04 LTS; and - macOS: Xcode (including its Command Line Tools).
Notes:
- Yes, OpenCOR for Windows on ARM can only be built using Visual Studio Community 2019 (this is because we must use
MSVC v142
; see here for more information). - On Windows on ARM, you can install Node.js using fnm. However, if you use
fnm install --lts
, it will install the Intel version of Node.js, which may or may not be what you want. If you want to install the ARM version of Node.js, you should usefnm install --lts --arch arm64
. - On Ubuntu on ARM, you need to install the
libopenjp2-tools
package so thatelectron-builder
can get access toopj_decompress
.
Before doing anything, you need to install all of OpenCOR's dependencies:
pnpm install
Then, you can run a given script:
pnpm <script>
where <script>
is one of the following:
build
: build OpenCOR;build:web
: build OpenCOR's Web app;clean
: clean OpenCOR's environment;dev
: (build and) start OpenCOR and OpenCOR's Web app in development mode;dev:web
: (build and) start OpenCOR's Web app in development mode;format
: format OpenCOR's code and OpenCOR's Web app's code;format:check
: check that OpenCOR's code and OpenCOR's Web app's code are properly formatted;libopencor
: build OpenCOR's JavaScript interface to libOpenCOR's C++ bindings;lint
: lint OpenCOR's code and OpenCOR's Web app's code;package
: (build and) package OpenCOR for the current platform;publish:web
: publish OpenCOR's Web app on npm;start
: (build and) start OpenCOR in production mode; andstart:web
: (build and) start OpenCOR's Web app in production mode.
Notes:
- To run or package OpenCOR, you first need to build OpenCOR's JavaScript interface to libOpenCOR's C++ bindings (using
pnpm libopencor
). From there, you can run (using eitherpnpm start
orpnpm dev
) or package (usingpnpm package
) OpenCOR. - OpenCOR does not, by default, work on Ubuntu 24.04 LTS and later (see here for more information), although it can be made to work by running the following command:
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- The URI scheme works fine when using the
package
-based version of OpenCOR. When it comes to thestart
-based anddev
-based versions of OpenCOR, the URI scheme "works" as follows: