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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 5 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ SortIncludes: false
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AlignAfterOpenBracket: false
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
Expand All @@ -14,15 +18,12 @@ BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80
ColumnLimit: 90
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 60
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
Expand Down
15 changes: 0 additions & 15 deletions .github/main.workflow

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/pymoose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.7, 3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -19,8 +19,8 @@ jobs:
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo -E apt install -y cmake libgsl-dev g++ gcc git
sudo -E apt install python3-tk python-tk
sudo -E apt install -y cmake libboost-dev g++ gcc git
sudo -E apt install python3-tk
python -m pip install numpy matplotlib --user
- name: Build
run: |
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Windows Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: "Setup Python ${{ matrix.python-version }}"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

# Runs a set of commands using the runners shell
- name: Build using MSVS
shell: bash
run: |
mkdir build
cd build
PYTHON=$(which python)
$PYTHON -m pip install pip --upgrade
$PYTHON -m pip install numpy pytest matplotlib setuptools
cmake -DOPTION_PYTHON=ON -DOPTION_EXAMPLES=ON -DPython3_EXECUTABLE=$PYTHON ..
cmake --build . --config Release
ctest -C Release

- name: Upload to PyPI
shell: bash
env:
SMOLDYN_PYPI_TOKEN: ${{ secrets.SMOLDYN_PYPI_TOKEN }}
run: |
cd build
python -m pip install twine --upgrade
python -m twine upload -u __token__ -p "$SMOLDYN_PYPI_TOKEN" *.whl --skip-existing || echo "Failed to upload"
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

86 changes: 11 additions & 75 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
cmake_minimum_required(VERSION 3.2.3 FATAL_ERROR)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

# Project to build MOOSE's python module.
project(PyMOOSE)
project(PyMOOSE LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# cmake related macros.
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CheckCXXCompiler.cmake)
include(CheckIncludeFileCXX)

# We find python executable here. Though mainly used inside pymoose.
# FIXME: When cmake 3.12 is widely available use the following:
# find_package(Python3 COMPONENTS Interpreter Numpy)
# set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(Python_ADDITIONAL_VERSIONS 2.7)
find_package(PythonInterp 3.5)
if(NOT PYTHONINTERP_FOUND)
find_package(PythonInterp 2.7)
endif()

find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(CMAKE_MACOSX_RPATH OFF)

# NOTE: version should be changed in setup.py file.
Expand Down Expand Up @@ -55,19 +49,16 @@ option(DEBUG "Build with debug support" OFF)
option(GPROF "Build for profiling using gprof" OFF)
option(ENABLE_UNIT_TESTS "Enable unit tests (DEBUG should also be ON)" OFF)
option(WITH_MPI "Enable Openmpi support" OFF)

option(WITH_BOOST "Enable boost. Prefer boost over stl" OFF)
option(WITH_BOOST_ODE "Use boost library ode2 library instead of GSL" OFF)
option(WITH_GSL "Use gsl-library. Alternative is WITH_BOOST" ON)

option(WITH_ASAN "Use AddressSanitizer in DEBUG mode." OFF)

option(WITH_NSDF "Enable NSDF support. Requires hdf5" OFF )

option(WITH_LEGACY_BINDING "Use legacy python-bindings" OFF)

############################ BUILD CONFIGURATION #################################

# At least version 1.53 (odeint is part of this version)
find_package(Boost 1.53 REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})

# Default definitions.
add_definitions(-DUSE_GENESIS_PARSER)
if(DEBUG OR "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
Expand Down Expand Up @@ -99,12 +90,6 @@ if(WITH_ASAN AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
endif()

# Override default GSL solvers when BOOST is enabled.
if(WITH_BOOST OR WITH_BOOST_ODE)
set(WITH_BOOST_ODE ON)
set(WITH_GSL OFF)
endif()

################################### TARGETS ####################################

link_directories(${CMAKE_BINARY_DIR})
Expand All @@ -120,35 +105,6 @@ set(STATIC_LIBRARIES "" )
# Collect all shared libraries here.
set(SYSTEM_SHARED_LIBS "")

# BOOST ode library performs better than GSL and ideally should be made default.
# Unfortunately Boost does not have a very good matrix library; it has ublas
# which is not well maintained and emit a lot
# of warning during compilation. Nonetheless, WITH_BOOST_ODE works fine and
# produce results quicker than GSL.
if(WITH_GSL)
find_package(GSL 1.16 REQUIRED)
if(NOT GSL_FOUND)
message(FATAL_ERROR
"=====================================================================\n"
" FATAL gsl(>=1.16) not found.\n\n"
" MOOSE requires Gnu Scientific Library (GSL) 1.16 or higher. \n"
" Please install the `dev` or `devel` package e.g. \n"
" $ sudo apt-get install libgsl0-dev \n"
" $ sudo yum install libgsl-devel \n"
" $ brew install gsl \n\n"
" Or build and install gsl from source code \n"
" https://www.gnu.org/software/gsl/ \n"
" After installing gsl, rerun cmake.\n\n"
" If you install gsl in non-standard place, set the GSL_ROOT_DIR environment \n"
" variable. CMAKE use this to search for required files. \n"
"====================================================================\n"
)
endif(NOT GSL_FOUND)
elseif(WITH_BOOST_ODE)
find_package(Boost 1.53 REQUIRED)
find_package(LAPACK REQUIRED)
endif()


# Openmpi
if(WITH_MPI)
Expand Down Expand Up @@ -177,26 +133,6 @@ list(APPEND SYSTEM_SHARED_LIBS ${CMAKE_THREAD_LIBS_INIT})
# These libraries could be static of dynamic. We need to discrimate between
# these two types because of --whole-archive option. See
# BhallaLab/moose-core#66,
if(WITH_GSL)
if(GSL_STATIC_LIBRARIES)
message( STATUS "Using static libraries ${GSL_STATIC_LIBRARIES}" )
list(APPEND STATIC_LIBRARIES ${GSL_STATIC_LIBRARIES})
else( )
# message(DEBUG "Using gsl libraries: ${GSL_LIBRARIES}")
foreach(GSL_LIB ${GSL_LIBRARIES} )
if(GSL_LIB)
get_filename_component( GSL_LIB_EXT ${GSL_LIB} EXT )
if(GSL_LIB_EXT)
if(GSL_LIB_EXT STREQUAL ".a" )
list(APPEND STATIC_LIBRARIES ${GSL_LIB})
else()
list(APPEND SYSTEM_SHARED_LIBS ${GSL_LIB})
endif( )
endif( )
endif( )
endforeach( )
endif( )
endif()

if(WITH_MPI)
if(MPI_CXX_FOUND)
Expand Down
56 changes: 0 additions & 56 deletions CheckCXXCompiler.cmake

This file was deleted.

4 changes: 1 addition & 3 deletions basecode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 2.8)
include( ${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake )
cmake_minimum_required(VERSION 3.12)
add_library(basecode
Element.cpp
DataElement.cpp
Expand Down Expand Up @@ -30,4 +29,3 @@ add_executable(test_globals testGlobals.cpp global.cpp)

enable_testing()
add_test(NAME cpp_test_globals COMMAND $<TARGET_FILE:test_globals>)

14 changes: 4 additions & 10 deletions biophysics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake)

if(WITH_GSL)
find_package(GSL 1.16)
include_directories(${GSL_INCLUDE_DIRS})
elseif(WITH_BOOST_ODE)
find_package(Boost)
include_directories(${Boost_INCLUDE_DIRS})
endif(WITH_GSL)
cmake_minimum_required(VERSION 3.12)

set(BIOPHYSICS_SRCS
IntFire.cpp
Expand Down Expand Up @@ -57,3 +48,6 @@ set(BIOPHYSICS_SRCS

add_library(biophysics ${BIOPHYSICS_SRCS})

target_include_directories(biophysics PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../external/odeint-v2/include)

Loading