Skip to content

Commit

Permalink
Merge pull request #68 from JeffersonLab/release-v2.0.0
Browse files Browse the repository at this point in the history
Release v2.0.0
  • Loading branch information
wdconinc authored May 25, 2018
2 parents c45cfb3 + af3e8ae commit 5006e77
Show file tree
Hide file tree
Showing 231 changed files with 105,026 additions and 5,828 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
map_directory

32 changes: 30 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
images

# output from createHTML
_remoll_*.html

# backups etc
*~
*.swp

# Mac
*.DS_Store

#ignore doxygen files for now
Expand All @@ -19,11 +27,31 @@ include/gitinfo.hh
#ignore kdev files
*.kdev4

#install directories
bin
lib
share

#ignore build and map directory
build*
bldXcode
map_directory

#ignore log and rootfiles directory
#ignore rad_dose radiation analysis work (another repository on sbujlab github)
rad_analysis

#ignore log files directory
log
rootfiles

#ignore project files for eclipse
.cproject
.project

#ignore dot files
*.dot

#sample_gdml output
sample_gdml.*

#ignore log files
*.log
31 changes: 24 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,37 @@ dist: trusty
language: cpp
sudo: required
compiler: gcc
services:
- docker

before_install:
- sudo apt-add-repository -y ppa:wdconinc/ppa-trusty
- sudo apt-get update -y
- sudo apt-get install -y cmake3 root-system libgeant4-dev
- sudo install-geant4-data all
- sudo install-geant4-data all 2>&1 | grep -v -F ".........."

script:
- mkdir build
- pushd build && cmake .. 2>&1 | tee -a ../remollbuild.log && popd
- pushd build && make 2>&1 | tee -a ../remollbuild.log && popd
- mkdir map_directory
- wget --directory-prefix=map_directory http://hallaweb.jlab.org/12GeV/Moller/downloads/remoll/blockyHybrid_rm_3.0.txt
- wget --directory-prefix=map_directory http://hallaweb.jlab.org/12GeV/Moller/downloads/remoll/blockyUpstream_rm_1.1.txt
- source geant4.sh && scripts/tests/test_macros.sh 2>&1 | tee remolltest.log
- tar -czvf remolltest.root.tar.gz rootfiles/tests/*.root
- tar -czvf remolltest.log.tar.gz logfiles/tests/*.log remolltest.log
- tar -czvf remolltest.png.tar.gz rootfiles/tests/analysis/*.png
- wget --directory-prefix=map_directory http://hallaweb.jlab.org/12GeV/Moller/downloads/remoll/blockyHybrid_rm_3.0.txt 2>&1 | grep -v -F ".........."
- wget --directory-prefix=map_directory http://hallaweb.jlab.org/12GeV/Moller/downloads/remoll/blockyUpstream_rm_1.1.txt 2>&1 | grep -v -F ".........."
- source geant4.sh && scripts/tests/test_macros.sh unit 2>&1 | tee remolltest_unit.log
- source geant4.sh && scripts/tests/test_macros.sh commit 2>&1 | tee remolltest_commit.log
- source geant4.sh && scripts/tests/test_macros.sh release 2>&1 | tee remolltest_release.log
- tar -czvf remolltest.root.tar.gz rootfiles/tests/release/*.root rootfiles/tests/release/analysis/*.root
- tar -czvf remolltest.log.tar.gz logfiles/tests/release/*.log logfiles/tests/release/analysis/*.log
- tar -czvf remolltest.png.tar.gz rootfiles/tests/release/analysis/*.png
- docker build -t jeffersonlab/remoll .

after_success:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker tag jeffersonlab/remoll jeffersonlab/remoll:latest && docker push jeffersonlab/remoll:latest;
else
docker tag jeffersonlab/remoll jeffersonlab/remoll:$TRAVIS_BRANCH && docker push jeffersonlab/remoll:$TRAVIS_BRANCH;
fi

deploy:
provider: releases
Expand All @@ -29,10 +42,14 @@ deploy:
- build/remoll
- build/libremollroot.so
- remollbuild.log
- remolltest_unit.log
- remolltest_commit.log
- remolltest_release.log
- remolltest.root.tar.gz
- remolltest.log.tar.gz
- remolltest.png.tar.gz
skip_cleanup: true
on:
repo: JeffersonLab/remoll
tags: true

69 changes: 31 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(REMOLL)

# Default install path is the source directory
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(STATUS " Install-prefix was at default -> forcing it to the source-dir" )
message(STATUS " Use -DCMAKE_INSTALL_PREFIX=/usr/local to set to something else" )
set (CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}"
CACHE PATH "default install path" FORCE )
endif()

#MAC specific variable
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_MACOSX_RPATH ON)
Expand All @@ -30,9 +38,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)

ROOT_GENERATE_DICTIONARY(
remollDict # path to dictionary to generate
"include/remollRunData.hh" # list of classes to process
"include/remolltypes.hh" # list of classes to process
"include/remollRunData.hh"
"include/remollTextFile.hh"
LINKDEF "include/remollLinkDef.h" # ROOT linkDef file
OPTIONS -p
)

#----------------------------------------------------------------------------
Expand Down Expand Up @@ -73,6 +83,11 @@ include(${Geant4_USE_FILE})
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -g -Woverloaded-virtual")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -g -Wno-shadow -Wno-pedantic")

# Ignore warning of struct initialization { } for gcc < 5.0 (after that it is ignored internally)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
endif()

# C++11 standard if avialable
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
Expand All @@ -92,24 +107,27 @@ endif()

include_directories(${PROJECT_SOURCE_DIR}/include ${ROOT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include)


#----------------------------------------------------------------------------
# Locate sources and headers for this project
# NB: headers are included so they will show up in IDEs
#
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/remoll*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)

file(GLOB libsources ${PROJECT_SOURCE_DIR}/src/remollRunData.cc ${PROJECT_SOURCE_DIR}/src/remollTextFile.cc)
file(GLOB libheaders ${PROJECT_SOURCE_DIR}/include/*.hh)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/remoll*.hh)

#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(remoll remoll.cc ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh ${sources} ${headers} remollDict.cxx)
add_library(remollroot SHARED ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh ${libsources} ${libheaders} remollDict.cxx)
target_link_libraries(remoll ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} ${Boost_LIBRARIES} )
target_link_libraries(remollroot ${ROOT_LIBRARIES} ${Boost_LIBRARIES} )
add_library(remoll-lib SHARED ${sources} ${headers} ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh remollDict.cxx)
set_target_properties(remoll-lib PROPERTIES OUTPUT_NAME remoll)
target_link_libraries(remoll-lib ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} ${Boost_LIBRARIES} )

add_executable(remoll-bin remoll.cc)
set_target_properties(remoll-bin PROPERTIES OUTPUT_NAME remoll)
target_link_libraries(remoll-bin remoll-lib)

add_executable(reroot-bin reroot.cc)
set_target_properties(reroot-bin PROPERTIES OUTPUT_NAME reroot)
target_link_libraries(reroot-bin remoll-lib)

#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
Expand All @@ -120,32 +138,6 @@ target_link_libraries(remollroot ${ROOT_LIBRARIES} ${Boost_LIBRARIES} )
FILE( GLOB REMOLL_GEO "geometry/*" )

set(REMOLL_SCRIPTS
geometry/mollerMother.gdml
geometry/detectorDaughter.gdml
geometry/hybridDaughter.gdml
geometry/targetDaughter.gdml
geometry/upstreamDaughter.gdml
geometry/schema/gdml.xsd
geometry/schema/gdml_core.xsd
geometry/schema/gdml_define.xsd
geometry/schema/gdml_extensions.xsd
geometry/schema/gdml_materials.xsd
geometry/schema/gdml_parameterised.xsd
geometry/schema/gdml_replicas.xsd
geometry/schema/gdml_solids.xsd
geometry_sculpt/mollerMother.gdml
geometry_sculpt/detectorDaughter.gdml
geometry_sculpt/hybridDaughter.gdml
geometry_sculpt/targetDaughter.gdml
geometry_sculpt/upstreamDaughter.gdml
geometry_sculpt/schema/gdml.xsd
geometry_sculpt/schema/gdml_core.xsd
geometry_sculpt/schema/gdml_define.xsd
geometry_sculpt/schema/gdml_extensions.xsd
geometry_sculpt/schema/gdml_materials.xsd
geometry_sculpt/schema/gdml_parameterised.xsd
geometry_sculpt/schema/gdml_replicas.xsd
geometry_sculpt/schema/gdml_solids.xsd
vis/OIX.mac
vis/Qt.mac
vis/vis.mac
Expand All @@ -167,11 +159,12 @@ endforeach()
# For internal Geant4 use - but has no effect if you build this
# example standalone
#
add_custom_target(REMOLL DEPENDS remoll)
add_custom_target(REMOLL DEPENDS remoll-bin)

#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS remoll DESTINATION bin)
install(TARGETS remoll-bin reroot-bin DESTINATION bin)
install(TARGETS remoll-lib DESTINATION lib)


31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM jeffersonlab/jlabce:2.1

ENV JLAB_VERSION=2.1
ENV JLAB_ROOT=/jlab
ENV JLAB_SOFTWARE=/jlab/2.1/Linux_CentOS7.3.1611-x86_64-gcc4.8.5

ENV REMOLL=$JLAB_SOFTWARE/remoll

WORKDIR $REMOLL
# Compile remoll
# RUN git clone https://github.com/jeffersonlab/remoll $REMOLL
ADD . .
RUN source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh && \
mkdir -p $REMOLL/build && cd $REMOLL/build && cmake .. && make

# Download the map data files and place them in the correct directory
RUN wget -r --no-parent -l1 -A txt http://hallaweb.jlab.org/12GeV/Moller/downloads/remoll/
RUN mkdir map_directory && \
find ./hallaweb.jlab.org -mindepth 2 -type f -exec mv -t ./map_directory -i '{}' + && \
rm -rf hallaweb.jlab.org

# Create entry point bash script
RUN echo '#!/bin/bash' > /entrypoint.sh && \
echo 'unset OSRELEASE' >> /entrypoint.sh && \
echo 'source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh' >> /entrypoint.sh && \
echo 'cd $REMOLL && exec ./build/remoll $1' >> /entrypoint.sh && \
chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["macros/runexample.mac"]

124 changes: 124 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# remoll: Simulation for the 12 GeV MOLLER Experiment at Jefferson Lab

[![Build Status](https://travis-ci.org/JeffersonLab/remoll.svg?branch=develop)](https://travis-ci.org/JeffersonLab/remoll)

## Contact information

The development of remoll is coordinated on the mailing list
12gevmoller_sim@jlab.org which you can subscribe to [here](https://mailman.jlab.org/mailman/listinfo/12gevmoller_sim).

There is a [slack channel](https://jlab12gev.slack.com) available for general discussion and questions. In particular, the `#moller_simulation` and `#moller_simulation_dev` channels are used for topics related to this project.


## Dependencies

The following packages are required to build `remoll`:
* cmake > 2.6
* Geant4 >= 4.9.6
* ROOT
* Python
* git (optional)
* boost (optional)


## Build instructions

To build, create the directory you would like to build in, say `build`:
```
mkdir build
cd build
cmake ..
make
```

## Magnetic field maps

Magnetic field maps are **required** to use the software and are available for download [here](http://hallaweb.jlab.org/12GeV/Moller/downloads/remoll/).


## Running remoll

An example macro will be found in `macros/`, in particular the
macro `runexample.mac` will be instructive for new users.

You need to load `libremollroot.so` if you want to access
the classes written out to the ROOT files. Building
remoll will create a rootlogon.C which will do this
automatically.

To execute remoll, run `build/remoll` from inside the source
directory. This should bring up a graphical command interface.

To load and visualize the default geometry, use the following
macro commands:
```
/run/initialize
/control/execute vis/Qt.mac
```
You can also load another macro in the `vis` directory, if
you prefer another visualization driver.


## Troubleshooting

### Missing gitinfo.hh

If you get errors about a missing `gitinfo.hh` file during building, try again
```
cmake ..
make
```

### LLVM SYMBOLS ARE EXPOSED TO CLING

You may encounter the following error message when running in graphical mode:
```
Error in <UnknownClass::InitInterpreter()>: LLVM SYMBOLS ARE EXPOSED TO CLING!
This will cause problems; please hide them or dlopen() them after the call to
TROOT::InitInterpreter()!
```
This is a [known issue](https://github.com/JeffersonLab/remoll/issues/40). A
workaround is to run remoll with OpenGL disabled:
```
LIBGL_ALWAYS_INDIRECT=1 build/remoll
```

## Docker container

**Note**: This image will allow you to use remoll in batch mode only. A separate image supporting the GUI mode will be available soon.

### Building

```
sudo docker build -t remoll .
```

### Running

You can use a prebuilt image [available on Docker Hub](https://hub.docker.com/r/jeffersonlab/remoll/).

```
docker run --rm \
-v `pwd`/output:/jlab/2.1/Linux_CentOS7.3.1611-x86_64-gcc4.8.5/remoll/rootfiles/ \
jeffersonlab/remoll [macro to run]
```

The ROOT files produced by remoll will be present in the output directory.

## Singularity container

### Building

```
sudo singularity build remoll.img Singularity
```

## Running

```
singularity pull shub://jeffersonlab/remoll-singularity
singularity run --bind `pwd`:/jlab/2.1/Linux_CentOS7.3.1611-x86_64-gcc4.8.5/remoll/rootfiles/ \
jeffersonlab-remoll-singularity-master.simg \
macros/tests/test_moller.mac
```

Loading

0 comments on commit 5006e77

Please sign in to comment.