See the related documentation.
The core of Capsis4 is distributed under the LGPL free license (see the license file in the Capsis distribution). The Capsis4 modules (i.e. the forestry growth models) are distributed with custom licenses, see the license file in each module directory (e.g. capsis4/bin/mountain/). If such a module has no explicit distribution license file, it means it is not freely distributable and it is the property of its author.
You need to open a terminal (also called a console or a shell under Unix).
cmd
.
While in the terminal, you can change volumes by typing the volume name (e.g. C:
or D:
) and you can navigate through the directories with the cd
(change directory) command.
E.g. to go to the capsis install directory (replace the directory names according to your installation path):
C: cd \capsis
All ant commands must be typed from the install directory like the following example (to force the recompilation of all sources):
ant clean compile
Note: this command should finish with this message: BUILD SUCCESSFUL
.
You need to open a terminal (also called a console or a shell).
E.g. under Linux Ubuntu, you may try Application > Accessories > Terminal.
While in the terminal, you can navigate through the directories with the cd
(change directory) command.
E.g. to go to the capsis install directory (replace the directory names according to your installation path):
cd /home/coligny/workspace/capsis
All ant commands must be typed from the install directory like the following example (to force the recompilation of all sources):
sh ant clean compile
Note: under Linux, the commands should be prefixed by sh
.
Note: this command should finish with this message: BUILD SUCCESSFUL
.
You need to open a terminal (also called a console or a shell). See Finder > Applications > Utilities > Terminal.
Then, see the Linux topic just above. You will use the same scripts than for Linux and launch them the same way with 'sh'.
cd .../capsis4 sh ant clean compile
Since 26 July 2016, Capsis needs Java 1.8.x, also called Java 8 (e.g. 1.8.0_102…).
It depends on your role in Capsis:
See the Java 8 installation page
The versions of Java by Oracle (owner of Sun Microsystems who invented the language) and OpenJDK are recommended. On Mac OS X systems, use the Java provided by Oracle, OpenJDK or Apple.
See the Java 8 installation page
Note: setting the CLASSPATH is not needed, neither for the end-users nor for the modellers (see the pages about compilation in the Capsis Documentation page).
See the Check if Java 8 is already the default version on your machine section in the Java 8 installation page
Compiler output (extract):
[javac] bad class file: ... [javac] class file has wrong version 51.0, should be 50.0 [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
Just do the following
# cd /System/Library/Frameworks/JavaVM.framework/Versions # rm -f CurrentJDK # ln -sf 1.8 CurrentJDK
and it should take care of the problem.
Alternative option:
Use the Finder to go to Applications > Utilities and launch Java Preferences. Ensure that Java 1.8 is at the top of the list.
In case several versions of java are available on your system, your may use a tool delivered with Capsis to select the one you need to run Capsis (compilation of the source code will still require the PATH to be set, see 3.5)
Open a terminal, go to the Capsis installation directory (generally named capsis4/) with 'cd' (change directory), then type:
// Under Linux and Mac sh selectjava.sh // Under Windows selectjava
The tool will search for the various versions of java installed on your system and will propose a list. Just choose the version you need.
[Note, 31.5.2022 at this date, Capsis only runs with a Java 1.8 or Java 8]
When launching the Capsis script, this version of java will be used.
// Under Linux and Mac sh capsis.sh // Under Windows capsis
Run the installer by double clicking on it, then follow the instructions.
Under Windows, if double-clicking does not start the installer, try to download and run jarfix to restore the system broken association (.jar file + double-click → open with java).
In case the installer still does not start, make sure the correct version of java is installed on your computer (see sections 3.1 and 3.6) and try to open the jar file with java like this:
// Run the jar installer from a terminal cd .../directoryContainingTheInstaller/ java -jar instalerName.jar
If you were given a tar.gz archive, it can be unzipped under Linux with gnozip or FileRoller and under Windows with PowerArchiver.
The Capsis archive contains a single directory named capsis4/ itself containing the whole platform. When unzipping, this directory can be located where you like in your file system. If you plan to develop under Capsis, locate the archive in your working directory (ex: c:/…/users/coligny/java/). For a simple use, Capsis can be installed anywhere.
Read the step by step tutorial to check the main features.
The installers (zip or jar) distributed on Internet only contain the components under free license. This concerns the Capsis kernel, its pilots (graphical user interface, script mode), all the platform extensions and the applicative libraries. Concerning the modules, only some of them are distributed and not always with a free license (depending on the author's choice). Many are still under development. If you are interested by an undistributed module, contact directly the author by mail (see the project page).
The maximum amount of memory Capsis can require from the operating system during simulation is a variable. This variable has a default value depending on the machine architecture.
Use the setmem tool to change the default value to a bigger or lower value (in mega bytes) if needed.
Once setmem has been run, the given value will be used until the next change with setmem.
Capsis shows the current value for memory at launch time in the terminal.
// e.g. setmem under Windows: ask for 4Gb > setmem 4096 Capsis will run with 4096 mega bytes available // Restore default value > setmem Capsis memory reset to capsis.bat default value // e.g. setmem under Linux: ask for 2Gb > sh setmem.sh 2048 Capsis will run with 2048 mega bytes available // Check the result in the first lines written when starting Capsis: > sh capsis.sh ... -> OS/JVM/memory: linux/64/2048m ...
Notes
Click (left) on a given step in the project manager, then double click in the lateral Selector on the chosen viewer. The viewer opens and synchronizes with the selected step (at every moment with the last selected step, named current step). Graphical outputs can be opened in the same way. A double-click on a new step of the project triggers synchronization on this step for the linked viewers and graphical outputs. Ctrl-clicking on a colored step closes all the associated tools (ex: curves are removed of graphics, viewers are closed…).
Select a step, then choose a viewer in the Selector. Do it again on another step.
In the View menu, check the corresponding options.
Capsis writes some messages into a log file. This file is named capsis.log and is located in capsis4/var/.
You may open it from the user interface with Tool > Log file.
You may also open it with a simple text editor (Textpad, SciTE…).
To write JUnit tests, see the related documentation.
To launch the test: capsis4/test/src/douglas/DouglasTest, type the following from capsis4/
ant run-test -Dtest=gymnos/GymnoTest
Then to check the results:
firefox test/report/index.html
EDIT: automatic run of tests is a discontinued feature (fc-28.4.2022)
Capsis tests (in test/src/) are compiled and run at each commit on the Capsis SVN server by a developer or a modeller. You must ensure the test compiles and runs in your local copy, then add it and commit it to svn.
To check the last test results (login required): https://amap-dev.cirad.fr/embedded/capsis/index.html [EDIT: broken link fc-2.2.2016]
Tests may have the status error (trouble in the code, e.g. NullPointerException) or failure: something changed and the assertions it checks are not true any more. A failure means maybe there is a regression.