pax_global_header00006660000000000000000000000064146502202010014502gustar00rootroot0000000000000052 comment=078a34a9dc12dab5a339d525ba159655ed703030 nrn-8.2.6/000077500000000000000000000000001465022020100123145ustar00rootroot00000000000000nrn-8.2.6/.circleci/000077500000000000000000000000001465022020100141475ustar00rootroot00000000000000nrn-8.2.6/.circleci/config.yml000066400000000000000000000067371465022020100161540ustar00rootroot00000000000000version: 2.1 orbs: python: circleci/python@0.3.2 jobs: manylinux2014-aarch64: parameters: NRN_PYTHON_VERSION: type: string NRN_NIGHTLY_UPLOAD: type: string machine: image: ubuntu-2004:202101-01 resource_class: arm.medium steps: - checkout - run: name: Build manylinux AArch64 wheel command: | 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 NEURON_WHEEL_VERSION \ -e NRN_BUILD_FOR_UPLOAD=1 \ 'neuronsimulator/neuron_wheel:latest-gcc9-aarch64' \ packaging/python/build_wheels.bash linux << parameters.NRN_PYTHON_VERSION >> coreneuron - store_artifacts: path: ./wheelhouse destination: artifacts - run: name: Test manylinux AArch64 wheel command: | # install mpi dependencies sudo apt update sudo apt install -y mpich openmpi-bin libopenmpi-dev libmpich-dev # choose available python versions from pyenv pyenv_py_ver="" case << parameters.NRN_PYTHON_VERSION >> in 37) pyenv_py_ver="3.7.9" ;; 38) pyenv_py_ver="3.8.7" ;; 39) pyenv_py_ver="3.9.1" ;; 310) pyenv_py_ver="3.10.1" ;; 311) pyenv_py_ver="3.11.0" ;; *) echo "Error: pyenv python version not specified!" && exit 1;; esac # install python dependencies: .10 is not available pyenv if [ "<< parameters.NRN_PYTHON_VERSION >>" == "310" ]; then sudo apt install software-properties-common -y sudo add-apt-repository ppa:deadsnakes/ppa -y sudo apt install python3.10 libpython3.10 python3.10-venv export PYTHON_EXE=$(which python3.10) else cd /opt/circleci/.pyenv/plugins/python-build/../.. && git pull && cd - env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $pyenv_py_ver --force pyenv global $pyenv_py_ver export PYTHON_EXE=$(which python) fi # test wheel packaging/python/test_wheels.sh $PYTHON_EXE $(ls -t wheelhouse/*.whl) - run: name: Upload nightly wheel to pypi.org command: | if [ "<< parameters.NRN_NIGHTLY_UPLOAD >>" == "true" ]; then python -m pip install twine python -m twine upload --verbose --skip-existing -u $TWINE_USERNAME -p $TWINE_PASSWORD wheelhouse/*.whl else echo "Skipping pypi.org upload!" fi workflows: build-workflow: jobs: - manylinux2014-aarch64: filters: branches: only: - /release\/.*/ - /circleci\/.*/ matrix: parameters: NRN_PYTHON_VERSION: ["311"] NRN_NIGHTLY_UPLOAD: ["false"] nightly: triggers: - schedule: cron: "0 0 * * *" filters: branches: only: - master jobs: - manylinux2014-aarch64: matrix: parameters: NRN_PYTHON_VERSION: ["37", "38", "39", "310", "311"] NRN_NIGHTLY_UPLOAD: ["true"] nrn-8.2.6/.clang-format.changes000066400000000000000000000002411465022020100162730ustar00rootroot00000000000000SortIncludes: false Standard: c++11 StatementMacros: [MKDLL, MKDLLdec, MKDLLif, MKDLLvp, MKDLLvpf, declareList, declarePtrList, implementList, implementPtrList] nrn-8.2.6/.cmake-format.changes.yaml000066400000000000000000000013651465022020100172400ustar00rootroot00000000000000additional_commands: nrn_add_test_group: pargs: 0 kwargs: CORENEURON: 0 ENVIRONMENT: '+' NAME: 1 MODFILE_PATTERNS: '+' NRNIVMODL_ARGS: '+' OUTPUT: '+' SCRIPT_PATTERNS: '+' SIM_DIRECTORY: 1 SUBMODULE: 1 nrn_add_test: pargs: 0 kwargs: GROUP: 1 NAME: 1 COMMAND: '+' ENVIRONMENT: '+' CONFLICTS: '+' PRECOMMAND: '+' PRELOAD_SANITIZER: 0 PROCESSORS: 1 REQUIRES: '+' OUTPUT: '*' SCRIPT_PATTERNS: '*' SIM_DIRECTORY: '?' nrn_add_test_group_comparison: pargs: 0 kwargs: GROUP: 1 REFERENCE_OUTPUT: '*' cpp_cc_build_time_copy: flags: ['NO_TARGET'] kwargs: INPUT: '1' OUTPUT: '1' nrn-8.2.6/.flake8000066400000000000000000000002021465022020100134610ustar00rootroot00000000000000[flake8] application-import-names = neuron ignore = W503, E203, E221, F841, E731 import-order-style = google max-line-length = 92 nrn-8.2.6/.git-blame-ignore-revs000066400000000000000000000006651465022020100164230ustar00rootroot00000000000000# Ignore blame of black formatting 4c6fd585f2d6138db5f77513a795a53cc56b0646 # Ignore blame of black formatting fixup #1729 d65a7083dbc54bede71aaf37c91677c8ce1f089d # Ignore blame of cmake-format formatting #1730 c5d0fc9499c22b947d76b65dfa756be154b93f18 # Ignore blame of clang-format formatting #1732 013b69a92bcbd09d917e5519940f75c511ed5072 # Ignore blame of extra clang-format formatting #1748 4d9a02539d13636c8e27cc123846072837d760be nrn-8.2.6/.githooks/000077500000000000000000000000001465022020100142215ustar00rootroot00000000000000nrn-8.2.6/.githooks/pre-commit000077500000000000000000000003121465022020100162170ustar00rootroot00000000000000[ -f clang-format-diff.py ] || wget https://raw.githubusercontent.com/llvm-mirror/clang/master/tools/clang-format/clang-format-diff.py git diff --cached --no-color | python clang-format-diff.py -p1 -i nrn-8.2.6/.github/000077500000000000000000000000001465022020100136545ustar00rootroot00000000000000nrn-8.2.6/.github/ISSUE_TEMPLATE/000077500000000000000000000000001465022020100160375ustar00rootroot00000000000000nrn-8.2.6/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000024641465022020100205370ustar00rootroot00000000000000--- name: NEURON Bug Report about: Detailed report to describe NEURON and CMake build related bugs title: '' labels: 'bug' assignees: '' --- ## Context ### Overview of the issue [Provide more details regarding the issue] ### Expected result/behavior [Describe what is the expected result and/or behavior] ### NEURON setup - Version: [e.g. master branch / 7.8.2] - Installation method [e.g. cmake build / pip / Windows Installer / macOS installer] - OS + Version: [e.g. Ubuntu 20.04] - Compiler + Version: [e.g. gcc-9] ## Minimal working example - MWE MWE that can be used for reproducing the issue and testing. A couple of examples: * python script: ```python from neuron import h def test_area(): soma = h.Section(name="soma") soma.L = soma.diam = 10 assert 314.159 < sum(seg.area() for seg in soma) < 314.16 test_area() ``` * CMake build commands: ```cmake git clone git@github.com:neuronsimulator/nrn.git mkdir build && cd build cmake -DNRN_ENABLE_CORENEURON=ON -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc .. cmake --build . -- ``` ## Logs [If this a build issue `CMakeError.log`, `CMakeOutput.log` or the output of `make VERBOSE=1` would be very helpful. Please attach the full file and not its content! Otherwise provide the error printed to the terminal or a screenshot of the issue] nrn-8.2.6/.github/ISSUE_TEMPLATE/ci.md000066400000000000000000000006021465022020100167520ustar00rootroot00000000000000--- name: NEURON CI bug about: Bugs related to the NEURON CIs (GitHub Actions, Azure, ReadTheDocs, CodeCov) title: '' labels: 'bug, CI' assignees: '' --- ## Context ### Overview of the CI issue [Provide more details regarding the issue] ### Expected result/behavior [Describe what is the expected result and/or behavior] ## CI Logs [If applicable, links to failing pipeline(s)] nrn-8.2.6/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000000331465022020100200230ustar00rootroot00000000000000blank_issues_enabled: true nrn-8.2.6/.github/ISSUE_TEMPLATE/feature_request.md000066400000000000000000000007441465022020100215710ustar00rootroot00000000000000--- name: NEURON Feature Request about: Request a feature in NEURON title: '' labels: 'enhancement' assignees: '' --- ## Overview of the feature [Provide more details regarding the requested feature] ## Foreseeable Impact [Provide if possible more details regarding the eventual impact of the feature] * Area(s) of change: HOC, Python, RXD, CoreNeuron, CMake etc. * Possible issues: non-backward compatible, high maintenance, etc. * External dependencies such as new libraries nrn-8.2.6/.github/ISSUE_TEMPLATE/release.md000066400000000000000000000065361465022020100200130ustar00rootroot00000000000000--- name: NEURON Release about: Create a NEURON release for a new branch from master. title: 'NEURON [x.y.z] release' labels: 'release' assignees: '' --- 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 & update submodule 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 & 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 --- - [ ] 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) - [ ] Create, test and upload manual artifacts (MacOS package installers, arm64/aarch64 wheels, ...) - [ ] 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) - [ ] Publish release on GitHub (edit https://github.com/neuronsimulator/nrn/releases/tag/x.y.z) Post-release --- - [ ] Tag `master` with `x.(y+1).dev` to mark the start of a new development cycle - [ ] Deactivate ReadTheDocs build for release/x.y - [ ] Let people know :rocket: Changelog ====== # NEURON X.Y ## [x.y.z] _Release Date_ : DD-MM-YYYY ### What's New * [List new features/support added] * ..... ### Breaking Changes * [List the changes that aren't backward compatible] * ... ### Deprecations * [List the features that are deprecated] * ... ### Bug Fixes * [List the important bug fixes] * ... ### Improvements / Other Changes * [List the improvements made in the new release and any other changes] * ... ### Upgrade Steps * [Describe how to migrate from previous NEURON Version] * ... For the complete list of features and bug fixes, see the list in [GitHub Issue #[GH_no.]](https://github.com/neuronsimulator/nrn/issues/#[GH_no.]) ReadTheDocs sneak peek ====================== * https://nrn.readthedocs.io/en/release-x.y Commits going into x.y.z ======================== [given `a.b.c` is the last release:] Since [a.b.c], with: ```bash git log --pretty=format:"%h : %s" a.b.c..release/x.y ``` we get: - [ ] commit 1 - [ ] commit 2 - [ ] ... nrn-8.2.6/.github/problem-matchers/000077500000000000000000000000001465022020100171205ustar00rootroot00000000000000nrn-8.2.6/.github/problem-matchers/address.json000066400000000000000000000004571465022020100214460ustar00rootroot00000000000000 { "problemMatcher": [ { "owner": "asan-problem-matcher", "severity": "warning", "pattern": [ { "regexp": "^.*AddressSanitizer: (.*)$", "message": 1 } ] } ] } nrn-8.2.6/.github/problem-matchers/gcc.json000066400000000000000000000010111465022020100205400ustar00rootroot00000000000000{ "__comment": "Taken from vscode-cpptools's Extension/package.json gcc rule", "problemMatcher": [ { "owner": "gcc-problem-matcher", "pattern": [ { "regexp": "^\\.\\./(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } ] } ] } nrn-8.2.6/.github/problem-matchers/undefined.json000066400000000000000000000010171465022020100217530ustar00rootroot00000000000000{ "problemMatcher": [ { "owner": "ubsan-problem-matcher", "severity": "warning", "pattern": [ { "regexp": "^.*\\/(src\\/.*):(\\d+):(\\d+): runtime error: (.*)$", "file": 1, "line": 2, "column": 3, "message": 4 }, { "regexp": "^.*UndefinedBehaviorSanitizer:.*$" } ] } ] } nrn-8.2.6/.github/workflows/000077500000000000000000000000001465022020100157115ustar00rootroot00000000000000nrn-8.2.6/.github/workflows/coverage.yml000066400000000000000000000115021465022020100202260ustar00rootroot00000000000000name: NEURON Code Coverage concurrency: group: ${{ github.workflow }}#${{ github.ref }} cancel-in-progress: true on: push: branches: - master - release/** pull_request: branches: - master - release/** # TODO : https://github.com/neuronsimulator/nrn/issues/1063 # paths-ignore: # - '**.md' # - '**.rst' # - 'docs/**' env: PY_MIN_VERSION: '3.7' PY_MAX_VERSION: '3.11' jobs: coverage: runs-on: ubuntu-22.04 name: Code Coverage timeout-minutes: 45 steps: - name: Install apt packages run: | sudo apt-get install build-essential doxygen lcov libopenmpi-dev libmpich-dev libx11-dev libxcomposite-dev mpich openmpi-bin patchelf gpg shell: bash - name: Setup Caliper profiler run: | git clone https://github.com/LLNL/Caliper.git cd Caliper mkdir build && cd build cmake .. make && sudo make install - name: Set up Python@${{ env.PY_MIN_VERSION }} uses: actions/setup-python@v5 with: python-version: ${{ env.PY_MIN_VERSION }} - name: Set up Python@${{ env.PY_MAX_VERSION }} uses: actions/setup-python@v5 with: python-version: ${{ env.PY_MAX_VERSION }} - uses: actions/checkout@v4 with: fetch-depth: 2 - name: Install Python@${{ env.PY_MIN_VERSION }} dependencies working-directory: ${{runner.workspace}}/nrn run: | python${PY_MIN_VERSION} -m pip install --upgrade pip -r nrn_requirements.txt - name: Install Python@${{ env.PY_MAX_VERSION }} dependencies working-directory: ${{runner.workspace}}/nrn run: | python${PY_MAX_VERSION} -m pip install --upgrade pip -r nrn_requirements.txt - name: Build & Test id: build-test shell: bash working-directory: ${{runner.workspace}}/nrn run: | export SHELL="/bin/bash" # Compiler setup export CC=gcc export CXX=g++ # Python setup export PYTHON_MIN=$(which $PYTHON_MIN_NAME); export PYTHON_MAX=$(which $PYTHON_MAX_NAME); mkdir build && cd build; # CMake options & flags export COVERAGE_FLAGS="--coverage -O0 -fno-inline -g"; export CMAKE_OPTION="-DNRN_ENABLE_MPI=ON -DNRN_ENABLE_INTERVIEWS=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_PYTHON_DYNAMIC=ON -DNRN_PYTHON_DYNAMIC=${PYTHON_MIN};${PYTHON_MAX} -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_PROFILING=ON"; cmake $CMAKE_OPTION -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DNRN_ENABLE_TESTS=ON -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" ..; # Coverage # The Linux runners apparently have 2 cores, but jobs were being killed when we did not specify this explicitly. # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources # By default we get a modern version of CMake that understands --parallel. cmake --build . --parallel 2 (cd ..; lcov --capture --initial --directory . --no-external --output-file build/coverage-base.info) export PATH=`pwd`/bin:$PATH; ctest -VV; (cd ..; lcov --capture --directory . --no-external --output-file build/coverage-run.info) lcov --add-tracefile coverage-base.info --add-tracefile coverage-run.info --output-file coverage-combined.info # Download codecov script and perform integrity checks curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --import # One-time step curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM shasum -a 256 -c codecov.SHA256SUM chmod +x codecov # Prefer auto-discovery for now. Specify reports once all python testing is unified under single report (-f option). ./codecov env: MATRIX_EVAL: "CC=gcc CXX=g++" PYTHON_MIN_NAME: "python${{ env.PY_MIN_VERSION }}" PYTHON_MAX_NAME: "python${{ env.PY_MAX_VERSION }}" # This step will set up an SSH connection on tmate.io for live debugging. # To enable it, you have to: # * add 'live-debug-coverage' to your PR title # * push something to your PR branch (note that just re-running the pipeline disregards the title update) - name: live debug session on failure (manual steps required, check `.github/coverage.yml`) if: failure() && contains(github.event.pull_request.title, 'live-debug-coverage') uses: mxschmitt/action-tmate@v3 nrn-8.2.6/.github/workflows/docs.yml000066400000000000000000000055611465022020100173730ustar00rootroot00000000000000name: NEURON Documentation concurrency: group: ${{ github.workflow }}#${{ github.ref }} cancel-in-progress: true on: push: branches: - master - release/** pull_request: branches: - master - release/** env: DEFAULT_PY_VERSION: '3.11' jobs: documentation: runs-on: ubuntu-20.04 name: Documentation timeout-minutes: 25 steps: - 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 sudo apt-get install ffmpeg doxygen pandoc shell: bash - name: Set up Python@${{ env.DEFAULT_PY_VERSION }} uses: actions/setup-python@v5 with: python-version: ${{ env.DEFAULT_PY_VERSION }} - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Python dependencies working-directory: ${{runner.workspace}}/nrn run: | python -m pip install --upgrade pip -r nrn_requirements.txt - name: Install Python documentation dependencies working-directory: ${{runner.workspace}}/nrn run: | python -m pip install --upgrade -r docs/docs_requirements.txt - name: Documentation id: documentation shell: bash working-directory: ${{runner.workspace}}/nrn run: | echo "-------- NEURON wheel --------"; python setup.py build_ext bdist_wheel; neuron_wheel=dist/NEURON*.whl; echo "-------- install wheel --------" python -m pip install $neuron_wheel; echo "-------- now build docs--------"; python setup.py docs; echo "-------- disable jekyll--------"; pushd docs/_build; touch .nojekyll; echo "-------- OK to deploy! --------"; echo "OK_TO_DEPLOY_DOCS=true" >> $GITHUB_ENV # This step will set up an SSH connection on tmate.io for live debugging. # To enable it, you have to: # * add 'live-debug-docs' to your PR title # * push something to your PR branch (note that just re-running the pipeline disregards the title update) - 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 nrn-8.2.6/.github/workflows/formatting.yml000066400000000000000000000061651465022020100206160ustar00rootroot00000000000000name: Check formatting concurrency: group: ${{ github.workflow }}#${{ github.ref }} cancel-in-progress: true on: push: branches: - master - release/** pull_request: branches: - master - release/** jobs: black: name: Python runs-on: ubuntu-20.04 timeout-minutes: 5 steps: - name: Set up Python@3.7 uses: actions/setup-python@v5 with: python-version: 3.7 - name: Install Black run: | python -m pip install --upgrade pip python -m pip install --upgrade black[jupyter]==22.12.0 - uses: actions/checkout@v4 - name: Check Python formatting working-directory: ${{runner.workspace}}/nrn run: | git ls-tree -z -r HEAD --name-only \ | grep -z '\.\(py\|ipynb\)$' \ | xargs -0 black --check --color --diff --target-version py37 cmake: name: CMake runs-on: ubuntu-20.04 timeout-minutes: 5 steps: - name: Set up Python@3.7 uses: actions/setup-python@v5 with: python-version: 3.7 - name: Install cmake-format run: | python -m pip install --upgrade pip python -m pip install --upgrade cmake-format pyyaml - name: Install Ninja run: | sudo apt-get update sudo apt-get install ninja-build - uses: actions/checkout@v4 - name: Configure working-directory: ${{runner.workspace}}/nrn run: | mkdir build cd build/ # Need to configure the build to trigger the hpc-coding-conventions # YAML magic cmake -G Ninja .. \ -DNRN_CMAKE_FORMAT=ON \ -DNRN_ENABLE_RX3D=OFF \ -DNRN_ENABLE_PYTHON=OFF \ -DNRN_ENABLE_INTERVIEWS=OFF \ -DNRN_ENABLE_MPI=OFF - name: Check CMake formatting working-directory: ${{runner.workspace}}/nrn/build run: ninja check-cmake-format cpp: name: C/C++ runs-on: ubuntu-20.04 timeout-minutes: 5 steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install ninja-build # The last .1 refers to ssciwr/clang-format-wheel#23. sudo pip install clang-format==12.0.1.1 command -v clang-format clang-format --version - uses: actions/checkout@v4 - name: Configure working-directory: ${{runner.workspace}}/nrn run: | mkdir build cd build/ # Need to configure the build to trigger the hpc-coding-conventions # YAML magic. Disable as much as possible now that the list of files # to format is based on git ls-tree. cmake -G Ninja .. \ -DClangFormat_EXECUTABLE=$(command -v clang-format) \ -DNRN_CLANG_FORMAT=ON \ -DNRN_ENABLE_INTERVIEWS=OFF \ -DNRN_ENABLE_MPI=OFF \ -DNRN_ENABLE_PYTHON=OFF \ -DNRN_ENABLE_RX3D=OFF - name: Check C/C++ formatting working-directory: ${{runner.workspace}}/nrn/build run: ninja check-clang-format nrn-8.2.6/.github/workflows/neuron-ci.yml000066400000000000000000000425471465022020100203470ustar00rootroot00000000000000name: NEURON CI concurrency: group: ${{ github.workflow }}#${{ github.ref }} cancel-in-progress: true on: push: branches: - master - release/** pull_request: branches: - master - release/** # TODO : https://github.com/neuronsimulator/nrn/issues/1063 # paths-ignore: # - '**.md' # - '**.rst' # - 'docs/**' env: BUILD_TYPE: Release DESIRED_CMAKE_VERSION: 3.15.0 PY_MIN_VERSION: '3.7' PY_MAX_VERSION: '3.11' jobs: ci: runs-on: ${{ matrix.os }} name: ${{ matrix.os }} - ${{ matrix.config.build_mode }} (${{ matrix.config.cmake_option }}${{ matrix.config.config_options }}${{ matrix.config.matrix_eval }}) timeout-minutes: 45 env: INSTALL_DIR: install SDK_ROOT: $(xcrun --sdk macosx --show-sdk-path) SKIP_WHEELHOUSE_REPAIR: true BUILD_TYPE: Release DESIRED_CMAKE_VERSION: 3.15.0 PY_MIN_VERSION: ${{ matrix.config.python_min_version || '3.8' }} PY_MAX_VERSION: ${{ matrix.config.python_max_version || '3.11' }} MUSIC_INSTALL_DIR: /opt/MUSIC strategy: matrix: os: [ macOS-12, ubuntu-20.04] config: - { matrix_eval : "CC=gcc-9 CXX=g++-9", build_mode: "setuptools"} - { matrix_eval : "CC=gcc-8 CXX=g++-8", build_mode: "cmake", music: ON} - { matrix_eval : "CC=gcc-9 CXX=g++-9", build_mode: "cmake", python_dynamic: ON} - { matrix_eval : "CC=gcc-7 CXX=g++-7" , build_mode: "cmake", cmake_option: "-DNRN_ENABLE_CORENEURON=ON"} - { matrix_eval : "CC=gcc-7 CXX=g++-7", build_mode: "cmake", cmake_option: "-DNRN_ENABLE_MPI=OFF -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_CORENEURON=ON"} - { matrix_eval : "CC=gcc-10 CXX=g++-10", build_mode: "cmake", cmake_option: "-DNRN_ENABLE_PYTHON=OFF -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_CORENEURON=ON"} include: - os: ubuntu-22.04 config: build_mode: cmake # TODO: -DCORENRN_ENABLE_NMODL=ON -DNMODL_SANITIZERS=undefined cmake_option: -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF -DCORENRN_SANITIZERS=undefined flag_warnings: ON sanitizer: undefined - os: ubuntu-22.04 config: build_mode: cmake # TODO: -DCORENRN_ENABLE_NMODL=ON -DNMODL_SANITIZERS=address,leak # TODO: CoreNEURON is only LeakSanitizer-clean if we disable MPI cmake_option: -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF -DCORENRN_SANITIZERS=address # TODO: address-leak is the dream, but there are many problems, # including external ones from the MPI implementations sanitizer: address fail-fast: false steps: - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ env.DESIRED_CMAKE_VERSION }} - name: Fix kernel mmap rnd bits if: ${{matrix.os == 'ubuntu-22.04'}} # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with # high-entropy ASLR in much newer kernels that GitHub runners are # using leading to random crashes: https://reviews.llvm.org/D148280 run: sudo sysctl vm.mmap_rnd_bits=28 - name: Install homebrew packages if: startsWith(matrix.os, 'macOS') run: | brew install ccache coreutils doxygen flex mpich ninja xz autoconf autoconf automake libtool brew unlink mpich brew install openmpi brew install --cask xquartz echo /usr/local/opt/flex/bin >> $GITHUB_PATH # Core https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources echo CMAKE_BUILD_PARALLEL_LEVEL=3 >> $GITHUB_ENV echo CTEST_PARALLEL_LEVEL=3 >> $GITHUB_ENV echo CI_OS_NAME=osx >> $GITHUB_ENV shell: bash - name: Install apt packages if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get install build-essential ccache libopenmpi-dev \ libmpich-dev libx11-dev libxcomposite-dev mpich ninja-build \ openmpi-bin patchelf # The sanitizer builds use ubuntu 22.04 if [[ "${{matrix.os}}" == "ubuntu-20.04" ]]; then sudo apt-get install g++-7 g++-8 fi # Core https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources echo CMAKE_BUILD_PARALLEL_LEVEL=2 >> $GITHUB_ENV echo CTEST_PARALLEL_LEVEL=2 >> $GITHUB_ENV echo CI_OS_NAME=linux >> $GITHUB_ENV shell: bash - uses: actions/checkout@v4 with: fetch-depth: 2 - name: Set up Python@${{ env.PY_MIN_VERSION }} if: ${{matrix.config.python_dynamic == 'ON'}} uses: actions/setup-python@v5 with: python-version: ${{ env.PY_MIN_VERSION }} - name: Install Python@${{ env.PY_MIN_VERSION }} dependencies if: ${{ matrix.config.python_dynamic == 'ON' }} working-directory: ${{runner.workspace}}/nrn run: | python -m pip install --upgrade pip -r nrn_requirements.txt - name: Set up Python@${{ env.PY_MAX_VERSION }} uses: actions/setup-python@v5 with: python-version: ${{ env.PY_MAX_VERSION }} - name: Install Python@${{ env.PY_MAX_VERSION }} dependencies working-directory: ${{runner.workspace}}/nrn run: | python -m pip install --upgrade pip -r nrn_requirements.txt - name: Setup MUSIC if: matrix.config.music == 'ON' run: | python3 -m venv music-venv source music-venv/bin/activate python3 -m pip install mpi4py "cython<3" "numpy<2" sudo mkdir -p $MUSIC_INSTALL_DIR sudo chown -R $USER $MUSIC_INSTALL_DIR # Stable build: https://github.com/INCF/MUSIC/archive/refs/heads/switch-to-MPI-C-interface.zip @ f33b66ea9348888eed1761738ab48c23ffc8a0d0 curl -L -o MUSIC.zip https://codeload.github.com/INCF/MUSIC/zip/f33b66ea9348888eed1761738ab48c23ffc8a0d0 unzip MUSIC.zip && mv MUSIC-* MUSIC && cd MUSIC ./autogen.sh # workaround for MUSIC on MacOS 12 if [[ "${{matrix.os}}" == "macOS-12" ]]; then MPI_CXXFLAGS="-g" MPI_CFLAGS="-g" MPI_LDFLAGS="-g" CC=mpicc CXX=mpicxx ./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource else ./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource fi make -j install deactivate working-directory: ${{runner.temp}} - name: Register gcc problem matcher if: ${{matrix.config.flag_warnings == 'ON'}} run: echo "::add-matcher::.github/problem-matchers/gcc.json" - name: Register sanitizer problem matcher if: ${{matrix.config.sanitizer}} run: echo "::add-matcher::.github/problem-matchers/${{matrix.config.sanitizer}}.json" - name: Hash config dictionary run: | cat << EOF > matrix.json ${{toJSON(matrix.config)}} EOF echo matrix.config JSON: cat matrix.json echo ----- - name: Restore compiler cache uses: actions/cache@v4 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}}- ${{matrix.os}}-${{hashfiles('matrix.json')}}- - name: Build and Test id: build-test shell: bash working-directory: ${{runner.workspace}}/nrn run: | # OS related if [ "$RUNNER_OS" == "Linux" ]; then export ${MATRIX_EVAL}; export SHELL="/bin/bash" else export CXX=${CXX:-g++}; export CC=${CC:-gcc}; fi if [ "$RUNNER_OS" == "macOS" ]; then # TODO - this is a workaround that was implemented for Azure being reported as getting stuck. # However it does not get stuck: neuron module not found and script goes to interpreter, seeming stuck. # This needs to be addressed and SKIP_EMBEDED_PYTHON_TEST logic removed everywhere. export SKIP_EMBEDED_PYTHON_TEST="true" fi # Python setup export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/lib/python/ # Python setup export PYTHON_MIN=$(command -v $PYTHON_MIN_NAME); export PYTHON_MAX=$(command -v $PYTHON_MAX_NAME); export PYTHON=$PYTHON_MAX if [ "$RUNNER_OS" == "macOS" ]; then # Python is not installed as a framework, so we need to writ 'backend: TkAgg' to `matplotlibrc`. # Since we are in a virtual environment, we cannot use `$HOME/matplotlibrc` # The following solution is generic and relies on `matplotlib.__file__` to know where to append backend setup. $PYTHON -c "import os,matplotlib; f =open(os.path.join(os.path.dirname(matplotlib.__file__), 'mpl-data/matplotlibrc'),'a'); f.write('backend: TkAgg');f.close();" fi; # Some logging echo $LANG echo $LC_ALL python3 -c 'import os,sys; os.set_blocking(sys.stdout.fileno(), True)' cmake --version # different builds with CMake if [[ "$BUILD_MODE" == "cmake" ]]; then cmake_args=(-G Ninja) # Sanitizer-specific setup if [[ -n "${{matrix.config.sanitizer}}" ]]; then CC=$(command -v clang-14) CXX=$(command -v clang++-14) symbolizer_path=$(realpath $(command -v llvm-symbolizer-14)) echo symbolizer_path=${symbolizer_path} cmake_args+=(-DCMAKE_BUILD_TYPE=Custom \ -DCMAKE_C_FLAGS="-O1 -g -Wno-writable-strings" \ -DCMAKE_CXX_FLAGS="-O1 -g -Wno-writable-strings" \ -DLLVM_SYMBOLIZER_PATH="${symbolizer_path}" \ -DNRN_SANITIZERS=$(echo ${{matrix.config.sanitizer}} | sed -e 's/-/,/g')) fi cmake_args+=(-DCMAKE_C_COMPILER="${CC}" \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER="${CXX}" \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ -DNRN_ENABLE_TESTS=ON \ ${{matrix.config.cmake_option}}) if [[ "$NRN_ENABLE_PYTHON_DYNAMIC" == "ON" ]]; then cmake_args+=(-DNRN_ENABLE_PYTHON=ON \ -DNRN_ENABLE_PYTHON_DYNAMIC=ON \ -DNRN_PYTHON_DYNAMIC="${PYTHON_MIN};${PYTHON_MAX}" \ -DNRN_ENABLE_CORENEURON=ON) else cmake_args+=(-DPYTHON_EXECUTABLE="${PYTHON}") fi if [[ "$NRN_ENABLE_MUSIC" == "ON" ]]; then cmake_args+=(-DNRN_ENABLE_MUSIC=ON \ -DCMAKE_PREFIX_PATH=${MUSIC_INSTALL_DIR} \ -DMUSIC_ROOT=${MUSIC_INSTALL_DIR}) fi # Enable more warnings in the builds whose compiler warnings we # highlight in the GitHub UI if [[ "${{matrix.config.flag_warnings}}" == "ON" ]]; then cmake_args+=(-DNRN_EXTRA_CXX_FLAGS="-Wall \ -Wno-char-subscripts \ -Wno-unknown-pragmas \ -Wno-unused-variable \ -Wno-unused-function \ -Wno-unused-but-set-variable \ -Wno-reorder \ -Wno-sign-compare \ -Wno-strict-aliasing \ -Wno-missing-braces \ -Wno-mismatched-tags" \ -DNRN_EXTRA_MECH_CXX_FLAGS="") fi mkdir build && cd build echo "Building with: ${cmake_args[@]}" cmake .. "${cmake_args[@]}" if ccache --version | grep -E '^ccache version 4\.(4|4\.1)$' then echo "------- Disable ccache direct mode -------" # https://github.com/ccache/ccache/issues/935 export CCACHE_NODIRECT=1 fi ccache -z # Older versions don't support -v (verbose) ccache -vs 2>/dev/null || ccache -s cmake --build . --parallel ccache -vs 2>/dev/null || ccache -s if [ "$RUNNER_OS" == "macOS" ] then echo $'[install]\nprefix='>src/nrnpython/setup.cfg; fi if [[ "$NRN_ENABLE_PYTHON_DYNAMIC" == "ON" ]]; then echo "--RUNNING BASIC TESTS FROM BUILD DIR--" for python in "${PYTHON_MIN}" "${PYTHON_MAX}" do echo "Using ${python}" NEURONHOME="${PWD}/share/nrn" \ PYTHONPATH="${PWD}/lib/python" \ PATH="${PWD}/bin" \ LD_LIBRARY_PATH="${PWD}/lib:${LD_LIBRARY_PATH}" \ DYLD_LIBRARY_PATH="${PWD}/lib:${DYLD_LIBRARY_PATH}" \ "${python}" -c "from neuron import h; import neuron; neuron.test()" done fi ctest --output-on-failure cmake --build . --target install export PATH="${INSTALL_DIR}/bin:${PATH}" if [[ -f "${INSTALL_DIR}/bin/nrn-enable-sanitizer" ]]; then echo --- bin/nrn-enable-sanitizer --- cat bin/nrn-enable-sanitizer echo --- nrn_enable_sanitizer=${INSTALL_DIR}/bin/nrn-enable-sanitizer nrn_enable_sanitizer_preload="${nrn_enable_sanitizer} --preload" else echo nrn-enable-sanitizer not found, not using it fi elif [[ "$BUILD_MODE" == "setuptools" ]]; then ./packaging/python/build_wheels.bash CI; fi; # basic test for cmake when python is not disabled if [[ "$BUILD_MODE" == "cmake" && ! "${cmake_args[*]}" =~ "NRN_ENABLE_PYTHON=OFF" ]]; then $PYTHON --version && ${nrn_enable_sanitizer_preload} $PYTHON -c 'import neuron; neuron.test()' fi; # test neurondemo with cmake if [[ "$BUILD_MODE" != "setuptools" ]]; then ${nrn_enable_sanitizer} neurondemo -nogui -c 'demo(4)' -c 'run()' -c 'quit()' fi; # with cmake dynamic check python_min and python_max together if [[ "$BUILD_MODE" == "cmake" && "$NRN_ENABLE_PYTHON_DYNAMIC" == "ON" ]]; then ${nrn_enable_sanitizer_preload} $PYTHON_MAX -c 'import neuron; neuron.test()' ${nrn_enable_sanitizer_preload} $PYTHON_MIN -c 'import neuron; neuron.test()' fi; # run rxd tests manually if rxd is enabled *and CoreNEURON is # disabled -- otherwise hh-related tests fail if [[ "$BUILD_MODE" == "cmake" \ && ! "${cmake_args[*]}" =~ "NRN_ENABLE_RX3D=OFF" \ && ! "${cmake_args[*]}" =~ "NRN_ENABLE_CORENEURON=ON" ]]; then ${nrn_enable_sanitizer_preload} $PYTHON ../share/lib/python/neuron/rxdtests/run_all.py fi; if [ "$BUILD_MODE" == "setuptools" ]; then neuron_wheel=wheelhouse/NEURON*.whl; # test with virtual environment ${nrn_enable_sanitizer_preload} ./packaging/python/test_wheels.sh $PYTHON $neuron_wheel # test with global installation ${nrn_enable_sanitizer_preload} ./packaging/python/test_wheels.sh $PYTHON $neuron_wheel false fi; env: BUILD_MODE: ${{ matrix.config.build_mode }} CCACHE_BASEDIR: ${{runner.workspace}}/nrn CCACHE_DIR: ${{runner.workspace}}/ccache NRN_ENABLE_PYTHON_DYNAMIC : ${{ matrix.config.python_dynamic }} NRN_ENABLE_MUSIC: ${{ matrix.config.music }} PYTHON_MIN_NAME: "python${{ env.PY_MIN_VERSION }}" PYTHON_MAX_NAME: "python${{ env.PY_MAX_VERSION }}" INSTALL_DIR : ${{ runner.workspace }}/install MATRIX_EVAL: ${{ matrix.config.matrix_eval }} # 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 # * push something to your PR branch (note that just re-running the pipeline disregards the title update) - name: live debug session on failure (manual steps required, check `.github/neuron-ci.yml`) if: failure() && contains(github.event.pull_request.title, 'live-debug-ci') uses: mxschmitt/action-tmate@v3 # see https://github.com/orgs/community/discussions/26822 final: name: Final CI needs: [ci] if: ${{ always() }} runs-on: ubuntu-latest steps: - name: Check ci matrix all done if: >- ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} run: exit 1 nrn-8.2.6/.github/workflows/release.yml000066400000000000000000000053711465022020100200620ustar00rootroot00000000000000name: NEURON Release on: workflow_dispatch: inputs: rel_branch: description: 'Release branch/commit' default: 'release/x.y' required: true rel_tag: description: 'Release version (tag name)' default: 'x.y.z' required: true env: GH_REPO: ${{ github.server_url }}/${{ github.repository }} REL_TAG: ${{ github.event.inputs.rel_tag }} REL_BRANCH: ${{ github.event.inputs.rel_branch }} jobs: tag-n-release: runs-on: ubuntu-latest name: tag-n-release ${{ github.event.inputs.rel_tag }} (${{ github.event.inputs.rel_branch }}) outputs: release_url: ${{ steps.create_release.outputs.upload_url }} steps: - uses: actions/checkout@v4 name: Checkout branch ${{ env.REL_BRANCH }} with: ref: ${{ env.REL_BRANCH }} - name: Create and upload tag ${{ env.REL_TAG }} run: | git config user.name github-actions git config user.email github-actions@github.com git tag -a $REL_TAG -m "${REL_TAG}" git push origin $REL_TAG env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} working-directory: ${{runner.workspace}}/nrn - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ env.REL_TAG }} release_name: Release ${{ env.REL_TAG }} prerelease: true full-src-package: runs-on: ubuntu-latest needs: tag-n-release steps: - name: Checkout feature-rich code run: | git clone --depth=1 --shallow-submodules --recurse-submodules $GH_REPO -b $REL_TAG --single-branch cd nrn LOCAL_TAG=`git tag` if [ $REL_TAG != $LOCAL_TAG ]; then echo "Wrong tag downloaded!" exit 1 else git log --oneline fi - name: Make nrnversion.h run: | mkdir build && cd build cmake -DNRN_ENABLE_PYTHON=OFF -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_MPI=OFF -DNRN_ENABLE_INTERVIEWS=OFF ../nrn make nrnversion_h VERBOSE=1 - name: Create full-src-package id: tar run: | tar -czvf ${REL_TAG}.tar.gz nrn echo ::set-output name=asset_file::${REL_TAG}.tar.gz - 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 }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} nrn-8.2.6/.github/workflows/windows.yml000066400000000000000000000046411465022020100201330ustar00rootroot00000000000000name: Windows Installer concurrency: group: ${{ github.workflow }}#${{ github.ref }} cancel-in-progress: true on: push: branches: - master - release/** pull_request: branches: - master - release/** # TODO : https://github.com/neuronsimulator/nrn/issues/1063 # paths-ignore: # - '**.md' # - '**.rst' # - 'docs/**' env: MSYS2_ROOT: C:\msys64 jobs: WindowsInstaller: runs-on: windows-latest timeout-minutes: 60 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python3 uses: actions/setup-python@v5 with: python-version: '3.11' - name: Download Dependencies run: | .\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 %MSYS2_ROOT%\usr\bin\bash -lc "$BUILD_SOURCESDIRECTORY/ci/win_build_cmake.sh" shell: cmd working-directory: ${{runner.workspace}}\nrn env: BUILD_SOURCESDIRECTORY: ${{runner.workspace}}\nrn # This step will set up an SSH connection on tmate.io for live debugging. # To enable it, you have to: # * add 'live-debug-win' to your PR title # * push something to your PR branch (note that just re-running the pipeline disregards the title update) - name: live debug session on failure (manual steps required, check `.github/windows.yml`) if: failure() && contains(github.event.pull_request.title, 'live-debug-win') uses: mxschmitt/action-tmate@v3 - name: Upload build artifact uses: actions/upload-artifact@v4 with: name: nrn-nightly-AMD64.exe path: ${{runner.workspace}}\nrn\nrn-nightly-AMD64.exe - name: Run installer and launch .hoc associaton test run: .\ci\win_install_neuron.cmd shell: cmd working-directory: ${{runner.workspace}}\nrn - name: Test Installer # temporarily disable rxd testing ( ci/win_test_installer.cmd <-> ci/win_test_installer_wo_rxd.cmd) # see https://github.com/neuronsimulator/nrn/issues/1522 run: .\ci\win_test_installer_wo_rxd.cmd shell: cmd working-directory: ${{runner.workspace}}\nrn nrn-8.2.6/.gitignore000066400000000000000000000013721465022020100143070ustar00rootroot00000000000000.clang-format .cmake-format.yaml nmodlconf.h.in nrnconf.h.in build .DS_Store .eggs/ .idea/ CMakeFiles/ Makefile Makefile.in .deps x86_64 __pycache__ venv virtualenv .python-version *.o *.lo # These files are generated at build time # It would be a good idea to create them in the # build directory in the future. src/nrnoc/apcount.c src/nrnoc/exp2syn.c src/nrnoc/expsyn.c src/nrnoc/feature.c src/nrnoc/hh.c src/nrnoc/hh.mod.orig src/nrnoc/hocusr.h src/nrnoc/intfire1.c src/nrnoc/intfire2.c src/nrnoc/intfire4.c src/nrnoc/netstim.c src/nrnoc/nrnversion. src/nrnoc/nrnversion.h src/nrnoc/oclmp.c src/nrnoc/passive.c src/nrnoc/pattern.c src/nrnoc/ppmark.c src/nrnoc/stim.c src/nrnoc/svclmp.c src/nrnoc/syn.c src/nrnoc/vclmp.c share/lib/python/neuron/help_data.dat nrn-8.2.6/.gitmodules000066400000000000000000000014131465022020100144700ustar00rootroot00000000000000[submodule "modules/iv"] path = external/iv url = https://github.com/neuronsimulator/iv.git [submodule "external/coreneuron"] path = external/coreneuron url = https://github.com/BlueBrain/CoreNeuron.git [submodule "external/catch2"] path = external/catch2 url = https://github.com/catchorg/Catch2.git [submodule "external/coding-conventions"] path = external/coding-conventions url = https://github.com/BlueBrain/hpc-coding-conventions.git [submodule "test/rxd/testdata"] path = test/rxd/testdata url = https://github.com/neuronsimulator/rxdtestdata [submodule "external/backward"] path = external/backward url = https://github.com/bombela/backward-cpp.git [submodule "external/Random123"] path = external/Random123 url = https://github.com/BlueBrain/Random123.git nrn-8.2.6/.pre-commit-config.yaml000066400000000000000000000002031465022020100165700ustar00rootroot00000000000000repos: - repo: https://github.com/psf/black rev: 22.1.0 hooks: - id: black language_version: python3 nrn-8.2.6/.readthedocs.yml000066400000000000000000000002011465022020100153730ustar00rootroot00000000000000version: 2 build: os: "ubuntu-22.04" tools: python: "mambaforge-22.9" conda: environment: docs/conda_environment.yml nrn-8.2.6/.sanitizers/000077500000000000000000000000001465022020100145655ustar00rootroot00000000000000nrn-8.2.6/.sanitizers/undefined.supp000066400000000000000000000035041465022020100174410ustar00rootroot00000000000000function:constructor(Object*) function:ctng.cpp implicit-integer-sign-change:double vector[2] Eigen::internal::pabs(double vector[2] const&) implicit-integer-sign-change:fgets_unlimited_nltrans(HocStr*, _IO_FILE*, int) implicit-integer-sign-change:invlfiresha.c implicit-integer-sign-change:ivRegexp::Search(char const*, int, int, int) nonnull-attribute:ECS_Grid_node::do_grid_currents(double*, double, int) nonnull-attribute:ECS_Grid_node::do_multicompartment_reactions(double*) nonnull-attribute:ECS_Grid_node::initialize_multicompartment_reaction() nonnull-attribute:get_reaction_rates(ICSReactions*, double*, double*, double*) nonnull-attribute:_ode_reinit(double*) nonnull-attribute:_rhs_variable_step(double const*, double*) null:GPolyLine::brush(ivBrush const*) null:GPolyLine::color(ivColor const*) pointer-overflow:_rhs_variable_step(double const*, double*) pointer-overflow:_rhs_variable_step_ecs(double const*, double*) pointer-overflow:coreneuron::_net_receive_kernel(double, coreneuron::Point_process*, int, double) pointer-overflow:coreneuron::_net_receive__NetStim(coreneuron::Point_process*, int, double) pointer-overflow:coreneuron::net_receive_NetStim(coreneuron::Point_process*, int, double) pointer-overflow:coreneuron::_net_receive__VecStim(coreneuron::Point_process*, int, double) pointer-overflow:NonLinImpRep::current(int, Memb_list*, int) pointer-overflow:pr_realcell(PreSyn&, NrnThread&, _IO_FILE*) shift-base:ACG::asLong() shift-base:nrnRan4int 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) vptr:NetCon::disconnect(ivObservable*) vptr:ObjObservable::object() vptr:PreSyn::disconnect(ivObservable*)nrn-8.2.6/CMakeLists.txt000066400000000000000000001257351465022020100150710ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.15 FATAL_ERROR) # Note that this needs to happen **before** the call to project(...). This is because CMake reads # the CRAYPE_LINK_TYPE environment variable inside the call to project(...) and sets various flags # and properties based on its value. Because we are so early in the CMake processing, we have to # figure out for ourselves whether or not we are running on a Cray system by looking for Cray # environment variables directly. if(DEFINED ENV{CRAYPE_VERSION}) # Older versions of the Cray software prefer static linking by default, which doesn't work with # NEURON with some compilers (GCC and Intel at the time of writing). Note that this variable will # not be set in the compiler and linker runtime environments, so we are relying on CMake baking in # the correct compiler flags based on the value we set here. In more recent versions of the Cray # software the default has changed; CMake knows about this in v3.15.3 and newer, but to support # older CMake versions we still need to set this explicitly. See: # https://github.com/neuronsimulator/nrn/issues/1153 set(ENV{CRAYPE_LINK_TYPE} dynamic) message(STATUS "Cray system detected...setting CRAYPE_LINK_TYPE=dynamic") endif() project( NEURON VERSION 8.2.6 LANGUAGES C CXX HOMEPAGE_URL "https://www.neuron.yale.edu/neuron/") # ============================================================================= # CMake common project settings # ============================================================================= set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) # ============================================================================= # CMake common project settings # ============================================================================= set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # ============================================================================= # Include default build options # ============================================================================= list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) include(BuildOptionDefaults) # ============================================================================= # Build options (boolean) # ============================================================================= option(NRN_ENABLE_DOCS "Build documentation" ${NRN_ENABLE_DOCS_DEFAULT}) # This is useful for readthedocs-style builds and the documentation CI, where the actual # installation of NEURON comes from an installed binary wheel. option( NRN_ENABLE_DOCS_WITH_EXTERNAL_INSTALLATION "Build documentation without building NEURON. It will be assumed that import neuron works, nrnivmodl is in PATH, etc." ${NRN_ENABLE_DOCS_WITH_EXTERNAL_INSTALLATION_DEFAULT}) mark_as_advanced(NRN_ENABLE_DOCS_WITH_EXTERNAL_INSTALLATION) option(NRN_ENABLE_SHARED "Build shared libraries (otherwise static library)" ${NRN_ENABLE_SHARED_DEFAULT}) option(NRN_ENABLE_INTERVIEWS "Enable GUI with INTERVIEWS" ${NRN_ENABLE_INTERVIEWS_DEFAULT}) option(NRN_ENABLE_MECH_DLL_STYLE "Dynamically load nrnmech shared library" ${NRN_ENABLE_MECH_DLL_STYLE_DEFAULT}) option(NRN_ENABLE_DISCRETE_EVENT_OBSERVER "Enable Observer to be a subclass of DiscreteEvent" ${NRN_ENABLE_DISCRETE_EVENT_OBSERVER_DEFAULT}) option(NRN_ENABLE_PYTHON "Enable Python interpreter support (default python3 fallback to python)" ${NRN_ENABLE_PYTHON_DEFAULT}) option(NRN_ENABLE_THREADS "Allow use of Pthreads" ${NRN_ENABLE_THREADS_DEFAULT}) option(NRN_ENABLE_MPI "Enable MPI support" ${NRN_ENABLE_MPI_DEFAULT}) option(NRN_ENABLE_MUSIC "Enable MUSIC support" ${NRN_ENABLE_MUSIC_DEFAULT}) option(NRN_ENABLE_RX3D "Enable rx3d support" ${NRN_ENABLE_RX3D_DEFAULT}) option(NRN_ENABLE_CORENEURON "Enable CoreNEURON support" ${NRN_ENABLE_CORENEURON_DEFAULT}) option(NRN_ENABLE_BACKTRACE "Enable pretty-printed backtraces" ${NRN_ENABLE_BACKTRACE_DEFAULT}) option(NRN_ENABLE_TESTS "Enable unit tests" ${NRN_ENABLE_TESTS_DEFAULT}) set(NRN_ENABLE_MODEL_TESTS "${NRN_ENABLE_MODEL_TESTS_DEFAULT}" CACHE STRING "Comma-separated list of detailed models to enable tests of.") # parse NRN_ENABLE_MODEL_TESTS as list string(REPLACE "," ";" NRN_ENABLE_MODEL_TESTS "${NRN_ENABLE_MODEL_TESTS}") # 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 "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}) option(NRN_ENABLE_REL_RPATH "Use relative RPATH in binaries. for relocatable installs/Python" ${NRN_ENABLE_REL_RPATH_DEFAULT}) option(NRN_WHEEL_BUILD ${NRN_WHEEL_BUILD_DEFAULT}) option(NRN_WHEEL_STATIC_READLINE "Use static readline libraries for the wheels." ${NRN_WHEEL_STATIC_READLINE_DEFAULT}) mark_as_advanced(NRN_ENABLE_REL_RPATH) mark_as_advanced(NRN_WHEEL_BUILD) # ============================================================================= # Build options (string) # ============================================================================= # ~~~ # NEURON module installation: # - OFF : do not install # - ON : install in ${CMAKE_INSTALL_PREFIX} (default) # NOTE: When building the wheel, this is set to OFF. # Dynamic Python version support: # - OFF : nrnpython interface is linked into libnrniv.so # - ON : nrnpython interface consistent with default python3 (falling back to python) # is built and loaded dynamically at run time (nrniv still works in the absence # of any Python at all). # - : semicolon (;) separated list of python executable used to create a separate # interface for each. When one of those versions of Python is launched, # "import neuron" will automatically load the appropriate module interface along # with the rest of neuron. Also nrniv -pyexe will work with any # in the list of python executables. # Dynamic MPI support: # - OFF : nrnmpi is linked into libnrniv.so # - ON : nrnmpi interface consistent with default mpi is built and loaded dynamically # at run time (nrniv still works in the absence of any mpi at all). # - : semicolon (;) separated list of MPI's bin directories to create a separate # libnrnmpi_xxx.so interface for each. When nrniv is launched with the -mpi argument, # the first mpi found will determine which interface is dynamically loaded." # Rx3D Cython generated files compiler optimization level. 0 is default. # Specific coverage files: # - OFF : Disable code coverage. # - ON : Collect code coverage for files (default all). # - : semicolon (;) separated list of files to collect coverage. # ~~~ option(NRN_ENABLE_MODULE_INSTALL "Enable installation of NEURON Python module for regular CMake builds" ${NRN_ENABLE_MODULE_INSTALL_DEFAULT}) option(NRN_ENABLE_PYTHON_DYNAMIC "Enable dynamic Python version support" ${NRN_ENABLE_PYTHON_DYNAMIC_DEFAULT}) set(NRN_PYTHON_DYNAMIC "" CACHE STRING "semicolon (;) separated list of python executables to create interface for (default python3)" ) option(NRN_ENABLE_MPI_DYNAMIC "Enable dynamic MPI library support" OFF) set(NRN_MPI_DYNAMIC "" CACHE STRING "semicolon (;) separated list of MPI include directories to build against (default to first found mpi)" ) set(NRN_RX3D_OPT_LEVEL "${NRN_RX3D_OPT_LEVEL_DEFAULT}" CACHE STRING "Optimization level for Cython generated files (non-zero may compile slowly)") option(NRN_ENABLE_COVERAGE "EnableCode Coverage (make cover_begin, make cover_html)" OFF) set(NRN_COVERAGE_FILES "" CACHE STRING "semicolon (;) separated list of files to collect code coverage") set(NRN_NMODL_CXX_FLAGS "${NRN_NMODL_CXX_FLAGS_DEFAULT}" CACHE STRING "space separated list of flags to be added to host tools (nocmodl, modlunit") separate_arguments(NRN_NMODL_CXX_FLAGS UNIX_COMMAND ${NRN_NMODL_CXX_FLAGS}) set(NRN_EXTRA_CXX_FLAGS "" CACHE STRING "Extra compiler flags for NEURON source files") separate_arguments(NRN_EXTRA_CXX_FLAGS) list(APPEND NRN_COMPILE_FLAGS ${NRN_EXTRA_CXX_FLAGS}) set(NRN_EXTRA_MECH_CXX_FLAGS "" CACHE STRING "Extra compiler flags for translated NEURON mechanisms") separate_arguments(NRN_EXTRA_MECH_CXX_FLAGS) option(NRN_ENABLE_PROFILING "Enable profiling" ${NRN_ENABLE_PROFILING_DEFAULT}) set(NRN_PROFILER "${NRN_PROFILER_DEFAULT}" CACHE STRING "Set which profiler to build against ('caliper', 'likwid')") # ============================================================================= # Set Python additional versions earlier (especially for old CMake) # ============================================================================= set(Python_ADDITIONAL_VERSIONS 3 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.8 2.7 2.6) # ============================================================================= # Include cmake modules # ============================================================================= # sub-directorty containing project submodules set(THIRD_PARTY_DIRECTORY "${PROJECT_SOURCE_DIR}/external") list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) include(cmake/PlatformHelper.cmake) include(cmake/CompilerHelper.cmake) include(cmake/MacroHelper.cmake) include(cmake/RpathHelper.cmake) include(cmake/ExternalProjectHelper.cmake) include(cmake/modules/FindPythonModule.cmake) include(cmake/Coverage.cmake) # set CMAKE_BUILD_TYPE and associated flags using allowableBuildTypes and CMAKE_BUILD_TYPE_DEFAULT set(allowableBuildTypes Custom Debug Release RelWithDebInfo Fast FastDebug) include(ReleaseDebugAutoFlags) # Try and emit an intelligent warning if the version number currently set in the CMake project(...) # call is inconsistent with the output of git describe. include(cmake/CheckGitDescribeCompatibility.cmake) # Save the version information from project(...) to an nrnsemanticversion.h header in the build # directory. This separate from nrnversion.h, which includes information about the latest git # commit, because it should change less frequently, but it is included in many more files. set(NRN_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(NRN_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(NRN_VERSION_PATCH ${PROJECT_VERSION_PATCH}) configure_file(src/nrnoc/nrnsemanticversion.h.in src/nrnoc/nrnsemanticversion.h @ONLY) # ============================================================================= # Add coding-conventions submodule so we can use helper functions defined there # ============================================================================= set(CODING_CONV_PREFIX "NRN") set(${CODING_CONV_PREFIX}_3RDPARTY_DIR "external") set(${CODING_CONV_PREFIX}_ClangFormat_REQUIRED_VERSION 12.0.1) set(${CODING_CONV_PREFIX}_ClangFormat_EXCLUDES_RE CACHE STRING "") # None needed set(CODING_CONV_CMAKE "${PROJECT_SOURCE_DIR}/${NRN_3RDPARTY_DIR}/coding-conventions/cpp/cmake") if(NOT EXISTS "${CODING_CONV_CMAKE}/3rdparty.cmake") # Abort with a helpful message if the current source tree lacks .git information, as in that case # we're not going to be able to initialise the submodule. nrn_submodule_file_not_found("3rdparty.cmake") nrn_initialize_submodule(external/coding-conventions) endif() include("${CODING_CONV_CMAKE}/3rdparty.cmake") cpp_cc_git_submodule(Random123) # ============================================================================= # Enable sanitizer support if the NRN_SANITIZERS variable is set # ============================================================================= include(cmake/SanitizerHelper.cmake) # ============================================================================= # Find required packages # ============================================================================= find_package(BISON REQUIRED) find_package(FLEX REQUIRED) # When shipping the wheels we want to link readline libs statically. if(NRN_WHEEL_STATIC_READLINE) # CMake will prefer dynamic libraries over static ones. With the following construct we make sure # we get them. set(ORIGINAL_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") endif() find_package(Readline REQUIRED) if(READLINE_FOUND) # MAC libedit.3.dylib does not have rl_event_hook Readline_LIBRARY may be a binary lib or (on the # MAC) a tbd file that points to the library and mentions all its definitions. this part has to be # prior to adding the nrniv subdirectory. execute_process(COMMAND grep -q rl_event_hook ${Readline_LIBRARY} RESULT_VARIABLE result) if(NOT result EQUAL 0) # define for src/oc/hoc.cpp set(DEF_RL_GETC_FUNCTION use_rl_getc_function) endif() # If we are not using self contained, static readline library created for building wheel then only # look for curses and termcap if(NOT NRN_WHEEL_STATIC_READLINE) find_package(Curses QUIET) find_package(Termcap QUIET) endif() endif() # Reset original CMake library suffixes if(ORIGINAL_CMAKE_FIND_LIBRARY_SUFFIXES) set(CMAKE_FIND_LIBRARY_SUFFIXES ${ORIGINAL_CMAKE_FIND_LIBRARY_SUFFIXES}) endif() if(NRN_ENABLE_RX3D) if(NOT NRN_ENABLE_PYTHON) message(SEND_ERROR "NRN_ENABLE_RX3D requires NRN_ENABLE_PYTHON feature.") else() find_package(Cython REQUIRED) endif() endif() if(MINGW) find_package(Termcap REQUIRED) endif() # ============================================================================= # Enable MPI # ============================================================================= if(NRN_ENABLE_MPI) # find_package(MPI REQUIRED) has a CMAKE_OSX_ARCHITECTURES edge case nrn_mpi_find_package() set(NRNMPI 1) set(PARANEURON 1) # avoid linking to C++ bindings add_definitions("-DMPI_NO_CPPBIND=1") add_definitions("-DOMPI_SKIP_MPICXX=1") add_definitions("-DMPICH_SKIP_MPICXX=1") # Launching mpi executable with full path can mangle different python versions and libraries (see # issue #894). ${MPIEXEC_NAME} would reinsert the full path, but ${CMAKE_COMMAND} -E env # ${MPIEXEC_NAME} does not. get_filename_component(MPIEXEC_NAME ${MPIEXEC_EXECUTABLE} NAME) # Detect if we have an OpenMPI v2 or older. execute_process( COMMAND "${MPIEXEC_EXECUTABLE}" --version RESULT_VARIABLE OPENMPI_TEST_RESULT OUTPUT_VARIABLE OPENMPI_TEST_OUTPUT) set(NRN_HAVE_OPENMPI2_OR_LESS OFF) if(${OPENMPI_TEST_RESULT} EQUAL 0 AND "${OPENMPI_TEST_OUTPUT}" MATCHES "^mpiexec \\(OpenRTE\\) ([0-9\.]+)") set(NRN_OPENMPI_VERSION "${CMAKE_MATCH_1}") message(STATUS "Detected OpenMPI ${NRN_OPENMPI_VERSION}") if("${NRN_OPENMPI_VERSION}" VERSION_LESS 3) set(NRN_HAVE_OPENMPI2_OR_LESS ON) message(STATUS "OpenMPI/share/nrn but for linux it has been . For now we keep # this distinction. # Also, the classic location for shared libraries has been //lib # and for max/linux we have move this to /lib. But windows has classically # expected these shared libraries in /bin (reduces the PATH and expected # by ctypes in the neuron module.) So for now we keep that distinction as # well. Setting these here as setup.py.in needs it. # ~~~ if(MINGW) set(NRN_INSTALL_SHARE_DIR ${CMAKE_INSTALL_PREFIX}) set(NRN_BUILD_SHARE_DIR ${CMAKE_BINARY_DIR}) set(NRN_INSTALL_SHARE_LIB_DIR ${CMAKE_INSTALL_PREFIX}/bin) else() set(NRN_INSTALL_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/nrn) set(NRN_BUILD_SHARE_DIR ${CMAKE_BINARY_DIR}/share/nrn) set(NRN_INSTALL_SHARE_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib) endif() # ============================================================================= # Add project directories AFTER CMake modules # ============================================================================= add_subdirectory(src/nrniv) add_subdirectory(bin) if(NRN_ENABLE_PYTHON) add_subdirectory(src/nrnpython) endif() if(NRN_MACOS_BUILD) add_subdirectory(src/mac) endif() if(MINGW) add_subdirectory(src/mswin) endif() # ============================================================================= # Collect the environment variables that are needed to execute NEURON from the build directory. This # is used when configuring tests, and when building documentation targets. TODO: be more careful # about trailing colons? # ============================================================================= set(NRN_RUN_FROM_BUILD_DIR_ENV "LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" "NEURONHOME=${PROJECT_BINARY_DIR}/share/nrn" "NRNHOME=${PROJECT_BINARY_DIR}" "PATH=${PROJECT_BINARY_DIR}/bin:$ENV{PATH}") if(NRN_ENABLE_CORENEURON AND NOT coreneuron_FOUND) # CoreNEURON is enabled *and* is being built internally list(APPEND NRN_RUN_FROM_BUILD_DIR_ENV "CORENRNHOME=${PROJECT_BINARY_DIR}") endif() if(NRN_ENABLE_PYTHON) list(APPEND NRN_RUN_FROM_BUILD_DIR_ENV PYTHONPATH=${PROJECT_BINARY_DIR}/lib/python:${PROJECT_SOURCE_DIR}/test/rxd:$ENV{PYTHONPATH}) endif() if(NRN_ENABLE_DOCS) # Do we need to set extra environment variables to find NEURON? set(NRN_DOCS_COMMAND_PREFIX ${CMAKE_COMMAND} -E env) if(NOT NRN_ENABLE_DOCS_WITH_EXTERNAL_INSTALLATION) list(APPEND NRN_DOCS_COMMAND_PREFIX ${NRN_RUN_FROM_BUILD_DIR_ENV}) endif() # Make sure all dependencies are available find_package(Doxygen REQUIRED) find_program(FFMPEG_EXECUTABLE ffmpeg REQUIRED) find_program(JUPYTER_EXECUTABLE jupyter REQUIRED) find_program(PANDOC_EXECUTABLE pandoc REQUIRED) find_package(Sphinx REQUIRED) set(docs_requirements_file "${PROJECT_SOURCE_DIR}/docs/docs_requirements.txt") file(STRINGS "${docs_requirements_file}" docs_requirements) # Make sure CMake reruns if docs_requirements.txt changeds. set_property(GLOBAL APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${docs_requirements_file}") foreach(docs_requirement ${docs_requirements}) if(${skip_next}) set(skip_next FALSE) continue() endif() # This is needed for ipython, which is pip installable but not importable. if("${docs_requirement}" STREQUAL "# do not check import of next line") set(skip_next TRUE) elseif("${docs_requirement}" MATCHES "^([a-zA-Z_][a-zA-Z0-9]*)") nrn_find_python_module(${CMAKE_MATCH_0} REQUIRED) endif() endforeach() # ============================================================================= # Setup Doxygen documentation # ============================================================================= # generate Doxyfile with correct source paths configure_file(${PROJECT_SOURCE_DIR}/docs/Doxyfile.in ${PROJECT_BINARY_DIR}/Doxyfile) add_custom_target( doxygen COMMAND ${NRN_DOCS_COMMAND_PREFIX} ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM) # ============================================================================= # Setup Sphinx documentation # ============================================================================= # Target to execute && convert notebooks to html. Note that neuron must be available for python # import, so we use NRN_RUN_FROM_BUILD_DIR_ENV. See docs/README.md. add_custom_target( notebooks COMMAND ${NRN_DOCS_COMMAND_PREFIX} NEURON_MODULE_OPTIONS="-nogui" bash ${PROJECT_SOURCE_DIR}/docs/notebooks.sh WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs) if(NRN_ENABLE_DOCS_WITH_EXTERNAL_INSTALLATION) message(STATUS "**Not** making the notebooks target depend on the rest of the NEURON build.") message(STATUS "Documentation building will probably fail if you haven't installed NEURON.") else() # We need NEURON to execute the notebooks. If we're building documentation as part of a normal # build, this means we need to schedule the documenation targets sufficiently late in the build. add_dependencies(notebooks hoc_module rxdmath) endif() add_custom_target( sphinx COMMAND ${NRN_DOCS_COMMAND_PREFIX} ${SPHINX_EXECUTABLE} -b html "${PROJECT_SOURCE_DIR}/docs" "${PROJECT_SOURCE_DIR}/docs/_build" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs COMMENT "Generating documentation with Sphinx") # Executing notebooks will add outputs in-place. We don't want those committed to the repo. This # commands cleans them out. add_custom_target( notebooks-clean COMMAND ${NRN_DOCS_COMMAND_PREFIX} bash ${PROJECT_SOURCE_DIR}/docs/notebooks.sh --clean WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs) # ============================================================================= # Build full docs # ============================================================================= add_custom_target( docs COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} --target doxygen COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} --target notebooks COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} --target sphinx COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} --target notebooks-clean COMMAND echo "The HTML docs are at file://${PROJECT_SOURCE_DIR}/docs/_build/index.html" COMMENT "Generating full documentation") endif() # ============================================================================= # Add coding-conventions submodule if code formatting enabled # ============================================================================= if(NRN_CMAKE_FORMAT OR NRN_CLANG_FORMAT) add_subdirectory(external/coding-conventions/cpp) endif() # ============================================================================= # ~~~ # Update hh.mod for CoreNEURON compatibility # - Replace GLOBAL variable by RANHE # - Comment out TABLE # ~~~ # ============================================================================= 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 ${CMAKE_SOURCE_DIR}/src/nrnoc/hh.mod COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/hh.mod.1 ${CMAKE_BINARY_DIR}/hh.mod.2 COMMENT "Update hh.mod for CoreNEURON compatibility" VERBATIM) add_dependencies(nrniv_lib hh_update) # ============================================================================= # Generate help_data.dat # ============================================================================= if(NRN_ENABLE_PYTHON) add_custom_target( help_data_dat COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/docs/parse_rst.py ${PROJECT_SOURCE_DIR}/docs/python ${PROJECT_SOURCE_DIR}/share/lib/python/neuron/help_data.dat COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/share/lib/python/neuron/help_data.dat ${PROJECT_BINARY_DIR}/lib/python/neuron/help_data.dat COMMENT "Generating help_data.dat" VERBATIM) add_dependencies(nrniv_lib help_data_dat) endif() # ============================================================================= # Add tests if enabled # ============================================================================= if(NRN_ENABLE_TESTS) # If CoreNEURON + NMODL are enabled, Catch2 will already have been set up... if(NOT TARGET Catch2::Catch2) nrn_add_external_project(catch2) set(CATCH_DIR ${PROJECT_SOURCE_DIR}/external/catch2) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/external/catch2/contrib) include(Catch) endif() include(CTest) nrn_find_python_module(pytest) nrn_find_python_module(pytest_cov) if(NRN_ENABLE_PYTHON) if(NOT PYTEST_FOUND) message(SEND_ERROR "pytest Python package is required.") elseif(NOT PYTEST_COV_FOUND) message(WARNING "pytest-cov package not installed. Python coverage will not be generated.") endif() else() # share/demo still required for testing add_custom_target( copy_demo_to_build COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/share/demo ${NRN_BUILD_SHARE_DIR}/demo COMMENT "Copying ${PROJECT_SOURCE_DIR}/share/demo to ${NRN_BUILD_SHARE_DIR}" VERBATIM) add_dependencies(nrniv_lib copy_demo_to_build) endif() # Initialize the submodule *before* including the test/CMakeLists.txt that uses it. This ensures # that the test infrastructure can find the names of the input data files and set up rules to copy # them into the test working directories. set(backup "${${CODING_CONV_PREFIX}_3RDPARTY_DIR}") set(${CODING_CONV_PREFIX}_3RDPARTY_DIR "test") cpp_cc_git_submodule(rxd/testdata) set(${CODING_CONV_PREFIX}_3RDPARTY_DIR "${backup}") add_subdirectory(test) endif() # ============================================================================= # Install targets # ============================================================================= install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/share/lib DESTINATION ${NRN_INSTALL_SHARE_DIR} PATTERN "python" EXCLUDE) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/share/demo DESTINATION ${NRN_INSTALL_SHARE_DIR}) install(FILES ${PROJECT_BINARY_DIR}/share/nrn/lib/nrnunits.lib ${PROJECT_BINARY_DIR}/share/nrn/lib/nrn.defaults DESTINATION ${NRN_INSTALL_SHARE_DIR}/lib) install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/share/lib/cleanup DESTINATION ${NRN_INSTALL_SHARE_DIR}/lib) # find headers to install nrn_find_project_files(NRN_HEADERS_PATHS ${HEADER_FILES_TO_INSTALL}) file(COPY ${NRN_HEADERS_PATHS} ${PROJECT_BINARY_DIR}/src/nrnoc/nrnsemanticversion.h ${PROJECT_BINARY_DIR}/src/oc/nrnpthread.h DESTINATION ${PROJECT_BINARY_DIR}/include) install(DIRECTORY ${PROJECT_BINARY_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX}) if(NRN_MACOS_BUILD) # universal build for neurondemo needs to be after, or at end of, install nrn_macos_after_install() endif() # ============================================================================= # Copy bash executable for windows # ============================================================================= if(MINGW) # ~~~ # nrniv.cpp calls nrnpyenv.sh with absolute path to bash.exe # this is sufficient on the build machine since a full # development environment exists. On the users install machine # using a setup.exe distribution, the setup.ex will contain a # minimal development environment with sufficient mingw programs # to allow nrnpyenv.sh to work. (see nrn/mingw_files/nrnmingwenv.sh) # ~~~ find_file(BASH_EXE bash.exe DOC "DOS path to bash.exe") message(STATUS "Found bash.exe at ${BASH_EXE}") if("${BASH_EXE}" STREQUAL "BASH_EXE-NOTFOUND") set(BASH_EXE "f:/msys64/usr/bin/bash.exe") message(WARNING "Can not find bash.exe, trying to use ${BASH_EXE}") endif() install(PROGRAMS ${BASH_EXE} DESTINATION ${CMAKE_INSTALL_PREFIX}/mingw/usr/bin) endif() # ============================================================================= # Installation steps for backward compatibility # ============================================================================= if(NOT NRN_WINDOWS_BUILD) # create arch folder under prefix with symlink to bin and lib nrn_install_dir_symlink(${CMAKE_INSTALL_PREFIX}/bin ${CMAKE_INSTALL_PREFIX}/${CMAKE_HOST_SYSTEM_PROCESSOR}/bin) nrn_install_dir_symlink(${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/${CMAKE_HOST_SYSTEM_PROCESSOR}/lib) endif() # ============================================================================= # Print build status # ============================================================================= # just for printing the compiler flags in the build status string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE_UPPER) if(BUILD_TYPE_UPPER MATCHES "CUSTOM") set(COMPILER_FLAGS "${CMAKE_CXX_FLAGS}") else() set(COMPILER_FLAGS "${CMAKE_CXX_FLAGS_${BUILD_TYPE_UPPER}}") endif() string(JOIN " " COMPILER_FLAGS "${COMPILER_FLAGS}" ${NRN_COMPILE_FLAGS}) message(STATUS "") message(STATUS "Configured NEURON ${PROJECT_VERSION}") message(STATUS "") message(STATUS "You can now build NEURON using:") message(STATUS " cmake --build . --parallel 8 [--target TARGET]") message(STATUS "You might want to adjust the number of parallel build jobs for your system.") message(STATUS "Some non-default targets you might want to build:") message(STATUS "--------------+--------------------------------------------------------------") message(STATUS " Target | Description") message(STATUS "--------------+--------------------------------------------------------------") message(STATUS "install | Will install NEURON to: ${CMAKE_INSTALL_PREFIX}") message(STATUS " | Change the install location of NEURON using:") message(STATUS " | cmake -DCMAKE_INSTALL_PREFIX=") message( STATUS "docs | Build full docs. Calls targets: doxygen, notebooks, sphinx, notebooks-clean") message(STATUS "uninstall | Removes files installed by make install (todo)") message(STATUS "--------------+--------------------------------------------------------------") message(STATUS " Build option | Status") message(STATUS "--------------+--------------------------------------------------------------") message(STATUS "C COMPILER | ${CMAKE_C_COMPILER}") 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}") if(NRN_ENABLE_MPI_DYNAMIC) list(LENGTH NRN_MPI_LIBNAME_LIST _num_mpi) math(EXPR num_mpi "${_num_mpi} - 1") foreach(val RANGE ${num_mpi}) list(GET NRN_MPI_LIBNAME_LIST ${val} libname) list(GET NRN_MPI_INCLUDE_LIST ${val} include) message(STATUS " LIBNAME | ${libname}") message(STATUS " INC | ${include}") endforeach(val) else() if(NRN_INCLUDE_MPI_HEADERS) message(STATUS " INC | ${MPI_INCLUDE_PATH}") else() message(STATUS " INC | N/A") endif() message(STATUS " LIB | ${MPI_LIBRARY}") endif() endif() if(NRN_ENABLE_MUSIC) message(STATUS "MUSIC | ${MUSIC_LIBDIR}") endif() message(STATUS "Python | ${NRN_ENABLE_PYTHON}") if(NRN_ENABLE_PYTHON) message(STATUS " EXE | ${NRN_DEFAULT_PYTHON_EXECUTABLE}") message(STATUS " INC | ${NRN_DEFAULT_PYTHON_INCLUDE_DIRS}") message(STATUS " LIB | ${NRN_DEFAULT_PYTHON_LIBRARIES}") message(STATUS " MODULE | ${NRN_ENABLE_MODULE_INSTALL}") message(STATUS " DYNAMIC | ${NRN_ENABLE_PYTHON_DYNAMIC}") if(NRN_ENABLE_PYTHON_DYNAMIC) list(LENGTH NRN_PYTHON_EXE_LIST _num_pythons) math(EXPR num_pythons "${_num_pythons} - 1") foreach(val RANGE ${num_pythons}) list(GET NRN_PYTHON_EXE_LIST ${val} exe) list(GET NRN_PYTHON_VER_LIST ${val} version) if(${version} LESS 3) message(SEND_ERROR "Python 3 required. Please upgrade.") endif() list(GET NRN_PYTHON_INCLUDE_LIST ${val} include) list(GET NRN_PYTHON_LIB_LIST ${val} lib) message(STATUS " EXE | ${exe}") message(STATUS " INC | ${include}") message(STATUS " LIB | ${lib}") endforeach(val) endif() endif() if(READLINE_FOUND) message(STATUS "Readline | ${Readline_LIBRARY}") endif() if(CURSES_FOUND) message(STATUS "Curses | ${CURSES_LIBRARIES}") elseif(TERMCAP_FOUND) message(STATUS "Termcap | ${TERMCAP_LIBRARIES}") endif() message(STATUS "RX3D | ${NRN_ENABLE_RX3D}") if(${NRN_ENABLE_RX3D}) message(STATUS " OptLevel | ${NRN_RX3D_OPT_LEVEL}") endif() message(STATUS "Interviews | ${NRN_ENABLE_INTERVIEWS}") if(NRN_ENABLE_INTERVIEWS) message(STATUS " PATH | ${IV_DIR}") message(STATUS " INC | ${IV_INCLUDE_DIR}") message(STATUS " X11 (INC) | ${X11_INCLUDE_DIR}") message(STATUS " (LIBDIR)| ${X11_LIBRARY_DIR}") if(IV_ENABLE_X11_DYNAMIC) message(STATUS " | IV_ENABLE_X11_DYNAMIC ${IV_ENABLE_X11_DYNAMIC}") message(STATUS " | IV_ENABLE_SHARED ${IV_ENABLE_SHARED}") endif() endif() message(STATUS "CoreNEURON | ${NRN_ENABLE_CORENEURON}") if(NRN_ENABLE_CORENEURON) message(STATUS " PATH | ${CORENEURON_DIR}") message(STATUS " LINK FLAGS | ${CORENEURON_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}") endif() message(STATUS "Tests | ${NRN_ENABLE_TESTS}") if(NRN_ENABLE_COVERAGE) message(STATUS "Coverage | Enabled") if(NRN_COVERAGE_FILES) message(STATUS " Files | ${NRN_COVERAGE_FILES}") endif() endif() if(NRN_ENABLE_PROFILING) message(STATUS "Profiling | ON") if(NRN_PROFILER STREQUAL "caliper") message(STATUS " Caliper | ${caliper_DIR}") endif() endif() message(STATUS "--------------+--------------------------------------------------------------") message(STATUS " See documentation : https://www.neuron.yale.edu/neuron/") message(STATUS "--------------+--------------------------------------------------------------") message(STATUS "") nrn-8.2.6/CONTRIBUTING.md000066400000000000000000000267071465022020100145610ustar00rootroot00000000000000# NEURON contribution guidelines ## Table of contents * **[Navigation](#nav)** * **[Getting oriented](#orient)** * **[Howto](#how)** * **[Reporting a bug](#bug)** * **[Code review process](#process)** ## Navigation There are several separate repositories that make up the NEURON project and you may contribute to any of these. A single *code board* manages the full set. This *Contributing* document is relevant not only for this repository but also for these other repositories. Five major repositories are directly included at this github: 1. [**nrn**](https://github.com/neuronsimulator/nrn) -- the main NEURON code. When you fork and clone this repository you will find the actual source in subdirectories under *nrn/src*. The subdirectories of primary interest will generally be those most recently edited -- *nrniv*, *nrnmpi*, *nrnpython*. By contrast some of the subdirectories will rarely if ever need updating. 1. [**progref-py**](https://github.com/neuronsimulator/progref-py) -- NEURON Python programmer's reference. As mentioned further below, the beginning user can often be of particular help to the community by clarifying documentation and examples which may have seemed clear to the person who wrote it but are lacking details that are needed for a student. 1. [**tutorials**](https://github.com/neuronsimulator/pythontutorial) -- here again, the student or beginning user can be of assistance either by improving existing tutorials or by providing new tutorials to illuminate aspects of NEURON that he or she had trouble with. 1. [**iv**](https://github.com/neuronsimulator/iv) -- the old Interviews graphical program, now largely deprecated in favor of modern GUIs. 1. [**progref-hoc**](https://github.com/neuronsimulator/progref-hoc) -- this is the _programmers reference_ for the hoc language, the 'higher order calculator' of Kernighan (a co-founder of UNIX). _hoc_ is now largely retired in favor of Python. The hoc code itself is in the nrn repository and also should not usually be touched. There are several NEURON-related repositories hosted elsewhere which also encourage contributions. Each of these will have it's own *Contributing* document. 1. [NMODL](https://github.com/BlueBrain/nmodl) -- improved method for compiling and porting *.mod* files using *abstract syntax trees* 1. [CoreNEURON](https://github.com/BlueBrain/CoreNeuron) -- an optimized NEURON for running on high performance computers (HPCs) 1. [NetPyNE](https://github.com/Neurosim-lab/netpyne) -- multiscale modeling tool for developing, simulating and analyzing networks which include complex cells, potentially with detailed molecular-modeling. 1. [NetPyNE-UI](https://github.com/MetaCell/NetPyNE-UI) -- graphical user interface for NetPyNE ## Getting oriented We encourage contributions to the NEURON simulator from individuals at all levels -- students, postdocs, academics, industry coders, etc. Knowledge of the domain of neural simulation is also helpful but much of the simulation technology is comparable to other simulation fields in biology and beyond -- numerical integration of ordinary differential equations (ODEs), here coupled with *events* (event-driven). If you want to pick up and try an existing improvement project, you will note that we have indicated levels of difficulty with [labels](https://github.com/neuronsimulator/nrn/labels). Most internal hacks will require knowledge of C/C++. Knowledge of python is also necessary for writing accompanying test code. Note that it can be much easier to get started by improving documentation or by adding new tutorials. There are some things that will make it easier to get your pull requests accepted quickly into the master build where it is teed-up for eventual release. Before you submit an issue, search the issue tracker to see if the problem or something very similar has already been addressed. The discussion there might show you some workaround or identify the status of a project. Consider what kind of change you have in mind: * For a **Major Feature**, first open an issue and make clear whether you are request the feature from the community or offering to provide the feature yourself. The *code board* will consider whether this is needed or whether some existing feature does approximately the same thing. If you would like to yourself *implement* the new feature, please submit an issue with the label **proposal** for your work first. This will also allow us to better coordinate effort and prevent duplication of work. We will also then be able to help you as you develop the feature so that it is can be readily integrated. * **Small Features** can be submitted directly. ## How to do this When you're ready to contribute to the code base, please consider the following guidelines: * Make a [fork](https://guides.github.com/activities/forking/) of this repository. From there you will clone your own version of the repository to your machine for compilation and running. * Make your changes in your version of the repo in a new git branch: ```shell git checkout -b my-fix-branch master ``` * For Python code contributions follow the Python Contribution guidelines. * When creating your fix or addition, consider what **new tests** may be needed for *continuous integration (CI)*, and what **new documentation** or documentation change is needed. * The full test-suite will run once you submit a pull-request. If you have concerns about the code, or if you've already failed the test-suite, you can run the test-suite locally on your machine. * Pull (fetch and merge) from *upstream* so that your current version contains all changes that have been made since you originally cloned or last pulled. ```shell git pull --ff upstream master ``` * Commit your changes using a descriptive commit message. ```shell git commit -a ``` * Push your branch to GitHub; note that this will push back to your version of NEURON code in your own github repository (the *origin*). ```shell git push origin my-fix-branch ``` * In GitHub, send a Pull Request to the `master` branch of the upstream repository of the relevant component -- this will run the test-suite before alerting the team. * If we suggest changes then: * Make the required updates. * Rewrite; Rerun test-suites; Repush; Rereq After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository. Development conventions: NEURON code is being built according to C/C++, Python best-practices. The easiest way to figure out what this is is to take a look at current code and copy the way things are formatted, indented, documented, and commented. The [Neuron Development Topics](https://neuronsimulator.github.io/nrn/dev/index.html) section of the documentation provides a starting point for understanding NEURON's internals. ### Code Formatting Currently we have enabled CMake and Clang code formatting using [cmake-format](https://github.com/cheshirekow/cmake_format) and [clang-format](https://clang.llvm.org/docs/ClangFormat.html). Before submitting a PR, make sure to run cmake-format and clang-format as below: * Make sure to install clang-format and cmake-format with Python version you are using: ``` pip3.7 install cmake-format==0.6.0 pyyaml --user brew install clang-format # or your favorite package manager ``` Now you should have the `clang-format` and `cmake-format` commands available. * Use `-DNRN_CMAKE_FORMAT=ON` option of CMake to enable CMake code formatting targets: ``` cmake .. -DPYTHON_EXECUTABLE=`which python3.7` -DNRN_CMAKE_FORMAT=ON ``` With this, new target called **cmake-format** can be used to automatically format all CMake files: ``` $ make cmake-format Scanning dependencies of target cmake-format Built target cmake-format ``` You can now use `git diff` to see how cmake-format has formatted existing CMake files. Note that if you want to exclude specific code section to be not formatted (e.g. comment blocks), you can use guards: ``` # ~~~ # This comment is fenced # and will not be formatted # ~~~ ``` Or, ``` # cmake-format: off # This bunny should remain untouched: # .   _ ∩ # cmake-format: on ``` See [cmake-format](https://github.com/cheshirekow/cmake_format) documentation for details. * For `clang-format` you should restrict formatting to only the code parts relevant to your change. This can be eachieved by setting following build options: ``` cmake .. -DNRN_CLANG_FORMAT=ON \ -DNRN_CMAKE_FORMAT=ON \ -DNRN_FORMATTING_ON="since-ref:master" \ -DNRN_FORMATTING_CPP_CHANGES_ONLY=ON ``` Note: Sometimes it might be necessary to point your build-system to the clang-format-diff utility, this can be done by supplying an additional flag: `-DClangFormatDiff_EXECUTABLE=/path/to/share/clang/clang-format-diff.py` * You can then run the `clang-format` target after a full build: ``` make && make clang-format ``` ## Python Contributions The Python source code is located under `share/lib/python/neuron`. Python unit tests are located under `test/pynrn` and use the [pytest](https://docs.pytest.org/) framework, along with [pytest-cov](https://pytest-cov.readthedocs.io/) for code coverage. Code coverage report can be found on [codecov.io under share/lib](https://codecov.io/gh/neuronsimulator/nrn/tree/master/share/lib) ### Code conventions Please follow [PEP8](https://www.python.org/dev/peps/pep-0008/) conventions in all submitted code and apply [black](https://black.readthedocs.io/en/stable/) formatting, a stricter superset of PEP8. Using [`pre-commit` hooks](https://pre-commit.com/), the `black` tool can be executed every time you commit, and automatically reformat your code according to the repository's preferences. To set up automatic formatting run the following commands from the root of the repository: pip install pre-commit pre-commit install **Note**: The first time you commit after installing the hooks, it can take a while to set up the environment. If your commit contains any formatting errors, an error will be displayed: Black will have reformatted your staged changes and your workspace will contain them as new unstaged changes; stage these changes and re-commit the now formatted code! You can also install and manually apply black formatting as follows: pip install black black /path/to/file.py This will reformat the entire file, not just your changes, and might pollute your PR. ## Reporting a bug Have you tested on the current alpha version of NEURON? If not, please clone, compile, install and run with current version (this one). Please let us know what operating system you were using when you found the bug. If you have access to another operating system, it is helpful if you can find out if the bug shows up there as well. Please indicate which operating system(s) the bug has been found in. In order to address a bug quickly, we need to reproduce and confirm it. Usually bugs will arise in the context of a simulation which will in many cases be extremely large. Please provide a *simple, short* example (zipped with any associated mod files and a README). The simplifying process may require considerable work to isolate the bug arising somewhere in the midst of a large simulation. Sometimes, this process alone is enough to identify the bug as a function limitation or documentation insufficiency, rather than a code bug per se. ## Code review process Pull requests are reviewed by the development team. If you don't receive any feedback after a couple weeks, please follow up with a new comment. nrn-8.2.6/Copyright000066400000000000000000000035141465022020100142120ustar00rootroot00000000000000Copyright (c) 2018, Michael Hines All rights reserved. This Copyright refers to all files in this distribution that do not have an explicit Copyright notice. See: grep -r '\' * All files are intended to have a license compatible with the following "three clause" open source BSD license. Please notify michael.hines@yale.edu if you believe any file is not compatible with the "three clause" open source BSD license. Redistribution and use in source and binary forms, with or without modification are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. nrn-8.2.6/MANIFEST.in000066400000000000000000000002331465022020100140500ustar00rootroot00000000000000include CMakeLists.txt include *.h *.in *.sh graft cmake graft src graft bin graft share/demo graft share/examples include share/lib/* graft share/lib/hoc nrn-8.2.6/README.md000066400000000000000000000055671465022020100136100ustar00rootroot00000000000000[![Build Status](https://dev.azure.com/neuronsimulator/nrn/_apis/build/status/neuronsimulator.nrn?branchName=master)](https://dev.azure.com/neuronsimulator/nrn/_build/latest?definitionId=1&branchName=master) [![Actions Status](https://github.com/neuronsimulator/nrn/workflows/Windows%20Installer/badge.svg)](https://github.com/neuronsimulator/nrn/actions) [![Actions Status](https://github.com/neuronsimulator/nrn/workflows/NEURON%20CI/badge.svg)](https://github.com/neuronsimulator/nrn/actions) [![codecov](https://codecov.io/gh/neuronsimulator/nrn/branch/master/graph/badge.svg?token=T7PIDw6LrC)](https://codecov.io/gh/neuronsimulator/nrn) [![Documentation Status](https://readthedocs.org/projects/nrn/badge/?version=latest)](http://nrn.readthedocs.io/?badge=latest) # NEURON NEURON is a simulator for models of neurons and networks of neuron. See [http://neuron.yale.edu](http://neuron.yale.edu) for installers, source code, documentation, tutorials, announcements of courses and conferences, and a discussion forum. ## Installing NEURON NEURON provides binary installers for Linux, Mac and Windows platforms. You can find the latest installers for Mac and Windows [here](https://neuron.yale.edu/ftp/neuron/versions/alpha/). For 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. 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. ## Documentation * See documentation section of the [NEURON website](https://neuron.yale.edu/neuron/docs) * See [https://nrn.readthedocs.io/en/latest/](https://nrn.readthedocs.io/en/latest/) for latest, nightly snapshot * See [docs/README.md](docs/README.md) for information on documentation (local build, Read the Docs setup) ## Changelog Refer to [docs/changelog.md](docs/changelog.md) ## Contributing to NEURON development Refer to [NEURON contribution guidelines](CONTRIBUTING.md) ## Funding NEURON development is supported by NIH grant R01NS11613 (PI M.L. Hines at Yale University). Collaboration is provided by the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL) with funding from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology. Additional funding from the European Union Seventh Framework Program (FP7/20072013) under grant agreement no. 604102 (HBP) and the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreement no. 720270 (Human Brain Project SGA1), no. 785907 (Human Brain Project SGA2) and no. 945539 (Human Brain Project SGA3). nrn-8.2.6/azure-pipelines.yml000066400000000000000000000166311465022020100161620ustar00rootroot00000000000000#============================================================================= # Azure Pipeline settings #============================================================================= # Nightly build master for pypi upload schedules: - cron: "0 0 * * *" branches: include: - master always: true # Auto cancel old PR builds pr: autoCancel: true # TODO : https://github.com/neuronsimulator/nrn/issues/1063 # paths: # exclude: # - docs # - README.md # Trigger build for certain branches only trigger: - master - release/* stages: - stage: BuildTestDeploy jobs: - job: 'ManyLinuxWheels' timeoutInMinutes: 30 pool: vmImage: 'ubuntu-20.04' strategy: matrix: Python37: python.version: '3.7' Python38: python.version: '3.8' Python39: python.version: '3.9' Python310: python.version: '3.10' Python311: python.version: '3.11' Python312: python.version: '3.12' 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 NEURON_WHEEL_VERSION \ -e NRN_BUILD_FOR_UPLOAD=1 \ 'neuronsimulator/neuron_wheel:latest-gcc9-x86_64' \ packaging/python/build_wheels.bash linux $(python.version) coreneuron 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: 40 pool: vmImage: 'macOS-12' strategy: matrix: Python37: python.version: '3.7' python.org.version: '3.7.7' python.installer.name: 'macosx10.9.pkg' Python38: python.version: '3.8' python.org.version: '3.8.2' python.installer.name: 'macosx10.9.pkg' Python39: python.version: '3.9' python.org.version: '3.9.0' python.installer.name: 'macosx10.9.pkg' Python310: python.version: '3.10' python.org.version: '3.10.0' python.installer.name: 'macos11.pkg' Python311: python.version: '3.11' python.org.version: '3.11.1' python.installer.name: 'macos11.pkg' Python312: python.version: '3.12' python.org.version: '3.12.2' python.installer.name: 'macos11.pkg' steps: - script: | installer=python-$(python.org.version)-$(python.installer.name) url=https://www.python.org/ftp/python/$(python.org.version)/$installer curl $url -o $installer sudo installer -pkg $installer -target / displayName: 'Install Python from python.org' - script: | brew install --cask xquartz brew install flex bison mpich brew unlink mpich && brew install openmpi cmake --version # see https://github.com/BlueBrain/CoreNeuron/issues/817, uninstall libomp until we fix this # as we are building wheels, we shouldn't enable OpenMP here anyway brew uninstall --ignore-dependencies libomp || echo "libomp doesn't exist" displayName: 'Install OSX System Dependencies' # readline has been manually built with ncurses and MACOSX_DEPLOYMENT_TARGET=10.9 and stored as secure file on Azure. # See `packaging/python/Dockerfile` for build instructions. # # 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: readlineSF displayName: 'Download readline secure file' inputs: secureFile: 'readline7.0-ncurses6.4.tar.gz' - script: | export MACOSX_DEPLOYMENT_TARGET=10.15 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/ packaging/python/build_wheels.bash osx $(python.version) coreneuron displayName: 'Build MacOS Wheel' - template: ci/azure-wheel-test-upload.yml # Jobs to build NEURON installer natively - job: 'WindowsInstaller' timeoutInMinutes: 60 pool: vmImage: windows-2019 variables: MSYS2_ROOT: C:\msys64 steps: - 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 pool: vmImage: 'ubuntu-20.04' condition: eq(variables['Build.Reason'], 'PullRequest') steps: - checkout: none - script: | export AZURE_DROP_URL=`curl -v 'https://dev.azure.com/neuronsimulator/nrn/_apis/build/builds/$(Build.BuildId)/artifacts?artifactName=drop' | jq -r '.resource.downloadUrl'` echo "Setting dropurl to $AZURE_DROP_URL" echo "##vso[task.setvariable variable=dropurl]$AZURE_DROP_URL" displayName: 'Resolve Azure drop URL' - task: GitHubComment@0 inputs: gitHubConnection: 'neuronsimulator' repositoryName: '$(Build.Repository.Name)' comment: | âœ”ï¸ $(system.pullRequest.sourceCommitId) -> [Azure artifacts URL]($(dropurl)) nrn-8.2.6/bin/000077500000000000000000000000001465022020100130645ustar00rootroot00000000000000nrn-8.2.6/bin/CMakeLists.txt000066400000000000000000000061271465022020100156320ustar00rootroot00000000000000# ============================================================================= # Set various variables used in template files # ============================================================================= # TODO: for nrn.defaults but these are repeated in cmake_config/CMakeLists.txt set(modsubdir ${CMAKE_SYSTEM_PROCESSOR}) set(nrndef_unix "//") set(nrndef_mac "//") set(nrndef_mswin "//") set(MAC_DARWIN_TRUE "\#") set(MAC_DARWIN_FALSE "") if(NRN_LINUX_BUILD) set(nrndef_unix "") elseif(NRN_MACOS_BUILD) set(nrndef_mac "") set(MAC_DARWIN_TRUE "") set(MAC_DARWIN_FALSE "\#") elseif(NRN_WINDOWS_BUILD) set(nrndef_mswin "") endif() # for nrnmech_makefile set(CMAKE_INSTALL_BINDIR bin) set(CMAKE_INSTALL_LIBDIR lib) set(CMAKE_INSTALL_INCLUDEDIR include) set(CMAKE_INSTALL_DATADIR share/nrn) # ============================================================================= # Include nrnivmodl makefile generator # ============================================================================= include(CMakeListsNrnMech) # ============================================================================= # nrnmech_makefile (based on coreneuron Configure templates) # ============================================================================= nrn_configure_file(nrngui bin) configure_file(sortspike sortspike COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nrnivmodl_makefile_cmake.in ${PROJECT_BINARY_DIR}/bin/nrnmech_makefile @ONLY) # if running from the build folder (e.g. make test) may need this. file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/nrnpyenv.sh DESTINATION ${PROJECT_BINARY_DIR}/bin) # Make sure nrnivmodl and neurondemo are executable in the build folder, so we can execute it to # prepare test files. This can be done more elegantly in newer CMake versions; v3.19+ have # file(CHMOD ...) and v3.20+ support setting permissions directly in configure_file(...). set(NRN_CONFIG_EXE_FILES "nrnivmodl" "neurondemo") foreach(NRN_CONFIG_EXE_FILE ${NRN_CONFIG_EXE_FILES}) nrn_configure_dest_src(${NRN_CONFIG_EXE_FILE} bin/tmp ${NRN_CONFIG_EXE_FILE} bin) file( COPY ${PROJECT_BINARY_DIR}/bin/tmp/${NRN_CONFIG_EXE_FILE} DESTINATION ${PROJECT_BINARY_DIR}/bin FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endforeach() file(REMOVE_RECURSE ${PROJECT_BINARY_DIR}/bin/tmp) # ============================================================================= # Install targets # ============================================================================= install(PROGRAMS ${PROJECT_BINARY_DIR}/bin/nrngui ${PROJECT_BINARY_DIR}/bin/neurondemo ${PROJECT_BINARY_DIR}/bin/nrnivmodl DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(FILES ${PROJECT_BINARY_DIR}/bin/nrnmech_makefile DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install( PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/nrnpyenv.sh ${CMAKE_CURRENT_BINARY_DIR}/sortspike ${CMAKE_CURRENT_SOURCE_DIR}/mkthreadsafe ${CMAKE_CURRENT_SOURCE_DIR}/nrnpyenv.sh ${CMAKE_CURRENT_SOURCE_DIR}/set_nrnpyenv.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) nrn-8.2.6/bin/bbswork.sh.in000077500000000000000000000005121465022020100154770ustar00rootroot00000000000000#!/usr/bin/env bash prefix=@prefix@ exec_prefix=@exec_prefix@ NRNBIN=@bindir@ ARCH=@host_cpu@ MODSUBDIR=@modsubdir@ NEURONHOME=@prefix@/share/nrn cd $1 if [ -x ${MODSUBDIR}/special ] ; then program="./${MODSUBDIR}/special" else program="${NRNBIN}/nrniv" fi hostname pwd shift shift echo "time $program $*" time $program $* nrn-8.2.6/bin/hel2mos1.sh.in000066400000000000000000000011661465022020100154630ustar00rootroot00000000000000#!/usr/bin/env bash #NETSCAPE='/u3/local/hines/netscape/netscape' NETSCAPE=`which netscape` help='http://neuron.yale.edu/neuron/help' #help="file:$NEURONHOME/html/help" #dict=$NEURONHOME/lib/helpdict #echo "$*" #url=`sed -n '/^'"$*"'/{ # s/.* //p # q #}' $dict` url=$1 if [ -z "$url" ] ; then echo "|$*|" url='contents.html' fi cmd="$NETSCAPE -remote openURL(${help}/${url})" if [ -x $NETSCAPE ] ; then $cmd if [ ! $? ] ; then $NEURONHOME/bin/ivdialog "$0: $cmd failed" "Continue" "Continue" exit 2 fi else $NEURONHOME/bin/ivdialog "$0: $NETSCAPE not executable from this shell" "Continue" "Continue" exit 1 fi nrn-8.2.6/bin/mkthreadsafe000077500000000000000000000035461465022020100154600ustar00rootroot00000000000000#!/usr/bin/env bash if test $# = 0 ; then files="`ls *.mod`" else files="$*" fi echo $files t=temp words="EXTERNAL discontinuity LINEAR DISCRETE PARTIAL ERROR" for i in $files ; do f="`echo $i | sed 's/\.mod//'`" nocmodl $f.mod 2>&1 | sed '/^Translating/d' > $t nline=`wc -l $t` rm $f.c thread_safe="" for word in $words ; do if grep -q "$word"' is not thread safe' $t ; then thread_safe=no fi done if grep -q 'Complain to hines' $t ; then thread_safe=no fi echo " $f.mod:" if test "$nline" = "0 temp" ; then echo "$f.mod is Thread Safe" elif grep -q '^Thread Safe$' $t ; then echo "$f.mod is Thread Safe" elif test "$thread_safe" = "no" ; then cat $t echo -n "Continue:" read a elif grep -q 'POINTER is not thread safe' $t ; then cat $t echo "$f.mod should be examined and if, in fact, it is or can be modified to be thread safe, the THREADSAFE keyword can be prepended to the NEURON block." echo -n "Continue:" read a elif grep -q 'Assignment to the GLOBAL' $t ; then sed -n '/NEURON *{/,/}/p' $f.mod sed -n '/VERBATIM/,/ENDVERBATIM/p' $f.mod cat $t a="n" echo "If you know that this model is in fact thread safe when the GLOBAL variables that are written to are promoted to thread instance variables, and therefore it is ok to add the THREADSAFE keyword, then ..." echo "Add THREADSAFE? [y][n]: $a" read a if test "$a" = "y" ; then sed '/NEURON *{/a \ THREADSAFE ' $f.mod > $t cp $t $f.mod fi elif grep -q 'VERBATIM' $t ; then sed -n '/VERBATIM/,/ENDVERBATIM/p' $f.mod cat $t a="n" echo "If you know that this model is in fact thread safe so that it is ok to add the THREADSAFE keyword, then ..." echo "Add THREADSAFE? [y][n]: $a" read a if test "$a" = "y" ; then sed '/NEURON *{/a \ THREADSAFE ' $f.mod > $t cp $t $f.mod fi else cat $t echo -n "Continue:" read a fi rm $t done nrn-8.2.6/bin/mos2nrn2.sh.in000077500000000000000000000053171465022020100155160ustar00rootroot00000000000000#!/usr/bin/env bash # mos2nrn2 zipfile simdir running ARCH=@host_cpu@ MODSUBDIR=@modsubdir@ if test "x${NRNHOME}" = x ; then prefix="@prefix@" exec_prefix="@exec_prefix@" NRNBIN="@bindir@/" else prefix="$NRNHOME" exec_prefix="${prefix}/${ARCH}" NRNBIN="${exec_prefix}/bin/" fi if test "${NRNHOME_EXEC}" != "" ; then exec_prefix="${NRNHOME_EXEC}" NRNBIN="${exec_prefix}/bin/" fi if [ "$3" = "1" ] ; then echo "Already running neuron controlled by mosaic. Must quit that instance before running another." read a exit 0 fi current=`pwd` simdir=$2 askread="yes" doclean() { if test "$a" = "y" ; then echo "removing $simdir" cd $simdir/.. rm -r $simdir else echo " not removing $simdir" fi sleep 2 exit 0 } cleanup() { a=y if test "$askread" = "yes" ; then echo "Clean up by removing directory $simdir ? (n/y):$a" read a fi if test "$a" = "" ; then a=y fi doclean } asklaunch() { a=C if test "$askread" = "yes" ; then echo "[C]lean up by removing directory $simdir, [R]elaunch NEURON, or immediately e[X]it ? (C/R/X):$a" read a fi case "$a" in R|r) a=R;; X|x) a=n;; *) a=y;; esac } if test -f $simdir ; then rm -f $simdir # maybe mkstemp was used and the file was created. fi if mkdir $simdir ; then true else echo "Couldn't mkdir $simdir" read a exit 0 fi # make a file for communication with neuron cp $1 $simdir/nrnzip.zip echo "Changing the current directory to $simdir" cd $simdir unzip -n nrnzip.zip for MOSINIT in mosinit.py mosinit.hoc ; do if [ -r $MOSINIT ] ; then first=./$MOSINIT else first=`find . -name $MOSINIT -print |sed -n 1p` fi if [ "$first" ] ; then break fi done if [ -z "$first" ] ; then echo "Missing the mosinit.hoc or mosinit.py file" cleanup fi cd `dirname $first` first=`basename $first` if [ -f moslocal.tmp ] ; then askread="no" fi if [ "$MOSINIT" = "mosinit.hoc" ] ; then moddirs="`sed -n '1s;^//moddir;;p' < $first | tr -d '\r'`" MOSINITARGS="$first -" else moddirs="`sed -n '1s;^#moddir;;p' < $first | tr -d '\r'`" MOSINITARGS="-python $first" fi if test "$moddirs" != "" ; then modfiles='yes' else modfiles="`ls *.mod 2>/dev/null`" fi if [ "$modfiles" ] ; then # run special a=y if test "$askread" = "yes" ; then echo "Create the special version and run it? (y/n):" read a fi if [ "$a" != "y" -a "$a" != "" ] ; then cleanup fi "${NRNBIN}nrnivmodl" $moddirs a=R while test "$a" = "R" ; do ./${MODSUBDIR}/special $MOSINITARGS asklaunch done else # run neuron a=y if test "$askread" = "yes" ; then echo "Run NEURON? (y/n):" read a fi if [ "$a" != "y" -a "$a" != "" ] ; then cleanup fi a=R while test "$a" = "R" ; do "${NRNBIN}nrniv" $MOSINITARGS asklaunch done fi doclean nrn-8.2.6/bin/neurondemo.in000077500000000000000000000012651465022020100155760ustar00rootroot00000000000000#!/usr/bin/env bash set -e ARCH=@host_cpu@ MODSUBDIR=@modsubdir@ if test "x${NRNHOME}" = x ; then prefix="@prefix@" exec_prefix=@exec_prefix@ NRNBIN=@bindir@/ NRNDEMO=@prefix@/share/@PACKAGE@/demo/ else prefix="$NRNHOME" exec_prefix="${prefix}" NRNBIN="${exec_prefix}/bin/" NRNDEMO="${prefix}/share/@PACKAGE@/demo/" fi if test "${NRNHOME_EXEC}" != "" ; then exec_prefix="${NRNHOME_EXEC}" NRNBIN="${exec_prefix}/bin/" fi export NRNDEMO if [ ! -f "${NRNDEMO}neuron" ] ; then (cd "${NRNDEMO}release" ; "${NRNBIN}nrnivmodl" ; cd .. ; rm -f neuron ; touch neuron) fi ${NRNBIN}nrniv -dll "${NRNDEMO}release/${MODSUBDIR}/.libs/libnrnmech.so" "${NRNDEMO}demo.hoc" "$@" - nrn-8.2.6/bin/nrn-enable-sanitizer.in000077500000000000000000000003571465022020100174530ustar00rootroot00000000000000#!/usr/bin/env bash prefix="${NRNHOME:-@CMAKE_INSTALL_PREFIX@}" if [[ "$1" == "--preload" ]]; then shift @NRN_SANITIZER_LD_PRELOAD@ @NRN_SANITIZER_ENABLE_ENVIRONMENT_STRING@ "$@" else @NRN_SANITIZER_ENABLE_ENVIRONMENT_STRING@ "$@" finrn-8.2.6/bin/nrndiagnose.sh.in000077500000000000000000000210631465022020100163410ustar00rootroot00000000000000#!/usr/bin/env bash set -e # sh nrndiagnose.sh [python] # Diagnostic tests to verify launch functionality of a NEURON # installation. Problems that occur are generally traceable to # environment issues that can be fixed with proper # PATH, PYTHONPATH, PYTHONHOME, and/or NRN_PYLIB # filled in by configure prefix="@prefix@" pysetup='@ac_pysetup@' # What python are we supposed to use that allows the possibility # of import neuron. Need a Python that is consistent with our build. # If not dynamic then just use PYTHONCFG. If dynamic there may be # multiple acceptable python versions, e.g 3.7, 3.8 so look in # $prefix/$host_cpu/lib for libnrnpython* and see if there are # any consistent versions on this machine PYTHONBLD="@PYTHON_BLD@" # The python used for PYTHONCFG="@PYTHON@" # The Python from --with_nrnpython or --pyexe host_cpu="@host_cpu@" host_os="@host_os@" NRN_ENABLE_PYTHON_DYNAMIC=OFF nrnPYTHONPATH="$prefix/lib/python" diagnose() { echo "nrnsetpypath failed with the message:" echo "$1" echo "If the information below is not sufficient to help you fix the problem, please send the entire output of this script, 'sh nrndiagnose.sh', to michael.hines@yale.edu." echo "prefix=$prefix" echo "nrnversion=$nrnversion" echo "pysetup=$pysetup" echo "setpypath=$setpypath" echo "PYTHONBLD=$PYTHONBLD" echo "PYTHONCFG=$PYTHONCFG" echo "PYTHON=$PYTHON" echo "host_cpu=$host_cpu" echo "host_os=$host_os" echo "NRN_ENABLE_PYTHON_DYNAMIC=$NRN_ENABLE_PYTHON_DYNAMIC" echo "origPYTHONPATH=$origPYTHONPATH" echo "origPYTHONHOME=$origPYTHONHOME" echo "origNRN_PYLIB=$origNRN_PYLIB" echo "pythonpath_needed=$pythonpath_needed" echo "nrnPYTHONPATH=$nrnPYTHONPATH" echo "neuron.__file__ with no PYTHONPATH: $xxx" echo "neuron.__file__ with nrnPYTHONPATH: $yyy" echo "SHELL=$SHELL" echo "exportstyle1=$exportstyle1" echo "exportstyle2=$exportstyle2" echo "rc=$rc" exit 1 } # What is nrniv for this installation and does it run NRNIV="$prefix/$host_cpu/bin/nrniv" if ! $NRNIV -nogui -nopython -c 'quit()' > /dev/null 2>& 1 || false ; then $NRNIV -nogui -nopython -c 'quit()' diagnose "$NRNIV did not run successfully" fi nrnversion=`$NRNIV -nogui -nopython -nobanner -c '{print nrnversion(5) quit()}'` # Is nrniv in the PATH and is it the same version as $NRNIV if which nrniv > /dev/null 2>& 1 && true ; then xxx=`nrniv -nogui -nopython -nobanner -c '{print nrnversion(5) quit()}'` if test "$xxx" != "$nrnversion" || false ; then echo "The version of nrniv in your PATH, `which nrniv` is $xxx but the installed version, $NRNIV, is $nrnversion" echo "You should update your PATH accordingly." exit 1 fi else echo 'nrniv is not in the PATH. You may wish to add a line like the following to .bashrc (or whatever your shell startup file is called).' echo "export PATH=$prefix/$host_cpu/bin:\$PATH" fi #should python functionality be checked? chkpython=yes if test "$BUILD_NRNPYTHON_TURE" = "#" ; then chkpython=no fi if test "$chkpython" = "yes" ; then origPYTHONPATH="$PYTHONPATH" origPYTHONHOME="$PYTHONHOME" origNRN_PYLIB="$NRN_PYLIB" unset PYTHONPATH # pristine, just going to check for runability # what python is to be used for testing... PYTHON="" if test "@BUILD_NRNPYTHON_DYNAMIC_FALSE@" = "#" ; then NRN_ENABLE_PYTHON_DYNAMIC=ON if $PYTHONCFG -c 'quit()' > /dev/null 2>& 1 ; then PYTHON="$PYTHONCFG" #last one built else # python for last one built is not on this machine # try python3 and python if python3 -c 'quit()' > /dev/null 2>& 1 ; then ( export PYTHONPATH=$nrnPYTHONPATH if python3 -c 'import neuron ; quit()' > /dev/nul 2>& 1 ; then PYTHON=python3 fi ) elif python -c 'quit()' > /dev/null/ 2>& 1 ; then ( export PYTHONPATH=$nrnPYTHONPATH if python -c 'import neuron ; quit()' > /dev/null 2>& 1 ; then PYTHON=python fi ) fi fi else # not a distribution so built on this machine. Use the configured. if $PYTHONCFG -c 'quit()' > /dev/null 2>& 1 ; then PYTHON="$PYTHONCFG" fi fi if test "$PYTHON" = "" || false ; then diagnose "Cannot find a python on this machine that is consistent with the NEURON build." fi # can $PYTHON import the neuron module of this build? unset PYTHONPATH # does it work without a PYTHONPATH pythonpath_needed='yes' if $PYTHON -c 'import neuron ; quit()' > /dev/null 2>& 1 || false ; then xxx=`$PYTHON -c 'import neuron ; print (neuron.h.nrnversion(5)); quit()' 2> /dev/null` if test "$xxx" != "$nrnversion" ; then yyy=`$PYTHON -c 'import neuron ; print (neuron.__file__) ; quit()' 2> /dev/null | sed -n '$s/\/__init__.py//p'` echo "$PYTHON with no PYTHONPATH is importing the wrong neuron module." echo "The wrong module version is $xxx but should be $nrnversion ." echo "The wrong module location is $yyy" else pythonpath_needed='no' fi fi # If origPYTHONPATH, does it work with that? if test "$origPYTHONPATH" != "" ; then PYTHONPATH="$origPYTHONPATH" export PYTHONPATH if $PYTHON -c 'import neuron ; quit()' > /dev/null 2>& 1 ; then xxx=`$PYTHON -c 'import neuron ; print (neuron.h.nrnversion(5)); quit()' 2> /dev/null` if test "$xxx" != "$nrnversion" ; then yyy=`$PYTHON -c 'import neuron ; print (neuron.__file__) ; quit()' 2> /dev/null | sed -n '$s/\/__init__.py//p'` echo "$PYTHON with the existing PYTHONPATH is importing the wrong neuron module." echo "The wrong module version is $xxx but should be $nrnversion ." echo "The wrong module location is $yyy" else pythonpath_needed='no' fi fi fi if test "$pythonpath_needed" = 'yes' ; then if test "$pysetup" = '--home=$(prefix)' && true ; then unset PYTHONPATH PYTHONPATH="$nrnPYTHONPATH" export PYTHONPATH if $PYTHON -c 'import neuron ; quit()' > /dev/null 2>& 1 && true; then xxx=`$PYTHON -c 'import neuron ; print (neuron.h.nrnversion(5)); quit()' 2> /dev/null` if test "$xxx" != "$nrnversion" || false ; then echo "$PYTHON with PYTHONPATH=$PYTHONPATH derived from" echo "--enable-pysetup=\'$pysetup\'" echo "is importing version $xxx instead of $nrnversion" diagnose "" else true fi else echo "$PYTHON with PYTHONPATH=$PYTHONPATH derived from default" echo "--enable-pysetup option '--home=\$(prefix)' does not succeed with" echo "import neuron" diagnose "" fi else echo "This script does not know how to derive a PYTHONPATH for the" echo "non default --enable-pysetup='$pysetup'" diagnose "" fi fi #how about launching nrniv -python unset PYTHONPATH unset PYTHONHOME unset NRN_PYLIB nrnivlaunch() { if $NRNIV -python -pyexe=$PYTHON -c 'quit()' > /dev/null 2>&1 && true ; then if $NRNIV -python -pyexe=$PYTHON -c 'import neuron ; quit()' > /dev/null 2>&1 && true ; then xxx=`$NRNIV -python -pyexe=$PYTHON -c 'import neuron ; print (neuron.h.nrnversion(5)); quit()' 2> /dev/null` if test "$xxx" != "$nrnversion" || false ; then echo "$1" echo "$NRNIV -python -pyexe=$PYTHON -c 'import neuron'" echo "is importing version $xxx instead of $nrnversion" diagnose "" fi else echo "$1" echo "$NRNIV -python -pyexe=$PYTHON -c 'import neuron' gives" $NRNIV -python -pyexe=$PYTHON -c 'import neuron ; quit()' || true diagnose "could not successfully import neuron" fi else echo "$1" echo "$NRNIV -python -pyexe=$PYTHON gives" $NRNIV -python -pyexe=$PYTHON -c 'quit()' || true diagnose "" fi } nrnivlaunch "With no PYTHONHOME or NRN_PYLIB" if test "$origPYTHONHOME" != "" -o "$origNRN_PYLIB" != "" ; then PYTHONHOME=$origPYTHONHOME NRNPY_LIB=$origNRN_PYLIB export PYTHONHOME export NRN_PYLIB nrnivlaunch "With original PYTHONHOME=$PYTHONHOME and NRN_PYLIB=$NRN_PYLIB" fi PYTHONPATH="$nrnPYTHONPATH" export PYTHONPATH if ! $PYTHON -c 'import neuron ; quit()' > /dev/null 2>&1 || false ; then diagnose "$PYTHON with \$PYTHONPATH=${PYTHONPATH} cannot import neuron" fi #which login shell case "$SHELL" in */bash ) exportstyle1="export" exportstyle2="=" if test -f "$HOME/.bashrc" ; then rc="$HOME/.bashrc" elif test -f "$HOME/.bash_profile" ; then rc="$HOME/.bash_profile" fi ;; esac if test "$rc" = "" || false ; then diagnose "Do not know where or how to set environment for SHELL=$SHELL" fi if test "$pythonpath_needed" = "yes" ; then echo "For successful \"$PYTHON -c 'import neuron ; quit()\" you need" orig="" if test "$origPYTHONPATH" != "" ; then orig=':$PYTHONPATH' fi echo "$exportstyle1 PYTHONPATH${exportstyle2}${nrnPYTHONPATH}${orig}" fi fi # chkpython nrn-8.2.6/bin/nrngui.in000077500000000000000000000012631465022020100147230ustar00rootroot00000000000000#!/usr/bin/env bash ARCH=@host_cpu@ MODSUBDIR=@modsubdir@ if test "x${NRNHOME}" = x ; then prefix=@prefix@ exec_prefix=@exec_prefix@ NRNBIN=@bindir@/ else prefix="$NRNHOME" exec_prefix="${prefix}" NRNBIN="${exec_prefix}/bin/" fi if test "${NRNHOME_EXEC}" != "" ; then exec_prefix="${NRNHOME_EXEC}" NRNBIN="${exec_prefix}/bin/" fi if test "@enable_carbon@" = "yes" ; then NRNIV="${exec_prefix}/bin/nrniv.app/Contents/MacOS/nrniv" else NRNIV="${NRNBIN}nrniv" fi NEURONHOME="${prefix}/share/nrn" export NEURONHOME if [ -x ${MODSUBDIR}/special ] ; then program="./${MODSUBDIR}/special" else program="${NRNIV}" fi exec "$program" "$NEURONHOME/lib/hoc/nrngui.hoc" "$@" - nrn-8.2.6/bin/nrnivmodl.in000077500000000000000000000126541465022020100154370ustar00rootroot00000000000000#!/usr/bin/env bash set -e ARCH=@host_cpu@ MODSUBDIR=@modsubdir@ USER_PWD="$PWD" if [ -z "$NRNHOME" ] ; then prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ libdir=@libdir@ else prefix="$NRNHOME" exec_prefix="${prefix}/${ARCH}" bindir="${prefix}/bin" libdir="${prefix}/lib" fi if [ -z ${CORENRNHOME+x} ] ; then # CORENRNHOME wasn't set, use the install prefix cnrn_prefix=@cnrn_prefix@ else cnrn_prefix="${CORENRNHOME}" fi if [ "${NRNHOME_EXEC}" ] ; then exec_prefix="${NRNHOME_EXEC}" bindir="${exec_prefix}/bin" libdir="${exec_prefix}/lib" fi export prefix export bindir export libdir if command -v xcrun; then @NRN_OSX_BUILD_TRUE@export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) @NRN_OSX_BUILD_TRUE@export MACOSX_DEPLOYMENT_TARGET="@CMAKE_OSX_DEPLOYMENT_TARGET@" if [ -z "${MACOSX_DEPLOYMENT_TARGET}" ]; then unset MACOSX_DEPLOYMENT_TARGET fi fi LinkCoreNEURON=false UserINCFLAGS="" UserLDFLAGS="" UserCOREFLAGS=() # - options come first but can be in any order. while [ "$1" ] ; do case "$1" in -coreneuron) # also run nrnivmodl-core LinkCoreNEURON=true shift;; -incflags) # extra include flags and paths (NEURON only) UserINCFLAGS="$2" # extra include flags and paths for CoreNEURON UserCOREFLAGS+=(-i "${2}") shift shift;; -loadflags) # extra link flags, paths, libraries (NEURON only) UserLDFLAGS="$2" # extra lin flags, paths. libraries (CoreNEURON) UserCOREFLAGS+=(-l "${2}") shift shift;; -*) echo "$1 unrecognized" exit 1;; *) break;; esac done echo "$PWD" # Mod file paths may contain spaces which make variable lists of those # hard to manage as space is the item separator. Furthermore, when a # path is used, sometimes the spaces must be escaped (eg. a Makefile # dependency pattern, and sometimes it is more useful for readability to # enclose the path in "". To work around this issue, when creating a list # of paths, translate the spaces for each item to +++ and after retrieval # of an item, retranslate back to either a space or an escaped space. # Only do this for cmake shopt -s nullglob # files is the complete list of mod files to process files=() if [ $# -gt 0 ] ; then for i in "$@" ; do if [ -d "$i" ] ; then files+=( "$i"/*.mod ) elif [ -e "$i" ] || [ -e "$i.mod" ] ; then files+=( "$i" ) else echo "Arg Error: \"$i\" is not a folder or mod file name or prefix" echo "" echo -n " Mod file, folder args:" for j in "$@" ; do echo -n " \"$j\"" done echo "" exit 1 fi done else files=( *.mod ) fi base_names=() for i in "${files[@]}" ; do base_names+=( "$(basename "$i" .mod)" ) done echo -n "Mod files:" for i in "${files[@]}" ; do dir_name=$(dirname "$i") echo -n " \"$dir_name/${i%.mod}.mod\"" done echo "" echo "" if [ ! -d "$MODSUBDIR" ] ; then echo "Creating '$MODSUBDIR' directory for .o files." echo mkdir "$MODSUBDIR" fi files=( "${files[@]%.mod}" ) cd $MODSUBDIR mdir="$PWD" # construct file to be included by makefile to specify mod to c rule when # executed in $MODSUBDIR (child folder of launch location folder) MODMAKE=makemod2c_inc > "$MODMAKE" for i in "${files[@]}" ; do case "$i" in /*) f="$i";; # absolute, fine as is *) f="../$i";; # relative esac base_name="$(basename "$f")" dir_name="$(dirname "$f")" # Note: indentation for shell lines in make rules must be a tab echo "\ ./${base_name// /\\ }.c: ${f// /\\ }.mod @printf \" -> \$(C_GREEN)NMODL\$(C_RESET) \$<\\\n\" (cd \"$dir_name\"; @NRN_NOCMODL_SANITIZER_ENVIRONMENT_STRING@ MODLUNIT=\$(NRNUNITS) \$(NOCMODL) \"$base_name.mod\" -o \"$mdir\") ./${base_name// /\\ }.o: ./${base_name// /\\ }.c @printf \" -> \$(C_GREEN)Compiling\$(C_RESET) \$<\\\n\" \$(COMPILE) -I\"$dir_name\" \$(INCLUDES) @CMAKE_CXX_COMPILE_OPTIONS_PIC@ -c \$< -o \$@ " >> "$MODMAKE" done MODOBJS= { echo '#include #include "hocdec.h" extern int nrnmpi_myid; extern int nrn_nobanner_; #if defined(__cplusplus) extern "C" { #endif ' for i in "${base_names[@]}" ; do echo "extern void _${i// }_reg(void);" done echo "" echo "void modl_reg() {" echo " if (!nrn_nobanner_) if (nrnmpi_myid < 1) {" printf ' fprintf(stderr, "Additional mechanisms from files\\n");\n' for i in "${files[@]}" do echo ' fprintf(stderr, " \"'"$i"'.mod\"");' done printf ' fprintf(stderr, "\\n");\n' echo " }" for i in "${base_names[@]}" ; do echo " _${i// }_reg();" MODOBJS="$MODOBJS ./${i// /\\ }.o" done echo "}" echo ' #if defined(__cplusplus) } #endif' } > mod_func.cpp # call nrnivmodl-core if CoreNEURON is enabled and requested via CLI UsingCoreNEURON=false @CORENEURON_ENABLED_TRUE@UsingCoreNEURON=true if [ "$LinkCoreNEURON" = true ] ; then if [ "$UsingCoreNEURON" = true ] ; then if [ "$#" -gt 1 ] ; then printf "ERROR : when called with -coreneuron only 1 mod dir is accepted.\n" exit 1 fi cd "$USER_PWD" "${cnrn_prefix}/bin/nrnivmodl-core" "${UserCOREFLAGS[@]}" "$@" cd "$MODSUBDIR" else printf "ERROR : CoreNEURON support is not enabled!\n" exit 1 fi fi make -j 4 -f "${bindir}/nrnmech_makefile" "ROOT=${prefix}" "MODOBJFILES=$MODOBJS" "UserLDFLAGS=$UserLDFLAGS" "UserINCFLAGS=$UserINCFLAGS" "LinkCoreNEURON=$LinkCoreNEURON" special && echo "Successfully created $MODSUBDIR/special" nrn-8.2.6/bin/nrnivmodl_makefile_cmake.in000066400000000000000000000143251465022020100204260ustar00rootroot00000000000000 # Arguments: # MODOBJFILES # UserLDFLAGS # UserINCFLAGS # LinkCoreNEURON # Rules to build MODOBJFILES from mod files are found in makemod2c_inc # Mechanisms version are by default 0.0, but should be overriden MECH_NAME = MECH_VERSION = 0.0 MODS_PATH = . # in the @CMAKE_HOST_SYSTEM_PROCESSOR@ folder OUTPUT = . DESTDIR = UserINCFLAGS = UserLDFLAGS = # install dirs bindir := ${ROOT}/@CMAKE_INSTALL_BINDIR@ libdir := ${ROOT}/@CMAKE_INSTALL_LIBDIR@ incdir := ${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@ datadir:= ${ROOT}/@CMAKE_INSTALL_DATADIR@ datadir_lib := ${ROOT}/@CMAKE_INSTALL_DATADIR@/lib # Additional variables set in CMAKE usable here # - @NRN_COMPILE_DEFS # - @NRN_LINK_DEFS LDFLAGS = $(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 OS_NAME := $(shell uname) _cm =, # We rebuild the include dirs since a lot of stuff changes place INCLUDES = -I. $(INCFLAGS) $(UserINCFLAGS) -I$(incdir) ifeq (@NRN_INCLUDE_MPI_HEADERS@, ON) INCLUDES += $(if @MPI_C_INCLUDE_PATH@, -I$(subst ;, -I,@MPI_C_INCLUDE_PATH@),) endif # CC/CXX are always defined. If the definition comes from default change it ifeq ($(origin CC), default) CC = @CMAKE_C_COMPILER@ CXX = @CMAKE_CXX_COMPILER@ endif CFLAGS = @BUILD_TYPE_C_FLAGS@ @CMAKE_C_FLAGS@ CXXFLAGS = @BUILD_TYPE_CXX_FLAGS@ @CMAKE_CXX_FLAGS@ @CXX11_STANDARD_COMPILE_OPTION@ COMPILE = $(CC) $(CFLAGS) @NRN_COMPILE_DEFS_STRING@ @NRN_COMPILE_FLAGS_STRING@ CXXCOMPILE = $(CXX) $(CXXFLAGS) @NRN_COMPILE_DEFS_STRING@ @NRN_COMPILE_FLAGS_STRING@ CXX_LINK_EXE = $(CXX) $(CXXFLAGS) @CMAKE_EXE_LINKER_FLAGS@ @NRN_LINK_FLAGS_STRING@ CXX_LINK_SHARED = $(CXX) $(CXXFLAGS) @CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS@ @CMAKE_SHARED_LIBRARY_CXX_FLAGS@ @CMAKE_SHARED_LINKER_FLAGS@ NOCMODL = $(bindir)/nocmodl NRNUNITS = $(datadir_lib)/nrnunits.lib # File path config (internal) MODC_DIR = . OBJS_DIR = . mod_objs = $(MODOBJFILES) mod_func_o = $(OBJS_DIR)/mod_func.o mod_func_cpp = $(MODC_DIR)/mod_func.cpp special = $(OUTPUT)/special LIB_SUFFIX_ = $(if $(MECH_NAME),_$(MECH_NAME),) mech_libname = nrnmech # In case of static library we need to link NRNLIB_FLAGS twice to avoid undefined # symbols from circular dependencies. But for shared library we don't do it to avoid # pthread linking with wheels. ifeq (@NRN_ENABLE_SHARED@, ON) mech_lib = $(OUTPUT)/lib$(mech_libname)@CMAKE_SHARED_LIBRARY_SUFFIX@ mech_lib_type = mech_lib_shared extra_lib_link = else mech_lib = $(OUTPUT)/lib$(mech_libname)@CMAKE_STATIC_LIBRARY_SUFFIX@ mech_lib_type = mech_lib_static extra_lib_link = $(NRNLIB_FLAGS) endif # add coreneuron flags ifeq ($(LinkCoreNEURON), true) EXTRA_LDFLAGS = @CORENEURON_LIB_LINK_FLAGS@ endif # If no DESTDIR (we are probably just building) we use $ORIGIN (@loader_path in OSX) _ORIGIN := $(if $(filter Darwin,$(OS_NAME)),@loader_path,$$ORIGIN) _SONAME := -Wl,$(if $(filter Darwin,$(OS_NAME)),-install_name${_cm}@rpath/,-soname${_cm})$(notdir ${mech_lib}) DESTDIR_RPATH = $(if $(DESTDIR),$(DESTDIR)/lib,$(_ORIGIN)) C_RESET := \033[0m C_GREEN := \033[32m # ======== MAIN BUILD RULES ============ # Take the main and link with nrnmech. # RPATH is set for DESTDIR_RPATH and coreneuron lib special: $(mech_lib) @printf " => $(C_GREEN)LINKING$(C_RESET) executable $(special) LDFLAGS are: $(LDFLAGS)\n" $(CXX_LINK_EXE) -I $(incdir) -I $(incdir)/nrncvode -DAUTO_DLOPEN_NRNMECH=0 $(datadir)/nrnmain.cpp -o $(special) \ -L $(OBJS_DIR) -l$(mech_libname) $(NRNLIB_FLAGS) -l$(mech_libname) $(extra_lib_link) -Wl,-rpath,'$(DESTDIR_RPATH)' -Wl,-rpath,$(libdir) $(LDFLAGS) $(EXTRA_LDFLAGS) $(mech_lib): $(mech_lib_type) mech_lib_shared: mod_func.o $(mod_objs) $(nrn_lib) 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 @printf " => $(C_GREEN)LINKING$(C_RESET) static library $(mech_lib)\n" ar cq ${mech_lib} $(mod_func_o) $(mod_objs) $(cobjs); mod_func.o: mod_func.cpp @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" $(COMPILE) $(INCLUDES) @CMAKE_CXX_COMPILE_OPTIONS_PIC@ -c $< -o $@ # Generic build c->o. Need PIC for shared lib $(OBJS_DIR)/%.o: $(MODC_DIR)/%.c | $(OBJS_DIR) @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" $(COMPILE) $(INCLUDES) @CMAKE_CXX_COMPILE_OPTIONS_PIC@ -c $< -o $@ include makemod2c_inc # If .mod doesnt exist attempt from previously built opt mods in shared/ $(MODC_DIR)/%.cpp: $(datadir_lib)/%.cpp | $(MODC_DIR) ln -s $< $@ install: special $(mech_lib) install -d $(DESTDIR)/bin $(DESTDIR)/lib install $(mech_lib) $(DESTDIR)/lib install $(special) $(DESTDIR)/bin libnrnmech.la: $(mech_lib) # == INIT == $(MODC_DIR): (cd .. ; mkdir -p $(MODC_DIR)) #$(OBJS_DIR): # mkdir -p $(OBJS_DIR) .PHONY: build_always $(VERBOSE).SILENT: nrn-8.2.6/bin/nrnocmodl.in000077500000000000000000000023261465022020100154150ustar00rootroot00000000000000#!/usr/bin/env bash prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ libdir=@libdir@ LIBOBJDIR=${libdir} MAKEFILEDIR=${bindir} ARCH=@host_cpu@ MODSUBDIR=@modsubdir@ if [ ! -d $MODSUBDIR ] then echo "Creating $MODSUBDIR directory for .o files." echo mkdir $MODSUBDIR fi if test $# -gt 0 ; then files=$* else files=`echo *.mod` fi files=`echo "$files" | sed s/\.mod//g` if test "$files" = '*' ; then files="" fi cd $MODSUBDIR for i in $files; do rm -f $i.mod ln -s ../$i.mod . done MODOBJS= if [ `echo "\n"` ] then newline="\n" else newline="\\\\n" fi echo '#include #include "hocdec.h" #if defined(__cplusplus) extern "C" #endif modl_reg(){ NOT_PARALLEL_SUB(fprintf(stderr, "Additional mechanisms from files'$newline'");) ' > mod_func.cpp for i in $files do echo 'NOT_PARALLEL_SUB(fprintf(stderr," '$i'.mod");)' >>mod_func.cpp done echo 'NOT_PARALLEL_SUB(fprintf(stderr, "'$newline'");)' >>mod_func.cpp for i in $files do echo _"$i"_reg"();" >> mod_func.cpp MODOBJS="$MODOBJS $i.o" done echo "}" >> mod_func.cpp echo ' #if defined(__cplusplus) } #endif' >> mod_func.cpp make -f $MAKEFILEDIR/nrnoc_makefile "MODOBJFILES=$MODOBJS" special && echo "Successfully created $MODSUBDIR/special" nrn-8.2.6/bin/nrnpyenv.sh000077500000000000000000000426721465022020100153150ustar00rootroot00000000000000#!/usr/bin/env bash # eval "`sh nrnpyenv.sh`" # will set bash environment variables so that nrniv -python has same # environment as python # May specify the python executable with explicit first argument. # Without arg use python3 and if that does not exist then python # Overcome environment issues when --with-nrnpython=dynamic . # The problems might be an immediate exit due to 'No module named site', # inability to find common modules and shared libraries that support them, # and not loading the correct python library. #Run python and generate the following on stdout #export PYTHONHOME=... #export PYTHONPATH=... #export LD_LIBRARY_PATH=... #export PATH=... #export NRN_PYLIB=... #with NRN_PYLIB as a full path to the Python library, #it may not be necessary to change LD_LIBRARY_PATH #Some python installations, such as enthought canopy, do not have site #in a subfolder of prefix. In that case, the site folder defines home and #if there is a site-packages subfolder of prefix, that is added to the #pythonpath. Also the lib under home is added to the ld_library_path. # This script is useful for linux, mingw, and mac versions. # Append the output to your .bashrc file. export originalPATH="$PATH" export originalPYTHONPATH="$PYTHONPATH" export originalPYTHONHOME="$PYTHONHOME" export originalLDLIBRARYPATH="$LD_LIBRARY_PATH" # get the last argument for last; do true; done # if the last argument begins with --NEURON_HOME= if [[ $last == "--NEURON_HOME="* ]] ; then last=${last#"--NEURON_HOME="} export PATH=/cygdrive/${last//:/}/mingw/usr/bin:/cygdrive/${last//:/}/mingw/mingw64/bin:$PATH # remove the last argument set -- "${@:1:$(($#-1))}" fi if test "$PYTHONHOME" != "" ; then echo "# Ignoring existing PYTHONHOME=$PYTHONHOME." unset PYTHONHOME fi WHICH=which function trypy { a=`ls "$1" |grep "$2"` if test "$a" != "" ; then b=`cygpath -U "$1/$a/$3"` c=`nrnbinstr "$4" "$b" 2> /dev/null` if test "$c" != "" ; then c=`cygpath -U "$c"` c=`dirname "$c"` c=`dirname "$c"` c="$c/python" if $WHICH "$c" >& /dev/null ; then PYTHON=`$WHICH "$c"` # if python.exe not in PATH then cygcheck may not find the library PYTHON=`cygpath -U "$PYTHON"` export PATH=`dirname "$PYTHON"`:"$PATH" PYTHON=`basename "$PYTHON"` fi fi fi } # On some windows systems python is an empty executable which, when # launched in a Command Prompt, directs the user to the Microsoft Store. # With bash, it returns a 128 exit status. So we loop until we # find a working python (or no python). Each time a python is non-working # we remove that path from the PATH. If not Windows, break out after first # attempt at finding a Python. while true ; do PYTHON="" # Priority is the argument -pyexe, NRN_PYTHONEXE, python3 and then python # check -pyexe option if test "$1" != "" ; then if $WHICH "$1" >& /dev/null ; then PYTHON="$1" fi # If NRN_PYTHONEXE is set (e.g. from wheel wrapper) then use it elif test "$NRN_PYTHONEXE" != ""; then PYTHON=$NRN_PYTHONEXE elif $WHICH python3 >& /dev/null ; then PYTHON=python3 elif $WHICH python >& /dev/null ; then PYTHON=python fi # do not do the following craziness if not Windows. if test "$OS" != "Windows_NT" ; then break fi if test "$PYTHON" == "" ; then break else if $PYTHON -c 'quit()' >& /dev/null ; then #working break else # remove from PATH oldpath="$PATH" a="`$WHICH $PYTHON`" b="`dirname \"$a\"`" PATH="`echo \"$PATH\" | sed \"s,:$b:,:,\"`" #remove b from path if internal PATH="`echo \"$PATH\" | sed \"s,^$b:,,\"`" #remove b from path if begin PATH="`echo \"$PATH\" | sed \"s,:$b\$,\",`" #remove b from path if end export PATH if test "$oldpath" = "$PATH" ; then echo "\"$b\", that contained a failing Python, did not get removed from PATH=\"$PATH\"" 1>&2 exit 1 fi fi fi done if test "$PYTHON" = "" ; then # Often people install Anaconda on Windows without adding it to PATH if test "$OS" = "Windows_NT" -a "$APPDATA" != "" ; then smenu="$APPDATA/Microsoft/Windows/Start Menu/Programs" if test "$PYTHON" = "" ; then trypy "$smenu" "Anaconda3 (64-bit)" "Anaconda Prompt (anaconda3).lnk" activate.bat # Anaconda3 2020 may need more PATH for numpy to work. if test "$PYTHON" != "" ; then if ! $PYTHON -c 'import numpy' >& /dev/null ; then # first item added in trypy a="`echo $PATH | sed 's/:.*//'`" export PATH="$PATH:$a/Library/mingw-w64/bin:$a/Library/usr/bin:$a/Library/bin:$a/Scripts:$a/bin:$a/condabin" # Actually get this PATH when scripts do a -- eval "`nrnpyenv.sh`" echo "export PATH=\"$PATH\"" fi fi fi if test "$PYTHON" = "" ; then trypy "$smenu" Anaconda3 "Anaconda Prompt.lnk" activate.bat fi if test "$PYTHON" = "" ; then trypy "$smenu" Anaconda2 "Anaconda Prompt.lnk" activate.bat fi if test "$PYTHON" = "" ; then trypy "$smenu" Anaconda "Anaconda Prompt.lnk" activate.bat fi if test "$PYTHON" = "" ; then #brittle but try Enthought a=`cygpath -U "$APPDATA/../local/enthought/canopy/edm/envs/user"` if test -d "$a" ; then export PATH="$a":"$PATH" PYTHON=python fi fi fi fi if test "$PYTHON" = "" ; then echo "Cannot find executable python3 or python" 1>&2 exit 1; fi echo "# PYTHON=`$WHICH $PYTHON`" # what is the python library for Darwin nrnpylib_provenance="" nrn_pylib="" kernel_name='' if type -P uname > /dev/null ; then kernel_name=`uname` fi if test "$kernel_name" = "Darwin" ; then python_path=`$WHICH $PYTHON` pyexedir=`dirname $python_path` # Get the python lib dir in an official way, working with virtualenv PYLIB=$($python_path -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))') for path in $PYLIB/libpython*.dylib; do if test -f "$path"; then nrn_pylib="$path" break fi done if test -f "$nrn_pylib" ; then unset python_path unset pyexedir nrnpylib_provenance="sysconfig LIBDIR" fi if test "$nrn_pylib" = "" ; then nrn_pylib=$($python_path -c ' try: from neuron import h shlib=h.libpython_path() shlib = shlib if ".dylib" in shlib else "" print(shlib) except: print("") ') if test "$nrn_pylib" != "" ; then nrnpylib_provenance="h.libpython_path()" fi fi if test "$nrn_pylib" = "" ; then DYLD_PRINT_LIBRARIES=1 export DYLD_PRINT_LIBRARIES nrn_pylib=`$PYTHON -c 'quit()' 2>&1 | sed -n 's/^dyld: loaded: //p' | sed -n /libpython/p` if test "$nrn_pylib" = "" ; then nrn_pylib=`$PYTHON -c 'quit()' 2>&1 | sed -n 's/^dyld: loaded: //p' | sed -n 2p` fi unset DYLD_PRINT_LIBRARIES if test "$nrn_pylib" != "" ; then nrnpylib_provenance=DYLD_PRINT_LIBRARIES fi fi if test -f "$nrn_pylib" ; then PYLIB_DARWIN=$nrn_pylib else PYLIB_DARWIN="" fi export nrnpylib_provenance export PYLIB_DARWIN fi $PYTHON << 'here' ########################################### import sys, os, site usep = "/" upathsep = ":" nrnpylib_provenance = "not found" nrnpyhome_provenance = "not found" def upath(path): #return linux path if path is None: return "" import posixpath, sys plist = path.split(os.pathsep) for i, p in enumerate(plist): p = os.path.splitdrive(p) if p[0]: p = "/cygdrive/" + p[0][:p[0].rfind(":")] + usep + p[1].replace(os.sep, usep) else: p = p[1].replace(os.sep, usep) p = posixpath.normpath(p) plist[i] = p p = upathsep.join(plist) return p def u2d(p): if "darwin" not in sys.platform and "win" in sys.platform: p = p.split(usep) if "cygdrive" == p[1]: p = p[2] + ':/' + usep.join(p[3:]) else: p = usep.join(p) return p #a copy of nrnpylib_linux() but with some os x specific modifications def nrnpylib_darwin_helper(): global nrnpylib_provenance import os, sys, re, subprocess #in case it was dynamically loaded by python pid = os.getpid() cmd = "lsof -p %d"%pid f = [] try: # in case lsof does not exist f = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout except: pass nrn_pylib = None cnt = 0 for bline in f: fields = bline.decode().split() if len(fields) > 8: line = fields[8] if re.search(r'libpython.*\.[ds]', line): print ("# nrn_pylib from lsof: %s" % line) nrn_pylib = line.strip() nrnpylib_provenance = "lsof search for libpython..." return nrn_pylib if re.search(r'[Ll][Ii][Bb].*[Pp]ython', line): cnt += 1 if cnt == 1: # skip 1st since it is the python executable continue if re.search(r'[Pp]ython', line.split('/')[-1]): print ("# nrn_pylib from lsof: %s" % line) candidate = line.strip() # verify the file defines a PyRun_SimpleString cmd = r'nm %s | grep PyRun_SimpleString' % candidate try: f = os.popen(cmd) i=0 for line in f: i += 1 if i == 0: continue except: continue nrn_pylib = candidate nrnpylib_provenance = 'lsof search for occurrence of [Ll][Ii][Bb].*[Pp]ython defineing PyRun_SimpleString' return nrn_pylib else: # figure it out from the os path p = os.path.sep.join(os.__file__.split(os.path.sep)[:-1]) name = "libpython%d.%d" % (sys.version_info[0], sys.version_info[1]) cmd = r'find %s -name %s\*.dylib' % (p, name) print ('# %s'%cmd) f = os.popen(cmd) libs = [] for line in f: libs.append(line.strip()) if len(libs) == 0: # try again searching the parent folder p = os.path.sep.join(os.__file__.split(os.path.sep)[:-2]) cmd = r'find %s -name %s\*.dylib' % (p, name) print ('# %s'%cmd) f = os.popen(cmd) for line in f: libs.append(line.strip()) print ('# %s'%str(libs)) if len(libs) == 1: nrnpylib_provenance="search based on os.__file__, found unique" print ("# nrn_pylib from os.path %s"%str(libs[0])) return libs[0] if len(libs) > 1: # which one do we want? Check the name of an imported shared object try: import _ctypes except: import ctypes for i in sys.modules.values(): try: s = i.__file__ if s.endswith('.dylib'): match = re.search(r'-%d%d([^-]*)-' % (sys.version_info[0], sys.version_info[1]), s) if match: name = name + match.group(1) + '.dylib' break elif s.endswith('.so'): match = re.search(r'-%d%d([^-]*)-' % (sys.version_info[0], sys.version_info[1]), s) if match: name = name + match.group(1) + '.so' break except: pass for i in libs: if name in i: print ("# nrn_pylib from os.path %s" % i) nrnpylib_provenance='search based on os.__file__, found one with version in name' return i print ("# nrn_pylib from os.path %s" % str(nrn_pylib)) return nrn_pylib def nrnpylib_darwin(): global nrnpylib_provenance import os nrn_pylib = os.getenv("PYLIB_DARWIN") if nrn_pylib != "": print ("# nrn_pylib from PYLIB_DARWIN %s"%nrn_pylib) nrnpylib_provenance = os.getenv("nrnpylib_provenance") return nrn_pylib return nrnpylib_darwin_helper() def nrnpylib_mswin(): global nrnpylib_provenance import os, sys, re e = '/'.join(sys.executable.split(os.path.sep)) cmd = 'cygcheck "%s"' % e f = os.popen(cmd) nrn_pylib = None for line in f: if re.search(r'ython[a-zA-Z0-9_.]*\.dll', line): nrn_pylib = '/'.join(line.split(os.path.sep)).strip() nrnpylib_provenance="cygcheck" return nrn_pylib def nrnpylib_linux(): global nrnpylib_provenance import os, sys, re, subprocess # Try the official way first import sysconfig libdir=sysconfig.get_config_var("LIBDIR") try: from os.path import isfile, join ver = "%d.%d"%(sys.version_info[0], sys.version_info[1]) for f in os.listdir(libdir): if 'libpython' in f and '.so' in f and ver in f: nrn_pylib = join(libdir, f) nrnpylib_provenance='sysconfig LIBDIR' return nrn_pylib except: pass #in case it was dynamically loaded by python try: from neuron import h s=h.libpython_path() s = s if ".so" in s else "" if (s != ""): nrnpylib_provenance="h.libpython_path()" return s except: print("") pid = os.getpid() cmd = "lsof -p %d"%pid f = [] try: # in case lsof does not exist f = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout except: pass nrn_pylib = None for bline in f: fields = bline.decode().split() if len(fields) > 8: line = fields[8] if re.search(r'libpython.*\.so', line): print ("# from lsof: %s" % line) nrn_pylib = line.strip() nrnpylib_provenance = r'lsof search for libpython.*\.so' return nrn_pylib else: # figure it out from the os path p = os.path.sep.join(os.__file__.split(os.path.sep)[:-1]) name = "libpython%d.%d" % (sys.version_info[0], sys.version_info[1]) cmd = r'find %s -name %s\*.so' % (p, name) print ('# %s'%cmd) f = os.popen(cmd) libs = [] for line in f: libs.append(line.strip()) if len(libs) == 0: # try again searching the parent folder p = os.path.sep.join(os.__file__.split(os.path.sep)[:-2]) cmd = r'find %s -name %s\*.so' % (p, name) print ('# %s'%cmd) f = os.popen(cmd) for line in f: libs.append(line.strip()) print ('# %s'%str(libs)) if len(libs) == 1: nrnpylib_provenance="search based on os.__file__, found unique" return libs[0] if len(libs) > 1: # which one do we want? Check the name of an imported shared object try: import _ctypes except: import ctypes for i in sys.modules.values(): try: s = i.__file__ if s.endswith('.so'): match = re.search(r'-%d%d([^-]*)-' % (sys.version_info[0], sys.version_info[1]), s) if match: name = name + match.group(1) + '.so' break except: pass for i in libs: if name in i: nrnpylib_provenance='search based on os.__file__, found one with version in name' return i return nrn_pylib nrn_pylib = None if 'darwin' in sys.platform: nrn_pylib = nrnpylib_darwin() elif 'win' in sys.platform: nrn_pylib = nrnpylib_mswin() elif 'linux' in sys.platform: nrn_pylib = nrnpylib_linux() #Use sys.base_prefix for PYTHONHOME if available, otherwise sys.prefix try: sp = upath(sys.base_prefix) spname='sys.base_prefix' base=True except: sp = upath(sys.prefix) spname='sys.prefix' base=False #there is a question about whether to use sys.prefix for PYTHONHOME #or whether to derive from site.__file__. #to help answer, ask how many sys.path items begin with sys.prefix and #how many begin with site.__file__ - 3 p = [upath(i) for i in sys.path] print ("# items in sys.path = " + str(len(p))) print ("# beginning with sys.prefix = " + str(len([i for i in p if sp in i]))) s = usep.join(upath(site.__file__).split(usep)[:-3]) if s == sp: print ("# site-3 same as " + spname) else: print ("# beginning with site-3 = " + str(len([i for i in p if s in i]))) foo = [i for i in p if sp not in i] foo = [i for i in foo if s not in i] print ("# in neither location " + str(foo)) print ("# " + spname + " = " + sp) print ("# site-3 = " + s) if "darwin" in sys.platform or "linux" in sys.platform or "win" in sys.platform: # What, if anything, did python prepend to PATH path="" oldpath = upath(os.getenv("originalPATH")) newpath = upath(os.getenv("PATH")) i = newpath.find(oldpath) if i > 1: path = newpath[:i] pythonhome = upath(sp) print ("#pythonhome=" + pythonhome) pythonpath = upath(os.getenv("PYTHONPATH")) ldpath = "" oldldpath = upath(os.getenv("originalLD_LIBRARY_PATH")) newldpath = upath(os.getenv("LD_LIBRARY_PATH")) i = newldpath.find(oldldpath) if i > 1: ldpath = newldpath[:i] sitedir = usep.join(upath(site.__file__).split(usep)[:-1]) # if sitedir is not a subfolder of pythonhome, add to pythonpath if not pythonhome in sitedir: if not sitedir in pythonpath: pythonpath = (pythonpath + upathsep if pythonpath else "") + sitedir # add the parent of sitedir to LD_LIBRARY_PATH ldp = usep.join(sitedir.split(usep)[:-1]) if ldp not in oldldpath: ldpath = (ldpath + upathsep if ldpath else "") + ldp try: #if a representative shared libary not under pythonhome, add to pythonpath import _ctypes f = usep.join(upath(_ctypes.__file__).split(usep)[:-1]) if f.find(pythonhome) == -1: pythonpath = (pythonpath + upathsep if pythonpath else "") + f except: pass dq = "\"" if pythonpath: print ("\n# if launch python, then need:") print ("export PYTHONPATH=" + dq + pythonpath + dq) if path: print ("\n#PYTHON prepended the following to PATH") print ("export PATH=" + dq + path + "$PATH" + dq) print("\n#NRN_PYLIB provenance: " + str(nrnpylib_provenance)) print ("\n# if launch nrniv, then likely need:") if pythonhome: pythonhome=u2d(pythonhome) print ("export NRN_PYTHONHOME=" + dq + pythonhome + dq) if ldpath and nrn_pylib is None: print ("export LD_LIBRARY_PATH=" + dq + ldpath + upathsep + "$LD_LIBRARY_PATH" + dq) if nrn_pylib is not None: print ('export NRN_PYLIB="%s"' % nrn_pylib) quit() ################################### here nrn-8.2.6/bin/set_nrnpyenv.sh000077500000000000000000000015021465022020100161530ustar00rootroot00000000000000#!/usr/bin/env bash #if nrniv does not work then see if we can fix the problem if nrniv -c 'quit()' >& /dev/null ; then true else orig_pythonhome="$PYTHONHOME" orig_pythonpath="$PYTHONPATH" orig_ldlibpath="$LD_LIBRARY_PATH" orig_path="$PATH" eval "`nrnpyenv.sh`" if nrniv -c 'quit()' >& /dev/null ; then true else echo Attempt to fix nrniv failure using: 'eval "`mk_nrnpyenv.sh`"' failed. if test "$orig_pythonhome" = "" ; then unset PYTHONHOME else export PYTHONHOME="$orig_pythonhome" fi if test "$orig_pythonpath" = "" ; then unset PYTHONPATH else export PYTHONPATH="$orig_pythonpath" fi if test "$orig_ldlibpath" = "" ; then unset LD_LIBRARY_PATH else export LD_LIBRARY_PATH="$orig_ldlibpath" fi export PATH="$orig_path" fi fi nrn-8.2.6/bin/sortspike000077500000000000000000000000631465022020100150340ustar00rootroot00000000000000#!/usr/bin/env bash sort -k 1n,1n -k 2n,2n $1 > $2 nrn-8.2.6/bldnrnmacpkgcmake.sh000066400000000000000000000132251465022020100163160ustar00rootroot00000000000000#!/usr/bin/env bash set -ex default_pythons="python3.8 python3.9 python3.10 python3.11 python3.12" # distribution built with # bash bldnrnmacpkgcmake.sh # without args, default are the pythons above. # rx3doptlevel=2 is default but very slow compiling. For script testing # launch with rx3doptlevel set to 0 or 1, e.g. # rx3doptlevel=0 bash bldnrnmacpkgcmake.sh if test "$rx3doptlevel" = "" ; then rx3doptlevel=2 fi # python3.8 needs to be universal and macosx-10.9. So we built our own # from python.org python3.8.18 sources. Unfortunately, I cannot get pip # to work (OpenSSH issues), so I installed python.org Python3.8.10 installer # (which would have been fine by itself except it is macosx-11) # and copied relevant site-packages from that into the python3.8.18 # installation site-packages. export PATH=$HOME/soft/python3.8/bin:$PATH # In the top level source dir?# if test -f nrnversion.sh ; then NRN_SRC=`pwd` fi # If all the pythons are universal, then so is NEURON. # Otherwise $CPU # All pythons must have the same macos version and that will become # the MACOSX_DEPLOYMENT_TARGET # On my machine, to build nrn-x.x.x-macosx-10.9-universal2-py-38-39-310-311.pkg # I built my own versions of 3.8 in $HOME/soft/python3.8, and export PATH=$HOME/soft/python3.8/bin:$PATH CPU=`uname -m` universal="yes" # changes to "no" if any python not universal args="$*" if test "$args" = "" ; then args="$default_pythons" fi # sysconfig.get_platform() looks like, e.g. "macosx-12.2-arm64" or # "macosx-11-universal2". I.e. encodes MACOSX_DEPLOYMENT_TARGET and archs. # Demand all pythons we are building against have same platform. mac_platform="" for i in $args ; do last_py=$i mplat=`$i -c 'import sysconfig; print(sysconfig.get_platform())'` echo "platform for $i is $mplat" if test "$mac_platform" = "" ; then mac_platform=$mplat fi if test "$mac_platform" != "$mplat" ; then echo "$i platform \"$mplat\" differs from previous python \"$mac_platform\"." exit 1 fi done # extract MACOSX_DEPLOYMENT_TARGET and archs from mac_platform macosver=`$last_py -c 'import sysconfig; print(sysconfig.get_platform().split("-")[1])'` archs=`$last_py -c 'import sysconfig; print(sysconfig.get_platform().split("-")[2])'` if test "$archs" != "universal2" ; then universal=no fi # Arrgh. Recent changes to nrn source require at least 10.15! # macosver=10.15 mac_platform=macosx-$macosver-$archs export MACOSX_DEPLOYMENT_TARGET=$macosver echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" if test "$NRN_SRC" == "" ; then NRN_SRC=`pwd` fi NRN_BLD=$NRN_SRC/build NSRC=$NRN_SRC export NSRC NRN_INSTALL=/Applications/NEURON export PATH=$NRN_INSTALL/bin:$PATH rm -r -f $NRN_INSTALL cd $NRN_SRC mkdir -p $NRN_BLD rm -r -f $NRN_BLD/* cd $NRN_BLD PYVS="py" # will be part of package file name, eg. py-38-39-310-311 pythons="" # will be arg value of NRN_PYTHON_DYNAMIC for i in $args ; do PYVER=`$i -c 'from sys import version_info as v ; print (str(v.major) + str(v.minor)); quit()'` PYVS=${PYVS}-${PYVER} pythons="${pythons}${i};" done archs_cmake="" # arg for CMAKE_OSX_ARCHITECTURES, eg. arm64;x86_64 if test "$universal" = "yes" ; then archs_cmake='-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' fi # The reason for the "-DCMAKE_PREFIX_PATH=/usr/X11" below # is to definitely link against the xquartz.org installation instead # of the one under /opt/homebrew/ (which I think came # from brew install gedit). User installations are expected to have the # former and would only accidentally have the latter. cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=$NRN_INSTALL \ -DNRN_ENABLE_MPI_DYNAMIC=ON \ -DPYTHON_EXECUTABLE=`which python3` -DNRN_ENABLE_PYTHON_DYNAMIC=ON \ -DNRN_PYTHON_DYNAMIC="$pythons" \ -DIV_ENABLE_X11_DYNAMIC=ON \ -DNRN_ENABLE_CORENEURON=OFF \ -DNRN_RX3D_OPT_LEVEL=$rx3doptlevel \ $archs_cmake \ -DCMAKE_PREFIX_PATH=/usr/X11 \ -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++ ninja install if test "$universal" = "yes" ; then _temp="`lipo -archs $NRN_INSTALL/share/nrn/demo/release/$CPU/special`" if test "$_temp" != "x86_64 arm64" ; then echo "universal build failed. lipo -archs .../special is \"$_temp\" instead of \"x86_64 arm64\"" exit 1 fi fi $NRN_INSTALL/bin/neurondemo -c 'quit()' chk () { # Can launch python and import neuron # only needs PYTHONPATH ( export PYTHONPATH=$NRN_INSTALL/lib/python $1 -c 'from neuron import test; test()' $1 -c 'from neuron.tests import test_rxd; test_rxd.test(); quit()' ) return # need to work out the multiprocessing problem # Launching nrniv does not need NRN_PYLIB and PYTHONHOME ( $NRN_INSTALL/bin/nrniv -python -pyexe $1 -c 'import neuron ; neuron.test() ; quit()' $NRN_INSTALL/bin/nrniv -python -pyexe $1 -c 'from neuron.tests import test_rxd; test_rxd.test(); quit()' ) } # test basic functionality for i in $args ; do chk $i done #/Applications/Packages.app from # http://s.sudre.free.fr/Software/Packages/about.html # For mac to do a productsign, need my developerID_installer.cer # and Neurondev.p12 file. To add to the keychain, double click each # of those files. By default, I added my certificates to the login keychain. ninja macpkg # will sign the binaries, construct below # mentioned PACKAGE_FILE_NAME, request notarization from # Apple, and staple the package. # Copy the package to $HOME/$PACKAGE_FULL_NAME # You should then manually upload that to github. describe="`sh $NRN_SRC/nrnversion.sh describe`" macos=macos${MACOSX_DEPLOYMENT_TARGET} PACKAGE_FULL_NAME=nrn-${describe}-${mac_platform}-${PYVS}.pkg PACKAGE_FILE_NAME=$NRN_BLD/src/mac/build/NEURON.pkg cp $PACKAGE_FILE_NAME $HOME/$PACKAGE_FULL_NAME echo " Manually upload $HOME/$PACKAGE_FULL_NAME to github " nrn-8.2.6/ci/000077500000000000000000000000001465022020100127075ustar00rootroot00000000000000nrn-8.2.6/ci/association.hoc000066400000000000000000000002541465022020100157170ustar00rootroot00000000000000objref f f = new File() if (f.ropen("association.hoc.out")) { f.close() f.unlink() } f.wopen("association.hoc.out") f.printf("%s\n","hello") f.flush() f.close() quit() nrn-8.2.6/ci/azure-wheel-test-upload.yml000066400000000000000000000066761465022020100201400ustar00rootroot00000000000000steps: - task: PublishBuildArtifacts@1 inputs: pathToPublish: '$(Build.SourcesDirectory)/wheelhouse' displayName: 'Publish wheel as build artifact' - script: | brew install python export SKIP_EMBEDED_PYTHON_TEST=true packaging/python/test_wheels.sh /usr/local/bin/python3 wheelhouse/*.whl condition: and(eq(variables['agent.os'], 'Darwin'), eq(variables['python.version'], '3.7')) displayName: 'Test with brew Python' - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' - script: | export SKIP_EMBEDED_PYTHON_TEST=true packaging/python/test_wheels.sh $(which python) $(ls -t wheelhouse/*.whl) displayName: 'Test with System Python' - task: TwineAuthenticate@1 inputs: pythonUploadServiceConnection: AzureNeuronPypiNightly condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), ne(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - script: | python -m pip install twine python -m twine upload --verbose --skip-existing -r NeuronPypiNightly --config-file $(PYPIRC_PATH) wheelhouse/*.whl condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), ne(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) displayName: 'Upload nightly wheel to pypi.org' - task: TwineAuthenticate@1 inputs: pythonUploadServiceConnection: AzureNeuronGpuPypiNightly condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), eq(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - script: | python -m pip install twine python -m twine upload --verbose --skip-existing -r NeuronGpuPypiNightly --config-file $(PYPIRC_PATH) wheelhouse/*.whl condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule'), eq(variables.GPU_BUILD, 'true'), ne(variables['NRN_NIGHTLY_UPLOAD'], 'false'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) displayName: 'Upload nightly GPU wheel to pypi.org' - task: TwineAuthenticate@1 inputs: pythonUploadServiceConnection: AzureNeuronPypi condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), ne(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true')) - script: | python -m pip install twine python -m twine upload --verbose --skip-existing -r NeuronPypi --config-file $(PYPIRC_PATH) wheelhouse/*.whl condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), ne(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true')) displayName: 'Upload release wheel to pypi.org' - task: TwineAuthenticate@1 inputs: pythonUploadServiceConnection: AzureNeuronGpuPypi condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), eq(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true')) - script: | python -m pip install twine python -m twine upload --verbose --skip-existing -r NeuronGpuPypiProj --config-file $(PYPIRC_PATH) wheelhouse/*.whl condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), eq(variables.GPU_BUILD, 'true'), eq(variables['NRN_RELEASE_UPLOAD'], 'true')) displayName: 'Upload release GPU wheel to pypi.org' nrn-8.2.6/ci/azure-win-installer-upload.yml000066400000000000000000000031141465022020100206270ustar00rootroot00000000000000steps: - task: PublishBuildArtifacts@1 inputs: pathToPublish: '$(Build.SourcesDirectory)\nrn-nightly-AMD64.exe' displayName: 'Publish windows installer as build artifact' - task: UsePythonVersion@0 inputs: versionSpec: '3.7' displayName: "Use System Python" - task: BatchScript@1 inputs: filename: ci/win_install_neuron.cmd displayName: "Run Installer and launch .hoc association test" condition: succeeded() - task: BatchScript@1 inputs: # temporarily disable rxd testing ( ci/win_test_installer.cmd <-> ci/win_test_installer_wo_rxd.cmd) # see https://github.com/neuronsimulator/nrn/issues/1522 filename: ci/win_test_installer_wo_rxd.cmd displayName: "Test Installer" condition: succeeded() - task: GithubRelease@0 inputs: gitHubConnection: neuronsimulator-installers repositoryName: neuronsimulator/installers action: edit # note : if previous release doesn't exist, as we are pushing # to different repository, we must need to provide commit id. target: '9d7b1e26717bd207f7ae6114f78f7ab7b958c998' tagSource: manual tag: nightly title: 'Nightly NEURON Developer Snapshot' releaseNotesSource: input releaseNotes: "Last NEURON Commit: $(Build.SourceVersionMessage)" isPreRelease: true assetUploadMode: replace addChangeLog: false assets: | $(Build.SourcesDirectory)\nrn-nightly-AMD64.exe displayName: 'Upload installer to GitHub' condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'Schedule')) nrn-8.2.6/ci/win_build_cmake.sh000077500000000000000000000026441465022020100163700ustar00rootroot00000000000000#!/usr/bin/env bash set -ex # standard env variables from ming2 shell export MSYSTEM_CHOST=x86_64-w64-mingw32 export MSYSTEM=MINGW64 export MINGW_PREFIX=/mingw64 export MINGW_CHOST=x86_64-w64-mingw32 export MSYSTEM_PREFIX=/mingw64 export PATH=/mingw64/bin:$PATH # have compatible cython3 python3 -m pip install "cython<3" # if BUILD_SOURCESDIRECTORY not available, use te root of the repo if [ -z "$BUILD_SOURCESDIRECTORY" ]; then export BUILD_SOURCESDIRECTORY=$(git rev-parse --show-toplevel) fi mkdir -p $BUILD_SOURCESDIRECTORY/build cd $BUILD_SOURCESDIRECTORY/build # build and create installer /mingw64/bin/cmake .. \ -G 'Unix Makefiles' \ -DNRN_ENABLE_MPI_DYNAMIC=ON \ -DNRN_ENABLE_MPI=ON \ -DCMAKE_PREFIX_PATH='/c/msmpi' \ -DNRN_ENABLE_INTERVIEWS=ON \ -DNRN_ENABLE_PYTHON=ON \ -DNRN_ENABLE_RX3D=ON \ -DNRN_RX3D_OPT_LEVEL=2 \ -DPYTHON_EXECUTABLE=/c/Python37/python.exe \ -DNRN_ENABLE_PYTHON_DYNAMIC=ON \ -DNRN_PYTHON_DYNAMIC='c:/Python37/python.exe;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' \ -DMPI_CXX_LIB_NAMES:STRING=msmpi \ -DMPI_C_LIB_NAMES:STRING=msmpi \ -DMPI_msmpi_LIBRARY:FILEPATH=c:/msmpi/lib/x64/msmpi.lib make -j 2 ctest -VV make install make setup_exe # copy installer with fixed name for nightly upload cp src/mswin/nrn*AMD64.exe $BUILD_SOURCESDIRECTORY/nrn-nightly-AMD64.exe nrn-8.2.6/ci/win_download_deps.cmd000066400000000000000000000034261465022020100171000ustar00rootroot00000000000000@echo on :: download all installers :: python pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.7.exe https://www.python.org/ftp/python/3.7.7/python-3.7.7-amd64.exe || goto :error pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.8.exe https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe || goto :error pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.9.exe https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe || goto :error pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.10.exe https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe || goto :error pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.11.exe https://www.python.org/ftp/python/3.11.1/python-3.11.1-amd64.exe || goto :error pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile python-3.12.exe https://www.python.org/ftp/python/3.12.1/python-3.12.1-amd64.exe || goto :error :: mpi pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile msmpisetup.exe https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe || goto :error pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile msmpisdk.msi https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisdk.msi || goto :error :: nsis + plugin curl -LO --retry 4 http://prdownloads.sourceforge.net/nsis/nsis-3.05-setup.exe || goto :error pwsh -command Invoke-WebRequest -MaximumRetryCount 4 -OutFile EnVar_pugin.zip https://nsis.sourceforge.io/mediawiki/images/7/7f/EnVar_plugin.zip || goto :error :: if all goes well, go to end goto :EOF :: something has failed, teminate with error code :error echo ERROR : exiting with error code %errorlevel% exit /b %errorlevel% nrn-8.2.6/ci/win_install_deps.cmd000066400000000000000000000117161465022020100167400ustar00rootroot00000000000000@echo on :: install all dependencies :: install python python-3.7.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python37 || goto :error python-3.8.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python38 || goto :error python-3.9.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python39 || goto :error python-3.10.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python310 || goto :error python-3.11.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python311 || goto :error python-3.12.exe /passive Include_pip=1 Include_test=0 PrependPath=1 DefaultJustForMeTargetDir=C:\Python312 || goto :error :: fix msvcc version for all python3 pwsh -command "(Get-Content C:\Python37\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1900'':' | Out-File C:\Python37\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python38\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1916'':' | Out-File C:\Python38\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python39\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1927'':' | Out-File C:\Python39\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python310\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1929'':' | Out-File C:\Python310\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python311\Lib\distutils\cygwinccompiler.py) -replace 'elif msc_ver == ''1600'':', 'elif msc_ver == ''1934'':' | Out-File C:\Python311\Lib\distutils\cygwinccompiler.py" :: fix msvc runtime library for all python pwsh -command "(Get-Content C:\Python37\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python37\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python38\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python38\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python39\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python39\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python310\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python310\Lib\distutils\cygwinccompiler.py" pwsh -command "(Get-Content C:\Python311\Lib\distutils\cygwinccompiler.py) -replace 'msvcr100', 'msvcrt' | Out-File C:\Python311\Lib\distutils\cygwinccompiler.py" :: install numpy C:\Python37\python.exe -m pip install numpy==1.14.6 "cython < 3" || goto :error 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 :: setuptools 70.2 leads to an error C:\Python312\python.exe -m pip install setuptools==70.1.1 || goto :error :: install nsis nsis-3.05-setup.exe /S || goto :error pwsh -command Expand-Archive EnVar_pugin.zip -DestinationPath "${env:ProgramFiles(x86)}\NSIS" || goto :error :: install mpi msmpisetup.exe -unattend -installroot C:\msmpi || goto :error start /wait msiexec /i msmpisdk.msi /norestart /qn INSTALLDIR="C:\msmpi" ADDLOCAL=ALL || goto :error rename C:\msmpi\Bin bin || goto :error rename C:\msmpi\Lib lib || goto :error rename C:\msmpi\Include include || goto :error copy "c:\Windows\System32\msmpi.dll" "c:\msmpi\lib\x64\msmpi.dll" || goto :error copy "c:\Windows\SysWoW64\msmpi.dll" "c:\msmpi\lib\x86\msmpi.dll" || goto :error :: check if MSYS2_ROOT is set, otherwise set it to C:\msys64 (default) if "%MSYS2_ROOT%"=="" set MSYS2_ROOT=C:\msys64 :: install msys2 / mingw packages. :: NOTE: msys2 is already installed in the CI VM image. We check if msys2 is not installed, then download and install it with choco if not exist "%MSYS2_ROOT%\usr\bin\bash.exe" ( choco install -y --no-progress msys2 --params="/InstallDir:%MSYS2_ROOT% /NoUpdate /NoPath" || goto :error ) set PATH=%MSYS2_ROOT%\usr\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%PATH% %MSYS2_ROOT%\usr\bin\pacman --noconfirm --needed -S --disable-download-timeout ^ cmake ^ git ^ zip ^ unzip ^ base-devel ^ mingw-w64-x86_64-cmake ^ mingw-w64-x86_64-ncurses ^ mingw-w64-x86_64-readline ^ mingw-w64-x86_64-python3 ^ mingw64/mingw-w64-x86_64-cython ^ mingw-w64-x86_64-python3-setuptools ^ mingw-w64-x86_64-python3-packaging ^ mingw-w64-x86_64-python3-pip ^ mingw64/mingw-w64-x86_64-dlfcn ^ mingw-w64-x86_64-toolchain || goto :error :: if all goes well, go to end goto :EOF :: something has failed, teminate with error code :error echo ERROR : exiting with error code %errorlevel% exit /b %errorlevel% nrn-8.2.6/ci/win_install_neuron.cmd000066400000000000000000000005501465022020100173050ustar00rootroot00000000000000:: run installer start /b /wait .\nrn-nightly-AMD64.exe /S /D=C:\nrn_test :: take a look dir C:\nrn_test tree /F C:\nrn_test\lib\python :: Test of association with hoc files. This test is very tricky to handle. We do it in two steps :: 1st step -> launch association.hoc here and test the output in another step start /wait /REALTIME %cd%\ci\association.hoc nrn-8.2.6/ci/win_test_installer.cmd000066400000000000000000000060001465022020100173010ustar00rootroot00000000000000@echo on :: error variable set "errorfound=" :: setup environment set PATH=C:\nrn_test\bin;%PATH% set PYTHONPATH=C:\nrn_test\lib\python;%PYTHONPATH% set NEURONHOME=C:\nrn_test echo %PATH% echo %PYTHONPATH% echo %NEURONHOME% :: Mitigation strategy -> for reasons uknown(thank you Windows), association.hoc.out may not be generated from previous step. :: If so, try again to generate it. No wait required like previous strategies, we rely on testing entropy from this point on. if not exist association.hoc.out (start /wait /REALTIME %cd%\ci\association.hoc) :: test all pythons C:\Python37\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y" 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" :: install numpy dependency python -m pip install "numpy<2" :: run also using whatever is system python python --version python -c "import neuron; neuron.test(); quit()" || set "errorfound=y" :: test python and nrniv python -c "from neuron import h; s = h.Section(); s.insert('hh'); quit()" || set "errorfound=y" nrniv -python -c "from neuron import h; s = h.Section(); s.insert('hh'); quit()" || set "errorfound=y" :: test mpi mpiexec -n 2 nrniv %cd%\src\parallel\test0.hoc -mpi || set "errorfound=y" mpiexec -n 2 python %cd%\src\parallel\test0.py -mpi --expected-hosts 2 || set "errorfound=y" :: setup for mknrndll/nrnivmodl set N=C:\nrn_test set PATH=C:\nrn_test\mingw\usr\bin;%PATH% :: test mknrndll copy /A share\examples\nrniv\nmodl\cacum.mod . C:\nrn_test\mingw\usr\bin\bash -c "mknrndll" || set "errorfound=y" python -c "import neuron; from neuron import h; s = h.Section(); s.insert('cacum'); print('cacum inserted'); quit()" || set "errorfound=y" :: test nrnivmodl rm -f cacum* mod_func* nrnmech.dll copy /A share\examples\nrniv\nmodl\cacum.mod . call nrnivmodl echo "nrnivmodl successfull" python -c "import neuron; from neuron import h; s = h.Section(); s.insert('cacum'); print('cacum inserted'); quit()" || set "errorfound=y" :: text rxd, disable until #2585 is fixed :: python share\lib\python\neuron\rxdtests\run_all.py || set "errorfound=y" :: Test of association with hoc files. This test is very tricky to handle. We do it in two steps. :: 2nd step -> check association.hoc output after we've launched 1step in previous CI step cat association.hoc.out findstr /i "^hello$" association.hoc.out || set "errorfound=y" echo "All tests finished!" :: uninstall neuron C:\nrn_test\uninstall /S || set "errorfound=y" echo "Uninstalled NEURON" :: if something failed, exit with error if defined errorfound (goto :error) :: if all goes well, go to end goto :EOF :: something has failed, teminate with error code :error echo ERROR : exiting with error code 1 .. exit 1 nrn-8.2.6/ci/win_test_installer_wo_rxd.cmd000066400000000000000000000060521465022020100206720ustar00rootroot00000000000000:: temporarily disable rxd testing ( ci/win_test_installer.cmd <-> ci/win_test_installer_wo_rxd.cmd) :: see https://github.com/neuronsimulator/nrn/issues/1522 @echo on :: error variable set "errorfound=" :: setup environment set PATH=C:\nrn_test\bin;%PATH% set PYTHONPATH=C:\nrn_test\lib\python;%PYTHONPATH% set NEURONHOME=C:\nrn_test echo %PATH% echo %PYTHONPATH% echo %NEURONHOME% :: Mitigation strategy -> for reasons uknown(thank you Windows), association.hoc.out may not be generated from previous step. :: If so, try again to generate it. No wait required like previous strategies, we rely on testing entropy from this point on. if not exist association.hoc.out (start /wait /REALTIME %cd%\ci\association.hoc) :: test all pythons C:\Python37\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y" 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" :: install numpy dependency python -m pip install "numpy<2" :: run also using whatever is system python python --version python -c "import neuron; neuron.test(); quit()" || set "errorfound=y" :: test python and nrniv python -c "from neuron import h; s = h.Section(); s.insert('hh'); quit()" || set "errorfound=y" nrniv -python -c "from neuron import h; s = h.Section(); s.insert('hh'); quit()" || set "errorfound=y" :: test mpi mpiexec -n 2 nrniv %cd%\src\parallel\test0.hoc -mpi || set "errorfound=y" mpiexec -n 2 python %cd%\src\parallel\test0.py -mpi --expected-hosts 2 || set "errorfound=y" :: setup for mknrndll/nrnivmodl set N=C:\nrn_test set PATH=C:\nrn_test\mingw\usr\bin;%PATH% :: test mknrndll copy /A share\examples\nrniv\nmodl\cacum.mod . C:\nrn_test\mingw\usr\bin\bash -c "mknrndll" || set "errorfound=y" python -c "import neuron; from neuron import h; s = h.Section(); s.insert('cacum'); print('cacum inserted'); quit()" || set "errorfound=y" :: test nrnivmodl rm -f cacum* mod_func* nrnmech.dll copy /A share\examples\nrniv\nmodl\cacum.mod . call nrnivmodl echo "nrnivmodl successfull" python -c "import neuron; from neuron import h; s = h.Section(); s.insert('cacum'); print('cacum inserted'); quit()" || set "errorfound=y" :: Test of association with hoc files. This test is very tricky to handle. We do it in two steps. :: 2nd step -> check association.hoc output after we've launched 1step in previous CI step cat association.hoc.out findstr /i "^hello$" association.hoc.out || set "errorfound=y" echo "All tests finished!" :: uninstall neuron C:\nrn_test\uninstall /S || set "errorfound=y" echo "Uninstalled NEURON" :: if something failed, exit with error if defined errorfound (goto :error) :: if all goes well, go to end goto :EOF :: something has failed, teminate with error code :error echo ERROR : exiting with error code 1 .. exit 1 nrn-8.2.6/cmake/000077500000000000000000000000001465022020100133745ustar00rootroot00000000000000nrn-8.2.6/cmake/BuildOptionDefaults.cmake000066400000000000000000000047551465022020100203310ustar00rootroot00000000000000# ~~~ # This allows h.nrnversion(6) to print only the configuration differences. # The _DEFAULT values should only be changed in this file # and not on the command line. # ~~~ set(NRN_ENABLE_DOCS_DEFAULT OFF) set(NRN_ENABLE_DOCS_WITH_EXTERNAL_INSTALLATION_DEFAULT OFF) set(NRN_ENABLE_SHARED_DEFAULT ON) set(NRN_ENABLE_INTERVIEWS_DEFAULT ON) set(NRN_ENABLE_MECH_DLL_STYLE_DEFAULT ON) set(NRN_ENABLE_DISCRETE_EVENT_OBSERVER_DEFAULT ON) set(NRN_ENABLE_PYTHON_DEFAULT ON) set(NRN_ENABLE_THREADS_DEFAULT ON) set(NRN_ENABLE_MPI_DEFAULT ON) set(NRN_ENABLE_MUSIC_DEFAULT OFF) set(NRN_ENABLE_RX3D_DEFAULT ON) set(NRN_ENABLE_CORENEURON_DEFAULT OFF) set(NRN_ENABLE_BACKTRACE_DEFAULT OFF) set(NRN_ENABLE_TESTS_DEFAULT OFF) set(NRN_ENABLE_MODEL_TESTS_DEFAULT "") set(NRN_ENABLE_MODULE_INSTALL_DEFAULT ON) set(NRN_ENABLE_PYTHON_DYNAMIC_DEFAULT OFF) 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 "") # Some distributions may set the prefix. To avoid errors, unset it set(NRN_PYTHON_DYNAMIC_DEFAULT "") set(NRN_MPI_DYNAMIC_DEFAULT "") set(NRN_RX3D_OPT_LEVEL_DEFAULT "0") # Some CMAKE variables we would like to see, if they differ from the following. set(CMAKE_BUILD_TYPE_DEFAULT RelWithDebInfo) set(CMAKE_INSTALL_PREFIX_DEFAULT "/usr/local") set(CMAKE_C_COMPILER_DEFAULT "gcc") set(CMAKE_CXX_COMPILER_DEFAULT "g++") set(PYTHON_EXECUTABLE_DEFAULT "") set(IV_LIB_DEFAULT "") # For wheel deployment set(NRN_WHEEL_BUILD_DEFAULT OFF) set(NRN_WHEEL_STATIC_READLINE_DEFAULT OFF) # we add some coreneuron options in order to check support like GPU set(NRN_OPTION_NAME_LIST NRN_ENABLE_SHARED NRN_ENABLE_INTERVIEWS NRN_ENABLE_MECH_DLL_STYLE NRN_ENABLE_DISCRETE_EVENT_OBSERVER NRN_ENABLE_PYTHON NRN_ENABLE_MUSIC NRN_ENABLE_THREADS NRN_ENABLE_MPI NRN_ENABLE_RX3D NRN_ENABLE_CORENEURON NRN_ENABLE_TESTS NRN_ENABLE_MODEL_TESTS NRN_ENABLE_MODULE_INSTALL NRN_ENABLE_PYTHON_DYNAMIC NRN_MODULE_INSTALL_OPTIONS NRN_PYTHON_DYNAMIC NRN_MPI_DYNAMIC NRN_DYNAMIC_UNITS_USE_LEGACY NRN_RX3D_OPT_LEVEL NRN_SANITIZERS CMAKE_BUILD_TYPE CMAKE_INSTALL_PREFIX CMAKE_C_COMPILER CMAKE_CXX_COMPILER PYTHON_EXECUTABLE IV_LIB CORENRN_ENABLE_GPU) # For profiling set(NRN_ENABLE_PROFILING_DEFAULT OFF) set(NRN_PROFILER_DEFAULT "caliper") nrn-8.2.6/cmake/CMakeListsNrnMech.cmake000066400000000000000000000066161465022020100176610ustar00rootroot00000000000000# ============================================================================= # Prepare nrnivmodl script with correct flags # ============================================================================= # extract the COMPILE_DEFINITIONS property from the directory get_directory_property(NRN_COMPILE_DEFS_DIR_PROPERTY COMPILE_DEFINITIONS) list(APPEND NRN_COMPILE_DEFS ${NRN_COMPILE_DEFS_DIR_PROPERTY}) # Turn the CMake lists NRN_COMPILE_DEFS, NRN_COMPILE_FLAGS, NRN_LINK_FLAGS and # NRN_NOCMODL_SANITIZER_ENVIRONMENT into flat strings list(TRANSFORM NRN_COMPILE_DEFS PREPEND -D OUTPUT_VARIABLE NRN_COMPILE_DEF_FLAGS) string(JOIN " " NRN_COMPILE_DEFS_STRING ${NRN_COMPILE_DEF_FLAGS}) string(JOIN " " NRN_COMPILE_FLAGS_STRING ${NRN_COMPILE_FLAGS} ${NRN_EXTRA_MECH_CXX_FLAGS}) string(JOIN " " NRN_LINK_FLAGS_STRING ${NRN_LINK_FLAGS}) string(JOIN " " NRN_NOCMODL_SANITIZER_ENVIRONMENT_STRING ${NRN_NOCMODL_SANITIZER_ENVIRONMENT}) # extract link defs to the whole project get_target_property(NRN_LINK_LIBS nrniv_lib LINK_LIBRARIES) if(NOT NRN_LINK_LIBS) set(NRN_LINK_LIBS "") 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. 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() 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() # PGI add --c++11;-A option for c++11 flag string(REPLACE ";" " " CXX11_STANDARD_COMPILE_OPTION "${CMAKE_CXX11_STANDARD_COMPILE_OPTION}") # Compiler flags depending on cmake build type from BUILD_TYPE__FLAGS string(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE) set(BUILD_TYPE_C_FLAGS "${CMAKE_C_FLAGS_${_BUILD_TYPE}}") set(BUILD_TYPE_CXX_FLAGS "${CMAKE_CXX_FLAGS_${_BUILD_TYPE}}") nrn-8.2.6/cmake/CheckGitDescribeCompatibility.cmake000066400000000000000000000067721465022020100222660ustar00rootroot00000000000000find_package(Git QUIET) if(GIT_FOUND) # --abbrev=0 just gives the parent tag without a suffix representing the number of commits since # the tag and the current commit hash execute_process( COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE GIT_EXIT_CODE OUTPUT_VARIABLE PARENT_GIT_TAG ERROR_VARIABLE GIT_STDERR OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) if(${GIT_EXIT_CODE} EQUAL 0) if(NOT GIT_STDERR STREQUAL "") message(FATAL_ERROR "git describe succeeded but had stderr: '${GIT_STDERR}'") endif() # ${PARENT_GIT_TAG} contains the name of the parent tag of the current commit. In a tagged # release, this should be exactly the version number in semver-compatible MAJOR.MINOR.PATCH # format. On a development or feature branch, this should be a tag that has been created just # after the last release from that branch. For example, the master branch (and feature branches # based on it) after the 8.1 release have a parent tag called 8.2.dev, so that git describe # produces output compatible with the guidelines in the NEURON documentation: # https://nrn.readthedocs.io/en/latest/scm/guide/SCMGuide.html#a-versioning-scheme-for-neuron. # In a branch whose parent tag is 8.2.dev, the project(...) call should say that the version is # 8.2.0. If and when an incompatible change is merged to the master branch then a 9.0.dev tag # should be created and the project(...) version should be updated to 9.0.0. If changes are # cherry-picked to a branch such as release/8.1 then a 8.1.1.dev tag should be created there and # the project(...) version in that branch updated to 8.1.1. The three cases handled are: # # * if the parent tag is a MAJOR.MINOR.PATCH version then it should exactly match project(...) # * if the parent tag is MAJOR.MINOR(a|b|rcN) then project(...) should contain MAJOR.MINOR.0 # * if the parent tag has a .dev suffix, the part before .dev is suffixed with .0 if needed to # make a full MAJOR.MINOR.PATCH version, which should exactly match project(...) if(PARENT_GIT_TAG MATCHES "^([0-9]+\\.[0-9]+)\\.dev$") # X.Y.dev CMAKE_MATCH_1 holds X.Y set(expected_version "${CMAKE_MATCH_1}.0") elseif(PARENT_GIT_TAG MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.dev$") # X.Y.Z.dev, CMAKE_MATCH_1 holds X.Y.Z set(expected_version "${CMAKE_MATCH_1}") elseif(PARENT_GIT_TAG MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") # Release tag set(expected_version "${PARENT_GIT_TAG}") elseif(PARENT_GIT_TAG MATCHES "^([0-9]+\\.[0-9]+)(a|b|rc[0-9]+)$") # Alpha, beta or release candidate (what about alpha/beta/rc of a patch release, i.e. 8.1.1a? # This is not foreseen in the docs.) set(expected_version "${CMAKE_MATCH_1}.0") else() message(FATAL_ERROR "Failed to parse Git tag: '${GIT_STDOUT}'") endif() if(NOT expected_version STREQUAL "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") message(WARNING "Parent git tag is ${PARENT_GIT_TAG} but the CMake version is " "${PROJECT_VERSION}; you should probably update CMakeLists.txt " "to contain project(NEURON VERSION ${expected_version} ...)!") endif() else() message( STATUS "git describe failed " "(stdout: '${PARENT_GIT_TAG}', stderr: '${GIT_STDERR}', code: ${GIT_EXIT_CODE}), " "skipping the version check") endif() endif() nrn-8.2.6/cmake/CompilerFlagsHelpers.cmake000066400000000000000000000133301465022020100204500ustar00rootroot00000000000000# ============================================================================= # Copyright (C) 2016-2019 Blue Brain Project # # See top-level LICENSE file for details. # ============================================================================= # CompilerFlagsHelpers.cmake # # set of Convenience functions for portable compiler flags set(SUPPORTED_COMPILER_LANGUAGE_LIST "C;CXX") # Detect compiler foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST}) if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "XL") set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_XLC ON) elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "Intel") set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_ICC ON) elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_MSVC) elseif(${CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID} STREQUAL "Clang") set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_CLANG ON) elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "GNU") set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_GCC ON) elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "Cray") set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_CRAY ON) endif() endforeach() set(FASTDEBUG_FLAG "-g -O1") # Set optimization flags for each compiler foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST}) # XLC compiler if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_XLC) # XLC -qinfo=all is awfully verbose on any platforms that use the GNU STL Enable by default only # the relevant one set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-qformat=all -qinfo=lan:trx:ret:zea:cmp:ret") set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FAST "-O3") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTDEBUG ${FASTDEBUG_FLAG}) set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-qstackprotect") set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDENT "-qpic=small") set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "-qhot") set(IGNORE_UNKNOWN_PRAGMA_FLAGS "-qsuppress=1506-224") # Microsoft compiler elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_MSVC) set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-Zi") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FAST "-O2") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTDEBUG ${FASTDEBUG_FLAG}) set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-GS") # enable by default on MSVC set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDENT "") # GCC elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_GCC) set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-Wall") set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FAST "-O3") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTDEBUG ${FASTDEBUG_FLAG}) set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-fstack-protector") set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDENT "-fPIC") set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "-ftree-vectorize") set(IGNORE_UNKNOWN_PRAGMA_FLAGS "-Wno-unknown-pragmas") set(CMAKE_${COMPILER_LANGUAGE}_IGNORE_WARNINGS "-Wno-write-strings") if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_VERSION VERSION_GREATER "4.7.0") set(CMAKE_${COMPILER_LANGUAGE}_LINK_TIME_OPT "-flto") endif() if((CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^ppc") OR (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^power" )) # ppc arch do not support -march= syntax set(CMAKE_${COMPILER_LANGUAGE}_GEN_NATIVE "-mcpu=native") else() set(CMAKE_${COMPILER_LANGUAGE}_GEN_NATIVE "-march=native") endif() # Intel Compiler elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_ICC) set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-Wall") set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FAST "-O3") if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "IntelLLVM") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTDEBUG "${FASTDEBUG_FLAG} -fp-model precise") else() set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTDEBUG "${FASTDEBUG_FLAG} -fp-model consistent") endif() set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-fstack-protector") set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDENT "-fpic") set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "") set(IGNORE_UNKNOWN_PRAGMA_FLAGS "-Wno-unknown-pragmas") set(CMAKE_${COMPILER_LANGUAGE}_GEN_NATIVE "-march=native") # rest of the world else() set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-Wall") set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0") set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FAST "-O3") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTDEBUG "-g -O1") set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "") set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDENT "-fPIC") set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "") if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "PGI") set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "") endif() if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID MATCHES "Clang|AppleClang") set(CMAKE_${COMPILER_LANGUAGE}_IGNORE_WARNINGS "-Wno-writable-strings") endif() if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "NVHPC") set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTDEBUG "${FASTDEBUG_FLAG} -fno-omit-frame-pointer") endif() endif() endforeach() nrn-8.2.6/cmake/CompilerHelper.cmake000066400000000000000000000072631465022020100173200ustar00rootroot00000000000000# ============================================================================= # Compiler specific settings # ============================================================================= if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR NRN_MACOS_BUILD) set(UNDEFINED_SYMBOLS_IGNORE_FLAG "-undefined dynamic_lookup") string(APPEND CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS " ${UNDEFINED_SYMBOLS_IGNORE_FLAG}") string(APPEND CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS " ${UNDEFINED_SYMBOLS_IGNORE_FLAG}") else() set(UNDEFINED_SYMBOLS_IGNORE_FLAG "--unresolved-symbols=ignore-all") endif() if(CMAKE_C_COMPILER_ID MATCHES "PGI" OR CMAKE_C_COMPILER_ID MATCHES "NVHPC") set(NRN_HAVE_NVHPC_COMPILER ON) # See https://gitlab.kitware.com/cmake/cmake/-/issues/22168, upper limit of 3.20.3 is based on the # current assigned milestone there. if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20" AND ${CMAKE_VERSION} VERSION_LESS "3.20.3") string(APPEND CMAKE_DEPFILE_FLAGS_CXX "-MD") endif() if(${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 20.7) # https://forums.developer.nvidia.com/t/many-all-diagnostic-numbers-increased-by-1-from-previous-values/146268/3 # changed the numbering scheme in newer versions. The following list is from a clean start 16 # August 2021. It would clearly be nicer to apply these suppressions only to relevant files. # Examples of the suppressed warnings are given below. # ~~~ # "src/oc/isoc99.h", warning #1-D: last line of file ends without a newline # "src/nrniv/nvector_nrnserial_ld.cpp", warning #47-D: incompatible redefinition of macro "..." # "src/nmodl/kinetic.cpp", warning #111-D: statement is unreachable # "src/nmodl/parsact.cpp", warning #128-D: loop is not reachable # "src/modlunit/units.cpp", warning #170-D: pointer points outside of underlying object # "src/nrnpython/grids.cpp", warning #174-D: expression has no effect # "src/nmodl/nocpout.cpp", warning #177-D: variable "j" was declared but never referenced # "src/mesch/conjgrad.c", warning #180-D: argument is incompatible with formal parameter # "src/nrniv/partrans.cpp", warning #186-D: pointless comparison of unsigned integer with zero # "src/mesch/machine.h", warning #301-D: typedef name has already been declared (with same type) # "src/nrnpython/rxdmath.cpp", warning #541-D: allowing all exceptions is incompatible with previous function # "src/nmodl/nocpout.cpp", warning #550-D: variable "sion" was set but never used # "src/gnu/neuron_gnu_builtin.h", warning #816-D: type qualifier on return type is meaningless" # "src/oc/fmenu.cpp", warning #941-D: missing return statement at end of non-void function "ibmgetc" # "src/modlunit/consist.cpp", warning #2465-D: conversion from a string literal to "char *" is deprecated # ~~~ list(APPEND NRN_COMPILE_FLAGS --diag_suppress=1,47,111,128,170,174,177,180,186,301,541,550,816,941,2465) endif() list(APPEND NRN_COMPILE_FLAGS -noswitcherror) list(APPEND NRN_LINK_FLAGS -noswitcherror) if(${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 21.11) # 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) endif() else() set(NRN_HAVE_NVHPC_COMPILER OFF) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "PGI") # CMake adds strict standard complaint PGI flag "-A" which breaks compilation of old codes (e.g. # spdlog, fmt) set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX11_STANDARD_COMPILE_OPTION --c++11) set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14) endif() nrn-8.2.6/cmake/ConfigFileSetting.cmake000066400000000000000000000322111465022020100177400ustar00rootroot00000000000000# ============================================================================= # Definitions used in nrnconf.h and nmodlconf.h # ============================================================================= set(PACKAGE_NAME "${PACKAGE}") set(PACKAGE_TARNAME "${PACKAGE}") set(PACKAGE_BUGREPORT "\"\"") set(PACKAGE_URL "\"\"") set(UNQUOTED_PACKAGE_VERSION "${PROJECT_VERSION}") # ~~~ # some of the variables need to be double quoted strings as they are # used in the above mentioned template files name for libraries # ~~~ nrn_set_string(PACKAGE "nrn") nrn_set_string(NRNHOST "${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}") nrn_set_string(NRNHOSTCPU "${CMAKE_SYSTEM_PROCESSOR}") nrn_set_string(PACKAGE_STRING "nrn ${PROJECT_VERSION}") nrn_set_string(PACKAGE_VERSION "${PROJECT_VERSION}") nrn_set_string(VERSION "${PROJECT_VERSION}") nrn_set_string(NRN_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib") nrn_set_string(NEURON_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/nrn") nrn_set_string(LT_OBJDIR ".libs/") nrn_set_string(DLL_DEFAULT_FNAME "${CMAKE_SYSTEM_PROCESSOR}/.libs/libnrnmech.so") # indicate nmodl config is used add_definitions(-DHAVE_CONFIG_H) set(YYTEXT_POINTER 1) set(TIME_WITH_SYS_TIME 1) set(HAVE_NAMESPACES "/**/") set(HAVE_STTY 0) # below two are universal nowadays set(IVOS_FABS "::fabs") set(HAVE_STL "/**/") set(prefix ${CMAKE_INSTALL_PREFIX}) set(host_cpu ${CMAKE_SYSTEM_PROCESSOR}) set(exec_prefix ${prefix}) set(bindir \${exec_prefix}/bin) set(modsubdir ${host_cpu}) set(bindir \${exec_prefix}/bin) set(libdir \${exec_prefix}/lib) set(BGPDMA ${NRNMPI}) # ============================================================================= # Comment or empty character to enable/disable cmake specific settings # ============================================================================= # adding `#` makes a comment in the python whereas empty enable code if(NRN_ENABLE_CORENEURON) set(CORENEURON_ENABLED_TRUE "") set(CORENEURON_ENABLED_FALSE "#") else() set(CORENEURON_ENABLED_TRUE "#") set(CORENEURON_ENABLED_FALSE "") endif() # ~~~ # A variable that doesn't start out as #undef but as #define needs an # explicit @...@ replacement in the .h.in files. # The value is set to description followed by a string of space # separated 'option=value' where value differs from the default value. # ~~~ set(neuron_config_args "cmake option default differences:") foreach(_name ${NRN_OPTION_NAME_LIST}) if(NOT ("${${_name}}" STREQUAL "${${_name}_DEFAULT}")) string(APPEND neuron_config_args " '${_name}=${${_name}}'") endif() endforeach() # ============================================================================= # Platform specific options (get expanded to comments) # ============================================================================= # for nrn.defaults set(nrndef_unix "//") set(nrndef_mac "//") set(nrndef_mswin "//") set(NRN_OSX_BUILD_TRUE "#") if(NRN_LINUX_BUILD) set(nrndef_unix "") elseif(NRN_MACOS_BUILD) set(nrndef_mac "") set(DARWIN 1) set(NRN_OSX_BUILD_TRUE "") elseif(NRN_WINDOWS_BUILD) set(nrndef_mswin "") endif() # ============================================================================= # Options based on user provided build options # ============================================================================= if(NRN_ENABLE_DISCRETE_EVENT_OBSERVER) set(DISCRETE_EVENT_OBSERVER 1) 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() unset(NRNMECH_DLL_STYLE) endif() if(NRN_ENABLE_INTERVIEWS AND NOT MINGW) set(NRNOC_X11 1) else() set(NRNOC_X11 0) endif() if(NRN_ENABLE_PYTHON_DYNAMIC) # the value needs to be made not to matter set(NRNPYTHON_DYNAMICLOAD 3) endif() if(NRN_DYNAMIC_UNITS_USE_LEGACY) set(DYNAMIC_UNITS_USE_LEGACY_DEFAULT 1) else() unset(DYNAMIC_UNITS_USE_LEGACY_DEFAULT) endif() # ============================================================================= # Dependencies option # ============================================================================= set(SUNDIALS_DOUBLE_PRECISION 1) set(SUNDIALS_USE_GENERIC_MATH 1) # ============================================================================= # Similar to check_include_files but also construct NRN_HEADERS_INCLUDE_LIST # ============================================================================= nrn_check_include_files(alloca.h HAVE_ALLOCA_H) nrn_check_include_files(dlfcn.h HAVE_DLFCN_H) nrn_check_include_files(execinfo.h HAVE_EXECINFO_H) nrn_check_include_files(fcntl.h HAVE_FCNTL_H) nrn_check_include_files(fenv.h HAVE_FENV_H) nrn_check_include_files(float.h HAVE_FLOAT_H) nrn_check_include_files(inttypes.h HAVE_INTTYPES_H) nrn_check_include_files(limits.h HAVE_LIMITS_H) nrn_check_include_files(locale.h HAVE_LOCALE_H) nrn_check_include_files(malloc.h HAVE_MALLOC_H) nrn_check_include_files(math.h HAVE_MATH_H) nrn_check_include_files(memory.h HAVE_MEMORY_H) nrn_check_include_files(pthread.h HAVE_PTHREAD_H) nrn_check_include_files(sgtty.h HAVE_SGTTY_H) nrn_check_include_files(stdarg.h HAVE_STDARG_H) nrn_check_include_files(stdint.h HAVE_STDINT_H) nrn_check_include_files(stdlib.h HAVE_STDLIB_H) nrn_check_include_files(stream.h HAVE_STREAM_H) nrn_check_include_files(strings.h HAVE_STRINGS_H) nrn_check_include_files(string.h HAVE_STRING_H) nrn_check_include_files(stropts.h HAVE_STROPTS_H) nrn_check_include_files(sys/conf.h HAVE_SYS_CONF_H) nrn_check_include_files(sys/file.h HAVE_SYS_FILE_H) nrn_check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H) nrn_check_include_files(sys/stat.h HAVE_SYS_STAT_H) nrn_check_include_files(sys/time.h HAVE_SYS_TIME_H) nrn_check_include_files(sys/types.h HAVE_SYS_TYPES_H) nrn_check_include_files(sys/wait.h HAVE_SYS_WAIT_H) nrn_check_include_files(termio.h HAVE_TERMIO_H) nrn_check_include_files(unistd.h HAVE_UNISTD_H) nrn_check_include_files(varargs.h HAVE_VARARGS_H) nrn_check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H) # ============================================================================= # Check for standard headers # ============================================================================= check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" STDC_HEADERS) check_include_file_cxx("_G_config.h" HAVE__G_CONFIG_H) # ============================================================================= # Check if this C++ compiler offers cxxabi.h (any that uses glibc should) # ============================================================================= check_include_file_cxx("cxxabi.h" HAVE_CXXABI_H) # ============================================================================= # Check symbol using check_cxx_symbol_exists but use ${NRN_HEADERS_INCLUDE_LIST} # ============================================================================= # note that this must be called after all *check_include_files because we use # NRN_HEADERS_INCLUDE_LIST is second argument (headers) is empty. nrn_check_symbol_exists("alloca" "" HAVE_ALLOCA) nrn_check_symbol_exists("bcopy" "" HAVE_BCOPY) nrn_check_symbol_exists("bzero" "" HAVE_BZERO) nrn_check_symbol_exists("doprnt" "" HAVE_DOPRNT) nrn_check_symbol_exists("ftime" "" HAVE_FTIME) nrn_check_symbol_exists("getcwd" "" HAVE_GETCWD) nrn_check_symbol_exists("gethostname" "" HAVE_GETHOSTNAME) nrn_check_symbol_exists("gettimeofday" "" HAVE_GETTIMEOFDAY) nrn_check_symbol_exists("index" "" HAVE_INDEX) nrn_check_symbol_exists("isatty" "" HAVE_ISATTY) nrn_check_symbol_exists("iv" "" HAVE_IV) nrn_check_symbol_exists("lockf" "" HAVE_LOCKF) nrn_check_symbol_exists("mallinfo" "" HAVE_MALLINFO) nrn_check_symbol_exists("mallinfo2" "" HAVE_MALLINFO2) nrn_check_symbol_exists("mkdir" "" HAVE_MKDIR) nrn_check_symbol_exists("mkstemp" "" HAVE_MKSTEMP) nrn_check_symbol_exists("namespaces" "" HAVE_NAMESPACES) nrn_check_symbol_exists("posix_memalign" "" HAVE_POSIX_MEMALIGN) nrn_check_symbol_exists("pthread" "" HAVE_PTHREAD) nrn_check_symbol_exists("putenv" "" HAVE_PUTENV) nrn_check_symbol_exists("realpath" "" HAVE_REALPATH) nrn_check_symbol_exists("select" "" HAVE_SELECT) nrn_check_symbol_exists("setenv" "" HAVE_SETENV) nrn_check_symbol_exists("setitimer" "" HAVE_SETITIMER) nrn_check_symbol_exists("sigaction" "" HAVE_SIGACTION) nrn_check_symbol_exists("SIGBUS" "signal.h" HAVE_SIGBUS) nrn_check_symbol_exists("SIGSEGV" "signal.h" HAVE_SIGSEGV) nrn_check_symbol_exists("strdup" "" HAVE_STRDUP) nrn_check_symbol_exists("strstr" "" HAVE_STRSTR) nrn_check_symbol_exists("stty" "" HAVE_STTY) nrn_check_symbol_exists("vprintf" "" HAVE_VPRINTF) nrn_check_cxx_symbol_exists("getpw" "sys/types.h;pwd.h" HAVE_GETPW) nrn_check_cxx_symbol_exists("fesetround" "" HAVE_FESETROUND) nrn_check_cxx_symbol_exists("feenableexcept" "" HAVE_FEENABLEEXCEPT) # not necessary to check as it should be always there set(HAVE_SSTREAM /**/) # ============================================================================= # Check data types # ============================================================================= nrn_check_type_exists(sys/types.h gid_t int gid_t) nrn_check_type_exists(sys/types.h off_t "long int" off_t) nrn_check_type_exists(sys/types.h pid_t int pid_t) nrn_check_type_exists(sys/types.h size_t "unsigned int" size_t) nrn_check_type_exists(sys/types.h uid_t int uid_t) # ============================================================================= # Set return type of signal in RETSIGTYPE # ============================================================================= nrn_check_signal_return_type(RETSIGTYPE) # ============================================================================= # Check direcotry manipulation header # ============================================================================= nrn_check_dir_exists(dirent.h HAVE_DIRENT_H) nrn_check_dir_exists(ndir.h HAVE_NDIR_H) nrn_check_dir_exists(sys/dir.h HAVE_SYS_DIR_H) nrn_check_dir_exists(sys/ndir.h HAVE_SYS_NDIR_H) if(HAVE_DIRENT_H) set(HAVE_SYS_DIR_H 0) endif() # ============================================================================= # Copy cmake specific template files # ============================================================================= # nrnconf.h.in and nmodlconf.h.in were originally generated from config.h.in generated by # autoheader. We use repository copy cmake_nrnconf.h.in to create nrnconf.h and nmodlconf.h directly # in the PROJECT_BINARY_DIR from the nrn_configure_dest_src macro. # ============================================================================= # Generate file from file.in template # ============================================================================= set(version_strs ${NRN_PYTHON_VERSIONS}) list(TRANSFORM version_strs APPEND "\"") list(TRANSFORM version_strs PREPEND "\"") string(JOIN ", " NRN_DYNAMIC_PYTHON_LIST_OF_VERSION_STRINGS ${version_strs}) nrn_configure_dest_src(nrnconf.h . cmake_nrnconf.h .) nrn_configure_dest_src(nmodlconf.h . cmake_nrnconf.h .) nrn_configure_file(nrnmpiuse.h src/oc) nrn_configure_file(nrnpthread.h src/oc) nrn_configure_file(nrnconfigargs.h src/nrnoc) nrn_configure_file(nrnpython_config.h src/nrnpython) nrn_configure_file(bbsconf.h src/parallel) nrn_configure_file(nrnneosm.h src/nrncvode) nrn_configure_file(sundials_config.h src/sundials) nrn_configure_file(mos2nrn.h src/uxnrnbbs) 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 DESTINATION ${PROJECT_BINARY_DIR}/share/nrn/lib) if(NRN_MACOS_BUILD) set(abs_top_builddir ${PROJECT_BINARY_DIR}) nrn_configure_file(macdist.pkgproj src/mac) nrn_configure_file(postinstall.sh src/mac) endif() if(MINGW) dospath("${CMAKE_INSTALL_PREFIX}" WIN_MARSHAL_NRN_DIR) nrn_configure_file(nrnsetupmingw.nsi src/mswin) nrn_configure_file(pre_setup_exe.sh src/mswin) # Just name and not path since setup.exe user chooses location of install. set(CC x86_64-w64-mingw32-gcc.exe) set(BUILD_MINGW_TRUE "") set(BUILD_MINGW_FALSE "#") 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 # ============================================================================= if(NOT NRN_ENABLE_INTERVIEWS) nrn_configure_dest_src(config.h . cmake_nrnconf.h .) else() file(REMOVE "${PROJECT_BINARY_DIR}/config.h") endif() # Prepare some variables for setup.py extension building (hoc_module, rx3d and music) string(JOIN " " NRN_COMPILE_FLAGS_STRING ${NRN_COMPILE_FLAGS}) string(JOIN " " NRN_LINK_FLAGS_STRING ${NRN_LINK_FLAGS}) nrn-8.2.6/cmake/Coverage.cmake000066400000000000000000000072061465022020100161360ustar00rootroot00000000000000# ========================================================= # Configure support for Code Coverage # ========================================================= # ~~~ # Verify lcov is available. # NRN_ENABLE_COVERAGE=ON # Compile appropriate files (all files or those specified in semicolon # separated list of files in NRN_COVERAGE_FILES (relative to # PROJECT_SOURCE_DIR) with code coverage enabled. # NRN_COVERAGE_FILES="" (default) means all files. # # NRN_COVERAGE_FILES speeds the workflow tremendously, when iteratively # working on a single or a few files. # # Two targets are created: cover_begin and cover_html. # # cover_begin erases all the *.gcda coverage files and # creates a baseline report (coverage-base.info) # # cover_html creates a report with all coverage so far (coverage-run.info), # combines that with coverage_base_info to create coverage-combined.info, # prints a summary of the coverage-combined.info and creates an html report # in the html folder # # All created files (folders) are relative to PROJECT_BINARY_DIR. # ~~~ if(NRN_ENABLE_COVERAGE) find_program(LCOV lcov) if(LCOV-NOTFOUND) message(ERROR "lcov is not installed.") endif() set(NRN_COVERAGE_FLAGS_UNQUOTED --coverage -O0 -fno-inline -g) set(NRN_COVERAGE_FLAGS "--coverage -O0 -fno-inline -g") set(NRN_COVERAGE_LIB gcov) if(NRN_MACOS_BUILD) unset(NRN_COVERAGE_LIB) add_link_options(-fprofile-arcs) endif() if(NRN_COVERAGE_FILES) # ~~~ # cannot figure out how to set specific file flags here. So they are # are set in src/nrniv/CMakeLists.txt # Surprisingly to me, this works for src/nrnpython files even though # they are compiled and linked in src/nrnpython/CMakeLists.txt. # I.e. successful with # -DNRN_COVERAGE_FILES="src/nrniv/partrans.cpp;src/nmodl/parsact.cpp;src/nrnpython/nrnpy_hoc.cpp" # ~~~ if(NRN_ADDED_COVERAGE_FLAGS) message( FATAL_ERROR "NRN_ENABLE_COVERAGE=ON and there are NRN_COVERAGE_FILES, but full coverage of all files is in effect from a previous setting. Please empty the build folder and start over." ) endif() else() # cannot be turned off without starting from scratch. set(NRN_ADDED_COVERAGE_FLAGS "${NRN_COVERAGE_FLAGS}" CACHE INTERNAL "Remind that this is always in effect from now on" FORCE) add_compile_options(${NRN_COVERAGE_FLAGS_UNQUOTED}) link_libraries(${NRN_COVERAGE_LIB}) endif() else() unset(NRN_COVERAGE_FLAGS) unset(NRN_COVERAGE_FILES CACHE) if(NRN_ADDED_COVERAGE_FLAGS) message( FATAL_ERROR "NRN_ENABLE_COVERAGE=OFF but full coverage of all files is in effect from a previous setting. Please empty the build folder and start over." ) endif() endif() if(NRN_ENABLE_COVERAGE) add_custom_target( cover_begin COMMAND find "${PROJECT_BINARY_DIR}" "-name" "*.gcda" "-type" "f" "-delete" COMMAND "${LCOV}" "--capture" "--initial" "--no-external" "--directory" "${PROJECT_SOURCE_DIR}" "--directory" "${PROJECT_BINARY_DIR}" "--output-file" "coverage-base.info" WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) add_custom_target( cover_html COMMAND ${LCOV} "--capture" "--no-external" "--directory" "${PROJECT_SOURCE_DIR}" "--directory" ${PROJECT_BINARY_DIR} "--output-file" "coverage-run.info" COMMAND "${LCOV}" "--add-tracefile" "coverage-base.info" "--add-tracefile" "coverage-run.info" "--output-file" "coverage-combined.info" COMMAND genhtml "coverage-combined.info" "--output-directory" html COMMAND echo "View in browser at file://${PROJECT_BINARY_DIR}/html/index.html" WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) endif() nrn-8.2.6/cmake/ExternalProjectHelper.cmake000066400000000000000000000041301465022020100206450ustar00rootroot00000000000000find_package(Git QUIET) if(${GIT_FOUND} AND EXISTS ${CMAKE_SOURCE_DIR}/.git) execute_process( COMMAND ${GIT_EXECUTABLE} --git-dir=.git describe --all RESULT_VARIABLE NOT_A_GIT_REPO OUTPUT_QUIET ERROR_QUIET WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) else() set(NOT_A_GIT_REPO "NotAGitRepo") endif() function(nrn_submodule_file_not_found name_for_message) if(NOT_A_GIT_REPO) message( FATAL_ERROR "To build NEURON from source you either need to clone the NEURON Git repository or " "download a source code archive that includes Git submodules, such as the " "full-src-package-X.Y.Z.tar.gz file in a NEURON release on GitHub (${name_for_message} " "could not be found).") endif() endfunction(nrn_submodule_file_not_found) # initialize submodule with given path function(nrn_initialize_submodule path) if(NOT ${GIT_FOUND}) message( FATAL_ERROR "git not found and ${path} sub-module not cloned (use git clone --recursive)") endif() message(STATUS "Sub-module : missing ${path} : running git submodule update --init") execute_process( COMMAND ${GIT_EXECUTABLE} submodule update --init -- ${path} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ret) if(NOT ret EQUAL 0) message(FATAL_ERROR "git submodule init failed") endif() endfunction() # check for external project and initialize submodule if it is missing function(nrn_add_external_project name) find_path( ${name}_PATH NAMES CMakeLists.txt PATHS "${THIRD_PARTY_DIRECTORY}/${name}" NO_DEFAULT_PATH) if(NOT EXISTS ${${name}_PATH}) nrn_submodule_file_not_found("${THIRD_PARTY_DIRECTORY}/${name}") nrn_initialize_submodule("${THIRD_PARTY_DIRECTORY}/${name}") else() message(STATUS "Sub-project : using ${name} from from ${THIRD_PARTY_DIRECTORY}/${name}") endif() # if second argument is passed and if it's OFF then skip add_subdirectory if(${ARGC} GREATER 1) if(${ARGV2}) add_subdirectory("${THIRD_PARTY_DIRECTORY}/${name}") endif() else() add_subdirectory("${THIRD_PARTY_DIRECTORY}/${name}") endif() endfunction() nrn-8.2.6/cmake/MPIDynamicHelper.cmake000066400000000000000000000065401465022020100174750ustar00rootroot00000000000000# ============================================================================= # Configure support for dynamic MPI initialization # ============================================================================= # ~~~ # Verify that NRN_ENABLE_MPI_DYNAMIC is valid and determine an include # directory for each MPI package building libnrnmpi_.so. # Depending on the MPIs used NRNMPI_INCLUDE_ will be defined. # A number of other lists needed to construct libnrnmpi_.so # are also constructed. The lists are all parallel in the sense that # corresponding elements are related to the same mpi installation. # ~~~ set(NRN_MPI_INCLUDE_LIST "" CACHE INTERNAL "" FORCE) set(NRN_MPI_LIBNAME_LIST "" CACHE INTERNAL "" FORCE) set(NRN_MPI_TYPE_LIST "" CACHE INTERNAL "" FORCE) if(NRN_ENABLE_MPI) if(NRN_ENABLE_MPI_DYNAMIC) set(NRNMPI_DYNAMICLOAD 1) # compute the NRN_MPI_INCLUDE_LIST if("${NRN_MPI_DYNAMIC}" STREQUAL "") # use the MPI already found string(REGEX REPLACE "/$" "" foo "${MPI_C_HEADER_DIR}") list(APPEND NRN_MPI_INCLUDE_LIST "${foo}") else() # find the mpi's in the ';' separated list of mpi include folders. foreach(incdir ${NRN_MPI_DYNAMIC}) # remove trailing '/' if it has one string(REGEX REPLACE "/$" "" foo "${incdir}") list(APPEND NRN_MPI_INCLUDE_LIST "${foo}") endforeach(incdir) endif() # compute the NRN_MPI_TYPE_LIST and NRN_MPI_LIBNAME_LIST foreach(idir ${NRN_MPI_INCLUDE_LIST}) # ${idir}/mpi.h must exist if(NOT EXISTS "${idir}/mpi.h") message(FATAL_ERROR "${idir}/mpi.h does not exist") endif() # ~~~ # Know about openmpi, mpich, ms-mpi, and a few others. # ~~~ execute_process(COMMAND grep -q "define OPEN_MPI *1" ${idir}/mpi.h RESULT_VARIABLE result) if(result EQUAL 0) set(type "ompi") else() # ~~~ # MPT releases of hpe-mpi defines MPT_VERSION as well as SGIABI. But HMPT releases # only defines MPT_VERSION. So first check for the existence of SGIABI to decide if a # a given library is MPT and then check MPT_VERSION to define it as MPICH. # ~~~ execute_process(COMMAND grep -q "define SGIABI" ${idir}/mpi.h RESULT_VARIABLE result) if(result EQUAL 0) set(type "mpt") else() execute_process(COMMAND grep -q -e "define MPICH *1" -e "define MPT_VERSION" ${idir}/mpi.h RESULT_VARIABLE result) if(result EQUAL 0) set(type "mpich") else() execute_process(COMMAND grep -q "define MSMPI_VER " ${idir}/mpi.h RESULT_VARIABLE result) if(result EQUAL 0) set(type "msmpi") else() # Perhaps rather set the type to "unknown" and check for no duplicates? message( FATAL_ERROR "${idir}/mpi.h does not seem to be either openmpi, mpich, mpt or msmpi") endif() endif() endif() endif() list(APPEND NRN_MPI_TYPE_LIST "${type}") list(APPEND NRN_MPI_LIBNAME_LIST "nrnmpi_${type}") endforeach(idir) endif() else() if(NRN_ENABLE_MPI_DYNAMIC) set(NRN_ENABLE_MPI_DYNAMIC "NO") message(WARNING "NRN_ENABLE_MPI_DYNAMIC can only be set if MPI is enabled (see NRN_ENABLE_MPI)") endif() endif() nrn-8.2.6/cmake/MacroHelper.cmake000066400000000000000000000275331465022020100166110ustar00rootroot00000000000000# ============================================================================= # Helper functions used in the project # ============================================================================= include(CheckIncludeFileCXX) include(CheckIncludeFiles) include(CheckFunctionExists) include(CheckSymbolExists) include(CheckCXXSymbolExists) include(CMakeParseArguments) set(CMAKE_REQUIRED_QUIET TRUE) # ============================================================================= # Check if directory related to DIR exists by compiling code # ============================================================================= macro(nrn_check_dir_exists HEADER VARIABLE) # code template to check existence of DIR string( CONCAT CONFTEST_DIR_TPL "#include \n" "#include <@dir_header@>\n" "int main () {\n" " if ((DIR *) 0)\n" " return 0\;\n" " return 0\;\n" "}\n") # first get header file check_include_files(${HEADER} HAVE_HEADER) if(${HAVE_HEADER}) # if header is found, create a code from template string(REPLACE "@dir_header@" ${HEADER} CONFTEST_DIR "${CONFTEST_DIR_TPL}") file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/conftest.cpp" ${CONFTEST_DIR}) # try to compile try_compile(${VARIABLE} "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/conftest.cpp") file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/conftest.cpp") endif() endmacro() # ============================================================================= # Check if given type exists by compiling code # ============================================================================= macro(nrn_check_type_exists HEADER TYPE DEFAULT_TYPE VARIABLE) # code template to check existence of specific type string( CONCAT CONFTEST_TYPE_TPL "#include <@header@>\n" "int main () {\n" " if (sizeof (@type@))\n" " return 0\;\n" " return 0\;\n" "}\n") string(REPLACE "@header@" ${HEADER} CONFTEST_TYPE "${CONFTEST_TYPE_TPL}") string(REPLACE "@type@" ${TYPE} CONFTEST_TYPE "${CONFTEST_TYPE}") file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/conftest.cpp ${CONFTEST_TYPE}) try_compile(MY_RESULT_VAR ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/conftest.cpp) if(NOT ${MY_RESULT_VAR}) set(${VARIABLE} ${DEFAULT_TYPE}) endif() file(REMOVE "conftest.cpp") endmacro() # ============================================================================= # Check return type of signal # ============================================================================= macro(nrn_check_signal_return_type VARIABLE) # code template to check signal support string(CONCAT CONFTEST_RETSIGTYPE "#include \n" "#include \n" "int main () {\n" " return *(signal (0, 0)) (0) == 1\;\n" "}\n") file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/conftest.cpp ${CONFTEST_RETSIGTYPE}) try_compile(MY_RESULT_VAR ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/conftest.cpp) if(MY_RESULT_VAR) set(${VARIABLE} int) else() set(${VARIABLE} void) endif() file(REMOVE "conftest.cpp") endmacro() # ============================================================================= # Transform PROJECT_SOURCE_DIR/sdir/sfile.in to PROJECT_BINARY_DIR/bdir/bfile # ============================================================================= # ~~~ # This 4 arg macro transformsPROJECT_SOURCE_DIR/sdir/sfile.in into # PROJECT_BINARY_DIR/bdir/bfile . # THE shorter two arg form transforms PROJECT_SOURCE_DIR/dir/file.in into # PROJECT_BINARY_DIR/dir/file # This first copies with some replacement the sfile.in to _cmake_tmp_bfile.in # so that the normal cmake configure_file command works to make a proper # cmake_file. Then that is compared to a possibly existing bfile and, # if different, copies _cmake_tmp_bfile to bfile. This prevents recompilation of # .o files that depend on unchanged bfile. The sdir arg is the path relative to # PROJECT_SOURCE_DIR, the bdir arg is the path relative to PROJECT_BINARY_DIR. # Note that everytime cmake is run, the bfile is compared to a newly created # _cmake_tmp_bfile consistent with the current cmake args. # Note that the sfile arg does NOT contain the .in suffix. # ~~~ macro(nrn_configure_dest_src bfile bdir sfile sdir) set(infile ${PROJECT_SOURCE_DIR}/${sdir}/${sfile}.in) set(bin_dir ${PROJECT_BINARY_DIR}/${bdir}) file(MAKE_DIRECTORY ${bin_dir}) execute_process( COMMAND sed "s/\#undef *\\(.*\\)/\#cmakedefine \\1 @\\1@/" INPUT_FILE ${infile} OUTPUT_FILE ${bin_dir}/_cmake_tmp_${bfile}.in) configure_file(${bin_dir}/_cmake_tmp_${bfile}.in ${bin_dir}/_cmake_tmp_${bfile} @ONLY) execute_process(COMMAND cmp -s ${bin_dir}/_cmake_tmp_${bfile} ${bin_dir}/${bfile} RESULT_VARIABLE result) if(result EQUAL 0) file(REMOVE ${bin_dir}/_cmake_tmp_${bfile}) else() file(RENAME ${bin_dir}/_cmake_tmp_${bfile} ${bin_dir}/${bfile}) endif() file(REMOVE ${bin_dir}/_cmake_tmp_${bfile}.in) set_property( DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${infile}) endmacro() macro(nrn_configure_file file dir) nrn_configure_dest_src(${file} ${dir} ${file} ${dir}) endmacro() # ============================================================================= # Perform check_include_files and add it to NRN_HEADERS_INCLUDE_LIST if exist Passing an optional # CXX will call check_include_files_cxx instead. # ============================================================================= macro(nrn_check_include_files filename variable) set(options CXX) cmake_parse_arguments(nrn_check_include_files "${options}" "" "" ${ARGN}) if(${nrn_check_include_files_CXX}) check_include_file_cxx(${filename} ${variable}) else() check_include_files(${filename} ${variable}) endif() if(${variable}) list(APPEND NRN_HEADERS_INCLUDE_LIST ${filename}) endif() endmacro() # ============================================================================= # Perform check_symbol_exists using NRN_HEADERS_INCLUDE_LIST if empty header_list # ============================================================================= macro(nrn_check_symbol_exists name header_list variable) if("${header_list}" STREQUAL "") check_symbol_exists("${name}" "${NRN_HEADERS_INCLUDE_LIST}" ${variable}) else() check_symbol_exists("${name}" "${header_list}" ${variable}) endif() endmacro() # ============================================================================= # Perform check_cxx_symbol_exists using NRN_HEADERS_INCLUDE_LIST if empty header_list # ============================================================================= # note that sometimes, though it should have succeeded, cc fails but c++ succeeds macro(nrn_check_cxx_symbol_exists name header_list variable) if("${header_list}" STREQUAL "") check_cxx_symbol_exists("${name}" "${NRN_HEADERS_INCLUDE_LIST}" ${variable}) else() check_cxx_symbol_exists("${name}" "${header_list}" ${variable}) endif() endmacro() # ============================================================================= # Append arguments to given list in the form of prefix/argument # ============================================================================= macro(nrn_create_file_list list_name prefix) foreach(name ${ARGN}) list(APPEND ${list_name} ${prefix}/${name}) endforeach(name) endmacro() # ============================================================================= # Copy file from source to destination in noclobber mode (i.e. no overwrite) # ============================================================================= macro(nrn_copy_file_without_overwrite source destination) execute_process(COMMAND cp -n ${source} ${destination}) endmacro() # ============================================================================= # Copy file from source to destination only if different # ============================================================================= macro(nrn_copy_file_if_different source destination) configure_file(${source} ${destination} COPYONLY) endmacro() # ============================================================================= # Set string with double quotes # ============================================================================= macro(nrn_set_string variable value) set(${variable} \"${value}\") endmacro() # ============================================================================= # Set var to to dos path format # ============================================================================= macro(dospath path var) # file(TO_NATIVE_PATH does not convert / to \ for us in msys2. string(REPLACE "/" "\\" var1 "${path}") set(${var} ${var1}) endmacro() # ============================================================================= # Given list of file names, find their path in project source tree # ============================================================================= macro(nrn_find_project_files list_name) foreach(name ${ARGN}) file(GLOB_RECURSE filepath "${PROJECT_SOURCE_DIR}/src/*${name}") if(filepath STREQUAL "") message(FATAL_ERROR " ${name} not found in ${PROJECT_SOURCE_DIR}/src") else() list(APPEND ${list_name} ${filepath}) endif() endforeach(name) endmacro() # ============================================================================= # Utility macro to print all matching CMake variables # ============================================================================= # example usage : nrn_print_matching_variables("[Mm][Pp][Ii]") macro(nrn_print_matching_variables prefix_regex) get_cmake_property(variable_names VARIABLES) list(SORT variable_names) foreach(variable ${variable_names}) if(variable MATCHES "^${prefix_regex}") message(NOTICE " ${variable} ${${variable}}") endif() endforeach() endmacro() # ============================================================================= # Run nocmodl to convert NMODL to C # ============================================================================= macro(nocmodl_mod_to_c modfile_basename) add_custom_command( OUTPUT ${modfile_basename}.c COMMAND ${CMAKE_COMMAND} -E env "MODLUNIT=${PROJECT_BINARY_DIR}/share/nrn/lib/nrnunits.lib" ${NRN_NOCMODL_SANITIZER_ENVIRONMENT} ${PROJECT_BINARY_DIR}/bin/nocmodl ${modfile_basename}.mod COMMAND sed "'s/_reg()/_reg_()/'" ${modfile_basename}.c > ${modfile_basename}.c.tmp COMMAND mv ${modfile_basename}.c.tmp ${modfile_basename}.c DEPENDS nocmodl ${modfile_basename}.mod WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/nrniv) endmacro() # ============================================================================= # Create symbolic links # ============================================================================= macro(nrn_install_dir_symlink source_dir symlink_dir) # make sure to have directory path exist upto parent dir get_filename_component(parent_symlink_dir ${symlink_dir} DIRECTORY) install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${parent_symlink_dir})") # create symbolic link install( CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${source_dir} ${symlink_dir})") endmacro(nrn_install_dir_symlink) # ======================================================================== # There is an edge case to 'find_package(MPI REQUIRED)' in that we can still build a universal2 # macos package on an arm64 architecture even if the mpi library has no slice for x86_64. # ======================================================================== macro(nrn_mpi_find_package) if("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES AND "x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES AND NRN_ENABLE_MPI_DYNAMIC) set(_temp ${CMAKE_OSX_ARCHITECTURES}) unset(CMAKE_OSX_ARCHITECTURES CACHE) find_package(MPI REQUIRED) set(CMAKE_OSX_ARCHITECTURES ${_temp} CACHE INTERNAL "" FORCE) set(NRN_UNIVERSAL2_BUILD ON) else() find_package(MPI REQUIRED) endif() endmacro() nrn-8.2.6/cmake/NeuronFileLists.cmake000066400000000000000000000325271465022020100174740ustar00rootroot00000000000000# ============================================================================= # Lists of header files to install # ============================================================================= set(HEADER_FILES_TO_INSTALL cabvars.h cspmatrix.h cspredef.h hoc.h hoc_membf.h hocassrt.h hocdec.h hocgetsym.h hoclist.h hocparse.h isoc99.h ivstream.h mcran4.h md1redef.h md2redef.h mech_api.h membdef.h membfunc.h multicore.h multisplit.h neuron.h newton_struct.h nmodlmutex.h nrn_ansi.h nrnapi.h nrnassrt.h nrncvode.h nrnisaac.h nrniv_mf.h nrnoc_ml.h nrnmpi.h nrnmpidec.h nrnrandom.h nrnran123.h nrnredef.h nrnversionmacros.h oc_ansi.h ocfunc.h ocmisc.h options.h scoplib.h section.h spconfig.h spmatrix.h) # ============================================================================= # Lists of headers populated using check_include_files # ============================================================================= set(NRN_HEADERS_INCLUDE_LIST) # ============================================================================= # Lists of random number related files # ============================================================================= set(RAN_FILE_LIST isaac64.cpp mcran4.cpp nrnisaac.cpp nrnran123.cpp) # ============================================================================= # Files in oc directory # ============================================================================= set(OC_FILE_LIST ${RAN_FILE_LIST} audit.cpp axis.cpp code.cpp code2.cpp debug.cpp fileio.cpp fmenu.cpp ftime.cpp functabl.cpp getsym.cpp hoc.cpp hocusr.cpp hoc_init.cpp hoc_oop.cpp isoc99.cpp list.cpp math.cpp mswinprt.cpp nonlin.cpp nrnfilewrap.cpp ocerf.cpp parallel.cpp plot.cpp plt.cpp regexp.cpp scoprand.cpp settext.cpp symbol.cpp version.cpp x.cpp xred.cpp) # ============================================================================= # Files in nrnoc directory # ============================================================================= set(NRNOC_FILE_LIST cabcode.cpp capac.cpp clamp.cpp eion.cpp extcelln.cpp fadvance.cpp fstim.cpp hocprax.cpp init.cpp ldifus.cpp method3.cpp nrnnemo.cpp nrntimeout.cpp nrnversion.cpp nrnversion.h passive0.cpp point.cpp psection.cpp seclist.cpp secref.cpp solve.cpp synapse.cpp treeset.cpp) # ============================================================================= # Files in ivoc directory # ============================================================================= set(IVOC_FILE_LIST apwindow.cpp axis.cpp bndedval.cpp cbwidget.cpp checkpnt.cpp epsprint.cpp fourier.cpp gifimage.cpp graph.cpp graphvec.cpp grglyph.cpp grmanip.cpp hocmark.cpp htlist.cpp idraw.cpp ivoc.cpp ivocmain.cpp ivocrand.cpp ivocvect.cpp matrix.cpp mlinedit.cpp mymath.cpp objcmd.cpp oc2iv.cpp ocbox.cpp ocbrowsr.cpp ocdeck.cpp ocfile.cpp ochelp.cpp oclist.cpp ocmatrix.cpp ocnoiv1.cpp ocobserv.cpp ocpicker.cpp ocpointer.cpp ocptrvector.cpp octimer.cpp pwman.cpp rect.cpp rubband.cpp scene.cpp scenepic.cpp strfun.cpp symchoos.cpp utility.cpp xmenu.cpp xyview.cpp) if(MINGW) list(APPEND IVOC_FILE_LIST ivocwin.cpp) else() list(APPEND IVOC_FILE_LIST field.cpp xdep.cpp) endif() # ============================================================================= # Files in nrniv directory # ============================================================================= set(NRNIV_FILE_LIST backtrace_utils.cpp bbs.cpp bbsavestate.cpp bbsdirect.cpp bbslocal.cpp bbslsrv.cpp bbslsrv2.cpp bbsrcli.cpp bbssrv.cpp cachevec.cpp classreg.cpp cxprop.cpp datapath.cpp finithnd.cpp geometry3d.cpp glinerec.cpp hocmech.cpp impedanc.cpp kschan.cpp kssingle.cpp linmod.cpp linmod1.cpp matrixmap.cpp multisplit.cpp ndatclas.cpp netpar.cpp nonlinz.cpp nrncore_write.cpp nrncore_write/callbacks/nrncore_callbacks.cpp nrncore_write/data/cell_group.cpp nrncore_write/data/datum_indices.cpp nrncore_write/io/nrncore_io.cpp nrncore_write/utils/nrncore_utils.cpp nrndae.cpp nrnmenu.cpp nrnpy.cpp nrnste.cpp nvector_nrnserial_ld.cpp nvector_nrnthread.cpp nvector_nrnthread_ld.cpp ocbbs.cpp ocjump.cpp partrans.cpp ppshape.cpp prcellstate.cpp pysecname2sec.cpp rotate3d.cpp savstate.cpp secbrows.cpp shape.cpp shapeplt.cpp singlech.cpp spaceplt.cpp splitcell.cpp symdir.cpp vrecord.cpp) # ============================================================================= # Files in nrncvode directory # ============================================================================= set(NRNCVODE_FILE_LIST cvodeobj.cpp cvodestb.cpp cvtrset.cpp netcvode.cpp nrndaspk.cpp occvode.cpp tqueue.cpp) # ============================================================================= # Files in sundials directory # ============================================================================= nrn_create_file_list( SUNDIALS_CVODES "${PROJECT_SOURCE_DIR}/src/sundials/cvodes" cvband.c cvbandpre.c cvbbdpre.c cvdense.c cvdiag.c cvodea.c cvodes.c cvodesio.c cvspgmr.c) nrn_create_file_list( SUNDIALS_IDA "${PROJECT_SOURCE_DIR}/src/sundials/ida" idaband.c idabbdpre.c ida.c idadense.c idaic.c idaio.c idaspgmr.c) nrn_create_file_list( SUNDIALS_SHARED "${PROJECT_SOURCE_DIR}/src/sundials/shared" band.c dense.c iterative.c nvector.c nvector_serial.c smalldense.c spgmr.c sundialsmath.c) set(NRN_SUNDIALS_SRC_FILES ${SUNDIALS_CVODES} ${SUNDIALS_IDA} ${SUNDIALS_SHARED}) # meschach matrix sources set(MESCH_FILES_LIST arnoldi.c bdfactor.c bkpfacto.c chfactor.c arnoldi.c bdfactor.c bkpfacto.c chfactor.c conjgrad.c copy.c dmacheps.c err.c extras.c fft.c givens.c hessen.c hsehldr.c init.c iter0.c iternsym.c itersym.c ivecop.c lanczos.c lufactor.c machine.c matlab.c matop.c matrixio.c meminfo.c memory.c memstat.c mfunc.c norm.c otherio.c pxop.c qrfactor.c schur.c solve.c sparse.c sparseio.c spbkp.c spchfctr.c splufctr.c sprow.c spswap.c submat.c svd.c symmeig.c update.c vecop.c version.c zcopy.c zfunc.c zgivens.c zhessen.c zhsehldr.c zlufctr.c zmachine.c zmatio.c zmatlab.c zmatop.c zmemory.c znorm.c zqrfctr.c zschur.c zsolve.c zvecop.c) set(SPARSE_FILES_LIST bksub.cpp getelm.cpp lineq.cpp prmat.cpp subrows.cpp) # sparse13 matrix sources set(SPARSE13_FILES_LIST spalloc.c spbuild.c spfactor.c spoutput.c spsolve.c sputils.c cspalloc.c cspbuild.c cspfactor.c cspoutput.c cspsolve.c csputils.c) # scopmath sources set(SCOPMATH_FILES_LIST abort.c adams.c adeuler.c adrunge.c advance.c boundary.c crank.c crout.c csoda.c csodabnc.c deflate.c dimplic.c scoperf.c euler.c expfit.c exprand.c f2cmisc.c factoria.c force.c gauss.c gear.c getmem.c harmonic.c heun.c hyperbol.c invert.c lag.c legendre.c newton.c normrand.c perpulse.c perstep.c poisrand.c poisson.c praxis.c pulse.c quad.c ramp.c revhyper.c revsawto.c revsigmo.c romberg.c runge.c sawtooth.c schedule.c seidel.c sigmoid.c simeq.c simplex.c sparse.c vsparse.c spline.c squarewa.c ssimplic.c step.c threshol.c tridiag.c sparse_thread.c newton_thread.c crout_thread.c ssimplic_thread.c) set(NRNMPI_FILES_LIST nrnmpi.cpp bbsmpipack.cpp mpispike.cpp) set(NRNGNU_FILES_LIST ACG.cpp Binomial.cpp DiscUnif.cpp Erlang.cpp Geom.cpp HypGeom.cpp LogNorm.cpp MLCG.cpp NegExp.cpp Normal.cpp Poisson.cpp RNG.cpp Random.cpp RndInt.cpp Uniform.cpp Weibull.cpp) # nrnpython sources (only if ${NRN_ENABLE_PYTHON_DYNAMIC} is OFF} set(NRNPYTHON_FILES_LIST nrnpython.cpp nrnpy_hoc.cpp nrnpy_nrn.cpp nrnpy_p2h.cpp grids.cpp rxd.cpp rxd_extracellular.cpp rxd_intracellular.cpp rxd_vol.cpp rxd_marching_cubes.cpp rxd_llgramarea.cpp) # built-in mod files set(MODFILE_BASE_NAMES apcount feature intfire2 oclmp ppmark syn exp2syn hh intfire4 passive stim vclmp expsyn intfire1 netstim pattern svclmp) set(MODLUNIT_FILES_LIST consist.cpp declare.cpp init.cpp io.cpp kinunit.cpp list.cpp model.cpp nrnunit.cpp passn.cpp symbol.cpp units.cpp units1.cpp version.cpp) set(NMODL_FILES_LIST consist.cpp deriv.cpp discrete.cpp init.cpp io.cpp kinetic.cpp list.cpp modl.cpp nocpout.cpp noccout.cpp parsact.cpp netrec_discon.cpp partial.cpp sens.cpp simultan.cpp solve.cpp symbol.cpp units.cpp version.cpp) set(IVOS_FILES_LIST listimpl.cpp math.cpp string.cpp observe.cpp regexp.cpp resource.cpp) set(MPI_DYNAMIC_INCLUDE nrnmpi_dynam.h nrnmpi_dynam_cinc nrnmpi_dynam_wrappers.inc) # ============================================================================= # Top level directories under src # ============================================================================= set(NRN_OC_SRC_DIR ${PROJECT_SOURCE_DIR}/src/oc) set(NRN_NRNOC_SRC_DIR ${PROJECT_SOURCE_DIR}/src/nrnoc) set(NRN_IVOC_SRC_DIR ${PROJECT_SOURCE_DIR}/src/ivoc) set(NRN_NRNCVODE_SRC_DIR ${PROJECT_SOURCE_DIR}/src/nrncvode) set(NRN_NRNIV_SRC_DIR ${PROJECT_SOURCE_DIR}/src/nrniv) set(NRN_MODLUNIT_SRC_DIR ${PROJECT_SOURCE_DIR}/src/modlunit) set(NRN_NMODL_SRC_DIR ${PROJECT_SOURCE_DIR}/src/nmodl) set(NRN_IVOS_SRC_DIR ${PROJECT_SOURCE_DIR}/src/ivos) # ============================================================================= # Create source file lists by gathering from various directories # ============================================================================= nrn_create_file_list(NRN_OC_SRC_FILES ${NRN_OC_SRC_DIR} ${OC_FILE_LIST}) nrn_create_file_list(NRN_NRNOC_SRC_FILES ${NRN_NRNOC_SRC_DIR} ${NRNOC_FILE_LIST}) nrn_create_file_list(NRN_IVOC_SRC_FILES ${NRN_IVOC_SRC_DIR} ${IVOC_FILE_LIST}) nrn_create_file_list(NRN_NRNCVODE_SRC_FILES ${NRN_NRNCVODE_SRC_DIR} ${NRNCVODE_FILE_LIST}) nrn_create_file_list(NRN_NRNIV_SRC_FILES ${NRN_NRNIV_SRC_DIR} ${NRNIV_FILE_LIST}) nrn_create_file_list(NRN_PARALLEL_SRC_FILES ${PROJECT_SOURCE_DIR}/src/nrniv nvector_nrnparallel_ld.cpp) nrn_create_file_list(NRN_PARALLEL_SRC_FILES ${PROJECT_SOURCE_DIR}/src/sundials/shared nvector_parallel.c) nrn_create_file_list(NRN_MESCH_SRC_FILES ${PROJECT_SOURCE_DIR}/src/mesch ${MESCH_FILES_LIST}) nrn_create_file_list(NRN_SPARSE_SRC_FILES ${PROJECT_SOURCE_DIR}/src/sparse ${SPARSE_FILES_LIST}) nrn_create_file_list(NRN_SPARSE13_SRC_FILES ${PROJECT_SOURCE_DIR}/src/sparse13 ${SPARSE13_FILES_LIST}) nrn_create_file_list(NRN_SCOPMATH_SRC_FILES ${PROJECT_SOURCE_DIR}/src/scopmath ${SCOPMATH_FILES_LIST}) nrn_create_file_list(NRN_NRNMPI_SRC_FILES ${PROJECT_SOURCE_DIR}/src/nrnmpi ${NRNMPI_FILES_LIST}) nrn_create_file_list(NRN_NRNGNU_SRC_FILES ${PROJECT_SOURCE_DIR}/src/gnu ${NRNGNU_FILES_LIST}) nrn_create_file_list(NRN_NRNPYTHON_SRC_FILES ${PROJECT_SOURCE_DIR}/src/nrnpython ${NRNPYTHON_FILES_LIST}) nrn_create_file_list(NRN_MODFILE_BASE_NAMES ${PROJECT_SOURCE_DIR}/src/nrnoc ${MODFILE_BASE_NAMES}) nrn_create_file_list(NRN_BIN_SRC_FILES ${PROJECT_SOURCE_DIR}/src/ivoc/ nrnmain.cpp) nrn_create_file_list(NRN_BIN_SRC_FILES ${PROJECT_SOURCE_DIR}/src/oc/ ockludge.cpp modlreg.cpp) nrn_create_file_list(NRN_MODLUNIT_SRC_FILES ${NRN_MODLUNIT_SRC_DIR} ${MODLUNIT_FILES_LIST}) nrn_create_file_list(NRN_NMODL_SRC_FILES ${NRN_NMODL_SRC_DIR} ${NMODL_FILES_LIST}) nrn_create_file_list(NRNMPI_DYNAMIC_INCLUDE_FILE ${PROJECT_SOURCE_DIR}/src/nrnmpi ${MPI_DYNAMIC_INCLUDE}) nrn_create_file_list(NRN_IVOS_SRC_FILES ${NRN_IVOS_SRC_DIR} ${IVOS_FILES_LIST}) list(APPEND NRN_OC_SRC_FILES ${PROJECT_BINARY_DIR}/src/oc/hocusr.h) # ============================================================================= # Create mswin install lists needed for setup_exe target # ============================================================================= if(MINGW) set(MSWIN_SRC_DIR ${PROJECT_SOURCE_DIR}/src/mswin) nrn_create_file_list(MSWIN_FILES ${PROJECT_SOURCE_DIR}/src/parallel test0.hoc test0.py) list(APPEND MSWIN_FILES ${MSWIN_SRC_DIR}/notes.txt) nrn_create_file_list(MSWIN_BIN_FILES ${MSWIN_SRC_DIR} nrniv.ico nrniv10.ico nmodl2a.ico) nrn_create_file_list( MSWIN_LIB_FILES ${MSWIN_SRC_DIR}/lib bshstart.sh neuron2.sh neuron3.sh mknrndl2.sh mknrndll.sh modlunit.sh) list(APPEND MSWIN_LIB_FILES ${PROJECT_BINARY_DIR}/src/mswin/lib/mknrndll.mak) endif() nrn-8.2.6/cmake/NeuronTestHelper.cmake000066400000000000000000000671711465022020100176600ustar00rootroot00000000000000# ~~~ # Utility functions for creating and managing integration tests comparing # results obtained with NEURON and, optionally, CoreNEURON in different modes # of operation. # # 1. nrn_add_test_group(NAME name # [CORENEURON] # [ENVIRONMENT var1=val2 ...] # [MODFILE_PATTERNS mod/file/dir/*.mod ...] # [NRNIVMODL_ARGS arg1 ...] # [OUTPUT datatype::file.ext ...] # [SCRIPT_PATTERNS "*.py" ...] # [SIM_DIRECTORY sim_dir] # [SUBMODULE some/submodule] # ) # # Create a new group of integration tests with the given name. The group # consists of different configurations of running logically the same # simulation. The outputs of the different configurations will be compared. # # CORENEURON - if this is passed, the mechanisms will be compiled for # CoreNEURON if CoreNEURON is enabled. You should pass # this if any test in the group is going to include # `coreneuron` in its REQUIRES clause. # ENVIRONMENT - extra environment variables that should be set when the # test is run. These must not overlap with the variables # that are automatically set internally, such as PATH. # MODFILE_PATTERNS - a list of patterns that will be matched against the # submodule directory tree to find the modfiles that must # be compiled (using nrnivmodl) to run the test. The special # value "NONE" will not emit a warning if nothing matches it # and will stop nrnivmodl from being called. # NRNIVMODL_ARGS - extra arguments that will be passed to nrnivmodl. # OUTPUT - zero or more expressions of the form `datatype::path` # describing the output data produced by a test. The # data type must be supported by the comparison script # `compare_test_results.py`, and `path` is defined # relative to the working directory in which the test # command is run. # SCRIPT_PATTERNS - zero or more glob expressions, defined relative to the # submodule directory, matching scripts that must be # copied from the submodule to the working directory in # which the test is run. # SIM_DIRECTORY - extra directory name under which the test will be run, # this is useful for some models whose scripts make # assumptions about directory layout. # SUBMODULE - the name of the git submodule containing test data. # # The ENVIRONMENT, OUTPUT, SCRIPT_PATTERNS and SIM_DIRECTORY arguments are # default values that will be inherited by tests that are added to this # group using nrn_add_test. They can be overriden for specific tests by # passing the same keyword arguments to nrn_add_test. # # 2. nrn_add_test(GROUP group_name # NAME test_name # COMMAND command [arg ...] # [ENVIRONMENT VAR1=value1 ...] # [PRELOAD_SANITIZER] # [CONFLICTS feature1 ...] # [PRECOMMAND command ...] # [PROCESSORS required_processors] # [REQUIRES feature1 ...] # [OUTPUT datatype::file.ext ...] # [SCRIPT_PATTERNS "*.py" ...] # [SIM_DIRECTORY sim_dir] # ) # # Create a new integration test inside the given group, which must have # previously been created using nrn_add_test_group. The COMMAND option is # the test expression, which is run in an environment whose PATH includes # the `special` binary built from the specified modfiles. # The REQUIRES and CONFLICTS arguments allow a test to be disabled if # certain features are, or are not, available. Eight features are currently # supported: coreneuron, cpu, gpu, mod_compatibility, mpi, mpi_dynamic, # nmodl and python. The PRECOMMAND argument is an optional command that will # be executed before COMMAND and in the same directory. It can be used to # prepare input data for simulations. The PROCESSORS argument specifies the # number of processors used by the test. This is passed to CTest and allows # invocations such as `ctest -j 16` to avoid overcommitting resources by # running too many tests with internal parallelism. The PRELOAD_SANITIZER # flag controls whether or not the PRELOAD flag is passed to # cpp_cc_configure_sanitizers; this needs to be set when the test executable # is *not* built by NEURON, typically because it is `python`. # The remaining arguments can documented in nrn_add_test_group. The default # values specified there can be overriden on a test-by-test basis by passing # the same arguments here. # # 3. nrn_add_test_group_comparison(GROUP group_name # [REFERENCE_OUTPUT datatype::file.ext ...]) # # Add a test job that runs after all the tests in this group (as defined by # prior calls to nrn_add_test) and compares their output data. The optional # REFERENCE_OUTPUT argument adds reference data files from the repository to # the comparison job with the magic name "reference_file". Paths are # specified relative to the root of the NEURON repository. # ~~~ # Load the cpp_cc_build_time_copy helper function. include("${CODING_CONV_CMAKE}/build-time-copy.cmake") function(nrn_add_test_group) # NAME is used as a key, [CORENEURON, MODFILE_PATTERNS, NRNIVMODL_ARGS and SUBMODULE] are used to # set up a custom target that runs nrnivmod, everything else is a default that can be overriden in # subsequent calls to nrn_add_test that actually set up CTest tests. set(options CORENEURON) set(oneValueArgs NAME SUBMODULE) set(multiValueArgs ENVIRONMENT MODFILE_PATTERNS NRNIVMODL_ARGS OUTPUT SCRIPT_PATTERNS SIM_DIRECTORY) cmake_parse_arguments(NRN_ADD_TEST_GROUP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(DEFINED NRN_ADD_TEST_GROUP_MISSING_VALUES) message( WARNING "nrn_add_test: missing values for keyword arguments: ${NRN_ADD_TEST_GROUP_MISSING_VALUES}") endif() if(DEFINED NRN_ADD_TEST_GROUP_UNPARSED_ARGUMENTS) message(WARNING "nrn_add_test: unknown arguments: ${NRN_ADD_TEST_GROUP_UNPARSED_ARGUMENTS}") endif() # Store the default values for this test group in parent-scope variables based on the group name set(prefix NRN_TEST_GROUP_${NRN_ADD_TEST_GROUP_NAME}) set(${prefix}_DEFAULT_ENVIRONMENT "${NRN_ADD_TEST_GROUP_ENVIRONMENT}" PARENT_SCOPE) set(${prefix}_DEFAULT_OUTPUT "${NRN_ADD_TEST_GROUP_OUTPUT}" PARENT_SCOPE) set(${prefix}_DEFAULT_SCRIPT_PATTERNS "${NRN_ADD_TEST_GROUP_SCRIPT_PATTERNS}" PARENT_SCOPE) set(${prefix}_DEFAULT_SIM_DIRECTORY "${NRN_ADD_TEST_GROUP_SIM_DIRECTORY}" PARENT_SCOPE) # Set up a target that runs nrnivmodl for this group of tests. First, make sure the specified # submodule is initialised. If there is no submodule, everything is relative to the root nrn/ # directory. if(NOT ${NRN_ADD_TEST_GROUP_SUBMODULE} STREQUAL "") cpp_cc_git_submodule(${NRN_ADD_TEST_GROUP_SUBMODULE} QUIET) # Construct the name of the source tree directory where the submodule has been checked out. set(test_source_directory "${PROJECT_SOURCE_DIR}/external/${NRN_ADD_TEST_GROUP_SUBMODULE}") else() set(test_source_directory "${PROJECT_SOURCE_DIR}") endif() set(${prefix}_TEST_SOURCE_DIRECTORY "${test_source_directory}" PARENT_SCOPE) if(NOT DEFINED NRN_RUN_FROM_BUILD_DIR_ENV) # To avoid duplication we take this value from the {nrn}/test/CMakeLists.txt file by assuming # this variable name. message(WARNING "nrn_add_test: NRN_RUN_FROM_BUILD_DIR_ENV was not defined;" " building test files may not work") endif() if(NOT "${NRN_ADD_TEST_GROUP_MODFILE_PATTERNS}" STREQUAL "NONE") # Add a rule to build the modfiles for this test group. Multiple groups may ask for exactly the # same thing (testcorenrn), so it's worth deduplicating. set(hash_components ${NRN_ADD_TEST_GROUP_NRNIVMODL_ARGS}) # Escape special characters (problematic with Windows paths when calling nrnivmodl) string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" NRN_RUN_FROM_BUILD_DIR_ENV "${NRN_RUN_FROM_BUILD_DIR_ENV}") set(nrnivmodl_command cmake -E env ${NRN_RUN_FROM_BUILD_DIR_ENV} ${CMAKE_BINARY_DIR}/bin/nrnivmodl ${NRN_ADD_TEST_GROUP_NRNIVMODL_ARGS}) # The user decides whether or not this test group should have its MOD files compiled for # CoreNEURON. set(nrnivmodl_dependencies) if(NRN_ADD_TEST_GROUP_CORENEURON AND NRN_ENABLE_CORENEURON) list(APPEND hash_components -coreneuron) list(APPEND nrnivmodl_dependencies ${CORENEURON_TARGET_TO_DEPEND}) list(APPEND nrnivmodl_command -coreneuron) endif() list(APPEND nrnivmodl_command .) # Collect the list of modfiles that need to be compiled. set(modfiles) foreach(modfile_pattern ${NRN_ADD_TEST_GROUP_MODFILE_PATTERNS}) file(GLOB pattern_modfiles "${test_source_directory}/${modfile_pattern}") list(APPEND modfiles ${pattern_modfiles}) endforeach() if("${modfiles}" STREQUAL "") message(WARNING "Didn't find any modfiles in ${test_source_directory} " "using ${NRN_ADD_TEST_GROUP_MODFILE_PATTERNS}") endif() list(SORT modfiles) foreach(modfile ${modfiles}) # ${modfile} is an absolute path starting with ${PROJECT_SOURCE_DIR}, let's only add the part # below this common prefix to the hash string(LENGTH "${PROJECT_SOURCE_DIR}/" prefix_length) string(SUBSTRING "${modfile}" ${prefix_length} -1 relative_modfile) list(APPEND hash_components "${relative_modfile}") endforeach() # Get a hash that forms the working directory for nrnivmodl. string(SHA256 nrnivmodl_command_hash "${hash_components}") # Construct the name of a target that refers to the compiled special binaries set(binary_target_name "NRN_TEST_nrnivmodl_${nrnivmodl_command_hash}") set(nrnivmodl_directory "${PROJECT_BINARY_DIR}/test/nrnivmodl/${nrnivmodl_command_hash}") # Short-circuit if the target has already been created. if(NOT TARGET "${binary_target_name}") # Copy modfiles from source -> build tree. foreach(modfile ${modfiles}) # Construct the build tree path of the modfile. get_filename_component(modfile_name "${modfile}" NAME) set(modfile_build_path "${nrnivmodl_directory}/${modfile_name}") # Add a build rule that copies this modfile from the source tree to the build tree. cpp_cc_build_time_copy( INPUT "${modfile}" OUTPUT "${modfile_build_path}" NO_TARGET) # Store a list of the modfile paths in the build tree so we can declare nrnivmodl's # dependency on these. list(APPEND modfile_build_paths "${modfile_build_path}") endforeach() # Construct the names of the important output files set(special "${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}/special") # Add the custom command to generate the binaries. Get nrnivmodl from the build directory. At # the moment it seems that `nrnivmodl` is generated at configure time, so there is no target # to depend on and it should always be available, but it will try and link against libnrniv.so # and libcoreneuron.so so we must depend on those. TODO: could the logic of `nrnivmodl` be # translated to CMake, so it can be called natively here and the `nrnivmodl` executable would # be a wrapper that invokes CMake? set(output_binaries "${special}") list(APPEND nrnivmodl_dependencies nrniv_lib) if(NRN_ADD_TEST_GROUP_CORENEURON) list(APPEND output_binaries "${special}-core") if((NOT coreneuron_FOUND) AND (NOT DEFINED CORENEURON_BUILTIN_MODFILES)) message(WARNING "nrn_add_test_group couldn't find the names of the builtin " "CoreNEURON modfiles that nrnivmodl-core implicitly depends " "on *and* CoreNEURON is being built internally") endif() list(APPEND nrnivmodl_dependencies ${CORENEURON_BUILTIN_MODFILES}) endif() add_custom_command( OUTPUT ${output_binaries} DEPENDS ${nrnivmodl_dependencies} ${modfile_build_paths} COMMAND ${nrnivmodl_command} COMMENT "Building special[-core] for test group ${NRN_ADD_TEST_GROUP_NAME}" WORKING_DIRECTORY "${nrnivmodl_directory}") # Add a target that depends on the binaries that will always be built. add_custom_target(${binary_target_name} DEPENDS ${output_binaries}) endif() set(${prefix}_NRNIVMODL_DIRECTORY "${nrnivmodl_directory}" PARENT_SCOPE) set(${prefix}_NRNIVMODL_TARGET_NAME "${binary_target_name}" PARENT_SCOPE) endif() endfunction() function(nrn_add_test) # Parse the function arguments set(oneValueArgs GROUP NAME PROCESSORS) set(multiValueArgs COMMAND ENVIRONMENT CONFLICTS PRECOMMAND REQUIRES OUTPUT SCRIPT_PATTERNS SIM_DIRECTORY) cmake_parse_arguments(NRN_ADD_TEST "PRELOAD_SANITIZER" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(DEFINED NRN_ADD_TEST_MISSING_VALUES) message( WARNING "nrn_add_test: missing values for keyword arguments: ${NRN_ADD_TEST_MISSING_VALUES}") endif() if(DEFINED NRN_ADD_TEST_UNPARSED_ARGUMENTS) message(WARNING "nrn_add_test: unknown arguments: ${NRN_ADD_TEST_UNPARSED_ARGUMENTS}") endif() # Check if the REQUIRES and/or CONFLICTS arguments mean we should disable this test. set(feature_cpu_enabled ON) set(feature_mpi_enabled ${NRN_ENABLE_MPI}) set(feature_mpi_dynamic_enabled ${NRN_ENABLE_MPI_DYNAMIC}) set(feature_python_enabled ${NRN_ENABLE_PYTHON}) set(feature_coreneuron_enabled ${NRN_ENABLE_CORENEURON}) if(${NRN_ENABLE_CORENEURON} OR ${NRN_ENABLE_MOD_COMPATIBILITY}) set(feature_mod_compatibility_enabled ON) else() set(feature_mod_compatibility_enabled OFF) endif() set(feature_gpu_enabled ${CORENRN_ENABLE_GPU}) set(feature_nmodl_enabled ${CORENRN_ENABLE_NMODL}) # Check REQUIRES set(requires_coreneuron OFF) foreach(required_feature ${NRN_ADD_TEST_REQUIRES}) if(NOT DEFINED feature_${required_feature}_enabled) message(FATAL_ERROR "Unknown feature ${required_feature} used in REQUIRES expression") endif() if(NOT ${feature_${required_feature}_enabled}) message( STATUS "Disabling ${NRN_ADD_TEST_GROUP}::${NRN_ADD_TEST_NAME}: ${required_feature} not enabled") return() endif() if(${required_feature} STREQUAL "coreneuron") set(requires_coreneuron ON) endif() endforeach() # Check CONFLICTS foreach(conflicting_feature ${NRN_ADD_TEST_CONFLICTS}) if(NOT DEFINED feature_${conflicting_feature}_enabled) message(FATAL_ERROR "Unknown feature ${conflicting_feature} used in REQUIRES expression") endif() if(${feature_${conflicting_feature}_enabled}) message( STATUS "Disabling ${NRN_ADD_TEST_GROUP}::${NRN_ADD_TEST_NAME}: ${conflicting_feature} enabled") return() endif() endforeach() # Get the prefix under which we stored information about this test group set(prefix NRN_TEST_GROUP_${NRN_ADD_TEST_GROUP}) # Name of the target created by nrn_add_test_group that we should depend on. This might not exist # if the test group does not have any MOD files of its own. set(binary_target_name "${${prefix}_NRNIVMODL_TARGET_NAME}") if(TARGET "${binary_target_name}") # Directory where nrn_add_test_group ran nrnivmodl. If the target exists, this will be created. set(nrnivmodl_directory "${${prefix}_NRNIVMODL_DIRECTORY}") endif() # Path to the test repository. set(test_source_directory "${${prefix}_TEST_SOURCE_DIRECTORY}") # Get the variables that have global defaults but which can be overriden locally set(extra_environment "${${prefix}_DEFAULT_ENVIRONMENT}") set(output_files "${${prefix}_DEFAULT_OUTPUT}") set(script_patterns "${${prefix}_DEFAULT_SCRIPT_PATTERNS}") set(sim_directory "${${prefix}_DEFAULT_SIM_DIRECTORY}") # Override them locally if appropriate if(DEFINED NRN_ADD_TEST_ENVIRONMENT) set(extra_environment "${NRN_ADD_TEST_ENVIRONMENT}") endif() if(DEFINED NRN_ADD_TEST_OUTPUT) set(output_files "${NRN_ADD_TEST_OUTPUT}") endif() if(DEFINED NRN_ADD_TEST_SCRIPT_PATTERNS) set(script_patterns "${NRN_ADD_TEST_SCRIPT_PATTERNS}") endif() if(DEFINED NRN_ADD_TEST_SIM_DIRECTORY) set(sim_directory "${NRN_ADD_TEST_SIM_DIRECTORY}") endif() # Finally a working directory for this specific test within the group set(working_directory "${PROJECT_BINARY_DIR}/test/${NRN_ADD_TEST_GROUP}/${NRN_ADD_TEST_NAME}") file(MAKE_DIRECTORY "${working_directory}") if(NOT ${sim_directory} STREQUAL "") set(simulation_directory ${working_directory}/${sim_directory}) else() set(simulation_directory ${working_directory}) endif() if(DEFINED nrnivmodl_directory) execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink "${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}" "${working_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}") endif() # Set up the actual test. First, collect the script files that need to be copied into the test- # specific working directory and copy them there. foreach(script_pattern ${script_patterns}) # We want to preserve directory structures, so if you pass SCRIPT_PATTERNS path/to/*.py then you # end up with {build_directory}/path/to/test_working_directory/path/to/script.py file( GLOB_RECURSE script_files RELATIVE "${test_source_directory}" "${test_source_directory}/${script_pattern}") foreach(script_file ${script_files}) # We use NO_TARGET because otherwise we would in some cases generate a lot of # build-time-copy-{hash} top-level targets, which the Makefile build system struggles with. # Instead we make a single top-level target that depends on all scripts copied for this test. cpp_cc_build_time_copy( INPUT "${test_source_directory}/${script_file}" OUTPUT "${working_directory}/${script_file}" NO_TARGET) list(APPEND all_copied_script_files "${working_directory}/${script_file}") endforeach() endforeach() # Construct the name of the test and store it in a parent-scope list to be used when setting up # the comparison job set(test_name "${NRN_ADD_TEST_GROUP}::${NRN_ADD_TEST_NAME}") add_custom_target(copy-scripts-${NRN_ADD_TEST_GROUP}-${NRN_ADD_TEST_NAME} ALL DEPENDS ${all_copied_script_files}) # Depend on the target that runs nrnivmodl, if it exists. Otherwise it will not be run. if(TARGET ${binary_target_name}) add_dependencies(copy-scripts-${NRN_ADD_TEST_GROUP}-${NRN_ADD_TEST_NAME} ${binary_target_name}) endif() set(group_members "${${prefix}_TESTS}") list(APPEND group_members "${test_name}") set(${prefix}_TESTS "${group_members}" PARENT_SCOPE) if(DEFINED NRN_ADD_TEST_PROCESSORS) set_tests_properties(${test_names} PROPERTIES PROCESSORS ${NRN_ADD_TEST_PROCESSORS}) endif() set(test_env "${NRN_RUN_FROM_BUILD_DIR_ENV}") if(requires_coreneuron) if(DEFINED nrnivmodl_directory) list( APPEND test_env "CORENEURONLIB=${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}/libcorenrnmech${CMAKE_SHARED_LIBRARY_SUFFIX}" ) else() list( APPEND test_env "CORENEURONLIB=${CMAKE_BINARY_DIR}/bin/${CMAKE_HOST_SYSTEM_PROCESSOR}/libcorenrnmech${CMAKE_SHARED_LIBRARY_SUFFIX}" ) endif() endif() # Get [VAR1, VAR2, ...] from [VAR1=VAL1, VAR2=VAL2, ...] set(test_env_var_names ${test_env}) list(TRANSFORM test_env_var_names REPLACE "^([^=]+)=.*$" "\\1") if(DEFINED nrnivmodl_directory) if(NOT "PATH" IN_LIST test_env_var_names) message(FATAL_ERROR "Expected to find PATH in ${test_env_var_names} but didn't") endif() # PATH will already be set in test_env list(TRANSFORM test_env REPLACE "^PATH=" "PATH=${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}:") endif() # Get the list of variables being set set(extra_env_var_names ${extra_environment}) list(TRANSFORM extra_env_var_names REPLACE "^([^=]+)=.*$" "\\1") # Make sure the new variables don't overlap with the old ones; otherwise we'd need to do some # merging, which sounds hard in the general case. list(APPEND new_vars_being_set ${extra_env_var_names}) list(REMOVE_ITEM new_vars_being_set ${test_env_var_names}) if(NOT "${new_vars_being_set}" STREQUAL "${extra_env_var_names}") message(FATAL_ERROR "New (${extra_env_var_names}) vars overlap old (${test_env_var_names}). " "This is not supported.") endif() list(APPEND test_env ${extra_environment}) if(NRN_ADD_TEST_PRELOAD_SANITIZER AND NRN_SANITIZER_LIBRARY_PATH) list(APPEND test_env LD_PRELOAD=${NRN_SANITIZER_LIBRARY_PATH}) endif() list(APPEND test_env ${NRN_SANITIZER_ENABLE_ENVIRONMENT}) # Add the actual test job, including the `special` and `special-core` binaries in the path. TODOs: # # * Do we need to manipulate PYTHONPATH more to make `python options.py` invocations work? # * Using CORENEURONLIB here introduces some differences between the tests and the standard way # that users run nrnivmodl and special. Ideally we would reduce such differences, without # increasing build time too much (by running nrnivmodl multiple times) or compromising our # ability to execute the tests in parallel (which precludes blindly running everything in the # same directory). add_test( NAME "${test_name}" COMMAND ${CMAKE_COMMAND} -E env ${test_env} ${NRN_ADD_TEST_COMMAND} WORKING_DIRECTORY "${simulation_directory}") set(test_names ${test_name}) if(NRN_ADD_TEST_PRECOMMAND) add_test( NAME ${test_name}::preparation COMMAND ${CMAKE_COMMAND} -E env ${test_env} ${NRN_ADD_TEST_PRECOMMAND} WORKING_DIRECTORY "${simulation_directory}") list(APPEND test_names ${test_name}::preparation) set_tests_properties(${test_name} PROPERTIES DEPENDS ${test_name}::preparation) endif() set_tests_properties(${test_names} PROPERTIES TIMEOUT 300) # Construct an expression containing the names of the test output files that will be passed to the # comparison script. set(output_file_string "${NRN_ADD_TEST_NAME}") foreach(output_file ${output_files}) # output_file is `type1::fname1` output_full_path is `type1::${working_directory}/fname1` string(REGEX REPLACE "^([^:]+)::(.*)$" "\\1::${simulation_directory}/\\2" output_full_path "${output_file}") set(output_file_string "${output_file_string}::${output_full_path}") endforeach() # Add the outputs from this test to a parent-scope list that will be read by the # nrn_add_test_group_comparison function and used to set up a test job that compares the various # test results. The list has the format: # ~~~ # [testname1::test1type1::test1path1::test1type2::test1path2, # testname2::test2type1::test2path1::test2type2::test2path2, # ...] # ~~~ set(test_outputs "${${prefix}_TEST_OUTPUTS}") list(APPEND test_outputs "${output_file_string}") set(${prefix}_TEST_OUTPUTS "${test_outputs}" PARENT_SCOPE) endfunction() function(nrn_add_test_group_comparison) # Parse function arguments set(oneValueArgs GROUP) set(multiValueArgs REFERENCE_OUTPUT) cmake_parse_arguments(NRN_ADD_TEST_GROUP_COMPARISON "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT DEFINED NRN_ADD_TEST_GROUP_COMPARISON_GROUP) message( ERROR "nrn_add_test_group_comparison was not told which test group to compare results from. Please pass a GROUP keyword argument." ) endif() if(DEFINED NRN_ADD_TEST_GROUP_COMPARISON_MISSING_VALUES) message( WARNING "nrn_add_test: missing values for keyword arguments: ${NRN_ADD_TEST_GROUP_COMPARISON_MISSING_VALUES}" ) endif() if(DEFINED NRN_ADD_TEST_GROUP_COMPARISON_UNPARSED_ARGUMENTS) message( WARNING "nrn_add_test: unknown arguments: ${NRN_ADD_TEST_GROUP_COMPARISON_UNPARSED_ARGUMENTS}" ) endif() # Get the prefix under which we stored information about this test group set(prefix NRN_TEST_GROUP_${NRN_ADD_TEST_GROUP_COMPARISON_GROUP}) # Check if there are any tests to compare the results from. It might be that the REQUIRES and # CONFLICTS clauses disable all the tests in a group. set(test_list "${${prefix}_TESTS}") # indirection via the test_list variable is needed for old # CMake list(LENGTH test_list num_tests) if(NOT ${num_tests}) message( STATUS "Skipping comparison job for group ${NRN_ADD_TEST_GROUP_COMPARISON_GROUP} because no tests were enabled." ) return() endif() # If REFERENCE_OUTPUT is passed it is a list of entries of the form # datatype::path_relative_to_nrn. Different test jobs are in principle allowed to come from # different repositories, so we don't insert the repository name automagically. Construct the # working directory for the comparison job. set(test_directory "${PROJECT_BINARY_DIR}/test") # Get the list of reference files and copy them into the build directory. Starting from # ~~~ # type1::path1;type2::path2 # ~~~ # assemble # ~~~ # reference_file::type1::{test_directory}/path1::type2::{test_directory}/path2 # ~~~ # i.e. make sure the expression passed to the comparison script refers to the copies of the # reference files in the build directory, and that there is a title string ("reference_file") for # the comparison script to use in its reports. set(reference_file_string "reference_file") foreach(reference_expression ${NRN_ADD_TEST_GROUP_COMPARISON_REFERENCE_OUTPUT}) # reference_expression is datatype::reference_path, extract `reference_path` string(REGEX REPLACE "^[^:]+::(.*)$" "\\1" reference_path "${reference_expression}") # construct `datatype::{test_directory}/reference_path` string(REGEX REPLACE "^([^:]+)::(.*)$" "\\1::${test_directory}/\\2" reference_file_string_addition "${reference_expression}") set(reference_file_string "${reference_file_string}::${reference_file_string_addition}") cpp_cc_build_time_copy(INPUT "${PROJECT_SOURCE_DIR}/${reference_path}" OUTPUT "${test_directory}/${reference_path}") endforeach() # Copy the comparison script cpp_cc_build_time_copy(INPUT "${PROJECT_SOURCE_DIR}/test/scripts/compare_test_results.py" OUTPUT "${test_directory}/compare_test_results.py") # Add a test job that compares the results of the previous test jobs set(comparison_name "${NRN_ADD_TEST_GROUP_COMPARISON_GROUP}::compare_results") add_test( NAME ${comparison_name} COMMAND "${test_directory}/compare_test_results.py" ${${prefix}_TEST_OUTPUTS} ${reference_file_string} WORKING_DIRECTORY "${test_directory}/${NRN_ADD_TEST_GROUP_COMPARISON_GROUP}") # Make sure the comparison job declares that it depends on the previous jobs. The comparison job # will always run, but the dependencies ensure that it will be sequenced correctly, i.e. it runs # after the jobs it is comparing. set_tests_properties(${comparison_name} PROPERTIES DEPENDS "${${prefix}_TESTS}") # Set up the environment for the test comparison job set_tests_properties(${comparison_name} PROPERTIES ENVIRONMENT "PATH=${CMAKE_BINARY_DIR}/bin:$ENV{PATH}") endfunction() nrn-8.2.6/cmake/PlatformHelper.cmake000066400000000000000000000006431465022020100173250ustar00rootroot00000000000000# ============================================================================= # Platform specific settings # ============================================================================= if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(NRN_LINUX_BUILD TRUE) endif() if(CMAKE_SYSTEM_NAME MATCHES "Windows") set(NRN_WINDOWS_BUILD TRUE) endif() if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(NRN_MACOS_BUILD TRUE) endif() nrn-8.2.6/cmake/PythonDynamicHelper.cmake000066400000000000000000000131311465022020100203230ustar00rootroot00000000000000# ============================================================================= # Configure support for dynamic Python to use multiple Python versions # ============================================================================= # ~~~ # NEURON can be built with python modules that can be usable from multiple # versions of Python. Here we check if NRN_ENABLE_PYTHON_DYNAMIC is valid # and determine an include directory for version 3 to build # libnrnpython.so. For now only NRNPYTHON_INCLUDE3 will be defined. # # The above is good for mac and linux. Sadly, for MINGW, a distinct # NRNPYTHON_INCLUDE is needed for each python in the # NRN_PYTHON_DYNAMIC list. This is because libnrnpython.dll # must be linked against the specfic libpython to avoid undefined name errors. # Thus, at least for MINGW, parallel to the NRN_PYTHON_DYNAMIC list # we construct the lists NRN_PYTHON_VER_LIST, NRN_PYTHON_INCLUDE_LIST, # and NRN_PYTHON_LIB_LIST # ~~~ set(LINK_AGAINST_PYTHON ${MINGW}) set(NRN_PYTHON_VER_LIST "" CACHE INTERNAL "" FORCE) set(NRN_PYTHON_INCLUDE_LIST "" CACHE INTERNAL "" FORCE) set(NRN_PYTHON_LIB_LIST "" CACHE INTERNAL "" FORCE) set(NRN_PYTHON_VERSIONS "" CACHE INTERNAL "" FORCE) # ~~~ # Inform setup.py and nrniv/nrnpy.cpp whether libnrnpython name is libnrnpython # or libnrnpython . The latter is required for mingw. # This is here instead of in src/nrnpython/CMakeLists.txt as src/nrniv/CMakeLists # needs it for nrniv/nrnpy.cpp # ~~~ set(USE_LIBNRNPYTHON_MAJORMINOR 0) if(LINK_AGAINST_PYTHON) set(USE_LIBNRNPYTHON_MAJORMINOR 1) endif() if(NRN_ENABLE_PYTHON) if(NRN_ENABLE_PYTHON_DYNAMIC) if(NRN_PYTHON_DYNAMIC STREQUAL "") # use the default python already determined if(LINK_AGAINST_PYTHON) set(PYVER "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") else() set(PYVER ${PYTHON_VERSION_MAJOR}) endif() set(NRN_PYTHON_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") # NB: we are constructing here a variable name NRNPYTHON_INCLUDE${PYVER} set(NRNPYTHON_INCLUDE${PYVER} ${PYTHON_INCLUDE_DIRS}) list(APPEND NRN_PYTHON_VER_LIST "${PYVER}") list(APPEND NRN_PYTHON_INCLUDE_LIST "${PYTHON_INCLUDE_DIRS}") list(APPEND NRN_PYTHON_LIB_LIST "${PYTHON_LIBRARIES}") else() # run each python provided by user to determine major and include directory message(STATUS "Dynamic Python support") foreach(pyexe ${NRN_PYTHON_DYNAMIC}) message(STATUS "Checking if ${pyexe} is a working python") if(LINK_AGAINST_PYTHON) set(pr_pyver "print('%d.%d' % (sys.version_info[0], sys.version_info[1]))") else() set(pr_pyver "print(sys.version_info[0])") endif() execute_process( COMMAND ${pyexe} -c "import sysconfig; print(sysconfig.get_path('include')); import sys; ${pr_pyver};quit()" RESULT_VARIABLE result OUTPUT_VARIABLE std_output ERROR_VARIABLE err_output OUTPUT_STRIP_TRAILING_WHITESPACE) if(result EQUAL 0) # cmake-format: off string(REGEX MATCH [0-9.]*$ PYVER ${std_output}) string(REGEX MATCH ^[^\n]* incval ${std_output}) # cmake-format: on if(NOT NRNPYTHON_INCLUDE${PYVER}) set(NRNPYTHON_INCLUDE${PYVER} ${incval}) endif() # Only needed to find include and library paths if LINK_AGAINST_PYTHON but useful for # build report. Unset the variables set by PythonLibsNew so we can start afresh. set(PYTHON_EXECUTABLE ${pyexe}) unset(PYTHON_INCLUDE_DIR CACHE) unset(PYTHON_LIBRARY CACHE) set(PYTHON_PREFIX "") set(PYTHON_LIBRARIES "") set(PYTHON_INCLUDE_DIRS "") set(PYTHON_MODULE_EXTENSION "") set(PYTHON_MODULE_PREFIX "") find_package(PythonLibsNew ${PYVER} REQUIRED) # convert major.minor to majorminor string(REGEX REPLACE [.] "" PYVER ${PYVER}) list(APPEND NRN_PYTHON_VER_LIST "${PYVER}") list(APPEND NRN_PYTHON_INCLUDE_LIST "${incval}") list(APPEND NRN_PYTHON_LIB_LIST "${PYTHON_LIBRARIES}") else() message( FATAL_ERROR "Error while checking ${pyexe} : ${result}\n${std_output}\n${err_output}") endif() # again to calculate PYVER (major.minor) for NRN_PYTHON_VERSIONS set(pr_pyverxy "print('%d.%d' % (sys.version_info[0], sys.version_info[1]))") execute_process( COMMAND ${pyexe} -c "import sys; ${pr_pyverxy}; quit()" RESULT_VARIABLE result OUTPUT_VARIABLE std_output ERROR_VARIABLE err_output OUTPUT_STRIP_TRAILING_WHITESPACE) if(result EQUAL 0) # cmake-format: off string(REGEX MATCH [0-9.]*$ PYVERXY ${std_output}) # cmake-format: on list(APPEND NRN_PYTHON_VERSIONS "${PYVERXY}") endif() endforeach() endif() else() # the default python version set(NRN_PYTHON_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") endif() endif() # check Python.h exists under provided include directory macro(check_python_include python_include major_version) if(python_include) if(NOT EXISTS "${${python_include}}/Python.h") message( FATAL_ERROR " ${${python_include}}/Python.h does not exist, set proper ${python_include} to include directory" ) endif() endif() endmacro() if(NOT LINK_AGAINST_PYTHON) # make sure provided python have Python.h header check_python_include(NRNPYTHON_INCLUDE3 3) endif() nrn-8.2.6/cmake/ReleaseDebugAutoFlags.cmake000066400000000000000000000043501465022020100205350ustar00rootroot00000000000000# ============================================================================= # Helper for different build types # ============================================================================= # default configuration if(NOT CMAKE_BUILD_TYPE AND (NOT CMAKE_CONFIGURATION_TYPES)) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_DEFAULT} CACHE STRING "Empty or one of ${allowableBuildTypes}." FORCE) message(STATUS "Setting build type to '${CMAKE_BUILD_TYPE}' as none was specified.") elseif(NOT CMAKE_BUILD_TYPE IN_LIST allowableBuildTypes) message( FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE} : Must be one of ${allowableBuildTypes}") endif() # ~~~ # Different configuration types: # # Custom : User specify flags with CMAKE_C_FLAGS and CMAKE_CXX_FLAGS # Debug : Optimized for debugging, include debug symbols # Release : Release mode, no debuginfo # RelWithDebInfo : Distribution mode, basic optimizations for portable code with debuginfos # Fast : Maximum level of optimization. Target native architecture, not portable code # FastDebug: Similar to Debug with a bit higher level optimisations (-O1) and other compiler # flags so that it's faster than -O0 but still produces consistent results for # testing and debugging purposes. # ~~~ include(CompilerFlagsHelpers) # ~~~ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_DEBUGINFO_FLAGS} ${CMAKE_C_OPT_NONE} ${CMAKE_C_STACK_PROTECTION} ${CMAKE_C_IGNORE_WARNINGS}" ) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_DEBUGINFO_FLAGS} ${CMAKE_CXX_OPT_NONE} ${CMAKE_CXX_STACK_PROTECTION} ${CMAKE_CXX_IGNORE_WARNINGS}" ) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_OPT_NORMAL} ${CMAKE_C_IGNORE_WARNINGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_OPT_NORMAL} ${CMAKE_CXX_IGNORE_WARNINGS}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_DEBUGINFO_FLAGS} ${CMAKE_C_OPT_NORMAL} ${CMAKE_C_IGNORE_WARNINGS}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_DEBUGINFO_FLAGS} ${CMAKE_CXX_OPT_NORMAL} ${CMAKE_CXX_IGNORE_WARNINGS}") set(CMAKE_C_FLAGS_FAST "${CMAKE_C_OPT_FAST} ${CMAKE_C_LINK_TIME_OPT} ${CMAKE_C_GEN_NATIVE} ${CMAKE_C_IGNORE_WARNINGS}") set(CMAKE_CXX_FLAGS_FAST "${CMAKE_CXX_OPT_FAST} ${CMAKE_CXX_LINK_TIME_OPT} ${CMAKE_CXX_GEN_NATIVE} ${CMAKE_CXX_IGNORE_WARNINGS}" ) # ~~~ nrn-8.2.6/cmake/RpathHelper.cmake000066400000000000000000000023531465022020100166170ustar00rootroot00000000000000# ============================================================================= # Set full RPATHs in build-tree, also set RPATHs in install for non-system libs # ============================================================================= # use, i.e. don't skip the full RPATH for the build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) # when building, don't use the install RPATH already (but later on when installing) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(LOADER_PATH_FLAG "\\@loader_path") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LOADER_PATH_FLAG "\\\$ORIGIN") else() set(LOADER_PATH_FLAG "") endif() # add the automatically determined parts of the RPATH which point to directories outside the build # tree to the install RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # the RPATH to be used when installing, but only if it's not a system directory list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) if(isSystemDir STREQUAL "-1") if(NRN_ENABLE_REL_RPATH) message(STATUS "Using relative RPATHs") set(CMAKE_INSTALL_RPATH "${LOADER_PATH_FLAG}/../lib") else() set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") endif() endif() nrn-8.2.6/cmake/RunHOCTest.cmake000066400000000000000000000021171465022020100163350ustar00rootroot00000000000000# ============================================================================= # ~~~ # Execute nrniv to generate an output file and then compare the output file to # a reference file # # Arguments: # - executable: nrniv executable # - exec_arg: executable arguments # - work_dir: working directory # - out_file: output file generated by the execution of the executable # - ref_file: reference file to compare the out_file # ~~~ # ============================================================================= execute_process( COMMAND ${executable} ${exec_arg} WORKING_DIRECTORY ${work_dir} RESULT_VARIABLE status) if(status) message(FATAL_ERROR "Running exec status: ${status}") endif() execute_process( COMMAND ${CMAKE_COMMAND} -E compare_files ${out_file} ${ref_file} WORKING_DIRECTORY ${work_dir} RESULT_VARIABLE status) if(status) execute_process( COMMAND sdiff -s ${out_file} ${ref_file} WORKING_DIRECTORY ${work_dir} RESULT_VARIABLE status) message(FATAL_ERROR "Validating results status: ${status}") else() file(REMOVE "${work_dir}/${out_file}") endif() nrn-8.2.6/cmake/SanitizerHelper.cmake000066400000000000000000000067331465022020100175170ustar00rootroot00000000000000# Disable some of the more pedantic checks. float-divide-by-zero is undefined in the C/C++ standard # but defined by (recent?) Clang. This is disabled for convenience because some user MOD files # trigger it, while the NEURON codebase does not seem to do so itself. # implicit-signed-integer-truncation does not flagged undefined behaviour, but rather behaviour that # may be unintentional; unsigned-integer-overflow is similarly not actually undefined -- these # checks are not enabled because they cause too much noise at the moment. set(${CODING_CONV_PREFIX}_SANITIZERS_UNDEFINED_EXCLUSIONS float-divide-by-zero implicit-signed-integer-truncation unsigned-integer-overflow CACHE STRING "" FORCE) include("${CODING_CONV_CMAKE}/sanitizers.cmake") # Propagate the sanitizer flags to the NEURON sources list(APPEND NRN_COMPILE_FLAGS ${NRN_SANITIZER_COMPILER_FLAGS}) list(APPEND NRN_LINK_FLAGS ${NRN_SANITIZER_COMPILER_FLAGS}) if(NRN_SANITIZER_LIBRARY_DIR) # At least Clang 14 does not add rpath entries for the sanitizer runtime libraries. Adding this # argument saves having to carefully set LD_LIBRARY_PATH and friends. list(APPEND NRN_LINK_FLAGS "-Wl,-rpath,${NRN_SANITIZER_LIBRARY_DIR}") endif() if(NRN_SANITIZERS) # nocmodl is quite noisy when run under LeakSanitizer, so only set the environment variables that # enable sanitizers if LeakSanitizer is not among them string(REPLACE "," ";" nrn_sanitizers "${NRN_SANITIZERS}") # NRN_SANITIZERS is comma-separated if("leak" IN_LIST nrn_sanitizers) set(NRN_NOCMODL_SANITIZER_ENVIRONMENT ${NRN_SANITIZER_DISABLE_ENVIRONMENT}) else() set(NRN_NOCMODL_SANITIZER_ENVIRONMENT ${NRN_SANITIZER_ENABLE_ENVIRONMENT}) endif() if("address" IN_LIST nrn_sanitizers) list(APPEND NRN_COMPILE_DEFS NRN_ASAN_ENABLED) endif() # generate and install a launcher script called nrn-enable-sanitizer [--preload] that sets # *SAN_OPTIONS variables and, optionally, LD_PRELOAD -- this is useful both in CI configuration # and when using the sanitizers "downstream" of NEURON string(JOIN " " NRN_SANITIZER_ENABLE_ENVIRONMENT_STRING ${NRN_SANITIZER_ENABLE_ENVIRONMENT}) # sanitizer suppression files are handled similarly to other data files: we copy them to the same # path under the build and installation directories, and then assume the installation path unless # the NRNHOME environment variable is set, in which case it is assumed to point to the build # directory foreach(sanitizer ${nrn_sanitizers}) if(EXISTS "${PROJECT_SOURCE_DIR}/.sanitizers/${sanitizer}.supp") configure_file(".sanitizers/${sanitizer}.supp" "share/nrn/sanitizers/${sanitizer}.supp" COPYONLY) install(FILES "${PROJECT_BINARY_DIR}/share/nrn/sanitizers/${sanitizer}.supp" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/nrn/sanitizers") endif() endforeach() # sanitizers.cmake uses absolute paths to suppression files in build directories. substitute that # with NEURON-specific NRNHOME-enabled logic string(REPLACE "${PROJECT_SOURCE_DIR}/.sanitizers/" "\${prefix}/share/nrn/sanitizers/" NRN_SANITIZER_ENABLE_ENVIRONMENT_STRING "${NRN_SANITIZER_ENABLE_ENVIRONMENT_STRING}") if(NRN_SANITIZER_LIBRARY_PATH) set(NRN_SANITIZER_LD_PRELOAD "LD_PRELOAD=${NRN_SANITIZER_LIBRARY_PATH}") endif() configure_file(bin/nrn-enable-sanitizer.in bin/nrn-enable-sanitizer @ONLY) install(PROGRAMS ${PROJECT_BINARY_DIR}/bin/nrn-enable-sanitizer DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) endif() nrn-8.2.6/cmake/find_libpython.py000077500000000000000000000252601465022020100167660ustar00rootroot00000000000000#!/usr/bin/env python """ Locate libpython associated with this Python executable. """ # https://pypi.org/project/find-libpython/ # License # # Copyright 2018, Takafumi Arakaki # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function, absolute_import from logging import getLogger import ctypes.util import functools import os import sys import sysconfig logger = getLogger("find_libpython") is_windows = os.name == "nt" is_apple = sys.platform == "darwin" SHLIB_SUFFIX = sysconfig.get_config_var("SHLIB_SUFFIX") if SHLIB_SUFFIX is None: if is_windows: SHLIB_SUFFIX = ".dll" else: SHLIB_SUFFIX = ".so" if is_apple: # sysconfig.get_config_var("SHLIB_SUFFIX") can be ".so" in macOS. # Let's not use the value from sysconfig. SHLIB_SUFFIX = ".dylib" def linked_libpython(): """ Find the linked libpython using dladdr (in *nix). Calling this in Windows always return `None` at the moment. Returns ------- path : str or None A path to linked libpython. Return `None` if statically linked. """ if is_windows: return None return _linked_libpython_unix() class Dl_info(ctypes.Structure): _fields_ = [ ("dli_fname", ctypes.c_char_p), ("dli_fbase", ctypes.c_void_p), ("dli_sname", ctypes.c_char_p), ("dli_saddr", ctypes.c_void_p), ] def _linked_libpython_unix(): libdl = ctypes.CDLL(ctypes.util.find_library("dl")) libdl.dladdr.argtypes = [ctypes.c_void_p, ctypes.POINTER(Dl_info)] libdl.dladdr.restype = ctypes.c_int dlinfo = Dl_info() retcode = libdl.dladdr( ctypes.cast(ctypes.pythonapi.Py_GetVersion, ctypes.c_void_p), ctypes.pointer(dlinfo), ) if retcode == 0: # means error return None path = os.path.realpath(dlinfo.dli_fname.decode()) if path == os.path.realpath(sys.executable): return None return path def library_name(name, suffix=SHLIB_SUFFIX, is_windows=is_windows): """ Convert a file basename `name` to a library name (no "lib" and ".so" etc.) >>> library_name("libpython3.7m.so") # doctest: +SKIP 'python3.7m' >>> library_name("libpython3.7m.so", suffix=".so", is_windows=False) 'python3.7m' >>> library_name("libpython3.7m.dylib", suffix=".dylib", is_windows=False) 'python3.7m' >>> library_name("python37.dll", suffix=".dll", is_windows=True) 'python37' """ if not is_windows and name.startswith("lib"): name = name[len("lib") :] if suffix and name.endswith(suffix): name = name[: -len(suffix)] return name def append_truthy(list, item): if item: list.append(item) def uniquifying(items): """ Yield items while excluding the duplicates and preserving the order. >>> list(uniquifying([1, 2, 1, 2, 3])) [1, 2, 3] """ seen = set() for x in items: if x not in seen: yield x seen.add(x) def uniquified(func): """Wrap iterator returned from `func` by `uniquifying`.""" @functools.wraps(func) def wrapper(*args, **kwds): return uniquifying(func(*args, **kwds)) return wrapper @uniquified def candidate_names(suffix=SHLIB_SUFFIX): """ Iterate over candidate file names of libpython. Yields ------ name : str Candidate name libpython. """ LDLIBRARY = sysconfig.get_config_var("LDLIBRARY") if LDLIBRARY: yield LDLIBRARY LIBRARY = sysconfig.get_config_var("LIBRARY") if LIBRARY: yield os.path.splitext(LIBRARY)[0] + suffix dlprefix = "" if is_windows else "lib" sysdata = dict( v=sys.version_info, # VERSION is X.Y in Linux/macOS and XY in Windows: VERSION=( sysconfig.get_config_var("VERSION") or "{v.major}.{v.minor}".format(v=sys.version_info) ), ABIFLAGS=( sysconfig.get_config_var("ABIFLAGS") or sysconfig.get_config_var("abiflags") or "" ), ) for stem in [ "python{VERSION}{ABIFLAGS}".format(**sysdata), "python{VERSION}".format(**sysdata), "python{v.major}".format(**sysdata), "python", ]: yield dlprefix + stem + suffix @uniquified def candidate_paths(suffix=SHLIB_SUFFIX): """ Iterate over candidate paths of libpython. Yields ------ path : str or None Candidate path to libpython. The path may not be a fullpath and may not exist. """ yield linked_libpython() # List candidates for directories in which libpython may exist lib_dirs = [] append_truthy(lib_dirs, sysconfig.get_config_var("LIBPL")) append_truthy(lib_dirs, sysconfig.get_config_var("srcdir")) append_truthy(lib_dirs, sysconfig.get_config_var("LIBDIR")) # LIBPL seems to be the right config_var to use. It is the one # used in python-config when shared library is not enabled: # https://github.com/python/cpython/blob/v3.7.0/Misc/python-config.in#L55-L57 # # But we try other places just in case. if is_windows: lib_dirs.append(os.path.join(os.path.dirname(sys.executable))) else: lib_dirs.append( os.path.join(os.path.dirname(os.path.dirname(sys.executable)), "lib") ) # For macOS: append_truthy(lib_dirs, sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX")) lib_dirs.append(sys.exec_prefix) lib_dirs.append(os.path.join(sys.exec_prefix, "lib")) lib_basenames = list(candidate_names(suffix=suffix)) for directory in lib_dirs: for basename in lib_basenames: yield os.path.join(directory, basename) # In macOS and Windows, ctypes.util.find_library returns a full path: for basename in lib_basenames: yield ctypes.util.find_library(library_name(basename)) # Possibly useful links: # * https://packages.ubuntu.com/bionic/amd64/libpython3.6/filelist # * https://github.com/Valloric/ycmd/issues/518 # * https://github.com/Valloric/ycmd/pull/519 def normalize_path(path, suffix=SHLIB_SUFFIX, is_apple=is_apple): """ Normalize shared library `path` to a real path. If `path` is not a full path, `None` is returned. If `path` does not exists, append `SHLIB_SUFFIX` and check if it exists. Finally, the path is canonicalized by following the symlinks. Parameters ---------- path : str ot None A candidate path to a shared library. """ if not path: return None if not os.path.isabs(path): return None if os.path.exists(path): return os.path.realpath(path) if os.path.exists(path + suffix): return os.path.realpath(path + suffix) if is_apple: return normalize_path(_remove_suffix_apple(path), suffix=".so", is_apple=False) return None def _remove_suffix_apple(path): """ Strip off .so or .dylib. >>> _remove_suffix_apple("libpython.so") 'libpython' >>> _remove_suffix_apple("libpython.dylib") 'libpython' >>> _remove_suffix_apple("libpython3.7") 'libpython3.7' """ if path.endswith(".dylib"): return path[: -len(".dylib")] if path.endswith(".so"): return path[: -len(".so")] return path @uniquified def finding_libpython(): """ Iterate over existing libpython paths. The first item is likely to be the best one. Yields ------ path : str Existing path to a libpython. """ logger.debug("is_windows = %s", is_windows) logger.debug("is_apple = %s", is_apple) for path in candidate_paths(): logger.debug("Candidate: %s", path) normalized = normalize_path(path) if normalized: logger.debug("Found: %s", normalized) yield normalized else: logger.debug("Not found.") def find_libpython(): """ Return a path (`str`) to libpython or `None` if not found. Parameters ---------- path : str or None Existing path to the (supposedly) correct libpython. """ for path in finding_libpython(): return os.path.realpath(path) def print_all(items): for x in items: print(x) def cli_find_libpython(cli_op, verbose): import logging # Importing `logging` module here so that using `logging.debug` # instead of `logger.debug` outside of this function becomes an # error. if verbose: logging.basicConfig(format="%(levelname)s %(message)s", level=logging.DEBUG) if cli_op == "list-all": print_all(finding_libpython()) elif cli_op == "candidate-names": print_all(candidate_names()) elif cli_op == "candidate-paths": print_all(p for p in candidate_paths() if p and os.path.isabs(p)) else: path = find_libpython() if path is None: return 1 print(path, end="") def main(args=None): import argparse parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "--verbose", "-v", action="store_true", help="Print debugging information." ) group = parser.add_mutually_exclusive_group() group.add_argument( "--list-all", action="store_const", dest="cli_op", const="list-all", help="Print list of all paths found.", ) group.add_argument( "--candidate-names", action="store_const", dest="cli_op", const="candidate-names", help="Print list of candidate names of libpython.", ) group.add_argument( "--candidate-paths", action="store_const", dest="cli_op", const="candidate-paths", help="Print list of candidate paths of libpython.", ) ns = parser.parse_args(args) parser.exit(cli_find_libpython(**vars(ns))) if __name__ == "__main__": main() nrn-8.2.6/cmake/modules/000077500000000000000000000000001465022020100150445ustar00rootroot00000000000000nrn-8.2.6/cmake/modules/FindCython.cmake000066400000000000000000000040051465022020100201120ustar00rootroot00000000000000# ~~~ # Find the Cython compiler. # # This code sets the following variables: # # CYTHON_EXECUTABLE # # See also UseCython.cmake # ============================================================================= # Copyright 2011 Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed under the License # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. See the License for the specific language governing permissions and limitations under # the License. # ============================================================================= # Use the Cython executable that lives next to the Python executable if it is a local installation. find_package(PythonInterp) if(PYTHONINTERP_FOUND) get_filename_component(_python_path ${PYTHON_EXECUTABLE} PATH) find_program( CYTHON_EXECUTABLE NAMES cython cython.bat cython3 HINTS ${_python_path}) else() find_program(CYTHON_EXECUTABLE NAMES cython cython.bat cython3) endif() if(NOT CYTHON_EXECUTABLE STREQUAL "CYTHON_EXECUTABLE-NOTFOUND") execute_process( COMMAND ${CYTHON_EXECUTABLE} --version RESULT_VARIABLE RESULT OUTPUT_VARIABLE CYTHON_VAR_OUTPUT ERROR_VARIABLE CYTHON_VAR_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE) if(RESULT EQUAL 0) string(REGEX REPLACE ".* ([0-9]+\\.[0-9]+(\\.[0-9]+)?).*" "\\1" CYTHON_VERSION "${CYTHON_VAR_OUTPUT}") else() message(STATUS "Found Cython: ${CYTHON_EXECUTABLE}") message(FATAL_ERROR "Cython error [${RESULT}]: ${CYTHON_VAR_OUTPUT}.") endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args( Cython FOUND_VAR CYTHON_FOUND REQUIRED_VARS CYTHON_EXECUTABLE VERSION_VAR CYTHON_VERSION) mark_as_advanced(CYTHON_EXECUTABLE) # ~~~ nrn-8.2.6/cmake/modules/FindMUSIC.cmake000066400000000000000000000007711465022020100175340ustar00rootroot00000000000000# # Find the MUSIC installation. # find_path(MUSIC_INCDIR music.hh PATH_SUFFIXES include) find_path(MUSIC_LIBDIR libmusic${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lib lib/x86_64-linux-gnu) find_library(MUSIC_LIBRARY libmusic${CMAKE_SHARED_LIBRARY_SUFFIX} PATHS ${MUSIC_LIBDIR}) find_package_handle_standard_args(MUSIC "Failed to find MUSIC package" MUSIC_INCDIR MUSIC_LIBDIR MUSIC_LIBRARY) nrn-8.2.6/cmake/modules/FindPythonLibsNew.cmake000066400000000000000000000220001465022020100214060ustar00rootroot00000000000000# ~~~ # ============================================================================= # Find libraries corresponding to Python interpreter # ============================================================================= # Using this module from Pybind11, see: github.com/pybind/pybind11/pull/207 # * Find python libraries This module finds the libraries corresponding to the Python interpreter # FindPythonInterp provides. This code sets the following variables: # # PYTHONLIBS_FOUND - have the Python libs been found PYTHON_PREFIX - path to # the Python installation PYTHON_LIBRARIES - path to the python library # PYTHON_INCLUDE_DIRS - path to where Python.h is found PYTHON_MODULE_EXTENSION - lib # extension, e.g. '.so' or '.pyd' PYTHON_MODULE_PREFIX - lib name prefix: usually an empty # string PYTHON_SITE_PACKAGES - path to installation site-packages PYTHON_IS_DEBUG - whether # the Python interpreter is a debug build # # Thanks to talljimbo for the patch adding the 'LDVERSION' config variable usage. # ============================================================================= # Copyright 2001-2009 Kitware, Inc. Copyright 2012 Continuum Analytics, Inc. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted # provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this list of conditions # and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, this list of # conditions and the following disclaimer in the documentation and/or other materials provided # with the distribution. # # * Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their # contributors may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND # FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ============================================================================= # Checking for the extension makes sure that `LibsNew` was found and not just `Libs`. if(PYTHONLIBS_FOUND AND PYTHON_MODULE_EXTENSION) return() endif() # Use the Python interpreter to find the libs. if(PythonLibsNew_FIND_REQUIRED) find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED) else() find_package(PythonInterp ${PythonLibsNew_FIND_VERSION}) endif() if(NOT PYTHONINTERP_FOUND) set(PYTHONLIBS_FOUND FALSE) return() endif() # According to http://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter # testing whether sys has the gettotalrefcount function is a reliable, cross-platform way to detect # a CPython debug interpreter. # # The library suffix is from the config var LDVERSION sometimes, otherwise VERSION. VERSION will # typically be like "2.7" on unix, and "27" on windows. execute_process( COMMAND "${PYTHON_EXECUTABLE}" "-c" "import sysconfig;import sys;import struct; print('.'.join(str(v) for v in sys.version_info)); print(sys.prefix); print(sysconfig.get_path('include')); print(sysconfig.get_path('platlib')); print(sysconfig.get_config_var('EXT_SUFFIX')); print(hasattr(sys, 'gettotalrefcount')+0); print(struct.calcsize('@P')); print(sysconfig.get_config_var('LDVERSION') or sysconfig.get_config_var('VERSION')); print(sysconfig.get_config_var('LIBDIR') or ''); print(sysconfig.get_config_var('MULTIARCH') or ''); " RESULT_VARIABLE _PYTHON_SUCCESS OUTPUT_VARIABLE _PYTHON_VALUES ERROR_VARIABLE _PYTHON_ERROR_VALUE) if(NOT _PYTHON_SUCCESS MATCHES 0) if(PythonLibsNew_FIND_REQUIRED) message(FATAL_ERROR "Python config failure:\n${_PYTHON_VALUES}\n${_PYTHON_ERROR_VALUE}") endif() set(PYTHONLIBS_FOUND FALSE) return() endif() # Convert the process output into a list if(WIN32) string(REGEX REPLACE "\\\\" "/" _PYTHON_VALUES ${_PYTHON_VALUES}) endif() string(REGEX REPLACE ";" "\\\\;" _PYTHON_VALUES ${_PYTHON_VALUES}) string(REGEX REPLACE "\n" ";" _PYTHON_VALUES ${_PYTHON_VALUES}) list(GET _PYTHON_VALUES 0 _PYTHON_VERSION_LIST) list(GET _PYTHON_VALUES 1 PYTHON_PREFIX) if(NOT DEFINED PYTHON_INCLUDE_DIR) list(GET _PYTHON_VALUES 2 PYTHON_INCLUDE_DIR) endif() list(GET _PYTHON_VALUES 3 PYTHON_SITE_PACKAGES) list(GET _PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION) list(GET _PYTHON_VALUES 5 PYTHON_IS_DEBUG) list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P) list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX) list(GET _PYTHON_VALUES 8 PYTHON_LIBDIR) list(GET _PYTHON_VALUES 9 PYTHON_MULTIARCH) # Make sure the Python has the same pointer-size as the chosen compiler Skip if CMAKE_SIZEOF_VOID_P # is not defined if(CMAKE_SIZEOF_VOID_P AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}")) if(PythonLibsNew_FIND_REQUIRED) math(EXPR _PYTHON_BITS "${PYTHON_SIZEOF_VOID_P} * 8") math(EXPR _CMAKE_BITS "${CMAKE_SIZEOF_VOID_P} * 8") message(FATAL_ERROR "Python config failure: Python is ${_PYTHON_BITS}-bit, " "chosen compiler is ${_CMAKE_BITS}-bit") endif() set(PYTHONLIBS_FOUND FALSE) return() endif() # The built-in FindPython didn't always give the version numbers string(REGEX REPLACE "\\." ";" _PYTHON_VERSION_LIST ${_PYTHON_VERSION_LIST}) list(GET _PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR) list(GET _PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR) list(GET _PYTHON_VERSION_LIST 2 PYTHON_VERSION_PATCH) # Make sure all directory separators are '/' string(REGEX REPLACE "\\\\" "/" PYTHON_PREFIX ${PYTHON_PREFIX}) string(REGEX REPLACE "\\\\" "/" PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR}) string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES}) if(CMAKE_HOST_WIN32) set(PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib") # when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the original python # installation. They may be found relative to PYTHON_INCLUDE_DIR. if(NOT EXISTS "${PYTHON_LIBRARY}") get_filename_component(_PYTHON_ROOT ${PYTHON_INCLUDE_DIR} DIRECTORY) set(PYTHON_LIBRARY "${_PYTHON_ROOT}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib") endif() # raise an error if the python libs are still not found. if(NOT EXISTS "${PYTHON_LIBRARY}") message(FATAL_ERROR "Python libraries not found") endif() else() if(PYTHON_MULTIARCH) set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}/${PYTHON_MULTIARCH}" "${PYTHON_LIBDIR}") else() set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}") endif() # message(STATUS "Searching for Python libs in ${_PYTHON_LIBS_SEARCH}") Probably this needs to be # more involved. It would be nice if the config information the python interpreter itself gave us # were more complete. find_library( PYTHON_LIBRARY NAMES "python${PYTHON_LIBRARY_SUFFIX}" PATHS ${_PYTHON_LIBS_SEARCH} NO_DEFAULT_PATH) # If all else fails, just set the name/version and let the linker figure out the path. if(NOT PYTHON_LIBRARY) set(PYTHON_LIBRARY python${PYTHON_LIBRARY_SUFFIX}) # Since this isn't very robust. One more try with find_libpython.py execute_process( COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/find_libpython.py" RESULT_VARIABLE _PYTHON_SUCCESS OUTPUT_VARIABLE _PYTHON_VALUES ERROR_VARIABLE _PYTHON_ERROR_VALUE) if(_PYTHON_SUCCESS MATCHES 0) if(_PYTHON_VALUES) set(PYTHON_LIBRARY "${_PYTHON_VALUES}") message(STATUS "PYTHON_LIBRARY from find_libpython.py: \"${PYTHON_LIBRARY}\"") endif() endif() endif() endif() mark_as_advanced(PYTHON_LIBRARY PYTHON_INCLUDE_DIR) # Make sure Python includes exist if(NOT EXISTS ${PYTHON_INCLUDE_DIR}) message( FATAL_ERROR "Could not find Python.h in ${PYTHON_INCLUDE_DIR}, install python-dev package (e.g. On Ubuntu : apt-get install python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}-dev)" ) endif() # We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the cache entries because # they are meant to specify the location of a single library. We now set the variables listed by the # documentation for this module. set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") find_package_message(PYTHON "Found PythonLibs: ${PYTHON_LIBRARY}" "${PYTHON_EXECUTABLE}${PYTHON_VERSION}") set(PYTHONLIBS_FOUND TRUE) # ~~~ nrn-8.2.6/cmake/modules/FindPythonModule.cmake000066400000000000000000000050351465022020100213010ustar00rootroot00000000000000# * Macro to find a python module # # Usage: find_python_module (module [VERSION] [REQUIRED]) # # Copyright 2005-2018 Airbus-EDF-IMACS-Phimeca # # Distributed under the OSI-approved BSD License (the "License"); see accompanying file # Copyright.txt for details in: # # https://github.com/openturns/otsubsetinverse/blob/master/cmake/FindPythonModule.cmake macro(nrn_find_python_module module) string(TOUPPER ${module} module_upper) if(NOT ${module_upper}_FOUND) # parse arguments set(${module}_FIND_OPTIONAL TRUE) if(${ARGC} EQUAL 2) if(${ARGV1} MATCHES REQUIRED) set(${module}_FIND_OPTIONAL FALSE) else() set(${module}_FIND_VERSION ${ARGV1}) endif() elseif(${ARGC} EQUAL 3) if(${ARGV2} MATCHES REQUIRED) set(${module}_FIND_OPTIONAL FALSE) endif() set(${module}_FIND_VERSION ${ARGV1}) endif() # A module's location is usually a directory, but for binary modules it's a .so file. execute_process( COMMAND "${PYTHON_EXECUTABLE}" "-c" "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))" RESULT_VARIABLE _${module}_status OUTPUT_VARIABLE _${module}_location ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT _${module}_status) set(${module_upper}_LOCATION ${_${module}_location} CACHE STRING "Location of Python module ${module}") # retrieve version execute_process( COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${module}; print(${module}.__version__)" RESULT_VARIABLE _${module}_status OUTPUT_VARIABLE _${module}_version ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) set(_${module_upper}_VERSION_MATCH TRUE) if(NOT _${module}_status) set(${module_upper}_VERSION_STRING ${_${module}_version}) if(${module}_FIND_VERSION) if(${module}_FIND_VERSION VERSION_GREATER ${module_upper}_VERSION_STRING) set(_${module_upper}_VERSION_MATCH FALSE) endif() endif() mark_as_advanced(${module_upper}_VERSION_STRING) endif() endif() find_package_handle_standard_args( ${module} REQUIRED_VARS ${module_upper}_LOCATION _${module_upper}_VERSION_MATCH VERSION_VAR ${module_upper}_VERSION_STRING) if(NOT ${module}_FIND_OPTIONAL AND NOT _${module_upper}_VERSION_MATCH) message(FATAL_ERROR "Missing python module ${module}") endif() mark_as_advanced(${module_upper}_LOCATION) endif(NOT ${module_upper}_FOUND) endmacro(nrn_find_python_module) nrn-8.2.6/cmake/modules/FindReadline.cmake000066400000000000000000000040211465022020100203670ustar00rootroot00000000000000# ~~~ # Code copied from sethhall@github # # - Try to find readline include dirs and libraries # # Usage of this module as follows: # # find_package(Readline) # # Variables used by this module, they can change the default behaviour and need # to be set before calling find_package: # # Readline_ROOT_DIR Set this variable to the root installation of # readline if the module has problems finding the # proper installation path. # # Variables defined by this module: # # READLINE_FOUND System has readline, include and lib dirs found # Readline_INCLUDE_DIR The readline include directories. # Readline_LIBRARY The readline library. find_path(Readline_ROOT_DIR NAMES include/readline/readline.h) find_path( Readline_INCLUDE_DIR NAMES readline/readline.h HINTS ${Readline_ROOT_DIR}/include) # On platforms like debian/ubuntu with multi-arch support libraries might be under separate # directory like /usr/lib/x86_64-linux-gnu/ With NVHPC compilers CMake can not find these librarise, # see # https://forums.developer.nvidia.com/t/nvhpc-cmake-issues-cmake-library-architecture-is-not-set-and-hence-system-libraries-are-not-found/200659 # Hence, provide extra directories as hint to search for libraries file(GLOB EXTRA_SEARCH_DIRS "${Readline_ROOT_DIR}/lib*/${CMAKE_SYSTEM_PROCESSOR}-*-*") find_library( Readline_LIBRARY NAMES readline HINTS ${Readline_ROOT_DIR}/lib ${EXTRA_SEARCH_DIRS}) if(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) set(READLINE_FOUND TRUE) else( Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) find_library(Readline_LIBRARY NAMES readline) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Readline DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY) mark_as_advanced(Readline_INCLUDE_DIR Readline_LIBRARY) endif( Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) mark_as_advanced(Readline_ROOT_DIR Readline_INCLUDE_DIR Readline_LIBRARY) nrn-8.2.6/cmake/modules/FindSphinx.cmake000066400000000000000000000003441465022020100201210ustar00rootroot00000000000000find_program( SPHINX_EXECUTABLE NAMES sphinx-build DOC "/path/to/sphinx-build") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Sphinx "Failed to find sphinx-build executable" SPHINX_EXECUTABLE) nrn-8.2.6/cmake/modules/FindTermcap.cmake000066400000000000000000000050161465022020100202440ustar00rootroot00000000000000# ~~~ # Copyright (c) 2014, Matthias Vallentin # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # 3. Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # Tries to find termcap headers and libraries # # Usage of this module as follows: # # find_package(Termcap) # # Variables used by this module, they can change the default behaviour and need to be set before # calling find_package: # # TERMCAP_ROOT_DIR Set this variable to the root installation of termcap if the module has problems # finding the proper installation path. # # Variables defined by this module: # # TERMCAP_FOUND System has Termcap libs/headers TERMCAP_LIBRARIES The Termcap # libraries TERMCAP_INCLUDE_DIR The location of Termcap headers find_path( TERMCAP_INCLUDE_DIR NAMES termcap.h HINTS ${TERMCAP_ROOT_DIR}/include) find_library( TERMCAP_LIBRARIES NAMES termcap ncurses HINTS ${TERMCAP_ROOT_DIR}/lib) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Termcap DEFAULT_MSG TERMCAP_LIBRARIES TERMCAP_INCLUDE_DIR) mark_as_advanced(TERMCAP_ROOT_DIR TERMCAP_LIBRARIES TERMCAP_INCLUDE_DIR) # ~~~ nrn-8.2.6/cmake_nrnconf.h.in000066400000000000000000000234301465022020100156770ustar00rootroot00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ #ifndef H_nrnconf_included #define H_nrnconf_included 1 /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* if mac os x */ #undef DARWIN /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define to 1 if you have the header file. */ #undef HAVE_CXXABI_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FENV_H /* Define to 1 if you have the `fesetround' function. */ #undef HAVE_FESETROUND /* Define to 1 if you have the `feenableexcept' function. */ #undef HAVE_FEENABLEEXCEPT /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the `getpw' function. */ #undef HAVE_GETPW /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `index' function. */ #undef HAVE_INDEX /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isatty' function. */ #undef HAVE_ISATTY /* define if using InterViews */ #undef HAVE_IV /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `lockf' function. */ #undef HAVE_LOCKF /* Define to 1 if you have the `mallinfo' function. */ #undef HAVE_MALLINFO /* Define to 1 if you have the `mallinfo2' function. */ #undef HAVE_MALLINFO2 /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* define if the compiler implements namespaces */ #undef HAVE_NAMESPACES /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `realpath' function. */ #undef HAVE_REALPATH /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setitimer' function. */ #undef HAVE_SETITIMER /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* (Define if this signal exists) */ #undef HAVE_SIGBUS /* (Define if this signal exists) */ #undef HAVE_SIGSEGV /* define if the compiler has stringstream */ #undef HAVE_SSTREAM /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STREAM_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `stty' function. */ #undef HAVE_STTY /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CONF_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the <_G_config.h> header file. */ #undef HAVE__G_CONFIG_H /* define if can declare inline float abs(float) */ #undef INLINE_FLOAT_ABS /* define if can declare inline long abs(long) */ #undef INLINE_LONG_ABS /* undefined or ::fabs or std::fabs */ #undef IVOS_FABS /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* 1 for legacy, undef for NIST (as of 2017), for FARADAY and R */ #undef LegacyFR /* define if using mingw */ #undef MINGW /* define if using Mike Neubig contributions */ #undef MikeNeubig /* where the lib hoc is */ #undef NEURON_DATA_DIR /* host triplet */ #undef NRNHOST /* cpu type consistent with nrnivmodl */ #undef NRNHOSTCPU /* if 1 then dlopen nrnmech instead of special */ #undef NRNMECH_DLL_STYLE /* if 1 then dynamic units default is legacy units */ #undef DYNAMIC_UNITS_USE_LEGACY_DEFAULT /* if nrnoc can use X11 */ #undef NRNOC_X11 /* location of NEURON libraries */ #undef NRN_LIBDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* define if RETSIGTYPE(*)(int) is not the prototype for a signal handler */ #undef SIGNAL_CAST /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define SUNDIALS data type 'realtype' as 'long double' */ #undef SUNDIALS_DOUBLE_PRECISION /* Use generic math functions */ #undef SUNDIALS_USE_GENERIC_MATH /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* define if using Carbon libraries */ #undef carbon /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef int64_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t #if defined(__cplusplus) #include #endif #ifdef MINGW #define WIN32 1 #endif #if defined(carbon) && defined(__cplusplus) #define MAC 1 #include #endif #endif /* H_nrnconf_included */ nrn-8.2.6/codecov.yml000066400000000000000000000001071465022020100144570ustar00rootroot00000000000000codecov: require_ci_to_pass: false notify: wait_for_ci: false nrn-8.2.6/docs/000077500000000000000000000000001465022020100132445ustar00rootroot00000000000000nrn-8.2.6/docs/Doxyfile.in000066400000000000000000003271741465022020100153750ustar00rootroot00000000000000# Doxyfile 1.8.15 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the configuration # file that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "NEURON" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = @PROJECT_SOURCE_DIR@/docs/logo.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = @PROJECT_SOURCE_DIR@/docs/_generated # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all generated output in the proper direction. # Possible values are: None, LTR, RTL and Context. # The default value is: None. OUTPUT_TEXT_DIRECTION = None # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines (in the resulting output). You can put ^^ in the value part of an # alias to insert a newline as if a physical newline was in the original file. # When you need a literal { or } or , in the value part of an alias you have to # escape them by means of a backslash (\), this can lead to conflicts with the # commands \{ and \} for these it is advised to use the version @{ and @} or use # a double escape (\\{ and \\}) ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice # sources only. Doxygen will then generate output that is more tailored for that # language. For instance, namespaces will be presented as modules, types will be # separated into more groups, etc. # The default value is: NO. OPTIMIZE_OUTPUT_SLICE = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, # Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: # FortranFree, unknown formatted Fortran: Fortran. In the later case the parser # tries to guess whether the code is fixed or free formatted code, this is the # default for Fortran type files), VHDL, tcl. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is # Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = .yaml=Python # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. # Minimum value: 0, maximum value: 99, default value: 0. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = YES # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = DoxygenLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. If # EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = @PROJECT_SOURCE_DIR@/src INPUT += @PROJECT_SOURCE_DIR@/test # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, # *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.ipp \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.markdown \ *.md \ *.mm \ *.dox \ *.yaml \ # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE += @PROJECT_SOURCE_DIR@/src/scopmath EXCLUDE += @PROJECT_SOURCE_DIR@/src/sundials # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. INPUT += @PROJECT_SOURCE_DIR@/README.md USE_MDFILE_AS_MAINPAGE = @PROJECT_SOURCE_DIR@/README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = doxygen # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = @PROJECT_SOURCE_DIR@/docs/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 240 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that # are dynamically created via Javascript. If disabled, the navigation index will # consists of multiple levels of tabs that are statically embedded in every HTML # page. Disable this option to support browsers that do not have Javascript, # like the Qt help browser. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_MENUS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: https://developer.apple.com/xcode/), introduced with OSX # 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from https://www.mathjax.org before deployment. # The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /