Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions bin/install-clara
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
set -e

# Default versions:
grapes=2.26
clara=5.0.2
clara=main

function error() {
echo -e "\n$usage\n\n Use option '-h' for more usage guidance.\n\nERROR: $@"
Expand Down Expand Up @@ -56,24 +55,18 @@ function cleanup() {
}

function build_clara {
#git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/clara-java
git clone --depth 1 https://code.jlab.org/hallb/clas12/clara-java
git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/clara-java
cd clara-java && CLARA_HOME=$1 ./gradlew deploy && cd -
}

function build_grapes {
git clone --depth 1 --branch $grapes https://code.jlab.org/hallb/clas12/coatjava/grapes.git
cd grapes && mvn package && cd -
}

trap cleanup EXIT

# Configure:
debug=0
args=()
usage="Usage: install-clara [-v] [-c COATJAVA] [-f CLARA] [-g GRAPES] PATH"
usage="Usage: install-clara [-v] [-c COATJAVA] [-f CLARA] PATH"
info="""
- The default CLARA / GRAPES versions are $clara / $grapes
- The default CLARA version is $clara
- COATJAVA can also be specified as a local installation directory
- If the COATJAVA version is not specified, it will try to auto-detect it.
- [-v adds verbosity and disables cleanup]"""
Expand All @@ -84,7 +77,7 @@ do
-h|--help) echo -e "\n$usage" && echo -e "$info" && exit 1 ;;
-f) clara="$2" && shift && shift ;;
-c) coatjava="$2" && shift && shift ;;
-g) grapes="$2" && shift && shift ;;
-g) echo "WARNING: option -g has been removed" >&2 && shift && shift ;;
-v) let debug=$debug+1 && shift ;;
-*|--*) echo -e "$usage\n\nUnknown option: $1" && exit 1 ;;
*) args+=("$1") && shift ;;
Expand Down Expand Up @@ -138,7 +131,4 @@ mkdir -p clara-cre/plugins/clas12/config
cp -Lr $coatjava/etc $coatjava/bin $coatjava/lib* clara-cre/plugins/clas12

# GRAPES:
echo -e "\nRetrieving GRAPES version $grapes ..."
build_grapes $PWD/grapes
mkdir -p clara-cre/plugins/grapes/lib/core/
cp grapes/target/grapes-*core*.jar clara-cre/plugins/grapes/lib/core/
cp $coatjava/lib/utils/grapes*.jar clara-cre/plugins/grapes/lib/core/
15 changes: 8 additions & 7 deletions build-coatjava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -386,22 +386,23 @@ fi
# - seem to break thread safety of `mvn install`, i.e., we'd need to run `mvn package` first, then `mvn install`
# - we just want copy the produced JAR files to a final installation directory, so the following bash code gets the job done without drama
install_jars() {
src=$(dirname $1)
src=$1
dest=$2
[ $# -ge 3 ] && filter="$3" || filter='*.jar'
if [ -d $src/target ]; then
for f in $(find $src/target -name $filter); do
if [ -d $src ]; then
for f in $(find $src -name $filter); do
mkdir -p $dest
cp $f $dest/
done
fi
}
for pom in $(find reconstruction -name pom.xml); do
install_jars $pom $prefix_dir/lib/services
install_jars $(dirname $pom)/target $prefix_dir/lib/services
done
install_jars common-tools/djl-runtime/pom.xml $prefix_dir/lib/services
install_jars common-tools/clara-io/pom.xml $prefix_dir/lib/utils 'jclara-*.jar'
install_jars common-tools/coat-libs/pom.xml $prefix_dir/lib/clas 'coat-libs-*.jar'
install_jars common-tools/copycat/target/lib/djl $prefix_dir/lib/services
install_jars common-tools/copycat/target/lib/grapes $prefix_dir/lib/utils
install_jars common-tools/copycat/target/lib/clara $prefix_dir/lib/utils 'jclara-*.jar'
install_jars common-tools/coat-libs/target $prefix_dir/lib/clas 'coat-libs-*.jar'
echo "installed coatjava to: $prefix_dir"

# install clara
Expand Down
25 changes: 0 additions & 25 deletions common-tools/clara-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,4 @@

</dependencies>

<!-- copy the CLARA jar for runtime usage -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-jclara</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/utils</outputDirectory>
<includeGroupIds>org.jlab.coda</includeGroupIds>
<includeArtifactIds>jclara</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<!--
this POM installs `ai.djl` runtime dependencies to our prefix classpath;
this includes its transitive dependencies, e.g. `gson` and `slf4j`
-->
<!-- this POM installs runtime dependencies to our prefix classpath -->

<artifactId>djl-runtime</artifactId>
<artifactId>copycat</artifactId>
<packaging>pom</packaging>

<parent>
Expand Down Expand Up @@ -63,6 +60,17 @@
</profiles>

<dependencies>
<!-- clara -->
<dependency>
<groupId>org.jlab.coda</groupId>
<artifactId>jclara</artifactId>
</dependency>
<!-- grapes -->
<dependency>
<groupId>org.jlab.jnp</groupId>
<artifactId>grapes</artifactId>
</dependency>
<!-- djl runtime -->
<dependency>
<groupId>ai.djl</groupId>
<artifactId>api</artifactId>
Expand Down Expand Up @@ -103,8 +111,35 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/services</outputDirectory>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/lib/djl</outputDirectory>
<includeGroupIds>ai.djl,ai.djl.pytorch</includeGroupIds>
<includeScope>runtime</includeScope> <!-- include transitive dependencies, e.g. `gson` and `slf4j` -->
</configuration>
</execution>
<execution>
<id>copy-jclara</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/clara</outputDirectory>
<includeGroupIds>org.jlab.coda</includeGroupIds>
<includeArtifactIds>jclara</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
</execution>
<execution>
<id>copy-grapes</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/grapes</outputDirectory>
<includeGroupIds>org.jlab.jnp</includeGroupIds>
<includeArtifactIds>grapes</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
</execution>
</executions>
Expand Down
2 changes: 1 addition & 1 deletion common-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<module>clara-io</module>
<module>clas-tracking</module>
<module>clas-decay-tools</module>
<module>djl-runtime</module>
<module>copycat</module>
<module>coat-libs</module>
</modules>

Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
<id>clasweb-clas12maven</id>
<url>https://clasweb.jlab.org/.clas12maven</url>
</repository>
<!-- https://code.jlab.org/hallb/clas12/coatjava/grapes package registry -->
<repository>
<id>code.jlab.org-hallb-grapes</id>
<url>https://code.jlab.org/api/v4/projects/776/packages/maven</url>
</repository>
</repositories>

<profiles>
Expand Down Expand Up @@ -124,6 +129,12 @@
<version>6.2</version>
</dependency>

<dependency>
<groupId>org.jlab.jnp</groupId>
<artifactId>grapes</artifactId>
<version>2.27-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.coda</groupId>
<artifactId>jevio</artifactId>
Expand Down
Loading