Skip to content

Commit

Permalink
Merge branch 'master' into cornu/sparse13_treeset
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu authored Oct 22, 2024
2 parents e1df5f2 + 510b9bc commit 9541fd9
Show file tree
Hide file tree
Showing 329 changed files with 8,798 additions and 12,131 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
python3 -m venv music-venv
source music-venv/bin/activate
python3 -m pip install mpi4py "cython<3" numpy setuptools
python3 -m pip install 'mpi4py<4' cython numpy setuptools
sudo mkdir -p $MUSIC_INSTALL_DIR
sudo chown -R $USER $MUSIC_INSTALL_DIR
curl -L -o MUSIC.zip https://github.com/INCF/MUSIC/archive/refs/tags/${MUSIC_VERSION}.zip
Expand Down Expand Up @@ -91,9 +91,9 @@ jobs:
- name: Install Python@${{ env.PY_MIN_VERSION }} dependencies
working-directory: ${{runner.workspace}}/nrn
run: |
python -m pip install --upgrade pip -r nrn_requirements.txt
python -m pip install --upgrade -r external/nmodl/requirements.txt
python -m pip install --upgrade -r ci_requirements.txt
python -m pip install --upgrade pip -r nrn_requirements.txt
- name: Set up Python@${{ env.PY_MID_VERSION }}
uses: actions/setup-python@v5
Expand All @@ -108,9 +108,9 @@ jobs:
- name: Install Python@${{ env.PY_MAX_VERSION }} dependencies
working-directory: ${{runner.workspace}}/nrn
run: |
python -m pip install --upgrade pip -r nrn_requirements.txt
python -m pip install --upgrade -r external/nmodl/requirements.txt
python -m pip install --upgrade -r ci_requirements.txt
python -m pip install --upgrade pip -r nrn_requirements.txt
- name: Build & Test
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,3 @@ jobs:
- name: live debug session on failure (manual steps required, check `.github/docs.yml`)
if: failure() && contains(github.event.pull_request.title, 'live-debug-docs')
uses: mxschmitt/action-tmate@v3

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: env.OK_TO_DEPLOY_DOCS == 'true' && github.ref == 'refs/heads/master'
with:
branch: gh-pages # The branch the action should deploy to.
folder: ${{runner.workspace}}/nrn/docs/_build # The folder the action should deploy.
single-commit: true #have a single commit on the deployment branch instead of maintaining the full history
51 changes: 0 additions & 51 deletions .github/workflows/formatting.yml

This file was deleted.

27 changes: 18 additions & 9 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
# TODO: address-leak is the dream, but there are many problems,
# including external ones from the MPI implementations
sanitizer: address
- os: ubuntu-22.04
- os: ubuntu-24.04
config:
build_mode: cmake
# Cannot use a non-instrumented OpenMP with TSan, and we don't
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
run: |
sudo apt-get install build-essential ccache libopenmpi-dev \
libmpich-dev libx11-dev libxcomposite-dev mpich ninja-build \
openmpi-bin flex libfl-dev bison
openmpi-bin flex libfl-dev bison libreadline-dev
# The sanitizer builds use ubuntu 22.04
if [[ "${{matrix.os}}" == "ubuntu-20.04" ]]; then
sudo apt-get install g++-7 g++-8
Expand Down Expand Up @@ -171,9 +171,9 @@ jobs:
if: ${{ matrix.config.python_dynamic == 'ON' }}
working-directory: ${{runner.workspace}}/nrn
run: |
python -m pip install --upgrade pip -r nrn_requirements.txt
python -m pip install --upgrade -r external/nmodl/requirements.txt
python -m pip install --upgrade -r ci_requirements.txt
python -m pip install --upgrade pip -r nrn_requirements.txt
- name: Set up Python@${{ env.PY_MAX_VERSION }}
uses: actions/setup-python@v5
Expand All @@ -183,17 +183,17 @@ jobs:
- name: Install Python@${{ env.PY_MAX_VERSION }} dependencies
working-directory: ${{runner.workspace}}/nrn
run: |
python -m pip install --upgrade pip -r nrn_requirements.txt
python -m pip install --upgrade -r external/nmodl/requirements.txt
python -m pip install --upgrade -r ci_requirements.txt
python -m pip install --upgrade pip -r nrn_requirements.txt
- name: Install a new automake
# A new automake is needed for python 3.12 because it generate a python script
# A automake >= 1.16.5 is needed for python 3.12 because it generates a python script
# called py-compile and the original one is not supporting this version of python
# Once ubuntu got a newer version of automake we can remove this part.
if: matrix.config.music == 'ON' && startsWith(matrix.os, 'ubuntu')
run: |
curl -L -o automake.tar.xz https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.xz
curl -L -o automake.tar.xz https://ftpmirror.gnu.org/gnu/automake/automake-1.16.5.tar.xz
tar -xf automake.tar.xz
cd automake-1.16.5/
./configure --prefix=/usr/
Expand All @@ -207,7 +207,7 @@ jobs:
run: |
python3 -m venv music-venv
source music-venv/bin/activate
python3 -m pip install mpi4py "cython<3" numpy setuptools
python3 -m pip install 'mpi4py<4' cython numpy setuptools
sudo mkdir -p $MUSIC_INSTALL_DIR
sudo chown -R $USER $MUSIC_INSTALL_DIR
curl -L -o MUSIC.zip https://github.com/INCF/MUSIC/archive/refs/tags/${MUSIC_VERSION}.zip
Expand Down Expand Up @@ -237,10 +237,10 @@ jobs:
echo -----
- name: Restore compiler cache
uses: actions/cache@v4
uses: actions/cache/restore@v4
id: restore-compiler-cache
with:
path: ${{runner.workspace}}/ccache
save-always: true
key: ${{matrix.os}}-${{hashfiles('matrix.json')}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{matrix.os}}-${{hashfiles('matrix.json')}}-${{github.ref}}-
Expand Down Expand Up @@ -441,6 +441,15 @@ jobs:
INSTALL_DIR : ${{ runner.workspace }}/install
MATRIX_EVAL: ${{ matrix.config.matrix_eval }}

- name: Save compiler cache
uses: actions/cache/save@v4
if: always() && steps.restore-compiler-cache.outputs.cache-hit != 'true'
with:
path: ${{runner.workspace}}/ccache
key: |
${{matrix.os}}-${{hashfiles('matrix.json')}}-${{github.ref}}-
${{matrix.os}}-${{hashfiles('matrix.json')}}-
# This step will set up an SSH connection on tmate.io for live debugging.
# To enable it, you have to:
# * add 'live-debug-ci' to your PR title
Expand Down
15 changes: 1 addition & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ mac_m1_cmake_build:
- echo "python3=$(command -v python3) is really ${real_python}"
- PYTHONEXECUTABLE=${real_python} ${real_python} -mvenv venv
- venv/bin/python3 -m ensurepip --upgrade --default-pip
- venv/bin/pip install --upgrade pip -r nrn_requirements.txt
- git submodule update --init --recursive --force --depth 1 -- external/nmodl
- venv/bin/pip install --upgrade -r external/nmodl/requirements.txt
- venv/bin/pip install --upgrade pip -r nrn_requirements.txt
- source ./venv/bin/activate
- export PYTHON=${PWD}/venv/bin/python
- ${PYTHON} --version
Expand Down Expand Up @@ -148,19 +148,6 @@ spack_setup:
# BLUECONFIGS_BRANCH does not correspond to a Spack package called blueconfigs
SPACK_SETUP_IGNORE_PACKAGE_VARIABLES: BLUECONFIGS

simulation_stack:
stage: .pre
# Take advantage of GitHub PR description parsing in the spack_setup job.
needs: [spack_setup]
trigger:
branch: $BLUECONFIGS_BRANCH
project: hpc/sim/blueconfigs
# NEURON CI status depends on the BlueConfigs CI status.
strategy: depend
variables:
GITLAB_PIPELINES_BRANCH: $GITLAB_PIPELINES_BRANCH
SPACK_ENV_FILE_URL: $SPACK_SETUP_COMMIT_MAPPING_URL

# Performance seems to be terrible when we get too many jobs on a single node.
.build:
extends: [.spack_build]
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@
[submodule "external/eigen"]
path = external/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "external/nanobind"]
path = external/nanobind
url = https://github.com/wjakob/nanobind
[submodule "external/fmt"]
path = external/fmt
url = https://github.com/fmtlib/fmt
3 changes: 2 additions & 1 deletion .sanitizers/undefined.supp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ unsigned-integer-overflow:_philox4x32bumpkey(r123array2x32)
unsigned-integer-overflow:coreneuron::nrnran123_deletestream(coreneuron::nrnran123_State*, bool)
unsigned-integer-overflow:coreneuron::nrnran123_newstream3(unsigned int, unsigned int, unsigned int, bool)
unsigned-integer-overflow:Py_INCREF(_object*)
unsigned-integer-overflow:fmt::*
vptr:NetCon::disconnect(ivObservable*)
vptr:ObjObservable::object()
vptr:PreSyn::disconnect(ivObservable*)
vptr:PreSyn::disconnect(ivObservable*)
44 changes: 27 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ option(
NRN_ENABLE_PERFORMANCE_TESTS
"Enable tests that measure performance. These are known to be unreliable when run on busy/oversubscribed machines such as CI runners."
${NRN_ENABLE_PERFORMANCE_TESTS_DEFAULT})
option(NRN_ENABLE_DIGEST
"Provides nrn_digest function for debugging cross platform floating result differences."
${NRN_ENABLE_DIGEST_DEFAULT})
option(
NRN_ENABLE_ARCH_INDEP_EXP_POW
"Provides use_exp_pow_precision(style) function so that exp and pow produce same results on all platforms"
${NRN_ENABLE_ARCH_INDEP_EXP_POW_DEFAULT})
# This can be helpful in very specific CI build configurations, where ccache is used *and* different
# CI builds are built under different directories.
option(NRN_AVOID_ABSOLUTE_PATHS
Expand Down Expand Up @@ -246,6 +253,13 @@ endif()
include("${CODING_CONV_CMAKE}/3rdparty.cmake")
cpp_cc_git_submodule(Random123)
cpp_cc_git_submodule(eigen)
nrn_add_external_project(fmt)
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)

file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/external/Random123/include/Random123"
DESTINATION "${CMAKE_BINARY_DIR}/include/")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/external/eigen/Eigen"
DESTINATION "${CMAKE_BINARY_DIR}/include/")

# =================================================================================================
# Enable sanitizer support if the NRN_SANITIZERS variable is set. Comes befores PythonHelper.cmake.
Expand Down Expand Up @@ -318,9 +332,6 @@ if(NRN_ENABLE_RX3D)
message(SEND_ERROR "NRN_ENABLE_RX3D requires NRN_ENABLE_PYTHON feature.")
else()
find_package(Cython REQUIRED)
if(CYTHON_VERSION VERSION_GREATER_EQUAL 3)
message(FATAL_ERROR "Cython 3+ is not supported")
endif()
endif()
endif()
if(MINGW)
Expand Down Expand Up @@ -375,9 +386,6 @@ if(NRN_ENABLE_MUSIC)
message(FATAL "MUSIC requires -DNRN_ENABLE_PYTHON=ON")
endif()
find_package(Cython REQUIRED)
if(CYTHON_VERSION VERSION_GREATER_EQUAL 3)
message(FATAL_ERROR "Cython 3+ is not supported")
endif()
find_package(MUSIC REQUIRED)
set(NRN_MUSIC 1)
endif()
Expand Down Expand Up @@ -432,6 +440,9 @@ endif()
if(NRN_ENABLE_PYTHON)
# Make sure the USE_PYTHON macro is defined in the C++ code
list(APPEND NRN_COMPILE_DEFS USE_PYTHON)
# Ensure nanobind is there, but dont import, we don't want its CMake
nrn_add_external_project(nanobind DISABLE_ADD RECURSIVE SHALLOW)
include(NanoBindMinimal)
endif()

# =============================================================================
Expand Down Expand Up @@ -572,6 +583,10 @@ endif()
# =============================================================================
add_subdirectory(src/sparse13)
add_subdirectory(src/gnu)
if(NRN_ENABLE_PYTHON)
add_subdirectory(src/nrnpython)
endif()

add_subdirectory(src/nrniv)

# Collect the environment variables that are needed to execute NEURON from the build directory. This
Expand Down Expand Up @@ -603,10 +618,6 @@ if(NRN_ENABLE_PYTHON)
endif()
add_subdirectory(bin)

if(NRN_ENABLE_PYTHON)
add_subdirectory(src/nrnpython)
endif()

if(NRN_MACOS_BUILD)
add_subdirectory(src/mac)
endif()
Expand Down Expand Up @@ -743,22 +754,17 @@ add_custom_target(
# =============================================================================
if(NRN_ENABLE_CORENEURON OR NRN_ENABLE_MOD_COMPATIBILITY)
set(GLOBAL_VAR_TOGGLE_COMMAND "'s/ GLOBAL minf/ RANGE minf/'")
set(TABLE_VAR_TOGGLE_COMMAND "'s/ TABLE minf/ :TABLE minf/'")
else()
set(GLOBAL_VAR_TOGGLE_COMMAND "'s/ RANGE minf/ GLOBAL minf/'")
set(TABLE_VAR_TOGGLE_COMMAND "'s/ :TABLE minf/ TABLE minf/'")
endif()
separate_arguments(GLOBAL_VAR_TOGGLE_COMMAND UNIX_COMMAND "${GLOBAL_VAR_TOGGLE_COMMAND}")
separate_arguments(TABLE_VAR_TOGGLE_COMMAND UNIX_COMMAND "${TABLE_VAR_TOGGLE_COMMAND}")
add_custom_target(
hh_update
COMMAND sed ${GLOBAL_VAR_TOGGLE_COMMAND} ${CMAKE_SOURCE_DIR}/src/nrnoc/hh.mod >
${CMAKE_BINARY_DIR}/hh.mod.1
COMMAND sed ${TABLE_VAR_TOGGLE_COMMAND} ${CMAKE_BINARY_DIR}/hh.mod.1 >
${CMAKE_BINARY_DIR}/hh.mod.2
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/hh.mod.2
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/hh.mod.1
${CMAKE_SOURCE_DIR}/src/nrnoc/hh.mod
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/hh.mod.1 ${CMAKE_BINARY_DIR}/hh.mod.2
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/hh.mod.1
COMMENT "Update hh.mod for CoreNEURON compatibility"
VERBATIM)
add_dependencies(nrniv_lib hh_update)
Expand Down Expand Up @@ -1057,6 +1063,10 @@ if(NRN_ENABLE_PROFILING)
message(STATUS " Caliper | ${caliper_DIR}")
endif()
endif()
if(NRN_ENABLE_DIGEST OR NRN_ARCH_INDEP_EXP_POW)
message(STATUS "NRN_ENABLE_DIGEST | ${NRN_ENABLE_DIGEST}")
message(STATUS "NRN_ENABLE_ARCH_INDEP_EXP_POW | ${NRN_ENABLE_ARCH_INDEP_EXP_POW}")
endif()
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS " See documentation : https://www.neuron.yale.edu/neuron/")
message(STATUS "--------------+--------------------------------------------------------------")
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ Linux and Mac you can install the official Python 3 wheel with:
pip3 install neuron
```

If you want to build the latest version from source, we support **CMake** as build system. **Autotools** build system has been removed after 8.0 release.
If you want to build the latest version from source, we support **CMake** as build system.
See detailed installation instructions: [docs/install/install_instructions.md](docs/install/install_instructions.md).

It is possible to install the Linux Python wheels on Windows via the Windows Subsystem for Linux (WSL) - check the installation instructions above.

> [!NOTE]
> **About NEURON >= 9.0**: If you are experiencing compilation errors while using
> `nrnivmodl` with NEURON >=9.0, but not with previous 8.x releases, see
> [Adapting MOD files for C++ with NEURON >= 9.0](docs/guide/porting_mechanisms_to_cpp.rst).
## Documentation

* See documentation section of the [NEURON website](https://neuron.yale.edu/neuron/docs)
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ stages:
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export NRN_BUILD_FOR_UPLOAD=1
sudo mkdir /opt/nrnwheel
sudo tar -zxf $(readlineSF.secureFilePath) --directory /opt/nrnwheel/
sudo mkdir -p /opt/nrnwheel/$(uname -m)
sudo tar -zxf $(readlineSF.secureFilePath) --directory /opt/nrnwheel/$(uname -m)
packaging/python/build_wheels.bash osx $(python.version) coreneuron
displayName: 'Build MacOS Wheel'
Expand Down
10 changes: 1 addition & 9 deletions bin/nrnivmodl-core.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ APP_NAME="$(basename "$0")"

# directory and parent directory of this script
PARENT_DIR="$(dirname "$BASH_SOURCE")/.."

# prefer perl exe set by neuron wrappers in case of wheel
PERL_EXE="${CORENRN_PERLEXE:-@PERL_EXECUTABLE@}"
# in case of mac installer, wrapper is not used and hence
# check if binary exist. otherwise, just rely on perl being
# in default $PATH
if [ ! -f "${PERL_EXE}" ]; then PERL_EXE="$(which perl)"; fi

ROOT_DIR="$("${PERL_EXE}" -e "use Cwd 'abs_path'; print abs_path('$PARENT_DIR')")"
ROOT_DIR="$(readlink -f "$PARENT_DIR")"

# default arguments : number of parallel builds and default mod file path
PARALLEL_BUILDS=4
Expand Down
Loading

0 comments on commit 9541fd9

Please sign in to comment.