In order to install and use Redberry you need the following software installed on your system:
We highly recommend to use Redberry with IntelliJ IDEA which is an excellent open-source IDE for Groovy. IntelliJ IDEA provides a very versatile features for convenient usage of Redberry including syntax highlighting, code completion, documentation rendering, easy refactoring and many more.
In order to install and run Redberry with Intellij IDEA follow the instructions below:
@Grab(group = 'cc.redberry', module = 'groovy', version = '1.1.8') import cc.redberry.groovy.Redberry
import cc.redberry.groovy.Redberry import static cc.redberry.groovy.RedberryPhysics.* import static cc.redberry.groovy.RedberryStatic.* import static cc.redberry.core.tensor.Tensors.* use(Redberry){ //put your code here }(when IntelliJ installed Redberry, the first line with
@Grab
is no longer necessary)You can run Redberry script directly in console. For this wrap your Redberry code like in the following example:
@Grab(group = 'cc.redberry', module = 'groovy', version = '1.1.9') import cc.redberry.groovy.Redberry import static cc.redberry.groovy.RedberryPhysics.* import static cc.redberry.groovy.RedberryStatic.* import static cc.redberry.core.tensor.Tensors.* use(Redberry){ //put your code here println Factor >> 'x**2 - y**2'.t }and simply run from the command line
> groovy MyRedberryScript.groovy
During the first run, Redberry and all required dependencies will be installed on the system (so the internet connection is required only for the first run).
You also can manually download Redberry all-in-one .jar
from Downloads page and add it to your system classpath. Then you can run Redberry scripts without specifying @Grab
in the first line.
In order to build Redberry from sources first you need to install Apache Maven .
Then you need to obtain Redberry sources either by downloading from Bitbucket or by cloning Redberry repository (you need Mercurial):
> hg clone https://bitbucket.org/redberry/redberryIn order to build Redberry and run all tests run from the command line
> mvn clean installIn order to produce all-in-one
.jar
file run
> mvn clean install assembly:singleThis will produce same file as one can download from Downloads page in
target/
directory.