Skip to content

Commit

Permalink
Merge branch 'master' into hines/soma-center
Browse files Browse the repository at this point in the history
  • Loading branch information
nrnhines authored Nov 2, 2024
2 parents d6fd24b + 7653d21 commit e4560c7
Show file tree
Hide file tree
Showing 248 changed files with 4,504 additions and 6,990 deletions.
2 changes: 1 addition & 1 deletion .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<4' "cython<3" 'numpy<2' 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
51 changes: 0 additions & 51 deletions .github/workflows/formatting.yml

This file was deleted.

19 changes: 14 additions & 5 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ jobs:
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<4' "cython<3" 'numpy<2' 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
13 changes: 0 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
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
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*)
26 changes: 13 additions & 13 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 @@ -325,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 @@ -382,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 @@ -753,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 @@ -1067,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
14 changes: 12 additions & 2 deletions bin/nrnivmodl.in
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,15 @@ if [ "$LinkCoreNEURON" = true ] ; then
fi
fi

make -j 4 -f "${bindir}/nrnmech_makefile" "ROOT=${prefix}" "MODOBJFILES=$MODOBJS" "UserLDFLAGS=$UserLDFLAGS" "UserINCFLAGS=$UserINCFLAGS" "LinkCoreNEURON=$LinkCoreNEURON" "UserNMODLBIN=$UserNMODLBIN" "UserNMODLFLAGS=$UserNMODLFLAGS" special &&
echo "Successfully created $MODSUBDIR/special"
set +e

make -j 4 -f "${bindir}/nrnmech_makefile" "ROOT=${prefix}" "MODOBJFILES=$MODOBJS" "UserLDFLAGS=$UserLDFLAGS" "UserINCFLAGS=$UserINCFLAGS" "LinkCoreNEURON=$LinkCoreNEURON" "UserNMODLBIN=$UserNMODLBIN" "UserNMODLFLAGS=$UserNMODLFLAGS" special

MAKE_STATUS=$?

if [ $MAKE_STATUS -eq 0 ]; then
echo "Successfully created $MODSUBDIR/special"
else
printf "\nNOTE: If you are encountering MOD file compilation errors only with NEURON version 9.0 or later\n"
printf "refer to the C++ migration guide at https://nrn.readthedocs.io/en/9.0.0/guide/porting_mechanisms_to_cpp.html\n\n"
fi
4 changes: 2 additions & 2 deletions ci/win_build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export MSYSTEM_PREFIX=/mingw64
export PATH=/mingw64/bin:$PATH

# have compatible cython3
python3 -m pip install "cython<3"
python3 -m pip install "cython"

# if BUILD_SOURCESDIRECTORY not available, use te root of the repo
if [ -z "$BUILD_SOURCESDIRECTORY" ]; then
Expand All @@ -30,7 +30,7 @@ cd $BUILD_SOURCESDIRECTORY/build
-DNRN_ENABLE_RX3D=ON \
-DNRN_RX3D_OPT_LEVEL=2 \
-DNRN_BINARY_DIST_BUILD=ON \
-DPYTHON_EXECUTABLE=/c/Python38/python.exe \
-DPYTHON_EXECUTABLE=/c/Python39/python.exe \
-DNRN_ENABLE_PYTHON_DYNAMIC=ON \
-DNRN_PYTHON_DYNAMIC='c:/Python38/python.exe;c:/Python39/python.exe;c:/Python310/python.exe;c:/Python311/python.exe;c:/Python312/python.exe' \
-DCMAKE_INSTALL_PREFIX='/c/nrn-install' \
Expand Down
10 changes: 5 additions & 5 deletions ci/win_install_deps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ pwsh -command "(Get-Content C:\Python310\Lib\distutils\cygwinccompiler.py) -repl
pwsh -command "(Get-Content C:\Python311\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python311\Lib\distutils\cygwinccompiler.py"

:: install numpy
C:\Python38\python.exe -m pip install numpy==1.17.5 "cython < 3" || goto :error
C:\Python39\python.exe -m pip install numpy==1.19.3 "cython < 3" || goto :error
C:\Python310\python.exe -m pip install numpy==1.21.3 "cython < 3" || goto :error
C:\Python311\python.exe -m pip install numpy==1.23.5 "cython < 3" || goto :error
C:\Python312\python.exe -m pip install numpy==1.26.3 "cython < 3" || goto :error
C:\Python38\python.exe -m pip install numpy cython || goto :error
C:\Python39\python.exe -m pip install numpy cython || goto :error
C:\Python310\python.exe -m pip install numpy cython || goto :error
C:\Python311\python.exe -m pip install numpy cython || goto :error
C:\Python312\python.exe -m pip install numpy cython || goto :error
:: setuptools 70.2 leads to an error
C:\Python312\python.exe -m pip install setuptools==70.1.1 || goto :error

Expand Down
19 changes: 17 additions & 2 deletions ci/win_test_installer.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,24 @@ C:\Python38\python -c "import neuron; neuron.test(); quit()" || set "errorfound=
C:\Python39\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python310\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python311\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
:: install numpy dependency
python -m pip install "numpy<2"
C:\Python312\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"

:: install oldest supported numpy
C:\Python38\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python39\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python310\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python311\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error
C:\Python312\python.exe -m pip install -r packaging/python/oldest_numpy_requirements.txt || goto :error

:: test all pythons again
C:\Python38\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python39\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python310\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python311\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python312\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"

:: run also using whatever is system python
python -m pip install numpy
python --version
python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"

Expand Down
2 changes: 2 additions & 0 deletions cmake/BuildOptionDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set(NRN_AVOID_ABSOLUTE_PATHS_DEFAULT OFF)
set(NRN_NMODL_CXX_FLAGS_DEFAULT "-O0")
set(NRN_SANITIZERS_DEFAULT "")
set(NRN_ENABLE_MATH_OPT_DEFAULT OFF)
set(NRN_ENABLE_DIGEST_DEFAULT OFF)
set(NRN_ENABLE_ARCH_INDEP_EXP_POW_DEFAULT OFF)

# Some distributions may set the prefix. To avoid errors, unset it
set(NRN_PYTHON_DYNAMIC_DEFAULT "")
Expand Down
2 changes: 1 addition & 1 deletion cmake/Coverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(NRN_ENABLE_COVERAGE)
if(NOT BUILD_TYPE_UPPER STREQUAL "DEBUG")
message(WARNING "Using CMAKE_BUILD_TYPE=Debug is recommended with NRN_ENABLE_COVERAGE")
endif()
set(NRN_COVERAGE_FLAGS_UNQUOTED --coverage -fno-inline)
set(NRN_COVERAGE_FLAGS_UNQUOTED --coverage -fno-inline -fprofile-update=atomic)
string(JOIN " " NRN_COVERAGE_FLAGS ${NRN_COVERAGE_FLAGS_UNQUOTED})
set(NRN_COVERAGE_LINK_FLAGS --coverage)

Expand Down
Loading

0 comments on commit e4560c7

Please sign in to comment.