Skip to content

Commit 1dfbbeb

Browse files
authored
Merge branch 'master' into master
2 parents 9b8f038 + 9c4458f commit 1dfbbeb

File tree

5 files changed

+58
-76
lines changed

5 files changed

+58
-76
lines changed

.travis.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
language: cpp
22
sudo: required
3-
group: travis_lts
4-
dist: xenial
5-
6-
os:
7-
- linux
8-
- osx
93

104
matrix:
115
include:
6+
- os : linux
7+
dist: xenial
128
- os : osx
13-
osx_image: xcode10
9+
osx_image: xcode10.1
1410

1511
notifications:
1612
email:

.travis/travis_build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ if type $PYTHON3 > /dev/null; then
5959
# GSL.
6060
(
6161
mkdir -p _GSL_BUILD_PY3 && cd _GSL_BUILD_PY3 && \
62-
cmake -DPYTHON_EXECUTABLE="$PYTHON3" -DDEBUG=ON ..
62+
cmake -DWITH_NSDF=ON -DPYTHON_EXECUTABLE="$PYTHON3" -DDEBUG=ON ..
6363
$MAKE && ctest --output-on-failure -E ".*socket_streamer.*"
6464
)
6565

6666
# BOOST
6767
(
6868
mkdir -p _BOOST_BUILD_PY3 && cd _BOOST_BUILD_PY3 && \
69-
cmake -DWITH_BOOST_ODE=ON -DPYTHON_EXECUTABLE="$PYTHON3" ..
69+
cmake -DWITH_NSDF=ON -DWITH_BOOST_ODE=ON -DPYTHON_EXECUTABLE="$PYTHON3" ..
7070
$MAKE && ctest --output-on-failure -E ".*socket_streamer.*"
7171
)
7272
echo "All done"

.travis/travis_prepare_linux.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ apt-get install -qq python3-lxml python-lxml
2727
apt-get install -qq python3-numpy python3-matplotlib python3-dev
2828
apt-get install -qq python-pip python3-pip
2929
apt-get install -qq python-tk python3-tk
30-
apt-get install -qq libgraphviz-dev
30+
apt-get install -qq libgraphviz-dev
3131

3232
# Gsl
3333
apt-get install -qq libgsl0-dev || apt-get install -qq libgsl-dev
3434

35+
# hdf5
36+
apt-get install -qq libhdf5-serial-dev
37+
3538
# Boost related.
3639
apt-get install -qq liblapack-dev
3740
apt-get install -qq libboost-all-dev

CMakeLists.txt

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -181,72 +181,6 @@ if(WITH_BOOST_ODE)
181181
add_definitions(-DUSE_BOOST_ODE -UUSE_GSL)
182182
endif()
183183

184-
# NSDF5 support. Disabled by default.
185-
if(WITH_NSDF)
186-
find_package(HDF5 COMPONENTS CXX HL)
187-
if(NOT HDF5_FOUND)
188-
message(
189-
"==================================================================\n"
190-
" HDF5 not found. Disabling NSDF support.\n\n"
191-
" If you need NSDF support, please install hdf5-dev or hdf5-devel\n"
192-
" package or equivalent.\n\n"
193-
" $ sudo apt-get install libhdf5-dev \n"
194-
" $ sudo yum install libhdf5-devel \n"
195-
" $ brew install hdf5 \n\n"
196-
" Otherwise, continue with 'make' and 'make install' \n"
197-
" If you install hdf5 to non-standard path, export environment \n"
198-
" variable HDF5_ROOT to the location. Rerun cmake \n"
199-
"================================================================ \n"
200-
)
201-
endif(NOT HDF5_FOUND)
202-
203-
if(HDF5_FOUND)
204-
include_directories( ${HDF5_INCLUDE_DIRS} )
205-
add_definitions( -DUSE_HDF5 -DENABLE_NSDF )
206-
if(HDF5_USE_STATIC_LIBRARIES)
207-
message(STATUS "Finding static HDF5 libraries in $ENV{HDF5_ROOT}")
208-
find_library(HDF5_CXX_LIBRARIES NAMES libhdf5.a
209-
PATHS $ENV{HDF5_ROOT}/lib $ENV{HDF5_ROOT}/lib64
210-
)
211-
find_library(HDF5_HL_LIBRARIES NAMES libhdf5_hl.a
212-
PATHS $ENV{HDF5_ROOT}/lib $ENV{HDF5_ROOT}/lib64
213-
)
214-
set(HDF5_LIBRARIES ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES})
215-
endif()
216-
217-
218-
# Make sure, HDF5_HL_LIBRARIES are set. The COMPONENTS in find_package may
219-
# or may not work. See BhallaLab/moose-core#163.
220-
if(NOT HDF5_HL_LIBRARIES)
221-
set(HDF5_HL_LIBRARIES ${HDF5_HL_LIBRARIES})
222-
endif(NOT HDF5_HL_LIBRARIES)
223-
list(APPEND HDF5_LIBRARIES ${HDF5_HL_LIBRARIES})
224-
225-
# message(STATUS "MOOSE will use following HDF5 ${HDF5_LIBRARIES}" )
226-
foreach(HDF5_LIB ${HDF5_LIBRARIES})
227-
if(HDF5_LIB)
228-
get_filename_component( HDF5_LIB_EXT ${HDF5_LIB} EXT )
229-
if(HDF5_LIB_EXT)
230-
if(${HDF5_LIB_EXT} STREQUAL ".a")
231-
list(APPEND STATIC_LIBRARIES ${HDF5_LIB} )
232-
else( )
233-
list(APPEND SYSTEM_SHARED_LIBS ${HDF5_LIB} )
234-
endif( )
235-
endif()
236-
endif( )
237-
endforeach( )
238-
else( HDF5_FOUND )
239-
message(STATUS "HDF5 is not found" )
240-
endif( HDF5_FOUND )
241-
# This is a fix for new HDF5 package on Debian/Ubuntu which installs hdf5
242-
# headers in non-standard path. issue #80.
243-
if(HDF5_LIBRARY_DIRS)
244-
set_target_properties( libmoose PROPERTIES LINK_FLAGS "-L${HDF5_LIBRARY_DIRS}" )
245-
endif()
246-
else(WITH_NSDF)
247-
message(STATUS "NSDF support is disabled" )
248-
endif(WITH_NSDF)
249-
250184
# Openmpi
251185
if(WITH_MPI)
252186
find_package(MPI REQUIRED)

builtins/CMakeLists.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
11
cmake_minimum_required(VERSION 2.8)
22
include( ${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake )
33

4+
# NSDF5 support. Disabled by default.
5+
if(WITH_NSDF)
6+
find_package(HDF5 COMPONENTS CXX HL)
7+
if(NOT HDF5_FOUND)
8+
message(
9+
"==================================================================\n"
10+
" HDF5 not found. Disabling NSDF support.\n\n"
11+
" If you need NSDF support, please install hdf5-dev or hdf5-devel\n"
12+
" package or equivalent.\n\n"
13+
" $ sudo apt-get install libhdf5-dev \n"
14+
" $ sudo yum install libhdf5-devel \n"
15+
" $ brew install hdf5 \n\n"
16+
" Otherwise, continue with 'make' and 'make install' \n"
17+
" If you install hdf5 to non-standard path, export environment \n"
18+
" variable HDF5_ROOT to the location. Rerun cmake \n"
19+
"================================================================ \n"
20+
)
21+
endif(NOT HDF5_FOUND)
22+
23+
if(HDF5_FOUND)
24+
include_directories(${HDF5_CXX_INCLUDE_DIRS} )
25+
add_definitions(-DUSE_HDF5 -DENABLE_NSDF )
26+
add_definitions(${HDF5_CXX_DEFINITIONS})
27+
if(HDF5_USE_STATIC_LIBRARIES)
28+
message(STATUS "Finding static HDF5 libraries in $ENV{HDF5_ROOT}")
29+
find_library(HDF5_CXX_LIBRARIES NAMES libhdf5.a
30+
PATHS $ENV{HDF5_ROOT}/lib $ENV{HDF5_ROOT}/lib64
31+
)
32+
find_library(HDF5_HL_LIBRARIES NAMES libhdf5_hl.a
33+
PATHS $ENV{HDF5_ROOT}/lib $ENV{HDF5_ROOT}/lib64
34+
)
35+
set(HDF5_LIBRARIES ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES})
36+
endif()
37+
38+
# Make sure, HDF5_HL_LIBRARIES are set. The COMPONENTS in find_package may
39+
# or may not work. See BhallaLab/moose-core#163.
40+
if(NOT HDF5_HL_LIBRARIES)
41+
set(HDF5_HL_LIBRARIES ${HDF5_HL_LIBRARIES})
42+
endif(NOT HDF5_HL_LIBRARIES)
43+
list(APPEND HDF5_LIBRARIES ${HDF5_HL_LIBRARIES})
44+
45+
else(HDF5_FOUND)
46+
message(STATUS "HDF5 is not found. Disabling NSDF support." )
47+
endif( HDF5_FOUND )
48+
endif(WITH_NSDF)
49+
450
set(SRCS
551
Arith.cpp
652
Group.cpp
@@ -33,3 +79,6 @@ if(WITH_NSDF AND HDF5_FOUND)
3379
endif()
3480

3581
add_library(moose_builtins ${SRCS} )
82+
if(WITH_NSDF AND HDF5_FOUND)
83+
target_link_libraries(moose_builtins ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES})
84+
endif()

0 commit comments

Comments
 (0)