Skip to content

Commit

Permalink
Merge branch 'master' into cornu/add_eigen
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino committed Oct 12, 2023
2 parents efdaaa8 + 4946a24 commit 3646c0f
Show file tree
Hide file tree
Showing 138 changed files with 1,125 additions and 2,282 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ concurrency:
cancel-in-progress: true

on:
merge_group:
push:
branches:
- master
Expand Down Expand Up @@ -65,7 +66,7 @@ jobs:
./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource
make -j install
deactivate
working-directory: ${{runner.temp}}
working-directory: ${{runner.temp}}

- name: Setup Xvfb
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ concurrency:
cancel-in-progress: true

on:
merge_group:
push:
branches:
- master
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/external.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: External CIs

concurrency:
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true

Expand All @@ -10,7 +10,7 @@ on:
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
get-last-azure-url:
runs-on: ubuntu-latest
Expand All @@ -19,7 +19,7 @@ jobs:
azure_drop_url: ${{ steps.drop.outputs.azure_drop_url }}
pr_azure_sha: ${{ steps.drop.outputs.pr_azure_sha }}
steps:
- id: drop
- id: drop
run: |
# use jq to get the last Azure drop URL from the PR and the SHA1 from the same body
export pr_json=$(gh pr view $PR_URL --json comments -q 'last(.comments[] .body | capture(".*(?<pr_azure_sha>[0-9a-f]{40}).*?(?<azure_drop_url>https://dev.azure.com/neuronsimulator/.*=zip)"))')
Expand All @@ -32,7 +32,7 @@ jobs:
export pr_azure_sha=$(echo $pr_json | jq -r .pr_azure_sha)
echo azure_drop_url=$azure_drop_url >> $GITHUB_OUTPUT
echo pr_azure_sha=$pr_azure_sha >> $GITHUB_OUTPUT
- id: remove-label
if: always()
run: |
Expand All @@ -47,7 +47,7 @@ jobs:
env:
pr_azure_sha: ${{ steps.drop.outputs.pr_azure_sha }}
azure_drop_url: ${{ steps.drop.outputs.azure_drop_url }}

nrn-modeldb-ci:
needs: get-last-azure-url
uses: neuronsimulator/nrn-modeldb-ci/.github/workflows/nrn-modeldb-ci.yaml@master
Expand All @@ -56,7 +56,7 @@ jobs:
neuron_v2: neuron-nightly

pr-update:
needs:
needs:
- nrn-modeldb-ci
- get-last-azure-url
runs-on: ubuntu-latest
Expand All @@ -68,4 +68,3 @@ jobs:
env:
ARTIFACTS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
pr_azure_sha: ${{ needs.get-last-azure-url.outputs.pr_azure_sha }}
7 changes: 4 additions & 3 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Check formatting

concurrency:
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: true

on:
merge_group:
push:
branches:
branches:
- release/**
pull_request:
branches:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: NEURON CI

concurrency:
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: true

on:
merge_group:
push:
branches:
branches:
# If nothing else, this is important for the ccache logic below...
- master
- release/**
Expand Down Expand Up @@ -34,7 +35,7 @@ jobs:
SDK_ROOT: $(xcrun --sdk macosx --show-sdk-path)
SKIP_WHEELHOUSE_REPAIR: true
BUILD_TYPE: Release
DESIRED_CMAKE_VERSION: 3.15
DESIRED_CMAKE_VERSION: 3.17
DYNAMIC_PYTHON_CMAKE_VERSION: 3.18
PY_MIN_VERSION: ${{ matrix.config.python_min_version || '3.8' }}
PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.11' }}
Expand Down Expand Up @@ -169,7 +170,7 @@ jobs:
./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource
make -j install
deactivate
working-directory: ${{runner.temp}}
working-directory: ${{runner.temp}}

- name: Register gcc problem matcher
if: ${{matrix.config.flag_warnings == 'ON'}}
Expand All @@ -195,7 +196,7 @@ jobs:
repository: actions/cache
ref: v3
path: tmp/actions/cache

- name: Make actions/cache@v3 run even on failure
run: |
sed -i'.bak' -e '/ post-if: /d' tmp/actions/cache/action.yml
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Windows Installer

concurrency:
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: true

on:
merge_group:
workflow_call:
inputs:
tag:
Expand All @@ -13,7 +14,7 @@ on:
required: true
type: string
push:
branches:
branches:
- master
- release/**
pull_request:
Expand Down Expand Up @@ -54,12 +55,12 @@ jobs:
.\nrn\ci\win_download_deps.cmd
shell: powershell
working-directory: ${{runner.workspace}}

- name: Install Dependencies
run: .\nrn\ci\win_install_deps.cmd
shell: powershell
working-directory: ${{runner.workspace}}

- name: Build and Create Installer
run: |
rm.exe C:\WINDOWS\system32\bash.EXE
Expand Down
19 changes: 3 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ option(NRN_AVOID_ABSOLUTE_PATHS
"Avoid embedding absolute paths in generated code (ccache optimisation)"
${NRN_AVOID_ABSOLUTE_PATHS_DEFAULT})
mark_as_advanced(NRN_AVOID_ABSOLUTE_PATHS)
option(NRN_DYNAMIC_UNITS_USE_LEGACY "Use legacy units as default for dynamic units"
${NRN_DYNAMIC_UNITS_USE_LEGACY_DEFAULT})
# note that if CoreNEURON is enabled then it is not necessary to enable this option
option(NRN_ENABLE_MOD_COMPATIBILITY "Enable CoreNEURON compatibility for MOD files"
${NRN_ENABLE_MOD_COMPATIBILITY_DEFAULT})
Expand Down Expand Up @@ -484,6 +482,9 @@ if(NOT NRN_ENABLE_MPI_DYNAMIC OR ${num_mpi} EQUAL 1)
set(NRN_INCLUDE_MPI_HEADERS ON)
endif()

# initialize CLI11 submodule
cpp_cc_git_submodule(CLI11 BUILD PACKAGE CLI11 REQUIRED)

# =============================================================================
# Enable CoreNEURON support
# =============================================================================
Expand All @@ -500,9 +501,6 @@ if(NRN_ENABLE_CORENEURON)
set(CORENRN_ENABLE_UNIT_TESTS
${NRN_ENABLE_TESTS}
CACHE BOOL "" FORCE)
set(CORENRN_ENABLE_LEGACY_UNITS
${NRN_DYNAMIC_UNITS_USE_LEGACY}
CACHE BOOL "" FORCE)
if(NRN_ENABLE_PROFILING)
if(NRN_PROFILER STREQUAL "caliper")
set(CORENRN_ENABLE_CALIPER_PROFILING ON)
Expand All @@ -512,9 +510,6 @@ if(NRN_ENABLE_CORENEURON)
endif()
set(CORENEURON_DIR ${PROJECT_SOURCE_DIR}/src/coreneuron)

# initialize CLI11 submodule
cpp_cc_git_submodule(CLI11 BUILD PACKAGE CLI11 REQUIRED)

add_subdirectory(${PROJECT_SOURCE_DIR}/src/coreneuron)

# By default `nrnivmodl` should look for `nrnivmodl-core` in the NEURON install prefix.
Expand Down Expand Up @@ -961,11 +956,6 @@ message(STATUS "CXX COMPILER | ${CMAKE_CXX_COMPILER}")
message(STATUS "BUILD_TYPE | ${CMAKE_BUILD_TYPE} (allowed: ${allowableBuildTypes})")
message(STATUS "COMPILE FLAGS | ${COMPILER_FLAGS}")
message(STATUS "Shared | ${NRN_ENABLE_SHARED}")
if(NRN_DYNAMIC_UNITS_USE_LEGACY)
message(STATUS "Default units | legacy units")
else()
message(STATUS "Default units | modern units (2019 nist constants)")
endif()
message(STATUS "MPI | ${NRN_ENABLE_MPI}")
if(NRN_ENABLE_MPI)
message(STATUS " DYNAMIC | ${NRN_ENABLE_MPI_DYNAMIC}")
Expand Down Expand Up @@ -1036,9 +1026,6 @@ message(STATUS "CoreNEURON | ${NRN_ENABLE_CORENEURON}")
if(NRN_ENABLE_CORENEURON)
message(STATUS " PATH | ${CORENEURON_DIR}")
message(STATUS " LINK FLAGS | ${CORENRN_LIB_LINK_FLAGS}")
if(NOT coreneuron_FOUND)
message(STATUS " Legacy Units| ${CORENRN_ENABLE_LEGACY_UNITS}")
endif()
endif()
if(NRN_UNIVERSAL2_BUILD)
message(STATUS "CMAKE_OSX_ARCH| ${CMAKE_OSX_ARCHITECTURES}")
Expand Down
2 changes: 0 additions & 2 deletions cmake/BuildOptionDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ set(NRN_ENABLE_MPI_DYNAMIC_DEFAULT OFF)
set(NRN_ENABLE_MOD_COMPATIBILITY_DEFAULT OFF)
set(NRN_ENABLE_REL_RPATH_DEFAULT OFF)
set(NRN_AVOID_ABSOLUTE_PATHS_DEFAULT OFF)
set(NRN_DYNAMIC_UNITS_USE_LEGACY_DEFAULT OFF)
set(NRN_NMODL_CXX_FLAGS_DEFAULT "-O0")
set(NRN_SANITIZERS_DEFAULT "")

Expand Down Expand Up @@ -68,7 +67,6 @@ set(NRN_OPTION_NAME_LIST
NRN_MODULE_INSTALL_OPTIONS
NRN_PYTHON_DYNAMIC
NRN_MPI_DYNAMIC
NRN_DYNAMIC_UNITS_USE_LEGACY
NRN_RX3D_OPT_LEVEL
NRN_SANITIZERS
CMAKE_BUILD_TYPE
Expand Down
30 changes: 1 addition & 29 deletions cmake/ConfigFileSetting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,6 @@ else()
set(DISCRETE_EVENT_OBSERVER 0)
endif()

# No longer a user option. Default modern units. Controlled at launch by the environment variable
# NRNUNIT_USE_LEGACY, and dynamically after launch by h.nrnunit_use_legacy(0or1). Left here solely
# to obtain a nrnunits.lib file for modlunit. Nmodl uses the nrnunits.lib.in file.
set(NRN_ENABLE_LEGACY_FR 0)
if(NRN_ENABLE_LEGACY_FR)
set(LegacyFR 1)
set(LegacyY "")
set(LegacyN "/")
set(LegacyYPy "")
set(LegacyNPy "#")
else()
set(LegacyFR 0)
set(LegacyY "/")
set(LegacyN "")
set(LegacyYPy "#")
set(LegacyNPy "")
endif()

if(NRN_ENABLE_MECH_DLL_STYLE)
set(NRNMECH_DLL_STYLE 1)
else()
Expand All @@ -126,12 +108,6 @@ if(NRN_ENABLE_PYTHON_DYNAMIC)
list(APPEND NRN_COMPILE_DEFS NRNPYTHON_DYNAMICLOAD)
endif()

if(NRN_DYNAMIC_UNITS_USE_LEGACY)
set(DYNAMIC_UNITS_USE_LEGACY_DEFAULT 1)
else()
unset(DYNAMIC_UNITS_USE_LEGACY_DEFAULT)
endif()

# =============================================================================
# Dependencies option
# =============================================================================
Expand Down Expand Up @@ -219,10 +195,8 @@ nrn_configure_file(nrnmpiuse.h src/oc)
nrn_configure_file(nrnconfigargs.h src/nrnoc)
nrn_configure_file(nrnneosm.h src/nrncvode)
nrn_configure_file(sundials_config.h src/sundials)
nrn_configure_dest_src(nrnunits.lib share/nrn/lib nrnunits.lib share/lib)
nrn_configure_dest_src(nrn.defaults share/nrn/lib nrn.defaults share/lib)
# NRN_DYNAMIC_UNITS requires nrnunits.lib.in be in same places as nrnunits.lib
file(COPY ${PROJECT_SOURCE_DIR}/share/lib/nrnunits.lib.in
file(COPY ${PROJECT_SOURCE_DIR}/share/lib/nrnunits.lib
DESTINATION ${PROJECT_BINARY_DIR}/share/nrn/lib)

if(NRN_MACOS_BUILD)
Expand All @@ -241,8 +215,6 @@ if(MINGW)
set(nrnskip_rebase "#")
nrn_configure_file(mknrndll.mak src/mswin/lib)
endif()
# TODO temporary workaround for mingw
file(COPY ${PROJECT_BINARY_DIR}/share/nrn/lib/nrnunits.lib.in DESTINATION ${PROJECT_BINARY_DIR}/lib)

# =============================================================================
# If Interviews is not provided, configure local files
Expand Down
4 changes: 2 additions & 2 deletions cmake/MacroHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ macro(nocmodl_mod_to_cpp modfile_basename)
OUTPUT ${PROJECT_BINARY_DIR}/${modfile_basename}.cpp
COMMAND
${CMAKE_COMMAND} -E env "MODLUNIT=${PROJECT_BINARY_DIR}/share/nrn/lib/nrnunits.lib"
${NRN_NOCMODL_SANITIZER_ENVIRONMENT} ${PROJECT_BINARY_DIR}/bin/nocmodl
${NRN_NOCMODL_SANITIZER_ENVIRONMENT} $<TARGET_FILE:nocmodl>
${PROJECT_SOURCE_DIR}/${modfile_basename}.mod
COMMAND sed "'s/_reg()/_reg_()/'" ${PROJECT_SOURCE_DIR}/${modfile_basename}.cpp >
${PROJECT_BINARY_DIR}/${modfile_basename}.cpp
COMMAND rm ${PROJECT_SOURCE_DIR}/${modfile_basename}.cpp
COMMAND ${CMAKE_COMMAND} -E rm ${PROJECT_SOURCE_DIR}/${modfile_basename}.cpp
DEPENDS nocmodl ${PROJECT_SOURCE_DIR}/${modfile_basename}.mod
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/nrniv)
endmacro()
Expand Down
2 changes: 1 addition & 1 deletion cmake/NeuronFileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ set(NMODL_FILES_LIST
units.cpp
version.cpp)

set(IVOS_FILES_LIST listimpl.cpp string.cpp observe.cpp regexp.cpp resource.cpp)
set(IVOS_FILES_LIST listimpl.cpp observe.cpp regexp.cpp resource.cpp)

set(MPI_DYNAMIC_INCLUDE nrnmpi_dynam.h nrnmpi_dynam_cinc nrnmpi_dynam_wrappers.inc)

Expand Down
3 changes: 0 additions & 3 deletions cmake_nrnconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

/* 1 for legacy, undef for NIST (as of 2017), for FARADAY and R */
#undef LegacyFR

/* define if using mingw */
#undef MINGW

Expand Down
22 changes: 18 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,37 @@ Contents:

### Local build

#### Setup
#### Virtual environment
It is recommended to use a Python virtual environment, for example:

```
```bash
python3 -m venv venv
source venv/bin/activate
```


In order to build documentation locally, you need to pip install the ``docs_requirements.txt`` :
```
pip3 install -r docs/docs_requirements.txt --upgrade
```

Also, make sure to have `Doxygen` and `pandoc` installed, and the dependencies listed in [conda_environment.yml](conda_environment.yml)
Note that this file is tailored to the ReadTheDocs setup, but lists all desired requirements.
Note that this conda environment file is tailored to the online ReadTheDocs setup (but it lists out all desired requirements, so make sure to check it out).

#### Anaconda environment

After installing Anaconda, create a new environment with the following command:

```bash
conda env create --quiet --name rtd --file docs/conda_environment.yml
conda activate rtd
```

This will install all dependencies needed to build the documentation locally, in a similar way as on ReadTheDocs. However ReadTheDocs has a different setup, so it is of interest to head over and check the build logs for additional information.

#### Confguring the build

With all dependencies installed, configure project with CMake as described in [CMake Build Options](./cmake_doc/options.rst#nrn-enable-docs-bool-off).
With all dependencies installed, configure project with CMake (>= v3.17) as described in [CMake Build Options](./cmake_doc/options.rst#nrn-enable-docs-bool-off).

e.g. in your CMake build folder:

Expand Down
Loading

0 comments on commit 3646c0f

Please sign in to comment.