Skip to content

Commit

Permalink
Merge branch 'master' into nodelist_test
Browse files Browse the repository at this point in the history
  • Loading branch information
ramcdougal committed Jun 20, 2023
2 parents ff111c1 + 7197b37 commit 7ce1b2a
Show file tree
Hide file tree
Showing 120 changed files with 1,138 additions and 1,251 deletions.
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/release-patch.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Action items
Pre-release
---
- [ ] Create a cherrypicks branch where all commits go into new release and open a PR against `release/x.y` branch
- [ ] Create CoreNEURON tag on the `release/x.y` branch after cherrypicking required commits, update semantic version in its `CMakeLists.txt`, tag it & update submodule in cherrypicks PR
- [ ] Look out for ModelDB regressions by manually submitting and analyzing [nrn-modeldb-ci](https://github.com/neuronsimulator/nrn-modeldb-ci/actions/workflows/nrn-modeldb-ci.yaml?query=event%3Aschedule++) for the cherrypicks branch vs previous version
- [ ] Make sure to look out for ModelDB regressions by manually submitting and analyzing [nrn-modeldb-ci](https://github.com/neuronsimulator/nrn-modeldb-ci/actions/workflows/nrn-modeldb-ci.yaml?query=event%3Aschedule++) for the cherrypicks branch vs previous version
- [ ] Update cherrypicks PR:
- [ ] Update semantic version in `CMakeLists.txt`
- [ ] Update changelog below and agree on it with everyone; then commit it to `docs/changelog` in the cherrypicks PR (copy structure as-is)
Expand All @@ -25,20 +24,20 @@ Sanity checks
- [ ] After cherrypicks PR is merged, make sure GitHub, Azure and CircleCI builds pass for `release/x.y` branch
- [ ] Run [nrn-build-ci](https://github.com/neuronsimulator/nrn-build-ci/actions/workflows/build-neuron.yml) for the `release/x.y` branch; see [nrn-build-ci guide](https://github.com/neuronsimulator/nrn-build-ci#azure-wheels-testing---manual-workflow)
- [ ] Activate ReadTheDocs build for `release/x.y` & make it hidden. Check docs are fine after build is done.
- [ ] Run BBP Simulation Stack, CoreNEURON CI & other relevant tests
- [ ] Run BBP Simulation Stack & other relevant tests
- [ ] Build release wheels but WITHOUT upload ([see details](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure))


Releasing
---
- [ ] Create new release+tag on GitHub via [release workflow](https://github.com/neuronsimulator/nrn/actions/workflows/release.yml?query=workflow%3A%22NEURON+Release%22). Note that the GitHub release will be marked as pre-release.
- [ ] Create new release+tag on GitHub via [release workflow](https://github.com/neuronsimulator/nrn/actions/workflows/release.yml?query=workflow%3A%22NEURON+Release%22). Note that the GitHub release will be marked as pre-release and will contain the full-src-package and the Windows installer at the end of the release workflow.
- [ ] Create, test and upload manual artifacts
- [ ] MacOS package installer (manual task, ask Michael)
- [ ] arm64 wheels (manual task, check with Alex or Pramod)
- [ ] aarch64 wheels (use existing `release/x.y-aarch64` branch for this, see [guide](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-circleci))
- [ ] Publish the `x.y.z` wheels on PyPI; see [wheel publishing instructions](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure)
- [ ] Once wheels are published, activate the `x.y.z` tag on ReadTheDocs
- [ ] Upload Windows installer from the wheels publishing Azure run (to get correct tag)
- [ ] Rename the Windows installer in the GitHub release to match the new version and the supported python versions (i.e. `nrn-8.2.2.w64-mingw-py-37-38-39-310-311-setup.exe`)
- [ ] Publish release on GitHub (edit https://github.com/neuronsimulator/nrn/releases/tag/x.y.z and un-tick the pre-release checkbox)


Expand Down
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ Action items

Pre-release
---
- [ ] Look out for ModelDB regressions by analyzing [nrn-modeldb-ci last version vs nightly reports](https://github.com/neuronsimulator/nrn-modeldb-ci/actions/workflows/nrn-modeldb-ci.yaml?query=event%3Aschedule++)
- [ ] Create CoreNEURON release branch, update semantic version in `CMakeLists.txt`, tag it & update submodule in NEURON
- [ ] Make sur to look out for ModelDB regressions by launching analyzing [nrn-modeldb-ci last version vs nightly reports](https://github.com/neuronsimulator/nrn-modeldb-ci/actions/workflows/nrn-modeldb-ci.yaml?query=event%3Aschedule++)

Sanity checks
---
- [ ] Create `release/x.y` branch and make sure GitHub, Azure and CircleCI builds pass
- [ ] Run [nrn-build-ci](https://github.com/neuronsimulator/nrn-build-ci/actions/workflows/build-neuron.yml) for the respective Azure build; see [Azure drop guide](https://github.com/neuronsimulator/nrn-build-ci#azure-wheels-testing---manual-workflow)
- [ ] Activate ReadTheDocs build for `release/x.y` & make it hidden. Check docs are fine after build is done.
- [ ] Run BBP Simulation Stack, CoreNEURON CI & other relevant tests
- [ ] Run BBP Simulation Stack & other relevant tests
- [ ] Build release wheels but WITHOUT upload ([see details](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure))


Expand All @@ -30,14 +29,15 @@ Releasing
- [ ] Update changelog below and agree on it with everyone; then commit it to `docs/changelog` (copy structure as-is)
- [ ] Update `docs/index.rst` accordingly with the new `.pkg` and `.exe` links for `PKG installer` and `Windows Installer`
- [ ] Run the ReadTheDocs build again for `release-x.y`, make sure the build passes and inspect the Changelog page.
- [ ] Create new release+tag on GitHub via [release workflow](https://github.com/neuronsimulator/nrn/actions/workflows/release.yml?query=workflow%3A%22NEURON+Release%22). Note that the GitHub release will be marked as pre-release.
- [ ] Create, test and upload manual artifacts
- [ ] Create new release+tag on GitHub via [release workflow](https://github.com/neuronsimulator/nrn/actions/workflows/release.yml?query=workflow%3A%22NEURON+Release%22). Note that the GitHub release will be marked as pre-release and will contain the full-src-package and the Windows installer at the end of the release workflow.
- [ ] Create, test and upload manual artifacts
- [ ] MacOS package installer (manual task, ask Michael)
- [ ] arm64 wheels (manual task, check with Alex or Pramod)
- [ ] aarch64 wheels (create a `release/x.y-aarch64` branch for this, see [guide](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-circleci))
- [ ] Publish the `x.y.z` wheels on Pypi; see [wheel publishing instructions](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure)
- [ ] Once wheels are published, activate the `x.y.z` tag on ReadTheDocs
- [ ] Upload Windows installer from the wheels publishing Azure run (to get correct tag)
- [ ] Rename the Windows installer in the GitHub release to match the new version and the supported python versions (i.e. `nrn-8.2.2.w64-mingw-py-37-38-39-310-311-setup.exe`
)
- [ ] Publish release on GitHub (edit https://github.com/neuronsimulator/nrn/releases/tag/x.y.z and un-tick the pre-release checkbox)


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- name: Install apt packages
run: |
sudo apt-get install xfonts-100dpi build-essential doxygen lcov libboost-all-dev libopenmpi-dev libmpich-dev libx11-dev libxcomposite-dev mpich openmpi-bin patchelf gpg ninja-build flex bison libfl-dev
sudo apt-get install xfonts-100dpi build-essential doxygen lcov libboost-all-dev libopenmpi-dev libmpich-dev libx11-dev libxcomposite-dev mpich openmpi-bin gpg ninja-build flex bison libfl-dev
shell: bash

- name: Setup Caliper profiler
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install apt packages
run: |
sudo apt-get update --fix-missing
sudo apt-get install build-essential libopenmpi-dev libmpich-dev libx11-dev libxcomposite-dev mpich openmpi-bin patchelf
sudo apt-get install build-essential libopenmpi-dev libmpich-dev libx11-dev libxcomposite-dev mpich openmpi-bin
sudo apt-get install ffmpeg doxygen pandoc
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
run: |
sudo apt-get install build-essential ccache libopenmpi-dev \
libmpich-dev libx11-dev libxcomposite-dev mpich ninja-build \
openmpi-bin patchelf flex libfl-dev bison
openmpi-bin flex libfl-dev bison
# The sanitizer builds use ubuntu 22.04
if [[ "${{matrix.os}}" == "ubuntu-20.04" ]]; then
sudo apt-get install g++-7 g++-8
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
name: tag-n-release ${{ github.event.inputs.rel_tag }} (${{ github.event.inputs.rel_branch }})
outputs:
release_url: ${{ steps.create_release.outputs.upload_url }}
rel_tag: ${{ env.REL_TAG }}
steps:
- uses: actions/checkout@v3
name: Checkout branch ${{ env.REL_BRANCH }}
Expand Down Expand Up @@ -74,15 +75,17 @@ jobs:
- name: Create full-src-package
id: tar
run: |
tar -czvf ${REL_TAG}.tar.gz nrn
echo "asset_file=${REL_TAG}.tar.gz" >> $GITHUB_OUTPUT
tar -czvf full-src-package-${REL_TAG}.tar.gz nrn
echo "asset_file=full-src-package-${REL_TAG}.tar.gz" >> $GITHUB_OUTPUT
- name: Upload full-src-package to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.tag-n-release.outputs.release_url }}
asset_name: ${{ github.job }}-${{ steps.tar.outputs.asset_file }}
asset_content_type: application/gzip
asset_path: ${{ steps.tar.outputs.asset_file }}
run: |
gh release upload ${{ needs.tag-n-release.outputs.rel_tag }} ${{ steps.tar.outputs.asset_file }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

windows-installer:
needs: tag-n-release
uses: neuronsimulator/nrn/.github/workflows/windows.yml@master
with:
tag: ${{ needs.tag-n-release.outputs.rel_tag }}
18 changes: 17 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ concurrency:
cancel-in-progress: true

on:
workflow_call:
inputs:
tag:
description: 'Release version (tag name)'
default: ''
required: true
type: string
push:
branches:
- master
- release/**
pull_request:
branches:
Expand All @@ -28,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.tag }}

- name: Retrieve rxd test data
run: |
Expand Down Expand Up @@ -84,3 +92,11 @@ jobs:
run: .\ci\win_test_installer.cmd
shell: cmd
working-directory: ${{runner.workspace}}\nrn

- name: Publish Release Installer
working-directory: ${{runner.workspace}}\nrn
if: inputs.tag != ''
run: |
gh release upload ${{ inputs.tag }} nrn-nightly-AMD64.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ endif()
# =============================================================================
# Add project directories AFTER CMake modules
# =============================================================================
add_subdirectory(src/gnu)
add_subdirectory(src/nrniv)

# Collect the environment variables that are needed to execute NEURON from the build directory. This
Expand Down Expand Up @@ -676,7 +677,7 @@ if(NRN_ENABLE_DOCS)
sphinx
COMMAND ${NRN_DOCS_COMMAND_PREFIX} ${SPHINX_EXECUTABLE} -j auto -b html
"${PROJECT_SOURCE_DIR}/docs" "${PROJECT_SOURCE_DIR}/docs/_build"
COMMAND echo "Copy/Paste to Browser ${PROJECT_SOURCE_DIR}/docs/_build/index.html"
COMMAND echo "Copy/Paste to Browser file://${PROJECT_SOURCE_DIR}/docs/_build/index.html"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs
COMMENT "Generating documentation with Sphinx")

Expand Down
90 changes: 1 addition & 89 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ stages:
-e NRN_RELEASE_UPLOAD \
-e SETUPTOOLS_SCM_PRETEND_VERSION \
-e NRN_BUILD_FOR_UPLOAD=1 \
'neuronsimulator/neuron_wheel:latest-gcc9-x86_64' \
'neuronsimulator/neuron_wheel:latest-x86_64' \
packaging/python/build_wheels.bash linux $(python.version) coreneuron
displayName: 'Building ManyLinux Wheel'
Expand All @@ -79,58 +79,6 @@ stages:
- template: ci/azure-wheel-test-upload.yml


- job: 'ManyLinuxGPUWheels'
timeoutInMinutes: 45
pool:
vmImage: 'ubuntu-20.04'
variables:
GPU_BUILD: 'true'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:

# Secure files documentation:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops
# NOTE: when uploading new secure files, access must be permitted from the Azure pipeline interface (check message there)
- task: DownloadSecureFile@1
name: mpt_headersSF
displayName: 'Download mpt_headers secure file'
inputs:
secureFile: 'mpt_headears.2.21.tar.gz'

# Note that mpt headers must be mounted in the docker imager under `/nrnwheel/mpt`
# This path is checked by `packaging/python/build_wheels.bash` when run in the image.
- script: |
sudo mkdir -p /opt/nrnwheel/mpt
sudo tar -zxf $(mpt_headersSF.secureFilePath) --directory /opt/nrnwheel/mpt
docker run --rm \
-w /root/nrn \
-v $PWD:/root/nrn \
-v /opt/nrnwheel/mpt:/nrnwheel/mpt \
-e NEURON_NIGHTLY_TAG \
-e NRN_NIGHTLY_UPLOAD \
-e NRN_RELEASE_UPLOAD \
-e SETUPTOOLS_SCM_PRETEND_VERSION \
-e NRN_BUILD_FOR_UPLOAD=1 \
'neuronsimulator/neuron_wheel_gpu:nvhpc-22.1-cuda-11.5-gcc9' \
packaging/python/build_wheels.bash linux $(python.version) coreneuron-gpu
displayName: 'Building ManyLinux Wheel'
- script: |
sudo apt update
sudo apt install -y mpich openmpi-bin libopenmpi-dev libmpich-dev
displayName: 'Install Test System Depdendencies'
- template: ci/azure-wheel-test-upload.yml

# Jobs to build OSX wheels natively
- job: 'MacOSWheels'
timeoutInMinutes: 45
Expand Down Expand Up @@ -202,42 +150,6 @@ stages:
- template: ci/azure-wheel-test-upload.yml


# Jobs to build NEURON installer natively
- job: 'WindowsInstaller'
timeoutInMinutes: 45
pool:
vmImage: windows-latest
variables:
MSYS2_ROOT: C:\msys64

steps:
- checkout: self
submodules: 'true'
clean: 'true'

- task: BatchScript@1
inputs:
filename: ci/win_download_deps.cmd
displayName: "Download Dependencies"
condition: succeeded()

- task: BatchScript@1
inputs:
filename: ci/win_install_deps.cmd
displayName: "Install Dependencies"
condition: succeeded()

# WSL is enabled by default in the image, with no installed linux distribution.
# WSL creates an unusable `bash.EXE` that can be resolved first from the environment.
# This is why we remove that file.
- script: |
rm.exe "C:/WINDOWS/system32/bash.EXE"
%MSYS2_ROOT%\usr\bin\bash -lc "$BUILD_SOURCESDIRECTORY/ci/win_build_cmake.sh"
displayName: "Build and Create Installer"
condition: succeeded()
- template: ci/azure-win-installer-upload.yml

- stage: Final
jobs:
- job: AzureDropURL
Expand Down
10 changes: 0 additions & 10 deletions bin/nrnivmodl_core_makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ ifeq ($(origin CXX), default)
CXX = @CMAKE_CXX_COMPILER@
endif

ifeq (@CORENRN_ENABLE_GPU@, ON)
ifneq ($(shell $(CXX) --version | grep -o nvc++), nvc++)
$(error GPU wheels are only compatible with the NVIDIA C++ compiler nvc++, but CXX=$(CXX) and --version gives $(shell $(CXX) --version))
endif
# nvc++ -dumpversion is simpler, but only available from 22.2
ifeq ($(findstring nvc++ @CORENRN_NVHPC_MAJOR_MINOR_VERSION@, $(shell $(CXX) --version)),)
$(error GPU wheels are currently not compatible across NVIDIA HPC SDK versions. You have $(shell $(CXX) -V | grep nvc++) but this wheel was built with @CORENRN_NVHPC_MAJOR_MINOR_VERSION@.)
endif
endif

# In case of wheel, python and perl exe paths are from the build machine.
# First prefer env variables set by neuron's nrnivmodl wrapper then check
# binary used during build. If they don't exist then simply use python and
Expand Down
29 changes: 4 additions & 25 deletions bin/nrnivmodl_makefile_cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,8 @@ endif
# - @NRN_LINK_DEFS
LDFLAGS = $(IV_LINK) $(READLINE_LINK) $(LINKFLAGS) $(UserLDFLAGS) @NRN_LINK_DEFS@

# In GPU wheel distributions then the shipped libnrniv.so is linked against
# some NVIDIA runtime libraries that are shipped with the wheel. If we use
# nrnivmodl on the user machine then the NVIDIA compilers will link the local
# versions of these libraries too, causing duplication.
libnrniv_without_nvidia: $(libdir)/libnrniv.so
cp -v $(libdir)/libnrniv.so $(OUTPUT)/libnrniv-without-nvidia.so
patchelf $(OUTPUT)/libnrniv-without-nvidia.so --print-needed | grep '^libnv\(hpcatm\|omp\|cpumath\|cpumath-avx2\|c\)-[a-f0-9]\{8\}\.so' | xargs -t -r -n 1 patchelf $(OUTPUT)/libnrniv-without-nvidia.so --remove-needed
patchelf $(OUTPUT)/libnrniv-without-nvidia.so --set-soname libnrniv-without-nvidia.so
patchelf $(OUTPUT)/libnrniv-without-nvidia.so --print-rpath
ldd $(OUTPUT)/libnrniv-without-nvidia.so

# In a GPU wheel build then we need to fudge libnrniv.so before linking to it.
# NEURONDEMO should be set when we run this as part of the wheel build, in
# which case we do *not* want this hack.
ifeq (@NRN_ENABLE_CORENEURON@@NRN_WHEEL_BUILD@@CORENRN_ENABLE_GPU@$(if $(NRNDEMO),OFF,ON), ONONONON)
NRNLIB_FLAGS = -L$(OUTPUT) -lnrniv-without-nvidia
NRNLIB_RPATH_FLAGS = -Wl,-rpath,\$$ORIGIN -Wl,-rpath,\$$ORIGIN/..
nrn_lib = libnrniv_without_nvidia
else
NRNLIB_FLAGS = -L$(libdir) -lnrniv
NRNLIB_RPATH_FLAGS = -Wl,-rpath,$(libdir)
nrn_lib =
endif
NRNLIB_FLAGS = -L$(libdir) -lnrniv
NRNLIB_RPATH_FLAGS = -Wl,-rpath,$(libdir)

OS_NAME := $(shell uname)
_cm =,
Expand Down Expand Up @@ -142,13 +121,13 @@ special: $(mech_lib)

$(mech_lib): $(mech_lib_type)

mech_lib_shared: mod_func.o $(mod_objs) $(nrn_lib) build_always
mech_lib_shared: mod_func.o $(mod_objs) build_always
@printf " => $(C_GREEN)LINKING$(C_RESET) shared library $(mech_lib)\n"
$(CXX_LINK_SHARED) -I $(incdir) -o ${mech_lib} ${_SONAME} \
$(mod_func_o) $(mod_objs) $(NRNLIB_FLAGS) $(NRNLIB_RPATH_FLAGS) $(LDFLAGS)
rm -f $(OBJS_DIR)/.libs/libnrnmech.so ; mkdir -p $(OBJS_DIR)/.libs ; cp $(mech_lib) $(OBJS_DIR)/.libs/libnrnmech.so

mech_lib_static: mod_func.o $(mod_objs) $(nrn_lib) build_always
mech_lib_static: mod_func.o $(mod_objs) build_always
@printf " => $(C_GREEN)LINKING$(C_RESET) static library $(mech_lib)\n"
ar cq ${mech_lib} $(mod_func_o) $(mod_objs) $(cobjs);

Expand Down
Loading

0 comments on commit 7ce1b2a

Please sign in to comment.