OpenCOR (and its corresponding tests) can be built and run either from the command line or using Qt Creator.
Various batch and VBScript files (.bat
and .vbs
files) and shell scripts are available on Windows and on Linux / OS X, respectively:
[OpenCOR]/clean
[.bat
]: cleans the OpenCOR environment;[OpenCOR]/make
[.bat
]: compiles and links everything that is required to get a release version of OpenCOR; and
make[.bat]
compiles OpenCOR sequentially. However, you can specify a number of jobs (n
) to be run simultaneously, making it possible to compile OpenCOR in parallel on Windows and on Linux / OS X, respectively:
C:\OpenCOR>make /m[:n]
$ ./make -j [n]If no
n
value is provided, then as many jobs as possible will be run simultaneously.
[OpenCOR]/maketests
[.bat
]: builds a release version of OpenCOR and its tests;[OpenCOR]/run
[.bat
| .vbs
]: runs OpenCOR.
run
, then run.bat
would be executed (rather than run.vbs
), offering you the opportunity to use OpenCOR as a console application. However, if you were to run OpenCOR by double clicking run.bat
in, say, Windows Explorer, then a console window will quickly appear and disappear. To avoid this, you should double click on run.vbs
instead.
[OpenCOR]/runtests
[.bat
]: runs OpenCOR's tests;[OpenCOR]/CMakeLists.txt
(by selecting the File
| Open File or Project...
menu, by pressing Ctrl+O
or by dragging and dropping the file onto Qt Creator);[OpenCOR]/build
as the build directory;Next
button;Run CMake
button;Finish
button; andBuild
| Run
menu or by pressing Ctrl+R
).
Projects
view and by clicking on the Add Build Step
drop-down button and clicking on the Custom Process Step
menu item. From there, set the Command
field to cmake
, set the Arguments
field to -DCMAKE_BUILD_TYPE=Debug ..
and leave the Working directory
field with %{buildDir}
. Finally, make sure that this new build step comes before the default Make
build step.
-DENABLE_TESTING=True
to the CMake command (see Note #1). Then, if you want the tests to be run every time you build OpenCOR, you need to create a new build step (see Note #1) with runtests
as the Command
and %{buildDir}/tests
as the Working directory
. Now, unlike in Note #1, this new build step must come after the default Make
build step.
Projects
view and by clicking on the Details
drop-down button of the default Make
build step under the Build Steps
header. From there, just set the Additional arguments
field to -j [n]
where n
is the number of jobs to be run simultaneously (the n
value is compulsory on Windows, but if none is provided on Linux / OS X, then Qt Creator will try to run as many jobs as possible).