Skip to content

Commit 7a164e6

Browse files
author
Fredrik Jadebeck
committed
Release v2.0.0
- Move examples to bin - Add sampling app with improved command-line interface for uniform sampling - Replace HDF5 Backend with HighFive for stable HDF5 parsing - Add FindSBML - Restructure thirdparty headers - Update FindGurobi - Update Readme - Replace Google Test by Boost unit tests. This should speed up building. - Fix small bug in csvreader
1 parent 6387bfa commit 7a164e6

3,217 files changed

Lines changed: 103164 additions & 11059 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "include/hops/thirdparty/HighFive"]
2+
path = include/hops/thirdparty/HighFive
3+
url = https://github.com/BlueBrain/HighFive.git

.travis.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,28 @@ compiler:
1313
before_install:
1414
- sudo apt-get update -y
1515
- sudo apt-get install -y apt-utils
16-
- sudo apt-get install -y build-essential software-properties-common libssl-dev
17-
- sudo apt-get install -y libeigen3-dev liblpsolve55-dev lp-solve libncursesw5-dev
18-
- sudo apt-get install -y libxerces-c-dev libhdf5-dev doxygen libncurses5-dev libsuitesparse-dev
19-
- sudo apt-get install -y libsbml5-dev git bzip2 libbz2-dev libsbml5-dev
20-
- sudo apt-get install -y coinor-clp coinor-libclp-dev
21-
- sudo snap install cmake --classic
16+
- sudo apt-get install -y build-essential
17+
- sudo apt-get install -y software-properties-common
18+
- sudo apt-get install -y cmake
19+
- sudo apt-get install -y libeigen3-dev
20+
- sudo apt-get install -y libhdf5-dev
21+
- sudo apt-get install -y doxygen
22+
- sudo apt-get install -y libsbml5-dev
23+
- sudo apt-get install -y libmpich-dev
24+
- sudo apt-get install -y libbz2-dev
25+
- sudo apt-get install -y coinor-libclp-dev
26+
- sudo apt-get install -y libboost-all-dev
2227

2328
script:
29+
- /usr/bin/mpiexec --help
2430
- mkdir -p cmake-build-debug
2531
- cd cmake-build-debug
26-
- /snap/cmake/current/bin/cmake -DHOPS_BENCHMARKS=OFF ..
32+
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DHOPS_BENCHMARKS=OFF -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu
2733
- make
2834
- travis_wait 30 make test
2935
- cd ..
3036
- mkdir -p cmake-build-release
3137
- cd cmake-build-release
32-
- /snap/cmake/current/bin/cmake -DCMAKE_BUILD_TYPE=Release -DHOPS_BENCHMARKS=OFF ..
38+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DHOPS_BENCHMARKS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu
3339
- make
3440
- travis_wait 30 make test

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
99

1010
if (UNIX)
1111
message(STATUS "Adjusting CMAKE_PREFIX_PATH on UNIX for CLP")
12-
list(APPEND CMAKE_PREFIX_PATH /usr/lib/x85_64-linux-gnu)
12+
list(APPEND CMAKE_PREFIX_PATH /usr/lib/x86_64-linux-gnu)
1313
endif (UNIX)
1414

1515
########################################################################################################################
@@ -42,7 +42,6 @@ option(HOPS_TESTS "Enables compilation of unit tests. Use -DHOPS_TESTS=OFF to di
4242
# C++-Compiler Settings
4343
########################################################################################################################
4444

45-
# TODO update to target_compile_feature and target_compile_option
4645
set(CMAKE_C_FLAGS "${CMAKE_FLAGS} ${MPI_FLAGS}")
4746
set(CMAKE_CXX_STANDARD 17)
4847
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_FLAGS}")
@@ -102,17 +101,17 @@ endif (MKL_LIBRARY_DIR)
102101
# HOPS
103102
########################################################################################################################
104103

105-
add_library(hops STATIC "")
104+
add_library(hops STATIC "" include/hops/FileReader/Hdf5Reader.hpp)
106105
target_include_directories(hops PUBLIC ${EIGEN3_INCLUDE_DIR})
107106

108107
if (MKL_INCLUDE_DIR)
109-
target_include_directories(hops PUBLIC ${MKL_INCLUDE_DIR})
108+
target_include_directories(hops PRIVATE ${MKL_INCLUDE_DIR})
110109
endif (MKL_INCLUDE_DIR)
111110
if (MKL_LIBRARY_DIR)
112-
target_link_directories(hops PUBLIC ${MKL_LIBRARY_DIR})
111+
target_link_directories(hops PRIVATE ${MKL_LIBRARY_DIR})
113112
endif (MKL_LIBRARY_DIR)
114113
if (MKL_LIBRARIES)
115-
target_link_libraries(hops PUBLIC ${MKL_LIBRARIES})
114+
target_link_libraries(hops PRIVATE ${MKL_LIBRARIES})
116115
endif (MKL_LIBRARIES)
117116

118117
add_subdirectory(include)
@@ -165,7 +164,7 @@ endif ()
165164

166165
if (HOPS_EXAMPLES)
167166
message(STATUS "Enabled compilation of examples. Use -DHOPS_EXAMPLES=OFF to disable.")
168-
add_subdirectory(examples)
167+
add_subdirectory(bin)
169168
else ()
170169
message(STATUS "Disabled compilation of examples. Use -DHOPS_EXAMPLES=ON to enable.")
171170
endif ()
@@ -188,7 +187,7 @@ endif ()
188187
########################################################################################################################
189188

190189
if (HOPS_BENCHMARKS OR HOPS_EXAMPLES OR HOPS_TESTS)
191-
message(STATUS "Copying resources.")
190+
message(STATUS "Copying resources")
192191
add_subdirectory(resources)
193192
endif ()
194193

@@ -198,6 +197,7 @@ endif ()
198197

199198
install(DIRECTORY include/ DESTINATION include/ FILES_MATCHING PATTERN "*.hpp")
200199
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hops/hops.hpp DESTINATION include/hops)
200+
install(TARGETS hops-sampler DESTINATION bin/)
201201
install(TARGETS hops EXPORT hops-config LIBRARY DESTINATION "lib")
202202
install(EXPORT hops-config DESTINATION "lib" CONFIGURATIONS RELEASE)
203203

Dockerfile

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,42 @@ LABEL Maintainer="Johann Fredrik Jadebeck <johann.fredrik@jadebeck.dev>"
44
ARG DEBIAN_FRONTEND=noninteractive
55
RUN apt-get update -y
66
RUN apt-get install -y apt-utils
7-
RUN apt-get install -y build-essential software-properties-common cmake libeigen3-dev \
8-
liblpsolve55-dev lp-solve libxerces-c-dev libhdf5-dev doxygen libncurses5-dev libncursesw5-dev \
9-
libsbml5-dev mpich libmpich-dev git
10-
RUN apt-get install -y bzip2 libbz2-dev
11-
RUN apt-get install -y coinor-clp coinor-libclp-dev
7+
RUN apt-get install -y build-essential
8+
RUN apt-get install -y software-properties-common
9+
RUN apt-get install -y cmake
10+
RUN apt-get install -y libeigen3-dev
11+
RUN apt-get install -y libhdf5-dev
12+
RUN apt-get install -y doxygen
13+
RUN apt-get install -y libsbml5-dev
14+
RUN apt-get install -y libmpich-dev
15+
#RUN apt-get install -y libbz2-dev
16+
#RUN apt-get install -y coinor-libclp-dev
17+
RUN apt-get install -y libboost-all-dev
1218

13-
WORKDIR /home
19+
RUN useradd -ms /bin/bash hops_user
20+
USER hops_user
1421

15-
ADD benchmarks /home/benchmarks
16-
ADD cmake /home/cmake
17-
ADD docs /home/docs
18-
ADD examples /home/examples
19-
ADD include /home/include
20-
ADD resources /home/resources
21-
ADD src /home/src
22-
ADD tests /home/tests
23-
ADD CMakeLists.txt /home/CMakeLists.txt
22+
WORKDIR /home/hops_user
2423

25-
RUN mkdir cmake-build-debug
26-
RUN mkdir cmake-build-release
24+
ADD bin /home/hops_user/bin
25+
ADD benchmarks /home/hops_user/benchmarks
26+
ADD cmake /home/hops_user/cmake
27+
ADD docs /home/hops_user/docs
28+
ADD include /home/hops_user/include
29+
ADD resources /home/hops_user/resources
30+
ADD src /home/hops_user/src
31+
ADD tests /home/hops_user/tests
32+
ADD CMakeLists.txt /home/hops_user/CMakeLists.txt
2733

28-
WORKDIR /home/cmake-build-debug
29-
RUN cmake .. -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu
30-
RUN make -j4
31-
RUN make test ARGS=j4
34+
RUN mkdir cmake-build-debug
35+
WORKDIR /home/hops_user/cmake-build-debug
36+
RUN cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu
37+
RUN make -j8
38+
RUN make test
3239

33-
WORKDIR /home/cmake-build-release
40+
WORKDIR /home/hops_user/
41+
RUN mkdir cmake-build-release
42+
WORKDIR /home/hops_user/cmake-build-release
3443
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu
35-
RUN make -j4
36-
RUN make test ARGS=j4
44+
RUN make -j8
45+
RUN make test

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ Test data from the application note is downloadable at https://doi.org/10.26165/
1414

1515
See https://modsim.github.io/hops/.
1616

17+
## Cloning from Github
18+
19+
HOPS contains git submodules that point to third-party libraries.
20+
For this reason, HOPS should be fetched recursively:
21+
22+
```
23+
git clone git@github.com:modsim/hops.git --recursive
24+
```
25+
1726
## Installation
1827

1928
HOPS uses CMake as build system.

bin/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
if (HOPS_MPI_SUPPORTED)
2+
set(BIN_SOURCES ${EXAMPLE_SOURCES} ParallelTemperingDemo.cpp)
3+
endif (HOPS_MPI_SUPPORTED)
4+
5+
foreach (BIN_SOURCE ${EXAMPLE_SOURCES})
6+
get_filename_component(BIN_NAME ${EXAMPLE_SOURCE} NAME_WE)
7+
add_executable(${BIN_NAME} ${EXAMPLE_SOURCE})
8+
target_link_libraries(${BIN_NAME} hops)
9+
target_include_directories(${BIN_NAME} PUBLIC ../include)
10+
endforeach (BIN_SOURCE)
11+
12+
find_package(Boost COMPONENTS program_options REQUIRED)
13+
add_executable(hops-sampler hops-sampler.cpp hops-sampler.hpp)
14+
target_link_libraries(hops-sampler hops ${Boost_LIBRARIES})
15+
target_include_directories(hops-sampler PUBLIC
16+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include/${LIBRARY_NAME}>
17+
$<INSTALL_INTERFACE:../include/${LIBRARY_NAME}>
18+
)
19+
20+
21+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int main(int argc, char **argv) {
5252
} else {
5353
std::unique_ptr<hops::LinearProgram> linearProgram = hops::LinearProgramFactory::createLinearProgram(
5454
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>(A.cast<double>()),
55-
b.cast<double>());
55+
b.cast<double>();
5656
startingPoint = linearProgram->calculateChebyshevCenter().optimalParameters.cast<RealType>();
5757
}
5858

@@ -124,7 +124,7 @@ int main(int argc, char **argv) {
124124
std::cout << "Current step size: " << markovChain->getAttribute(hops::MarkovChainAttribute::STEP_SIZE) << std::endl;
125125

126126
auto fileWriter = hops::FileWriterFactory::createFileWriter(std::string(argv[8]) + "_" + markovChain->getName(),
127-
hops::FileWriterType::Csv);
127+
hops::FileWriterType::CSV);
128128
markovChain->draw(randomNumberGenerator, numberOfSamples, thinning);
129129
markovChain->writeHistory(fileWriter.get());
130130
markovChain->clearHistory();

0 commit comments

Comments
 (0)