Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare next major release #2

Merged
merged 1 commit into from
Jul 13, 2021
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "include/hops/thirdparty/HighFive"]
path = include/hops/thirdparty/HighFive
[submodule "include/hops/Third-party/HighFive"]
path = include/hops/Third-party/HighFive
url = https://github.com/BlueBrain/HighFive.git
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: true

env:
global:
- MAKEFLAGS="-j 2"
- MAKEFLAGS="-j 3"

language: cpp

Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Johann Fredrik Jadebeck <j.jadebeck@fz-juelich.de>
Samuel Leweke <s.leweke@fz-juelich.de>
Axel Theorell <a.theorell@fz-juelich.de>
Katharina Nöh <k.noeh@fz-juelich.de>
Richard D. Paul <r.paul@fz-juelich.de>
95 changes: 71 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
########################################################################################################################
# CMAKE Settings
########################################################################################################################
# CMAKE Settings ########################################################################################################################

cmake_minimum_required(VERSION 3.14)
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
Expand Down Expand Up @@ -33,10 +32,15 @@ set(MKL_USE_interface lp64)
# Set Options
########################################################################################################################

option(HOPS_SBML_SUPPORT "Enables SBML support. Use -DHOPS_SBML_SUPPORT=ON to enable." OFF)
option(HOPS_HDF5_SUPPORT "Enables HDF5 support with HighFive. Use -DHOPS_HDF5_SUPPORT=ON to enable." OFF)
option(HOPS_BENCHMARKS "Enables compilation of Benchmarks (Requires Celero). Use -DHOPS_BENCHMARKS=ON to enable." OFF)
option(HOPS_DOCS "Enables generation of documentation. Use -DHOPS_DOCS=OFF to disable." ON)
option(HOPS_EXAMPLES "Enables compilation of Examples. Use -DHOPS_EXAMPLES=OFF to disable." ON)
option(HOPS_BINARIES "Enables compilation of hops executables. Use -DHOPS_BINARIES=OFF to disable." ON)
option(HOPS_TESTS "Enables compilation of unit tests. Use -DHOPS_TESTS=OFF to disable." ON)
option(HOPS_NO_INSTALL "Disables installation. Use -DHOPS_NO_INSTALL=ON to disable installation." OFF)
set(HOPS_LIBRARY_TYPE SHARED CACHE STRING "Type of library to build. Options are HEADER_ONLY, STATIC or SHARED")
set_property(CACHE HOPS_LIBRARY_TYPE PROPERTY STRINGS HEADER_ONLY STATIC SHARED)

########################################################################################################################
# C++-Compiler Settings
Expand Down Expand Up @@ -86,6 +90,7 @@ endif (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
find_package(Doxygen)
find_package(Eigen3 REQUIRED)
find_package(MKL)
find_package(OpenMP)
message(STATUS "FOUND MKL ? ${MKL_FOUND}")

########################################################################################################################
Expand All @@ -101,22 +106,58 @@ endif (MKL_LIBRARY_DIR)
# HOPS
########################################################################################################################

add_library(hops STATIC "" include/hops/FileReader/Hdf5Reader.hpp)
target_include_directories(hops PUBLIC ${EIGEN3_INCLUDE_DIR})
if (HOPS_LIBRARY_TYPE STREQUAL "HEADER_ONLY")
message(STATUS "Set to header-only installation")
set(SCOPE INTERFACE)
add_library(hops INTERFACE)

target_compile_definitions(hops INTERFACE HOPS_HEADER_ONLY)
if (HOPS_HDF5_SUPPORT)
target_compile_definitions(hops INTERFACE HOPS_HDF5_SUPPORT)
endif (HOPS_HDF5_SUPPORT)

target_include_directories(hops INTERFACE ${EIGEN3_INCLUDE_DIR}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
else (HOPS_LIBRARY_TYPE STREQUAL "HEADER_ONLY")
message(STATUS "Set to ${HOPS_LIBRARY_TYPE} library installation")
set(SCOPE PRIVATE)
add_library(hops ${HOPS_LIBRARY_TYPE})
target_compile_definitions(hops ${SCOPE} HOPS_HDF5_SUPPORT)

target_include_directories(hops PUBLIC ${EIGEN3_INCLUDE_DIR}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
endif (HOPS_LIBRARY_TYPE STREQUAL "HEADER_ONLY")

if (OpenMP_CXX_FOUND)
target_link_libraries(hops INTERFACE OpenMP::OpenMP_CXX)
target_link_libraries(hops ${SCOPE} OpenMP::OpenMP_CXX)
target_link_options(hops INTERFACE ${OpenMP_CXX_LIBRARY} ${OpenMP_CXX_FLAGS})
target_link_options(hops ${SCOPE} ${OpenMP_CXX_LIBRARY} ${OpenMP_CXX_FLAGS})
else (OpenMP_CXX_FOUND)
message(WARNING "OPENMP not found.")
endif (OpenMP_CXX_FOUND)


add_subdirectory(include)

########################################################################################################################
# MKL support for faster linear algebra
########################################################################################################################

if (MKL_INCLUDE_DIR)
target_include_directories(hops PRIVATE ${MKL_INCLUDE_DIR})
target_include_directories(hops ${SCOPE} ${MKL_INCLUDE_DIR})
endif (MKL_INCLUDE_DIR)
if (MKL_LIBRARY_DIR)
target_link_directories(hops PRIVATE ${MKL_LIBRARY_DIR})
target_link_directories(hops ${SCOPE} ${MKL_LIBRARY_DIR})
endif (MKL_LIBRARY_DIR)
if (MKL_LIBRARIES)
target_link_libraries(hops PRIVATE ${MKL_LIBRARIES})
target_link_libraries(hops ${SCOPE} ${MKL_LIBRARIES})
endif (MKL_LIBRARIES)

add_subdirectory(include)
add_subdirectory(src)

########################################################################################################################
# HOPS_DOCS
########################################################################################################################
Expand All @@ -129,12 +170,11 @@ if (HOPS_DOCS)
message(STATUS "Enabled Doxygen documentation. Use -DHOPS_DOCS=OFF to disable.")
set(DOCUMENTATION_DIR "docs")

set(HEADER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/hops")
set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")

set(doxy_main_page "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(doxyfile_in "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in")
set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile")
set(doxyfile_in "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in")
set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} && make -C ${CMAKE_CURRENT_BINARY_DIR}/docs/latex
Expand All @@ -159,14 +199,14 @@ else ()
endif ()

########################################################################################################################
# HOPS_EXAMPLES
# HOPS_BINARIES
########################################################################################################################

if (HOPS_EXAMPLES)
message(STATUS "Enabled compilation of examples. Use -DHOPS_EXAMPLES=OFF to disable.")
if (HOPS_BINARIES)
message(STATUS "Enabled compilation of executables. Use -DHOPS_BINARIES=OFF to disable.")
add_subdirectory(bin)
else ()
message(STATUS "Disabled compilation of examples. Use -DHOPS_EXAMPLES=ON to enable.")
message(STATUS "Disabled compilation of executables. Use -DHOPS_BINARIES=ON to enable.")
endif ()

########################################################################################################################
Expand Down Expand Up @@ -195,9 +235,16 @@ endif ()
# Install
########################################################################################################################

install(DIRECTORY include/ DESTINATION include/ FILES_MATCHING PATTERN "*.hpp")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hops/hops.hpp DESTINATION include/hops)
install(TARGETS hops-sampler DESTINATION bin/)
install(TARGETS hops EXPORT hops-config LIBRARY DESTINATION "lib")
install(EXPORT hops-config DESTINATION "lib" CONFIGURATIONS RELEASE)
if(NOT HOPS_NO_INSTALL)
install(DIRECTORY include/ DESTINATION include/ FILES_MATCHING PATTERN "*.hpp")
install(DIRECTORY include/ DESTINATION include/ FILES_MATCHING PATTERN "*.cpp")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hops/hops.hpp DESTINATION include/hops)

if (HOPS_BINARIES)
install(TARGETS hops-sampler DESTINATION bin/)
endif ()

install(TARGETS hops EXPORT hops-config LIBRARY DESTINATION "lib")
install(EXPORT hops-config DESTINATION "lib")
endif()

5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@ ADD cmake /home/hops_user/cmake
ADD docs /home/hops_user/docs
ADD include /home/hops_user/include
ADD resources /home/hops_user/resources
ADD src /home/hops_user/src
ADD tests /home/hops_user/tests
ADD CMakeLists.txt /home/hops_user/CMakeLists.txt

RUN mkdir cmake-build-debug
WORKDIR /home/hops_user/cmake-build-debug
RUN cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu
RUN make -j8
RUN make -j16
RUN make test

WORKDIR /home/hops_user/
RUN mkdir cmake-build-release
WORKDIR /home/hops_user/cmake-build-release
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu
RUN make -j8
RUN make -j16
RUN make test
11 changes: 5 additions & 6 deletions docs/Doxyfile.in → Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ SORT_BY_SCOPE_NAME = NO

STRICT_PROTO_MATCHING = NO

# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
# list. This list is created by putting \todo commands in the documentation.
# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the t0do
# list. This list is created by putting \t0do commands in the documentation.
# The default value is: YES.

GENERATE_TODOLIST = YES
Expand Down Expand Up @@ -772,8 +772,7 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched.

INPUT = @doxy_main_page@ \
@HEADER_DIR@ \
@SOURCE_DIR@
@SOURCE_DIR@

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -1473,7 +1472,7 @@ FORMULA_TRANSPARENT = YES
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

USE_MATHJAX = NO
USE_MATHJAX = YES

# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
Expand Down Expand Up @@ -1661,7 +1660,7 @@ PAPER_TYPE = a4
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.

EXTRA_PACKAGES =
EXTRA_PACKAGES ={amsmath}

# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
Expand Down
52 changes: 29 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

[![Build Status](https://travis-ci.org/modsim/hops.svg?branch=master)](https://travis-ci.org/modsim/hops)


The **H**ighly **O**ptimized **P**olytope **S**ampling toolbox is an open-source C++17
library for efficient and scalable MCMC algorithms for sampling convex-constrained spaces possibly
equipped with arbitrary target functions.

For details and benchmarks see the application note https://doi.org/10.1093/bioinformatics/btaa872.
Test data from the application note is downloadable at https://doi.org/10.26165/JUELICH-DATA/YXLFKJ.


## Documentation

See https://modsim.github.io/hops/.
Documentation, interactive demos and further resources can be found at https://modsim.github.io/hops/.


## Cloning from Github

Expand All @@ -23,54 +24,59 @@ For this reason, HOPS should be fetched recursively:
git clone git@github.com:modsim/hops.git --recursive
```

<img src="hops.png" alt="HOPS Logo" width="500"/>


## Installation

HOPS uses CMake as build system.
See the Dockerfile for a demonstration on installing HOPS and its dependencies on Ubuntu 20.4.

## Python Interface

Python interface is available at https://github.com/modsim/hopsy.


### CMake options

* HOPS\_BENCHMARKS (default OFF) - Enables compilation of Benchmarks (Requires Celero). Use -DHOPS\_BENCHMARKS=ON to enable.
* HOPS\_DOCS (default ON) - Enables generation of documentation. Use -DHOPS\_DOCS=OFF to disable. (This creates the Doxygen file from which the docs have to be generated)
* HOPS\_EXAMPLES (default ON) - Enables compilation of Examples. Use -DHOPS\_EXAMPLES=OFF to disable.
* HOPS\_TESTS (default ON) - Enables compilation of unit tests. Use -DHOPS\_TESTS=OFF to disable.
| Option Name | Default | Description |
| ------------------------- | --------- | --------------------------------------------------------------------------------------------------------- |
| HOPS\_HDF5\_SUPPORT | OFF | Enables HDF5 support with HighFive. Use -DHOPS\_BENCHMARKS=ON to enable. |
| HOPS\_BENCHMARKS | OFF | Enables compilation of Benchmarks (Requires Celero). Use -DHOPS\_BENCHMARKS=ON to enable. |
| HOPS\_DOCS | ON | Enables generation of documentation. Use -DHOPS\_DOCS=OFF to disable. (This creates the Doxygen file fr om which the docs have to be generated) |
| HOPS\_BINARIES | ON | Enables compilation of hops executables. Use -DHOPS\_EXAMPLES=OFF to disable. |
| HOPS\_TESTS | ON | Enables compilation of unit tests. Use -DHOPS\_TESTS=OFF to disable. |
| HOPS\_LIBRARY\_TYPE | SHARED | Type of library to build. Options are HEADER\_ONLY, STATIC or SHARED |

When building HOPS with Tests, an internet connection is required in order to fetch Googletest (https://github.com/google/googletest).

#### Install on Linux:

```
# Create directory for out-of-source build
$ mkdir cmake-build-release
$ cd cmake-build-release
# Run cmake
$ cmake .. -DCMAKE_BUILD_TYPE=Release
# Build HOPS
$ make
# Run Tests
$ make test
# Alternatively run tests by calling runTests
# cd tests
$ ./runTests
$ cd ..
# Install
$ sudo make install
$ mkdir cmake-build-release cd cmake-build-release # create and switch into
# directory for out-of-source build
$ cmake .. -DCMAKE_BUILD_TYPE=Release # run cmake
$ make # build hops
$ make test # run Tests
$ sudo make install # install
```


#### Install on Windows 10:

Use an IDE (e.g. CLion) to parse the project and its CMakeLists.txt.



## Examples

See the examples directory for demonstrations on how to use the library.


## Supported Compilers
* g++
* Clang
* Microsoft Visual C++


## Troubleshooting

* If you run into trouble finding CLP on Linux (e.g. Ubuntu 20.04), try extending the cmake prefix path:
Expand Down
22 changes: 10 additions & 12 deletions bin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
if (HOPS_MPI_SUPPORTED)
set(BIN_SOURCES ${EXAMPLE_SOURCES} ParallelTemperingDemo.cpp)
endif (HOPS_MPI_SUPPORTED)
find_package(MPI)

foreach (BIN_SOURCE ${EXAMPLE_SOURCES})
get_filename_component(BIN_NAME ${EXAMPLE_SOURCE} NAME_WE)
add_executable(${BIN_NAME} ${EXAMPLE_SOURCE})
if (MPI_FOUND)
# set(BIN_SOURCES ParallelTemperingDemo.cpp)
set(BIN_SOURCES )
endif (MPI_FOUND)

foreach (BIN_SOURCE ${BIN_SOURCES})
get_filename_component(BIN_NAME ${BIN_SOURCE} NAME_WE)
add_executable(${BIN_NAME} ${BIN_SOURCE})
target_link_libraries(${BIN_NAME} hops)
target_include_directories(${BIN_NAME} PUBLIC ../include)
endforeach (BIN_SOURCE)

find_package(Boost COMPONENTS program_options REQUIRED)
add_executable(hops-sampler hops-sampler.cpp hops-sampler.hpp)
target_link_libraries(hops-sampler hops ${Boost_LIBRARIES})
target_include_directories(hops-sampler PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include/${LIBRARY_NAME}>
$<INSTALL_INTERFACE:../include/${LIBRARY_NAME}>
)
target_link_libraries(hops-sampler PRIVATE hops ${Boost_LIBRARIES})



Loading