Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #67 from jpatton-USGS/tt-files
Browse files Browse the repository at this point in the history
Travel time package rewrite
  • Loading branch information
wyeck-usgs authored Jan 23, 2020
2 parents 28118b0 + 2ea8ed8 commit 1ee5a9f
Show file tree
Hide file tree
Showing 68 changed files with 8,056 additions and 5,275 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ script:
- cd build
# build
# - cmake -DBUILD_GLASS-APP=1 -DBUILD_GEN-TRAVELTMES-APP=1 -DBUILD_GLASS-BROKER-APP=1 -DGIT_CLONE_PUBLIC=1 -DRUN_TESTS=1 -DSUPPORT_COVERAGE=1 -DRUN_COVERAGE=1 -DRUN_CPPCHECK=1 -DRUN_CPPLINT=1 -DGENERATE_DOCUMENTATION=1 -DCMAKE_INSTALL_PREFIX=../dist -DRAPIDJSON_PATH=../lib/rapidjson -DLIBRDKAFKA_C_LIB=/usr/local/lib/librdkafka.a -DLIBRDKAFKA_CPP_LIB=/usr/local/lib/librdkafka++.a -DLIBRDKAFKA_PATH=/usr/local/include/librdkafka -DCPPLINT_PATH=../lib/cpplint/cpplint.py -DCPPCHECK_PATH=/usr/bin/cppcheck .. && make
- cmake -DBUILD_GLASS-APP=1 -DBUILD_GEN-TRAVELTMES-APP=1 -DGIT_CLONE_PUBLIC=1 -DRUN_TESTS=1 -DSUPPORT_COVERAGE=1 -DRUN_COVERAGE=1 -DRUN_CPPCHECK=1 -DRUN_CPPLINT=1 -DGENERATE_DOCUMENTATION=1 -DCMAKE_INSTALL_PREFIX=../dist -DRAPIDJSON_PATH=../lib/rapidjson -DCPPLINT_PATH=../lib/cpplint/cpplint.py -DCPPCHECK_PATH=/usr/bin/cppcheck .. && make
- cmake -DBUILD_GLASS-APP=1 -DGIT_CLONE_PUBLIC=1 -DRUN_TESTS=1 -DSUPPORT_COVERAGE=1 -DRUN_COVERAGE=1 -DRUN_CPPCHECK=1 -DRUN_CPPLINT=1 -DGENERATE_DOCUMENTATION=1 -DCMAKE_INSTALL_PREFIX=../dist -DRAPIDJSON_PATH=../lib/rapidjson -DCPPLINT_PATH=../lib/cpplint/cpplint.py -DCPPCHECK_PATH=/usr/bin/cppcheck .. && make
# copy documentation index.md to doxygen documentation directory
- cd ${TRAVIS_BUILD_DIR}
- cp -r ${TRAVIS_BUILD_DIR}/doc/* ${TRAVIS_BUILD_DIR}/dist/doc
Expand Down
22 changes: 0 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ option(GENERATE_DOCUMENTATION "Create and install the HTML based API documentati
option(RUN_TESTS "Create and run unit tests" ON)
option(BUILD_GLASS-APP "Build the glass application" ON)
option(BUILD_GLASS-BROKER-APP "Build the glass broker based application" OFF)
option(BUILD_GEN-TRAVELTMES-APP "Build the travel time generation application" OFF)
option(RUN_CPPCHECK "Run CPP Checks (requires cppcheck installed)" OFF)
option(RUN_CPPLINT "Run CPP Checks (requires cpplint and python installed)" OFF)
option(SUPPORT_COVERAGE "Instrument for Coverage" OFF)
Expand Down Expand Up @@ -374,27 +373,6 @@ if (BUILD_GLASS-BROKER-APP)

endif()

if (BUILD_GEN-TRAVELTMES-APP)

# gen-travel-times-app
ExternalProject_Add(
gen-travel-times-app
SOURCE_DIR ${PROJECT_SOURCE_DIR}/gen-travel-times-app/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${INSTALL_LOCATION}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DRUN_CPPCHECK=${RUN_CPPCHECK}
-DRUN_CPPLINT=${RUN_CPPLINT}
-DSUPPORT_COVERAGE=${SUPPORT_COVERAGE}
-DPYTHON_PATH=${PYTHON_PATH}
-DCPPLINT_PATH=${CPPLINT_PATH}
-DCPPCHECK_PATH=${CPPCHECK_PATH}
DEPENDS SuperEasyJSON util glasscore ${DOXYGEN_DEPEND} ${GTEST_DEPEND}
UPDATE_COMMAND ""
)

endif()

# ----- GENERATE DOCUMENTATION ----- #
set(DOC_DIRS "${PROJECT_SOURCE_DIR}/util/ ${PROJECT_SOURCE_DIR}/glasscore/ ${PROJECT_SOURCE_DIR}/parse/ ${PROJECT_SOURCE_DIR}/input/ ${PROJECT_SOURCE_DIR}/output/ ${PROJECT_SOURCE_DIR}/process/ ${PROJECT_SOURCE_DIR}/glass-app/ ${PROJECT_SOURCE_DIR}/glass-broker-app/ ${PROJECT_SOURCE_DIR}/gen-travel-times-app/")
include(${CMAKE_DIR}/documentation.cmake)
4 changes: 2 additions & 2 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# version.cmake - a CMake script that defines the overall project version
set (PROJECT_VERSION_MAJOR 1)
set (PROJECT_VERSION_MINOR 2)
set (PROJECT_VERSION_PATCH 1)
set (PROJECT_VERSION_MINOR 3)
set (PROJECT_VERSION_PATCH 0)
5 changes: 5 additions & 0 deletions gen-travel-times-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build/
52 changes: 0 additions & 52 deletions gen-travel-times-app/CMakeLists.txt

This file was deleted.

33 changes: 20 additions & 13 deletions gen-travel-times-app/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
# gen-traveltimes-app
# gen-travel-times-app

**Gen-travel-times-app** is an application that uses the glasscore traveltime
libraries to generate the traveltime lookup files (.trv) used by neic-glass3 from a
model file. Please note that this application is currently not optimized, and
is **extremely** slow.
A java program used to generate glass3 traveltimes from the NEIC java [travel time](https://github.com/usgs/neic-traveltime) package.

## Building
Dependencies
------
* gen-travel-times-app was written in Oracle Java 1.8
* gen-travel-times-app is built with [Gradle](https://gradle.org/), a build.gradle file and gradlew are included in this project
* gen-travel-times-app depends on the [neic-traveltime](https://github.com/usgs/neic-traveltime) package. A copy of this package is included with this package.

To build **gen-travel-times-app**, set the `BUILD_GEN-TRAVELTMES-APP` option equal
to true (1) in the CMake command or GUI.
Building
------
The steps to get and build gen-travel-times-app.jar using gradle are as follows:

## Configuration
1. Clone neic-glass3.
2. Open a command window and change directories to /neic-glass3/gen-travel-times-app/
3. To build the jar file, run the command `./gradlew build`

An example configuration for **gen-travel-times-app** is available in the [gen-travel-times-app params directory](https://github.com/usgs/neic-glass3/tree/master/gen-travel-times-app/params)
Using
-----
Once you are able to build the gen-travel-times-app jar, simply include the jar
file in your application, or call using the App class.

## Running
A set of model files used by the gen-travel-times-app is stored in the models/ directory.

To run **gen-travel-times-app**, use the following command: `gen-travel-times-app <configfile> [logname]` where `<configfile>` is the required path the the gen-travel-times.d configuration file and `[logname]` is an optional command that when present specifies the log file name and enables logging.
Example configuration files are included in `/neic-glass3/gen-travel-times-app/src/main/resources/`

For more information, please see the [gen-travel-times-app DOxygen documentation](https://usgs.github.io/neic-glass3/html/gen-travel-times-app_8cpp.html)
To run this example, run from `/neic-glass3/gen-travel-times-app/` run the command: `java -jar build/libs/gen-travel-times-app-0.1.0.jar --configFile=src/main/resources/config.json`
76 changes: 76 additions & 0 deletions gen-travel-times-app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.4.1/userguide/tutorial_java_projects.html
*/

plugins {
// Apply the java plugin to add support for Java
id 'java'

// Apply the application plugin to add support for building an application
id 'application'

// google java format
id 'com.github.sherter.google-java-format' version '0.8'
}

sourceCompatibility = '1.10'
targetCompatibility = '1.10'
version = '0.1.0'

repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}

dependencies {
// This dependency is found on compile classpath of this component and consumers.
implementation 'com.google.guava:guava:27.0.1-jre'

// com.googlecode.json.simple
compile "com.googlecode.json-simple:json-simple:1.1.1"

// Use JUnit test framework
testImplementation 'junit:junit:4.12'

// neic traveltimes
compile files('lib/neic-traveltime-0.1.0.jar')

// https://mvnrepository.com/artifact/log4j/log4j
compile group: 'log4j', name: 'log4j', version: '1.2.17'
}

// always format to google style prior to the build
//compileJava.dependsOn 'googleJavaFormat'

// Google java style is checked automatically as part of the check task
// Note: To reformat all java code (not in lib) into the
// google java style, run ./gradlew goJF
project.tasks.check.dependsOn(verifyGoogleJavaFormat)

// set jar entry point
jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'gov.usgs.GenTravelTimes.App'
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}

// Define the main class for the application
mainClassName = 'gov.usgs.GenTravelTimes.App'

// show compile warnings
tasks.withType(JavaCompile) {
options.setDeprecation(true);
options.setWarnings(true);
}

Loading

0 comments on commit 1ee5a9f

Please sign in to comment.