Skip to content

Commit

Permalink
Merge branch 'master' into slds
Browse files Browse the repository at this point in the history
  • Loading branch information
nrnhines committed Oct 1, 2024
2 parents 9414fb6 + 95cc05b commit 7cf79d6
Show file tree
Hide file tree
Showing 310 changed files with 9,215 additions and 10,254 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.

29 changes: 20 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 All @@ -86,6 +86,13 @@ jobs:
cmake_option: -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF
-DNRN_ENABLE_RX3D=OFF -DNMODL_SANITIZERS=address
sanitizer: address
- os: macOS-14
config:
build_mode: cmake
# TODO: investigate rxd test timeouts in this build and re-enable them
cmake_option: -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF
-DNRN_ENABLE_RX3D=OFF -DNMODL_SANITIZERS=address
sanitizer: thread
fail-fast: false

steps:
Expand Down Expand Up @@ -113,14 +120,18 @@ jobs:
brew unlink mpich
brew install openmpi
brew install --cask xquartz
if [[ "${{matrix.os}}" == "macOS-14" ]]; then
brew install cmake
echo "$(brew --prefix)/opt/cmake/bin" >> $GITHUB_PATH
fi
echo "$(brew --prefix)/opt/flex/bin:$(brew --prefix)/opt/bison/bin" >> $GITHUB_PATH
# Core https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
if [[ "${{matrix.os}}" == "macOS-13" ]]; then
echo CMAKE_BUILD_PARALLEL_LEVEL=4 >> $GITHUB_ENV
echo CTEST_PARALLEL_LEVEL=4 >> $GITHUB_ENV
echo CMAKE_BUILD_PARALLEL_LEVEL=4 >> $GITHUB_ENV
echo CTEST_PARALLEL_LEVEL=4 >> $GITHUB_ENV
else
echo CMAKE_BUILD_PARALLEL_LEVEL=3 >> $GITHUB_ENV
echo CTEST_PARALLEL_LEVEL=3 >> $GITHUB_ENV
echo CMAKE_BUILD_PARALLEL_LEVEL=3 >> $GITHUB_ENV
echo CTEST_PARALLEL_LEVEL=3 >> $GITHUB_ENV
fi
echo CI_OS_NAME=osx >> $GITHUB_ENV
shell: bash
Expand All @@ -130,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 @@ -160,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 @@ -172,9 +183,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: Install a new automake
# A new automake is needed for python 3.12 because it generate a python script
Expand All @@ -196,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
2 changes: 1 addition & 1 deletion .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
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*)
39 changes: 21 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,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 +325,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 +379,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 +433,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 +576,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 All @@ -590,7 +598,11 @@ endfunction()
set(NRN_RUN_FROM_BUILD_DIR_ENV "NEURONHOME=${PROJECT_BINARY_DIR}/share/nrn"
"NRNHOME=${PROJECT_BINARY_DIR}")
prepend_to_var(PATH "${PROJECT_BINARY_DIR}/bin")
prepend_to_var(LD_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")
if(APPLE)
prepend_to_var(DYLD_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")
else()
prepend_to_var(LD_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")
endif()
if(NRN_ENABLE_CORENEURON)
list(APPEND NRN_RUN_FROM_BUILD_DIR_ENV "CORENRNHOME=${PROJECT_BINARY_DIR}")
endif()
Expand All @@ -599,10 +611,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 @@ -739,22 +747,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
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
13 changes: 12 additions & 1 deletion bin/nrnivmodl.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,19 @@ while [ "$1" ] ; do
UserNMODLFLAGS="$UserNMODLFLAGS $2"
shift
shift;;
-h|--help)
echo "Usage: nrnivmodl [options] [mod files or directories with mod files]"
echo "Options:"
echo " -coreneuron Compile MOD files for CoreNEURON using nrnivmodl-core."
echo " -incflags \"include flags\" Extra include flags and paths when MOD (C++) files are compiled."
echo " -loadflags \"link flags\" Extra link flags, paths, and libraries when MOD (C++) files are linked."
echo " -nmodl /path/to/nmodl Path to the new NMODL transpiler for MOD files (pre-alpha, development use only)."
echo " -nmodlflags \"CLI flags\" Additional CLI flags for new NMODL transpiler"
echo " -h, --help Show this help message and exit."
echo "If no MOD files or directories provided then MOD files from current directory are used."
exit 0;;
-*)
echo "$1 unrecognized"
echo "$1 unrecognized, check available CLI options with --help"
exit 1;;
*)
break;;
Expand Down
Loading

0 comments on commit 7cf79d6

Please sign in to comment.