arbor-sim / arbor

The Arbor multi-compartment neural network simulation library.
https://arbor-sim.org
BSD 3-Clause "New" or "Revised" License
105 stars 59 forks source link

Building a catalogue with a mechanism with a different `SUFFIX` than filename crashes #2250

Closed Helveg closed 6 months ago

Helveg commented 6 months ago

Arbor 0.9, pip installed

Describe the bug With filename Cav2_1__0.mod, and SUFFIX glia__glia_test_mods__Cav2_1__0:

arbor-build-catalogue dbbs mod/
glia.exceptions.BuildCatalogueError: ABC errored out with exitcode 2

Command: arbor-build-catalogue glia_test_mods /tmp/tmpo_dcajwv
---- ABC output ----

Building debug code in '/tmp/tmp5wb69lrr'.
Build log:
[ 25%] modcc generating: /tmp/tmp5wb69lrr/build/generated/glia_test_mods/glia_test_mods_catalogue.cpp;/tmp/tmp5wb69lrr/build/generated/glia_test_mods/Cav2_1__0_cpu.cpp
Scanning dependencies of target glia_test_mods-catalogue
[ 25%] modcc generating: /tmp/tmp5wb69lrr/build/generated/glia_test_mods/glia_test_mods_catalogue.cpp;/tmp/tmp5wb69lrr/build/generated/glia_test_mods/Cav2_1__0_cpu.cpp
[ 50%] Building CXX object CMakeFiles/glia_test_mods-catalogue.dir/generated/glia_test_mods/glia_test_mods_catalogue.cpp.o
[ 75%] Building CXX object CMakeFiles/glia_test_mods-catalogue.dir/generated/glia_test_mods/Cav2_1__0_cpu.cpp.o

---- ABC error  ----

Warning: prefix '/opt/rh/devtoolset-10/root/usr/bin/c++' does not exist, falling back to 'c++'.
Traceback (most recent call last):
  File "/home/robin/.pyenv/versions/3.11.6/envs/arbor-dbbs/lib/python3.11/site-packages/arbor/bin/arbor-build-catalogue", line 318, in <module>
    sp.run(make_cmd, shell=True, check=True, capture_output = True, text = True)
  File "/home/robin/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'make' returned non-zero exit status 2.
 Error:

c++: error: /tmp/tmp5wb69lrr/build/generated/glia_test_mods/Cav2_1__0_cpu.cpp: No such file or directory
c++: fatal error: no input files
compilation terminated.
make[2]: *** [CMakeFiles/glia_test_mods-catalogue.dir/build.make:83: CMakeFiles/glia_test_mods-catalogue.dir/generated/glia_test_mods/Cav2_1__0_cpu.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/glia_test_mods-catalogue.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

This is during a build managed by my CLI NMODl asset management tool, the log shows the stdout followed by stderr. These are the files created in the build dir's build/generated/glia_test_mods:

glia__glia_test_mods__Cav2_1__0.hpp  glia__glia_test_mods__Cav2_1__0_cpu.cpp  glia_test_mods_catalogue.cpp  glia_test_mods_catalogue.hpp

these filenames are derived from the SUFFIX, while the build log shows that it looks for them based on the original filename's derived location. It's fixed by lining up the SUFFIX statement with the filename.

thorstenhater commented 6 months ago

Ok, this is a bug in modcc, not a-b-c directly, but, should be fixed.