Skip to content
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

Clean headers dependencies in nrn #2389

Closed
wants to merge 19 commits into from
Closed

Clean headers dependencies in nrn #2389

wants to merge 19 commits into from

Conversation

alkino
Copy link
Member

@alkino alkino commented Jun 14, 2023

Replace all nrn includes by a general include.
Remove all the -I from CMake and move them inside the script nrnivmodl.

"" => <>
<> => <>

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@azure-pipelines
Copy link

✔️ 411eec3 -> Azure artifacts URL

@azure-pipelines
Copy link

✔️ 787d3ea -> Azure artifacts URL

@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #2389 (4aa5393) into master (65efbdd) will increase coverage by 0.07%.
The diff coverage is 100.00%.

❗ Current head 4aa5393 differs from pull request most recent head a40e447. Consider uploading reports for the commit a40e447 to get more accurate results

@@            Coverage Diff             @@
##           master    #2389      +/-   ##
==========================================
+ Coverage   60.20%   60.28%   +0.07%     
==========================================
  Files         627      650      +23     
  Lines      121085   121697     +612     
==========================================
+ Hits        72905    73368     +463     
- Misses      48180    48329     +149     
Impacted Files Coverage Δ
src/gnu/ACG.cpp 94.33% <ø> (ø)
src/gnu/Binomial.cpp 0.00% <ø> (ø)
src/gnu/Binomial.h 0.00% <ø> (ø)
src/gnu/DiscUnif.cpp 100.00% <ø> (ø)
src/gnu/DiscUnif.h 100.00% <ø> (ø)
src/gnu/Erlang.cpp 0.00% <ø> (ø)
src/gnu/Erlang.h 0.00% <ø> (ø)
src/gnu/Geom.cpp 0.00% <ø> (ø)
src/gnu/Geom.h 0.00% <ø> (ø)
src/gnu/HypGeom.cpp 0.00% <ø> (ø)
... and 236 more

... and 36 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@alkino alkino marked this pull request as ready for review June 15, 2023 14:27
@github-actions
Copy link
Contributor

NEURON ModelDB CI: launching for 787d3ea via its drop url

@bbpbuildbot

This comment has been minimized.

@github-actions
Copy link
Contributor

NEURON ModelDB CI: 787d3ea -> download reports from here

@azure-pipelines
Copy link

✔️ 4aa5393 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@@ -859,15 +859,6 @@ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/share/lib/cleanup

# Copy NEURON headers that will be included in the installation into the build directory.
set(headers_in_build_dir)
foreach(header_below_src ${HEADER_FILES_TO_INSTALL})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment for other reviewers: I understand the idea here is that src/dir/header.h used to get installed as include/header.h, but now it gets installed as include/dir/header.h.

@@ -19,7 +19,7 @@ UserLDFLAGS =
# install dirs
bindir := ${ROOT}/@CMAKE_INSTALL_BINDIR@
libdir := ${ROOT}/@CMAKE_INSTALL_LIBDIR@
incdir := ${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@
incdir := -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@ -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/crout -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/neuron -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/newton -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/nrncvode -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/nrniv -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/nrnmpi -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/nrnoc -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/oc -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/scopmath -I${ROOT}/@CMAKE_INSTALL_INCLUDEDIR@/sparse13
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by this change. If we are now including a lot more of these directory names in the #include <...> statements, why do we need these here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because mod files still include "raw" files from the old grouped <BUILD>/include directory

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that is widespread in VERBATIM blocks, not just in the code generated by nocmodl?

I'm not sure it's a step forwards to introduce two different #include schemes, one for the library source files and one for the generated .cpp...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can slowly clean all mod files.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't buy that; the cost/reward for updating all of ModelDB for that is such that it will never happen, in my view.

So: this seems like it's creating and locking in a new source of inconsistency between different bits of C++. Is that really worth it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on the first part that it will never happens.

For the second part, I, personnaly, think, it worse it, to clean more the code and know who include what.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't buy that; the cost/reward for updating all of ModelDB for that is such that it will never happen, in my view.

I agree on the first part that it will never happens.

We are on the same page!

So: this seems like it's creating and locking in a new source of inconsistency between different bits of C++. Is that really worth it?

For the second part, I, personnaly, think, it worse it, to clean more the code and know who include what.

I understand the "inconsistency" aspects that Olli mentioned (i.e. having a single way would be better).

I don't have recent enough hands-on experience to assess the impact or propose a better solution here. Maybe @olupton you can propose what should be done here?

src/gnu/ACG.cpp Outdated Show resolved Hide resolved
src/gnu/ACG.h Outdated Show resolved Hide resolved
src/ivoc/apwindow.cpp Outdated Show resolved Hide resolved
@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@alkino alkino closed this Oct 2, 2023
@alkino alkino deleted the cornu/clean_headers branch January 31, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants