Skip to content

Commit

Permalink
Merge branch 'master' into arith_object_flux
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodk authored Feb 8, 2024
2 parents 325fdcb + f7aba0a commit 798c640
Show file tree
Hide file tree
Showing 121 changed files with 3,315 additions and 3,334 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
sudo apt-get install xvfb
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1600x1200x24 -noreset -nolock -shmem & # run in bg
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2

Expand All @@ -83,7 +83,7 @@ jobs:
git submodule update --init --recursive --force --depth 1 -- external/nmodl
- name: Set up Python@${{ env.PY_MIN_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PY_MIN_VERSION }}

Expand All @@ -95,12 +95,12 @@ jobs:
python -m pip install --upgrade -r ci_requirements.txt
- name: Set up Python@${{ env.PY_MID_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PY_MID_VERSION }}

- name: Set up Python@${{ env.PY_MAX_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PY_MAX_VERSION }}

Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
if: failure() && contains(github.event.pull_request.title, 'live-debug-coverage')
uses: mxschmitt/action-tmate@v3

- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
directory: ./build
fail_ci_if_error: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
shell: bash

- name: Set up Python@${{ env.DEFAULT_PY_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PY_VERSION }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Python dependencies
working-directory: ${{runner.workspace}}/nrn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Update submodule
working-directory: ${{runner.workspace}}/nrn
run: git submodule update --init external/coding-conventions
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
echo CI_OS_NAME=linux >> $GITHUB_ENV
shell: bash

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2

Expand All @@ -138,7 +138,7 @@ jobs:
- name: Set up Python@${{ env.PY_MIN_VERSION }}
if: ${{matrix.config.python_dynamic == 'ON'}}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PY_MIN_VERSION }}

Expand All @@ -151,7 +151,7 @@ jobs:
python -m pip install --upgrade -r ci_requirements.txt
- name: Set up Python@${{ env.PY_MAX_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PY_MAX_VERSION }}

Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
# Workaround for https://github.com/actions/cache/issues/92
- name: Checkout cache action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: actions/cache
ref: v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
release_url: ${{ steps.create_release.outputs.upload_url }}
rel_tag: ${{ env.REL_TAG }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout branch ${{ env.REL_BRANCH }}
with:
ref: ${{ env.REL_BRANCH }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
timeout-minutes: 45

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}

Expand All @@ -46,7 +46,7 @@ jobs:
working-directory: ${{runner.workspace}}\nrn

- name: Set up Python3
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
uses: mxschmitt/action-tmate@v3

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nrn-nightly-AMD64.exe
path: ${{runner.workspace}}\nrn\nrn-nightly-AMD64.exe
Expand Down
58 changes: 57 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ include:
- project: hpc/gitlab-upload-logs
file: enable-upload.yml


# see https://gitlab.com/gitlab-org/gitlab/-/issues/263401 for why we specify the flags like this now
# 130 characters seems to be the point at which jobs refuse to run
.matrix:
Expand Down Expand Up @@ -263,3 +262,60 @@ test:neuron:nmodl:nvhpc:omp:legacy:
test:neuron:nmodl:nvhpc:omp:
extends: [.test_neuron, .gpu_node]
needs: ["build:neuron:nmodl:nvhpc:omp"]


# Container building
mac_m1_container_build:
stage: .pre
tags:
- macos-arm64
script:
- if [ -z "${ARM64_IMAGE_TAG}" ]; then
- echo "Please set the ARM64_IMAGE_TAG variable"
- exit 1
- fi
- cd packaging/python
- echo "Replacing symlinks with their targets to keep podman happy"
- find . -type l -exec cp $(realpath {}) ./TEMP \; -exec rm {} \; -exec mv TEMP {} \;
- ls -l
- export BUILDAH_FORMAT=docker # enables ONBUILD instructions which are not OCI compatible
- machine_status=$(podman machine inspect | awk '/State/ {print $2}' | tr -d '",')
# If you start the machine yourself, make sure BUILDAH_FORMAT and the http proxy variables are set in the shell before doing so!
- if [[ "${machine_status}" != "running" ]]; then
- echo "Machine is in ${machine_status} status - starting"
- podman machine start
- fi
- podman build -t neuronsimulator/neuron_wheel:${ARM64_IMAGE_TAG} --build-arg MANYLINUX_IMAGE=manylinux2014_aarch64 -f Dockerfile .
- podman login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_AUTH_TOKEN} docker.io
- podman push neuronsimulator/neuron_wheel:${ARM64_IMAGE_TAG}
- podman rmi localhost/neuronsimulator/neuron_wheel:${ARM64_IMAGE_TAG}
rules:
- if: $CI_PIPELINE_SOURCE == "web"
when: manual

x86_64_container_build:
stage: .pre
image:
name: quay.io/buildah/stable
entrypoint: [""]
variables:
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_CPU_REQUEST: 2
KUBERNETES_MEMORY_LIMIT: 8Gi
KUBERNETES_MEMORY_REQUEST: 4Gi
tags:
- kubernetes
rules:
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
script:
- if [ -z "${X86_IMAGE_TAG}" ]; then
- echo "Please set the X86_IMAGE_TAG variable"
- exit 1
- fi
- export STORAGE_DRIVER=vfs # allows to build inside containers without additional mounts
- export BUILDAH_FORMAT=docker # enables ONBUILD instructions which are not OCI compatible
- cd packaging/python
- buildah bud --iidfile image_id -t neuronsimulator/neuron_wheel:${X86_IMAGE_TAG} -f Dockerfile .
- buildah login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_AUTH_TOKEN} docker.io
- buildah push $(<image_id) docker://docker.io/neuronsimulator/neuron_wheel:${X86_IMAGE_TAG}
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-22.9"

conda:
environment: docs/conda_environment.yml
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,11 @@ if(NRN_ENABLE_TESTS)
"${neurondemo_prefix}/${CMAKE_SHARED_LIBRARY_PREFIX}nrnmech${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_custom_command(
OUTPUT ${neurondemo_files}
COMMAND
${CMAKE_COMMAND} -E env ${NRN_RUN_FROM_BUILD_DIR_ENV} ${NRN_SANITIZER_ENABLE_ENVIRONMENT}
"${PROJECT_BINARY_DIR}/bin/neurondemo" "-nobanner" "-nogui" "-c" "quit()"
COMMAND ${CMAKE_COMMAND} -E env ${NRN_RUN_FROM_BUILD_DIR_ENV}
${NRN_SANITIZER_ENABLE_ENVIRONMENT} "${PROJECT_BINARY_DIR}/bin/nrnivmodl"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/share/nrn/demo/release
VERBATIM)

add_custom_target(generate-neurondemo-mechanism-library ALL DEPENDS ${neurondemo_files} nrniv
copy_share_lib_to_build)
# Initialize the submodule *before* including the test/CMakeLists.txt that uses it. This ensures
Expand Down
94 changes: 53 additions & 41 deletions cmake/CMakeListsNrnMech.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,60 @@ endif()
# Interview might have linked to libnrniv but we don't want to link to special
list(REMOVE_ITEM NRN_LINK_LIBS "interviews")

# CMake does some magic to transform sys libs to -l<libname>. We replicate it
foreach(link_lib ${NRN_LINK_LIBS})
# skip static readline library as it will be linked to nrniv (e.g. with wheel) also stub libraries
# from OSX can be skipped
if("${link_lib}" MATCHES "(libreadline.a|/*.tbd)")
continue()
endif()
function(get_link_libraries libs)
# CMake does some magic to transform sys libs to -l<libname>. We replicate it
foreach(link_lib ${libs})
# skip static readline library as it will be linked to nrniv (e.g. with wheel) also stub
# libraries from OSX can be skipped
if("${link_lib}" MATCHES "(libreadline.a|/*.tbd)")
continue()
endif()

get_filename_component(dir_path ${link_lib} DIRECTORY)
if(TARGET ${link_lib})
get_property(
link_flag
TARGET ${link_lib}
PROPERTY INTERFACE_LINK_LIBRARIES)
set(description
"Extracting link flags from target '${link_lib}', beware that this can be fragile.")
# Not use it yet because it can be generator expressions get_property(compile_flag TARGET
# ${link_lib} PROPERTY INTERFACE_COMPILE_OPTIONS) string(APPEND NRN_COMPILE_DEFS
# ${compile_flag})
elseif(NOT dir_path)
set(link_flag "-l${link_lib}")
set(description
"Generating link flags from name '${link_lib}', beware that this can be fragile.")
# avoid library paths from special directory /nrnwheel which used to build wheels under docker
# container
elseif("${dir_path}" MATCHES "^/nrnwheel")
continue()
elseif("${dir_path}" MATCHES "^(/lib|/lib64|/usr/lib|/usr/lib64)$")
# NAME_WLE not avaialble with CMake version < 3.14
get_filename_component(libname ${link_lib} NAME)
string(REGEX REPLACE "\\.[^.]*$" "" libname_wle ${libname})
string(REGEX REPLACE "^lib" "" libname_wle ${libname_wle})
set(link_flag "-l${libname_wle}")
set(description
"Extracting link flags from path '${link_lib}', beware that this can be fragile.")
else()
set(link_flag "${link_lib} -Wl,-rpath,${dir_path}")
set(description "Generating link flags from path ${link_lib}")
endif()
message(NOTICE "${description} Got: ${link_flag}")
string(APPEND NRN_LINK_DEFS " ${link_flag}")
endforeach()
get_filename_component(dir_path ${link_lib} DIRECTORY)
if(TARGET ${link_lib})
get_property(
sublink_flag
TARGET ${link_lib}
PROPERTY INTERFACE_LINK_LIBRARIES)
set(description
"Extracting link flags from target '${link_lib}', beware that this can be fragile.")
# Not use it yet because it can be generator expressions get_property(compile_flag TARGET
# ${link_lib} PROPERTY INTERFACE_COMPILE_OPTIONS) string(APPEND NRN_COMPILE_DEFS
# ${compile_flag})
foreach(sublink_lib ${sublink_flag})
if(TARGET ${sublink_lib})
message(NOTICE "For '${link_lib}' going to see TARGET '${sublink_lib}' recursively.")
get_link_libraries(${sublink_lib})
else()
set(link_flag "${link_flag} ${sublink_flag}")
endif()
endforeach()
elseif(NOT dir_path)
set(link_flag "-l${link_lib}")
set(description
"Generating link flags from name '${link_lib}', beware that this can be fragile.")
# avoid library paths from special directory /nrnwheel which used to build wheels under docker
# container
elseif("${dir_path}" MATCHES "^/nrnwheel")
continue()
elseif("${dir_path}" MATCHES "^(/lib|/lib64|/usr/lib|/usr/lib64)$")
# NAME_WLE not avaialble with CMake version < 3.14
get_filename_component(libname ${link_lib} NAME)
string(REGEX REPLACE "\\.[^.]*$" "" libname_wle ${libname})
string(REGEX REPLACE "^lib" "" libname_wle ${libname_wle})
set(link_flag "-l${libname_wle}")
set(description
"Extracting link flags from path '${link_lib}', beware that this can be fragile.")
else()
set(link_flag "${link_lib} -Wl,-rpath,${dir_path}")
set(description "Generating link flags from path ${link_lib}")
endif()
message(NOTICE "${description} Got: ${link_flag}")
string(APPEND NRN_LINK_DEFS " ${link_flag}")
endforeach()
endfunction(get_link_libraries)

get_link_libraries("${NRN_LINK_LIBS}")

# Compiler flags depending on cmake build type from BUILD_TYPE_<LANG>_FLAGS
string(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/CompilerHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "PGI" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC")
# Random123 does not play nicely with NVHPC 21.11+'s detection of ABM features, see:
# https://github.com/BlueBrain/CoreNeuron/issues/724 and
# https://github.com/DEShawResearch/random123/issues/6.
list(APPEND NRN_COMPILE_DEFS R123_USE_INTRIN_H=0)
list(APPEND NRN_R123_COMPILE_DEFS R123_USE_INTRIN_H=0)
endif()
else()
set(NRN_HAVE_NVHPC_COMPILER OFF)
Expand Down
Loading

0 comments on commit 798c640

Please sign in to comment.