Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .ci/travis_build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ set -x
BUILDDIR=_build_travis
mkdir -p $BUILDDIR

PYTHON2="/usr/bin/python2"
PYTHON3="/usr/bin/python3"

$PYTHON2 -m pip install pip --upgrade --user
$PYTHON2 -m pip install libNeuroML numpy==1.14 scipy==1.2 \
pyNeuroML python-libsbml --upgrade --user

$PYTHON3 -m pip install pip --upgrade --user
$PYTHON3 -m pip install libNeuroML pyNeuroML python-libsbml --upgrade --user

Expand All @@ -37,7 +32,6 @@ unset PYTHONPATH
# many not be available. Therefore, it is neccessary to use fixed path for
# python executable.

$PYTHON2 -m compileall -q .
$PYTHON3 -m compileall -q .

# Python3 with GSL in debug more.
Expand Down Expand Up @@ -67,14 +61,3 @@ $PYTHON3 -m compileall -q .
export MOOSE_NUM_THREADS=3
make coverage
)

# GSL and python2, failure is allowed
set +e
(
mkdir -p $BUILDDIR && cd $BUILDDIR && \
cmake -DPYTHON_EXECUTABLE=$PYTHON2 -DCMAKE_INSTALL_PREFIX=/usr ..
$MAKE && MOOSE_NUM_THREADS=$NPROC ctest -j$NPROC --output-on-failure
)
set -e

echo "All done"
9 changes: 4 additions & 5 deletions .ci/travis_prepare_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ set -e -x
apt update
apt-get install -qq libxml2-dev libbz2-dev
apt-get install -qq make cmake
apt-get install -qq python-numpy python-matplotlib python-networkx python-pip
apt-get install -qq python3-numpy python3-matplotlib python3-networkx python3-pip
apt-get install -qq python-tk python3-tk
apt-get install -qq python3-tk
apt-get install -qq valgrind

# Gsl
Expand All @@ -23,9 +22,9 @@ apt-get install -qq liblapack-dev
apt-get install -qq libboost-all-dev

# Dependencies for NML2
apt-get install -qq python-scipy python3-scipy
apt-get install -qq python-lxml python3-lxml
apt-get install -qq python-setuptools python3-setuptools
apt-get install -qq python3-scipy
apt-get install -qq python3-lxml
apt-get install -qq python3-setuptools

# Install twine
python3 -m pip install twine
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.2.3 FATAL_ERROR)
# Project to build MOOSE's python module.
project(PyMOOSE)

# minimum cxx standard required is 14
set(CMAKE_CXX_STANDARD 14)

# cmake related macros.
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CheckCXXCompiler.cmake)
Expand Down Expand Up @@ -299,7 +302,7 @@ endif( WITH_BOOST )
######################### BUILD PYMOOSE ########################################

if(NOT WITH_LEGACY_BINDING)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/pybind11)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/pybind11-2.6.1)
add_subdirectory(pybind11)
else()
message(STATUS "Building legacy python binding.")
Expand Down
14 changes: 0 additions & 14 deletions CheckCXXCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Compiler check.
# Must support c++14
# If python2 is supported then we can not use c++17.
if(COMPILER_IS_TESTED)
return()
endif()

########################### COMPILER MACROS #####################################
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11 )
CHECK_CXX_COMPILER_FLAG("-Wno-strict-aliasing" COMPILER_WARNS_STRICT_ALIASING )

# Turn warning to error: Not all of the options may be supported on all
Expand Down Expand Up @@ -41,16 +39,4 @@ CHECK_CXX_COMPILER_FLAG( "-Wno-unused-but-set-variable"
if(COMPILER_SUPPORT_UNUSED_BUT_SET_VARIABLE_NO_WARN)
add_definitions( "-Wno-unused-but-set-variable" )
endif(COMPILER_SUPPORT_UNUSED_BUT_SET_VARIABLE_NO_WARN)

if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(APPLE)
add_definitions( -mllvm -inline-threshold=1000 )
endif(APPLE)
else(COMPILER_SUPPORTS_CXX11)
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} is too old. \n"
"Please use a compiler which has full c++11 support."
)
endif(COMPILER_SUPPORTS_CXX11)

set(COMPILER_IS_TESTED ON)
37 changes: 37 additions & 0 deletions external/pybind11-2.6.1/.appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: 1.0.{build}
image:
- Visual Studio 2015
test: off
skip_branch_with_pr: true
build:
parallel: true
platform:
- x86
environment:
matrix:
- PYTHON: 36
CONFIG: Debug
- PYTHON: 27
CONFIG: Debug
install:
- ps: |
$env:CMAKE_GENERATOR = "Visual Studio 14 2015"
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
python -W ignore -m pip install --upgrade pip wheel
python -W ignore -m pip install pytest numpy --no-warn-script-location
- ps: |
Start-FileDownload 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip'
7z x eigen-3.3.7.zip -y > $null
$env:CMAKE_INCLUDE_PATH = "eigen-3.3.7;$env:CMAKE_INCLUDE_PATH"
build_script:
- cmake -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
-DCMAKE_CXX_STANDARD=14
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_SUPPRESS_REGENERATION=1
.
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cmake --build . --config %CONFIG% --target pytest -- /m /v:m /logger:%MSBuildLogger%
- cmake --build . --config %CONFIG% --target cpptest -- /m /v:m /logger:%MSBuildLogger%
on_failure: if exist "tests\test_cmake_build" type tests\test_cmake_build\*.log*
13 changes: 13 additions & 0 deletions external/pybind11-2.6.1/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FormatStyle: file

Checks: '
llvm-namespace-comment,
modernize-use-override,
readability-container-size-empty,
modernize-use-using,
modernize-use-equals-default,
modernize-use-auto,
modernize-use-emplace,
'

HeaderFilterRegex: 'pybind11/.*h'
73 changes: 73 additions & 0 deletions external/pybind11-2.6.1/.cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
parse:
additional_commands:
pybind11_add_module:
flags:
- THIN_LTO
- MODULE
- SHARED
- NO_EXTRAS
- EXCLUDE_FROM_ALL
- SYSTEM

format:
line_width: 99
tab_size: 2

# If an argument group contains more than this many sub-groups
# (parg or kwarg groups) then force it to a vertical layout.
max_subgroups_hwrap: 2

# If a positional argument group contains more than this many
# arguments, then force it to a vertical layout.
max_pargs_hwrap: 6

# If a cmdline positional group consumes more than this many
# lines without nesting, then invalidate the layout (and nest)
max_rows_cmdline: 2
separate_ctrl_name_with_space: false
separate_fn_name_with_space: false
dangle_parens: false

# If the trailing parenthesis must be 'dangled' on its on
# 'line, then align it to this reference: `prefix`: the start'
# 'of the statement, `prefix-indent`: the start of the'
# 'statement, plus one indentation level, `child`: align to'
# the column of the arguments
dangle_align: prefix
# If the statement spelling length (including space and
# parenthesis) is smaller than this amount, then force reject
# nested layouts.
min_prefix_chars: 4

# If the statement spelling length (including space and
# parenthesis) is larger than the tab width by more than this
# amount, then force reject un-nested layouts.
max_prefix_chars: 10

# If a candidate layout is wrapped horizontally but it exceeds
# this many lines, then reject the layout.
max_lines_hwrap: 2

line_ending: unix

# Format command names consistently as 'lower' or 'upper' case
command_case: canonical

# Format keywords consistently as 'lower' or 'upper' case
# unchanged is valid too
keyword_case: 'upper'

# A list of command names which should always be wrapped
always_wrap: []

# If true, the argument lists which are known to be sortable
# will be sorted lexicographically
enable_sort: true

# If true, the parsers may infer whether or not an argument
# list is sortable (without annotation).
autosort: false

# Causes a few issues - can be solved later, possibly.
markup:
enable_markup: false
Loading