-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code generation issue with inlining #809
Comments
I got a similar issue again when building
|
Seems like after 2109df6 this issue is somehow fixed Edit: After this commit the mod files included in NEURON integrated tests pass however I still go the error in another mod file with current NMODL master |
@alkino Have you maybe tested whether this fixes the issue in an M1 machine? |
It seems like the issue is still not resolved. |
Some more instructions to reproduce the issue in M1 processors:
Above script is installing NMODL and CoreNEURON and compiles the mod files from reduced dentate that showcase this issue multiple times until there is a failure. |
I don't think this happens on Apple M1 only! today on my Intel MacBook I saw: [NMODL] [info] :: Running cnexp visitor
[NMODL] [info] :: Running C backend code generator
x86_64/corenrn/mod2c/Aradi_Ca.cpp:560:36: error: use of undeclared identifier 'exponential_in_2'; did you mean 'exptrap_in_2'?
exptrap_in_2 = exponential_in_2;
^~~~~~~~~~~~~~~~
exptrap_in_2
x86_64/corenrn/mod2c/Aradi_Ca.cpp:550:20: note: 'exptrap_in_2' declared here
double exptrap_in_2, A_in_7, k_in_7, v_in_20, D_in_7;
^
x86_64/corenrn/mod2c/Aradi_Ca.cpp:1482:48: error: use of undeclared identifier 'exponential_in_2'; did you mean 'exptrap_in_2'?
exptrap_in_2 = exponential_in_2;
^~~~~~~~~~~~~~~~
exptrap_in_2
x86_64/corenrn/mod2c/Aradi_Ca.cpp:1472:32: note: 'exptrap_in_2' declared here
double exptrap_in_2, A_in_7, k_in_7, v_in_20, D_in_7;
^
2 errors generated.
make[3]: *** [x86_64/corenrn/build/Aradi_Ca.o] Error 1
make[3]: *** Waiting for unfinished jobs.... The NMODL version: ✗ ./bin/nmodl --help
NMODL : Source-to-Source Code Generation Framework [0.4 14359293 2022-10-28 08:35:35 +0200] And CMake command I used: cmake .. -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_RX3D=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/install -DNRN_ENABLE_CORENEURON=ON -DCORENRN_ENABLE_LEGACY_UNITS=ON -DNRN_DYNAMIC_UNITS_USE_LEGACY=ON -DCORENRN_ENABLE_NMODL=ON -DCORENRN_ENABLE_OPENMP=OFF -DNRN_ENABLE_TESTS=ON Tried to build again and I see: [NMODL] [info] :: Running C backend code generator
x86_64/corenrn/mod2c/Aradi_Ca.cpp:400:36: error: use of undeclared identifier 'alphaa_in_1'
exptrap_in_1 = alphaa_in_1;
^
x86_64/corenrn/mod2c/Aradi_Ca.cpp:1262:48: error: use of undeclared identifier 'alphaa_in_1'
exptrap_in_1 = alphaa_in_1;
^ |
* when we inline AST nodes, we keep the track of which nodes being replaced by using a map containing address of those nodes. * when inlining of a particular node is finished, we were not removing that node address from the map. * if we get a situation where AST node with same address is created (dynamic allocation) during inlining pass, it might end-up replacing wrong node just because it has the same address as previously inlined node. * to avoid this, make sure to clear map entry when inlining is done! Fixes #809
* when we inline AST nodes, we keep the track of which nodes being replaced by using a map containing address of those nodes. * when inlining of a particular node is finished, we were not removing that node address from the map. * if we get a situation where AST node with same address is created (dynamic allocation) during inlining pass, it might end-up replacing wrong node just because it has the same address as previously inlined node. * to avoid this, make sure to clear map entry when inlining is done! Fixes #809
* when we inline AST nodes, we keep the track of which nodes being replaced by using a map containing address of those nodes. * when inlining of a particular node is finished, we were not removing that node address from the map. * if we get a situation where AST node with same address is created (dynamic allocation) during inlining pass, it might end-up replacing wrong node just because it has the same address as previously inlined node. * to avoid this, make sure to clear map entry when inlining is done! Fixes #809
* when we inline AST nodes, we keep the track of which nodes being replaced by using a map containing address of those nodes. * when inlining of a particular node is finished, we were not removing that node address from the map. * if we get a situation where AST node with same address is created (dynamic allocation) during inlining pass, it might end-up replacing wrong node just because it has the same address as previously inlined node. * to avoid this, make sure to clear map entry when inlining is done! Fixes #809
* when we inline AST nodes, we keep the track of which nodes being replaced by using a map containing address of those nodes. * when inlining of a particular node is finished, we were not removing that node address from the map. * if we get a situation where AST node with same address is created (dynamic allocation) during inlining pass, it might end-up replacing wrong node just because it has the same address as previously inlined node. * to avoid this, make sure to clear map entry when inlining is done! Fixes #809
Installing
NEURON
withNMODL
on Apple Macbook Air with M1 processor generated the following issue when compiling the na3n.mod file from the reduced_dentate repo:Seems like there is some issue with the code generated in
which should be:
after the inline pass.
Unfortunately I couldn't reproduce the issue when I installed
NEURON
withCoreNEURON
andNMODL
using the following commands:The text was updated successfully, but these errors were encountered: