Skip to content

Commit 18319dd

Browse files
authored
Merge branch 'master' into LSODE
2 parents de451bd + e7cd7c0 commit 18319dd

File tree

538 files changed

+14883
-43249
lines changed

Some content is hidden

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

538 files changed

+14883
-43249
lines changed

.github/main.workflow

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
workflow "build pymoose" {
2+
resolves = "build"
3+
on = "push"
4+
}
5+
6+
action "build" {
7+
uses = "./"
8+
args = "install"
9+
env = {
10+
CMAKE_GIT_REPO = "https://github.com/dilawar/moose-core",
11+
CMAKE_INSTALL_DEPS_SCRIPT = ".travis/travis_prepare_linux.sh",
12+
CMAKE_FLAGS = "-DCMAKE_INSTALL_PREFIX:PATH=/tmp/foo",
13+
CMAKE_BUILD_THREADS = "4"
14+
}
15+
}

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: C/C++ CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Install dependencies
13+
run: |
14+
sudo apt update
15+
sudo apt install libgsl-dev g++ cmake python3-dev python3-numpy
16+
- name: configure
17+
run: mkdir -p build && cd build && cmake ..
18+
- name: make
19+
run: cd build && make
20+
- name: ctest --output-on-failure
21+
run: cd build && make check

.travis.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
language: cpp
22
sudo: required
3-
addons:
4-
apt:
5-
update: true
63

7-
os:
8-
- linux
9-
- osx
4+
matrix:
5+
include:
6+
- os: linux
7+
dist: xenial
8+
- os: osx
9+
osx_image: xcode10.2
10+
1011
notifications:
1112
email:
1213
recipients:
@@ -21,22 +22,11 @@ addons:
2122
update: true
2223

2324
before_script:
24-
- echo "OSX related"
2525
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then nvm get head || true; fi
2626
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/travis_prepare_osx.sh; fi
2727
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ./.travis/travis_prepare_linux.sh; fi
2828

29-
30-
before_script:
31-
- echo "OSX related"
32-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then nvm get head || true; fi
33-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/travis_prepare_osx.sh; fi
34-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ./.travis/travis_prepare_linux.sh;
35-
fi
3629
script:
37-
38-
- python2 -m compileall -q . || echo "Python2 not found"
39-
- if type python3 > /dev/null; then python3 -m compileall -q . ; fi
4030
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/travis_build_osx.sh; fi
4131
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./.travis/travis_build_linux.sh; fi
4232

.travis/run_pylint.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
python3 -m pip install pylint --user
4+
PYLINT="python3 -m pylint -E \
5+
--disable=no-member --disable=no-name-in-module \
6+
--disable=invalid-unary-operand-type \
7+
--disable=import-error \
8+
"
9+
function do_pylint() {
10+
echo "Checking $1"
11+
DIR=$(dirname $1)
12+
SNAME=$(basename $1)
13+
(
14+
cd $DIR
15+
$PYLINT $@ $SNAME
16+
)
17+
}
18+
19+
FILES=$(find . -type f -name "*.py" | shuf)
20+
N=4
21+
i=0
22+
for f in $FILES; do
23+
#i=$((i+1))
24+
#if [ $i -eq $N ]; then
25+
# i=0
26+
# wait;
27+
#fi
28+
# do_pylint "$f"
29+
echo "Checking $f"
30+
DIR=$(dirname $f)
31+
SNAME=$(basename $f)
32+
(
33+
cd $DIR
34+
$PYLINT $@ $SNAME
35+
)
36+
done

.travis/travis_build_linux.sh

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,42 +40,38 @@ unset PYTHONPATH
4040
$PYTHON2 -m compileall -q .
4141
if type $PYTHON3 > /dev/null; then $PYTHON3 -m compileall -q . ; fi
4242

43+
# Python2 and GSL.
4344
echo "Currently in `pwd`"
4445
(
4546
MOOSE_INSTALL_PREFIX=/tmp/moose/usr
4647
rm -rf $MOOSE_INSTALL_PREFIX && mkdir -p $MOOSE_INSTALL_PREFIX/{bin,lib}
4748
mkdir -p _GSL_BUILD && cd _GSL_BUILD
4849
cmake -DDEBUG=ON -DPYTHON_EXECUTABLE="$PYTHON2" ..
49-
$MAKE && ctest --output-on-failure
50+
$MAKE && ctest --output-on-failure -E ".*socket_streamer.*"
5051
sudo make install && cd /tmp
5152
$PYTHON2 -c 'import moose;print(moose.__file__);print(moose.version())'
5253
)
5354

54-
(
55-
# Now with boost.
56-
mkdir -p _BOOST_BUILD && cd _BOOST_BUILD && \
57-
cmake -DWITH_BOOST_ODE=ON -DDEBUG=ON -DPYTHON_EXECUTABLE="$PYTHON2" ..
58-
$MAKE && ctest --output-on-failure
59-
)
60-
61-
# This is only applicable on linux build.
55+
# Python3 with GSL and BOOST. This should be the only build after we drop
56+
# python2 support.
6257
echo "Python3: Removed python2-networkx and install python3"
6358
if type $PYTHON3 > /dev/null; then
64-
if type apt-get --help > /dev/null; then
65-
sudo apt-get remove -qq python-networkx
66-
sudo apt-get install -qq python3-networkx
67-
fi
59+
sudo apt-get remove -qq python-networkx || echo "Error with apt"
60+
sudo apt-get install -qq python3-networkx || echo "Error with apt"
61+
# GSL.
6862
(
69-
mkdir -p _GSL_BUILD2 && cd _GSL_BUILD2 && \
70-
cmake -DPYTHON_EXECUTABLE="$PYTHON3" ..
71-
$MAKE && ctest --output-on-failure
63+
mkdir -p _GSL_BUILD_PY3 && cd _GSL_BUILD_PY3 && \
64+
cmake -DWITH_NSDF=ON -DPYTHON_EXECUTABLE="$PYTHON3" -DDEBUG=ON ..
65+
$MAKE && ctest --output-on-failure -E ".*socket_streamer.*"
7266
)
67+
68+
# BOOST
7369
(
74-
mkdir -p _BOOST_BUILD2 && cd _BOOST_BUILD2 && \
75-
cmake -DWITH_BOOST_ODE=ON -DPYTHON_EXECUTABLE="$PYTHON3" ..
76-
$MAKE && ctest --output-on-failure
70+
mkdir -p _BOOST_BUILD_PY3 && cd _BOOST_BUILD_PY3 && \
71+
cmake -DWITH_NSDF=ON -DWITH_BOOST_ODE=ON -DPYTHON_EXECUTABLE="$PYTHON3" ..
72+
$MAKE && ctest --output-on-failure -E ".*socket_streamer.*"
7773
)
7874
echo "All done"
7975
else
8076
echo "Python3 is not found. Build disabled"
81-
fi
77+
fi

.travis/travis_build_osx.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,29 @@ set -e
2323
# NOTE: On travis, don't enable -j`nproc` option. It may not compile properly.
2424

2525
(
26-
2726
# Make sure not to pick up python from /opt.
28-
PATH=/usr/bin:/usr/local/bin:$PATH
27+
PATH=/usr/local/bin:/usr/bin:$PATH
28+
29+
PYTHON3=$(which python3)
30+
31+
# Get pylint
32+
$PYTHON3 -m pip install pylint --user
33+
$PYTHON3 -m pip install python-libsbml --user
34+
$PYTHON3 -m pip install pyneuroml --user
35+
2936
mkdir -p _GSL_BUILD && cd _GSL_BUILD \
3037
&& cmake -DDEBUG=ON \
31-
-DPYTHON_EXECUTABLE=`which python` ..
32-
make && ctest --output-on-failure
38+
-DPYTHON_EXECUTABLE=$PYTHON3 \
39+
..
40+
make pylint -j3
41+
make && ctest --output-on-failure
3342

3443
cd .. # Now with boost.
3544
mkdir -p _BOOST_BUILD && cd _BOOST_BUILD \
3645
&& cmake -DWITH_BOOST_ODE=ON -DDEBUG=ON \
37-
-DPYTHON_EXECUTABLE=`which python` ..
46+
-DPYTHON_EXECUTABLE=`which python3` ..
3847

39-
make && ctest --output-on-failure
48+
make -j4 && ctest --output-on-failure
4049
cd ..
4150
set +e
4251

.travis/travis_prepare_linux.sh

Lines changed: 19 additions & 6 deletions
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,28 @@ 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
31-
apt-get install -qq libgraphviz-dev
29+
apt-get install -qq python-tk python3-tk
30+
apt-get install -qq libgraphviz-dev
31+
32+
# Gsl
33+
apt-get install -qq libgsl0-dev || apt-get install -qq libgsl-dev
34+
35+
# hdf5
36+
apt-get install -qq libhdf5-serial-dev
37+
38+
# Boost related.
39+
apt-get install -qq liblapack-dev
40+
apt-get install -qq libboost-all-dev
3241

3342
# Dependencies for NML2
3443
apt-get install -qq python-scipy python3-scipy
35-
#pip install pyNeuroML libNeuroML
44+
apt-get install -qq python-lxml python3-lxml
45+
apt-get install -qq python-setuptools python3-setuptools
46+
apt-get install -qq python-tornado python3-tornado
47+
/usr/bin/python2 -m pip install pyNeuroML libNeuroML
48+
/usr/bin/python3 -m pip install pyNeuroML libNeuroML

.travis/travis_prepare_osx.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,28 @@
2020
set -o nounset # Treat unset variables as an error
2121
set +e
2222
#rvm get head
23-
#brew update
24-
#brew outdated cmake || brew install cmake
25-
brew install gsl
23+
brew update || echo "failed to update"
24+
brew outdated cmake || brew install cmake
25+
brew install gsl || brew upgrade gsl
2626
brew install hdf5
2727
brew install python
2828
brew install numpy
2929
brew install boost
3030

31+
PYTHON3=$(which python3)
32+
3133
#brew outdated python || brew install python
3234
#brew outdated numpy || brew install homebrew/python/numpy
3335
brew unlink numpy && brew link numpy || echo "Failed to link numpy"
3436
# Numpy caveats
35-
mkdir -p $HOME/Library/Python/2.7/lib/python/site-packages
36-
echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> $HOME/Library/Python/2.7/lib/python/site-packages/homebrew.pth
37+
#mkdir -p $HOME/Library/Python/2.7/lib/python/site-packages
38+
#echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> $HOME/Library/Python/2.7/lib/python/site-packages/homebrew.pth
3739

3840
# To make sure that we do not pick python from /opt etc.
3941
PATH=/usr/local/bin:/usr/bin:$PATH
4042
# ensurepip
41-
python -m ensurepip
42-
python -m pip install matplotlib --user --upgrade
43-
python -m pip install pyNeuroML libNeuroML --user
44-
python -m pip install scipy --user
43+
$PYTHON3 -m ensurepip
44+
$PYTHON3 -m pip install matplotlib --user --upgrade
45+
$PYTHON3 -m pip install pyNeuroML libNeuroML --user
46+
$PYTHON3 -m pip install scipy --user
47+
$PYTHON3 -m pip install pylint --user

0 commit comments

Comments
 (0)