This repository was archived by the owner on Mar 25, 2025. It is now read-only.
Fix CMake integration of NMODL generation.#1554
Merged
Merged
Conversation
f399b0c to
d72500b
Compare
Collaborator
Author
|
Second attempt at fixing the issue. The previous was a rather short-lived "solution". |
The code for the code-generator NMODL is itself generated from Jinja
templates. This requires CMake integration to ensure it happens
automatically.
The following has been changed about the integration:
* The CMake code needs a list of the generated files. This list is
stored in a CMake file and included. This file must exist before
running `code_generator.py` to generate the NMODL code, because the
command to generate the files needs to know which file it will be
generating. Therefore, we split the script into two phases: one to
generate the list of generated files, and another to generate the
files.
* The list of generated files depends on the build flags. Therefore,
this file (`code_generator.cmake`) can't be checked into the Git
repo. The `code_generator.cmake` is created during the configure
phase, and now lives in the build directory.
* CMake code was lifted from `src/language/CMakeLists.txt` to the
top-level `CMakeLists.txt` to avoid any scoping issues for the
lists of generated files.
* Removed pattern of yielding tasks while creating a list tasks in
favour of returning the list of tasks directly.
ce0f0c7 to
2f31622
Compare
pramodk
approved these changes
Nov 7, 2024
pramodk
left a comment
Contributor
There was a problem hiding this comment.
LGTM this approach as well.
JCGoran
pushed a commit
to neuronsimulator/nrn
that referenced
this pull request
Mar 12, 2025
The code for the code-generator NMODL is itself generated from Jinja
templates. This requires CMake integration to ensure it happens
automatically.
The following has been changed about the integration:
* The CMake code needs a list of the generated files. This list is
stored in a CMake file and included. This file must exist before
running `code_generator.py` to generate the NMODL code, because the
command to generate the files needs to know which file it will be
generating. Therefore, we split the script into two phases: one to
generate the list of generated files, and another to generate the
files.
* The list of generated files depends on the build flags. Therefore,
this file (`code_generator.cmake`) can't be checked into the Git
repo. The `code_generator.cmake` is created during the configure
phase, and now lives in the build directory.
* CMake code was lifted from `src/language/CMakeLists.txt` to the
top-level `CMakeLists.txt` to avoid any scoping issues for the
lists of generated files.
* Removed pattern of yielding tasks while creating a list tasks in
favour of returning the list of tasks directly.
NMODL Repo SHA: BlueBrain/nmodl@49fdfe6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code for the code-generator NMODL is itself generated from Jinja templates. This requires CMake integration to ensure it happens automatically.
The following has been changed about the integration:
The CMake code needs a list of the generated files. This list is stored in a CMake file and included. This file must exist before running
code_generator.pyto generate the NMODL code, because the command to generate the files needs to know which file it will be generating. Therefore, we split the script into two phases: one to generate the list of generated files, and another to generate the files.The list of generated files depends on the build flags. Therefore, this file (
code_generator.cmake) can't be checked into the Git repo. Thecode_generator.cmakeis created during the configure phase, and now lives in the build directory.CMake code was lifted from
src/language/CMakeLists.txtto the top-levelCMakeLists.txtto avoid any scoping issues for the lists of generated files.Removed pattern of yielding tasks while creating a list tasks in favour of returning the list of tasks directly.