Skip to content

Commit 6733daa

Browse files
authored
2018 sep20 (#243)
* Pull subtree to master branch. * Squashed 'moose-core/' changes from d229eba6bb..8463cc73e5 8463cc73e5 Update setup.cmake.py (#307) 8c38fc6d60 Removed deprecated warnings from neuroml2 reader (#305) 6df4332d2d Fixes to BOOST based steadystate solver (#306) 99dd7d2503 Merge pull request #302 from BhallaLab/chhennapoda 86c4244522 Merge branch 'master' into chhennapoda ec06b242ae HotFix: Fix regression in StreadyState solver caused by #293. (#304) 6b79f6701c prefer .so suffix over CPython version specific suffix . this way a wheel compiled by any version of python3 will work with any python3. 92da6a7fb8 removed python-libsbml from install dependencies; added matplotlib. sbml and neuroml packages should be installed by user and not automatically. They may not be available for all distribution of python on all OSes. e2bc19c0e4 Merge branch 'master' into chhennapoda 385a5cf0a1 Merge pull request #303 from upibhalla/master 080767c5aa Fixes to rdesigneur due to bad merge. Cleanup on rmoogli 62f8bc89e0 Tweak to Neuron.cpp so it can handle insertion of spines with uniform spacing. b6088109bf Fixes for linux. 406fee2a06 Temp commit to test on OSX. cc3c604b9f Merge branch 'master' into chhennapoda 342092829c Update moose_test.py (#301) 61f4f66843 show timeout in moose.test() . abf822c4a6 with python2, just test with GSL. Build python3 first. 088c61673c Made changes to build system so that pymoose directory can be built in isolation. Build system is bit more module. Ideally I should make sure that each subdirectory can built in isolation. 3c0ff27903 Few changes to build with python3.6. 5d688f63d8 Use option --relative in setup.py and tell cmake not to look into usr prefix anymore. 1f3fe9fc35 Merge branch 'chhennapoda' of github.com:BhallaLab/moose-core into chhennapoda 3e19983c83 removed unneeded library which is never used. c2fbab8726 cmake related changes to build on centos5 (manylinux docker image). f1230f1518 Merge branch 'master' of https://github.com/upibhalla/moose-core 23a2892cc8 Merge branch 'master' of https://github.com/BhallaLab/moose-core 8a835c1332 minor bugfix to rdesigneur 6ef1d567ec Merge branch 'master' into master a9a2e758ff Merge branch 'master' of https://github.com/BhallaLab/moose-core 5e1294d991 Further updates to rdesigneur for argument handling a702bded54 Put in kwargs based specification of plotList, stimList and moogList. Folded savePlots into plotList but not yet tested. git-subtree-dir: moose-core git-subtree-split: 8463cc73e5d837ade8e191404359bc278f377b9d * Fixes to build system. * Some test only runs on travis only. * Don't run moose.test()
1 parent ba782a9 commit 6733daa

32 files changed

+865
-592
lines changed

.travis_build_linux.sh

+8
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ set -e -x
44
PATH=/usr/bin:/usr/local/bin:$PATH
55
gbp buildpackage --git-ignore-branch --git-ignore-new -uc -us -d | tee _gbp.log
66
pwd
7+
ls ../*.deb
8+
9+
if [ -n "$TRAVIS" ]; then
10+
echo "We are on travis"
11+
sudo dpkg -i ../*.deb
12+
sudo apt-get install -f
13+
python -c 'import moose; print(moose.__file__); print(moose.__version__)'
14+
fi

.travis_build_osx.sh

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ brew tap BhallaLab/moose
33
brew install --HEAD moose-nightly
44
python -m pip install networkx python-libsbml pyNeuroML matplotlib
55
python -c 'import moose; print( moose.__version__ )'
6-
python -c 'import moose; print( moose.test() )'

CMakeLists.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ if(WITH_GUI)
108108
add_dependencies(examples gui)
109109
endif()
110110

111-
112-
# NOTE: leading / is important other whole path will be installed. Do not
113-
# install usr since it comes with CMAKE_INSTALL_PREFIX.
114-
install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/usr/
111+
install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/
115112
DESTINATION ${CMAKE_INSTALL_PREFIX}
116113
CONFIGURATIONS Release
117114
PATTERN ".git" EXCLUDE

moose-core/.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: cpp
22
sudo: required
3-
group: edge
4-
3+
group: travis_lts
4+
dist: xenial
55

66
os:
77
- linux

moose-core/.travis/travis_build_linux.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,34 @@ unset PYTHONPATH
4040
$PYTHON2 -m compileall -q .
4141
if type $PYTHON3 > /dev/null; then $PYTHON3 -m compileall -q . ; fi
4242

43-
# This is only applicable on linux build.
43+
# Python2 and GSL.
44+
echo "Currently in `pwd`"
45+
(
46+
mkdir -p _GSL_BUILD && cd _GSL_BUILD
47+
cmake -DDEBUG=ON -DPYTHON_EXECUTABLE="$PYTHON2" ..
48+
$MAKE && ctest --output-on-failure
49+
sudo make install && cd /tmp
50+
$PYTHON2 -c 'import moose;print(moose.__file__);print(moose.version())'
51+
)
52+
53+
# Python3 with GSL and BOOST. This should be the only build after we drop
54+
# python2 support.
4455
echo "Python3: Removed python2-networkx and install python3"
4556
if type $PYTHON3 > /dev/null; then
4657
sudo apt-get remove -qq python-networkx || echo "Error with apt"
4758
sudo apt-get install -qq python3-networkx || echo "Error with apt"
48-
4959
# GSL.
5060
(
5161
mkdir -p _GSL_BUILD2 && cd _GSL_BUILD2 && \
5262
cmake -DPYTHON_EXECUTABLE="$PYTHON3" -DDEBUG=ON ..
53-
$MAKE && ctest --output-on-failure
63+
$MAKE && ctest --output-on-failure
5464
)
5565

5666
# BOOST
5767
(
5868
mkdir -p _BOOST_BUILD2 && cd _BOOST_BUILD2 && \
5969
cmake -DWITH_BOOST_ODE=ON -DPYTHON_EXECUTABLE="$PYTHON3" ..
60-
$MAKE && ctest --output-on-failure
70+
$MAKE && ctest --output-on-failure
6171
)
6272
echo "All done"
6373
else

moose-core/.travis/travis_prepare_linux.sh

+14-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# OPTIONS: ---
1111
# REQUIREMENTS: ---
1212
# BUGS: ---
13-
# NOTES: ---
13+
# NOTES: Always run with sudo permission.
1414
# AUTHOR: Dilawar Singh (), [email protected]
1515
# ORGANIZATION: NCBS Bangalore
1616
# CREATED: 01/02/2017 10:10:02 AM
@@ -21,15 +21,24 @@ set -o nounset # Treat unset variables as an error
2121
set +e # Let installation fail in some command
2222

2323
apt-get install -qq libxml2-dev libbz2-dev
24-
apt-get install -qq libhdf5-serial-dev
2524
apt-get install -qq make cmake
2625
apt-get install -qq python-numpy python-matplotlib python-networkx python-pip
26+
apt-get install -qq python3-lxml python-lxml
2727
apt-get install -qq python3-numpy python3-matplotlib python3-dev
28-
apt-get install -qq libboost-all-dev
29-
apt-get install -qq libgsl0-dev
3028
apt-get install -qq python-pip python3-pip
3129
apt-get install -qq libgraphviz-dev
3230

31+
# Gsl
32+
apt-get install -qq libgsl0-dev || apt-get install -qq libgsl-dev
33+
34+
# Boost related.
35+
apt-get install -qq liblapack-dev
36+
apt-get install -qq libboost-all-dev
37+
3338
# Dependencies for NML2
3439
apt-get install -qq python-scipy python3-scipy
35-
#pip install pyNeuroML libNeuroML
40+
apt-get install -qq python-lxml python3-lxml
41+
apt-get install -qq python-setuptools python3-setuptools
42+
apt-get install -qq python-tornado python3-tornado
43+
python2 -m pip install pyNeuroML libNeuroML
44+
python3 -m pip install pyNeuroML libNeuroML

moose-core/CMakeLists.txt

+67-62
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ else()
7676
endif()
7777

7878
################################ CMAKE OPTIONS ##################################
79+
option(WITH_NSDF "Enable NSDF support. Requires hdf5" OFF )
80+
7981
option(DEBUG "Build with debug support" OFF)
8082
option(GPROF "Build for profiling using gprof" OFF)
8183
option(ENABLE_UNIT_TESTS "Enable unit tests (DEBUG should also be ON)" OFF)
@@ -187,68 +189,71 @@ if(WITH_BOOST_ODE)
187189
add_definitions(-DUSE_BOOST_ODE -UUSE_GSL)
188190
endif()
189191

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

253258
# Openmpi
254259
if(WITH_MPI)
@@ -432,7 +437,7 @@ message(STATUS "binary distribution file ${PYMOOSE_BDIST_FILE}")
432437
add_custom_target(bdist ALL DEPENDS ${PYMOOSE_BDIST_FILE} )
433438

434439
# Any command using setup.cmake.py must run in the same directory. Use option
435-
# `--relative` to prefix is aways fixed.
440+
# `--relative` to prefix is aways fixed.
436441
add_custom_command( OUTPUT ${PYMOOSE_BDIST_FILE}
437442
COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py bdist_dumb -p ${_platform}
438443
-d ${PYMOOSE_BDIST_DIR} --relative
@@ -464,7 +469,7 @@ add_dependencies( copy_pymoose _moose )
464469
install(TARGETS moose.bin DESTINATION bin CONFIGURATIONS Debug)
465470
install(TARGETS libmoose DESTINATION lib CONFIGURATIONS Debug)
466471

467-
# install pymoose bdist.
472+
# install pymoose bdist.
468473
install(DIRECTORY ${PYMOOSE_BDIST_INSTALL_DIR}/
469474
DESTINATION ${CMAKE_INSTALL_PREFIX}
470475
CONFIGURATIONS Release Debug

0 commit comments

Comments
 (0)