Warning | ||
---|---|---|
| ||
Most of the information on this page is now out of date, as it refers to the old Maven 1 build system. The lcsim projects have been ported to use Maven 2 instead. |
Prerequisites
...
To build the org.lcsim software, you first need to should have the following installed.
- Java JDK 1.5 (aka 5.0) (from http://java.sun.com/j2se/1.5.0/download.jsp)
- Maven (from http://maven.apache.org)
- cvs
...
title | SLAC Unix |
---|
These tools are all pre-installed on SLAC unix. Just issue the command:
No Format |
---|
setenv JAVAVER 1.5 |
- or 1.6
- Maven 2.0.9
- Netbeans 6.5
- CVS client such as command-line on Linux, Tortoise CVS, or just use the Netbeans cvs client
If you are following the lcsim tutorial instructions, these tools should be setup by now.
Building org.lcsim software
...
The lcsim software consists of two three primary packages, the geometry package, and the analysis and reconstruction package. You must obtain and build the geometry package first, since the analysis package depends on it: GeomConverter, org.lcsim, and lcsim-contrib.
Most users will be primarily interested in building and running lcsim and/or lcsim-contrib.
Here are condensed instructions:, which you can execute from any bash-like unix shell.
No Format |
---|
setenvexport CVSROOT =:pserver:anonymous@cvs.freehep.org:/cvs/lcd cvs login (just hit enter when prompted for password) cvs co GeomConverterlcsim cvs co lcsim cd GeomConverter maven cd ../lcsim maven |
Testing the installation
...
cd lcsim
mvn
|
The build procedure for lcsim-contrib is virtually the same. Just replace "lcsim" in the above instructions by "lcsim-contrib".
Keeping the Release Current
Oftentimes new directories are added in a new release. In order
to make sure that cvs adds those, please use the command
No Format |
---|
cvs update -PdA
|
which will
P: prune empty directories
d: create directories
A: reset sticky tags
No Format |
---|
man cvs
|
will give more information on the cvs program.
Installing Custom JARs into JAS3
By default, your lcsim and lcsim-contrib builds install their current jar files into ~/.JAS3/extensions.
Edit the pom.xml file to turn off this behavior.
Testing the installation
Note | ||
---|---|---|
| ||
By default, maven will also run the JUnit tests associated with this distribution. |
...
|
...
If you wish to build without testing, issue the following command, but do this at your own risk:
No Format |
---|
maven -Dmaven.test.skip=true |
To execute a single test case (, e.g. that for org.lcsim.recon.cluster.fixedcone.FixedConeClusterer):
No Format |
---|
maven test:single -Dtestcase=org.lcsim.recon.cluster.fixedcone.FixedConeClustererTest |
Tip | ||
---|---|---|
| ||
There are also other component tests for many of the org.lcsim classes. Until they can be ported
|
Running Classes from the
...
Command Line
We have defined a maven Maven goal to allow that allows users to run a java class using maven Java class in the project from the command line.
...
using the freehep-run-plugin.
For example:
No Format |
---|
maven run -Drun.class="org.lcsim.geometry.compact.converter.heprep.Main" -Dargs="test/org/lcsim/geometry/compact/sdjan03_compact.xml tst.heprep" |
The documentation for the plugin is in:
http://java.freehep.org/freehep-run-plugin/index.html
Building org.lcsim with NetBeans
In addition to the above you will need:
- NetBeans 4.0 (from http://www.netbeans.org/community/releases/40/index.html)
- Mevenide plugin for Netbeans (from http://mevenide.codehaus.org/download.html).
Tip | ||
---|---|---|
| ||
Download this small autoupdate module. To install, start NetBeans and select the "Update Center Wizard" option from the "Tools" menu. Select the "Install Manually Downloaded Modules (.nbm Files)." On the next page, select "Add..." from the "Modules to Install" panel and navigate to the location of the downloaded file. On the next page, transfer that file from the "Available Updates and New Modules:" panel to the "Include in install:" panel and click on the "Finish" button. |
Once these are installed you can open the project folders in NetBeans and build using maven from inside netbeans.
Building org.lcsim with Eclipse
Instead of NetBeans, you can also use the Eclipse IDE to build org.lcsim and write your applications.
Download Eclipse: http://eclipse.org/downloads/index.php
I recommend the latest "3.1 Stream Stable Build" (M6 at the time of this writing), because of the better support of Java 1.5 features.
The Mevenide plugin can be installed as follows:
Help->Software Updates->Find and Install...
Select "Search for new features to install", click 'Finish'
Select "New Remote Site"; for Name enter "Mevenide", for Location enter http://mevenide.codehaus.org/release/eclipse/update/site.xml
Select the latest versions of both Maven and the Mevenide plugins, click 'Next'
You will have to agree to a license agreement.
The plugin will then be downloaded.
Confirm the installation with 'Install All'
When finished, you will be asked to restart the workbench.
Click 'Yes'.
Tip | ||
---|---|---|
| ||
You can now install the CVS project by selecting File->New->Project |
You can add the 'Maven nature' and the 'Java Nature' to your project by right clicking on the project and selecting the entry from the context menu.
Note | ||
---|---|---|
| ||
You may have to change the source path of the project, otherwise Java may be inclined to look for packages src.org.lcsim.* instead of org.lcsim.*. This can be done by right-clicking on the project and selecting Properties->Java Build Path. The src/ folder should be selected as the only source folder. |
Note | ||
---|---|---|
| ||
When building the project outside of Eclipse, Maven secretly downloads a plethora of external libraries. If you want to build the project inside of Eclipse, you have to add those libraries to the build path. This can be done by right-clicking on the project and selecting "Properties". The JAS libraries can be used alternatively. |
Installing Custom JARs into JAS3
To use a different version of org.lcsim, you can execute the following from the checkout directory.
No Format |
---|
maven jas:install
|
above command run the Main class to convert the given compact description to a HepRep.
Compiler Warnings
By default, compiler warnings about deprecation and unchecked method or class usages are turned off.
To turn on these warnings, remove the "#" from these two lines in lcsim/project.properties
No Format |
---|
#maven.compile.deprecation=on
#maven.compile.compilerargs=-Xlint:unchecked
|
Now you should see lots of warning messages, which will effect both Netbeans and command-line builds.
To customize Netbeans, only, you can change how the Netbeans Build Mapping works.
Right-click on the org.lcsim project and select "Properties". Now double-click on "Goal to IDE Mappings". Where it says "Build", you should see "jar:install".
To see all warnings, change the Build line to this:
No Format |
---|
jar:install -Dmaven.compile.deprecation=on -Dmaven.compile.compilerargs=-Xlint:unchecked
|
This should have the same effect as changing the project.properties file, but command-line builds using maven only will unaffected.
Building the Documentation
Generating the documentation with maven is quite easy. Just execute this command.
No Format |
---|
maven site
|
This builds the site at the location ./target/docs. You can use this site for local documentation by browsing to ./target/docs/index.html.
The reference copy of the lcsim documentation is kept at http://www.lcsim.org/software/lcsim. This usually corresponds to the CVS head version.
Increasing the Java Heap and Perm Size
The LCSim tests can take up more memory than the default heap/perm size assigned to the java VM.
Use this environment variable setting to allocate more memory, i.e. 1 gigabyte heap / 256 megabyte perm, to maven.
No Format |
---|
MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
|
If you are building the lcsim documentation, including running all the tests, you are required to increase the heap size beyond the initial default of 256 megabytes. Otherwise, the target will fail due to an "out of memory" errorThis will copy the lcsim and GeomConverter jars to your JAS3 extension directory at ~/.JAS3/extensions.