I am creating this single placeholder ticket to summarise the issues I have seen while using this project with NEURON:
NEURON_FORMATTING doesnt work as expected:
→ cmake .. -DPYTHON_EXECUTABLE=`which python3.7` -DNEURON_FORMATTING:BOOL=ON -DNRN_ENABLE_CORENEURON=OFF -DNRN_ENABLE_INTERVIEWS=OFF
....
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
NEURON_FORMATTING
Am I missing something obvious here?
So I used -DNEURON_CMAKE_FORMAT=ON -DNEURON_CLANG_FORMAT=ON:
→ cmake .. -DPYTHON_EXECUTABLE=`which python3.7` -DNEURON_CMAKE_FORMAT=ON -DNEURON_CLANG_FORMAT=ON -DNRN_ENABLE_CORENEURON=OFF -DNRN_ENABLE_INTERVIEWS=OFF
...
-- Sub-module : missing external/coding-conventions : running git submodule update --init --recursive
-- NEURON_FORMATTING: OFF
-- NEURON_FORMATTING_ON: all
-- NEURON_FORMATTING_CPP_CHANGES_ONLY: OFF
-- NEURON_TEST_FORMATTING: OFF
-- NEURON_FORMATTING_NO_SUBMODULES: ON
-- NEURON_CLANG_FORMAT: ON
-- NEURON_CMAKE_FORMAT: ON
-- NEURON_PRECOMMIT: OFF
-- NEURON_PRECOMMIT_REGEN: OFF
-- NEURON_STATIC_ANALYSIS: OFF
-- NEURON_TEST_STATIC_ANALYSIS: OFF
All good. But if I try use clang-format target then:
→ make clang-format
Scanning dependencies of target clang-format
Could not find file /Users/kumbhar/workarena/repos/bbp/nn/build/compile_commands.json. Please make sure CMAKE_EXPORT_COMPILE_COMMANDS CMake variable is on.
Traceback (most recent call last):
File "/Users/kumbhar/workarena/repos/bbp/nn/external/coding-conventions/cpp/cmake/bbp-clang-format.py", line 257, in <module>
sys.exit(0 if main() else 1)
File "/Users/kumbhar/workarena/repos/bbp/nn/external/coding-conventions/cpp/cmake/bbp-clang-format.py", line 248, in main
args, collect_files(args.compile_commands_file, filter_cpp_file)
File "/Users/kumbhar/workarena/repos/bbp/nn/external/coding-conventions/cpp/cmake/cpplib.py", line 241, in filter_files_outside_time_range
for file in generator:
File "/Users/kumbhar/workarena/repos/bbp/nn/external/coding-conventions/cpp/cmake/cpplib.py", line 269, in collect_files
raise Exception(msg)
Exception: Could not find file /Users/kumbhar/workarena/repos/bbp/nn/build/compile_commands.json. Please make sure CMAKE_EXPORT_COMPILE_COMMANDS CMake variable is on.
Is CMAKE_EXPORT_COMPILE_COMMANDS supposed to be set by NEURON project? I assume not. (I dont see NEURON overriding this variable).
I am creating this single placeholder ticket to summarise the issues I have seen while using this project with NEURON:
Am I missing something obvious here?
-DNEURON_CMAKE_FORMAT=ON -DNEURON_CLANG_FORMAT=ON
:All good. But if I try use clang-format target then:
CMAKE_EXPORT_COMPILE_COMMANDS
supposed to be set by NEURON project? I assume not. (I dont see NEURON overriding this variable).So I continue by setting above variable: