-
Notifications
You must be signed in to change notification settings - Fork 93
move include/common to include/finufft_common #734
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
base: master
Are you sure you want to change the base?
Conversation
Thanks @iboB, we will discuss in the next team meeting and keep you posted. |
Hi @iboB, Do you know what is the best practice for solving this issue? The usual structure used by common big libraries that we should follow? Also, any suggestion on naming here is welcome, I am not great at it. Thanks, |
The modern approach is to have a "namespace" directory and no headers outside of it. Besides that I don't think there's anything close to a standard or a de facto standard for C or C++. The desire to keep finufft and cufinufft separate, and also have common code between them, would in practice mean that there are three libraries, so I would suggest the following structure:
Then one would include If you plan on merging the two in a unified library, I'd simplify things by going:
Other things that I personally find appealing:
|
I second this. It is what I use and see in other open source projects.
I I ma not mistaken the plan is to merge cufinufft and finufft. The reason this has not happened is time I think. My plan is to gradually move functionalities in the common third library and reuse it in both projects until there is no overlap. Then we can do the merge.
I like this too. I was planning on proposing to the team in the future. Also, some of the linters breaks if the see c++ code in a .h because they think is a c code.
I am not a fan of this because having .cpp and .hpp makes the linting slower for users downstream. Usually includes are specified by folder (-I folder). if the number of files in this directories blows up it makes some linters sluggish or use more ram than needed. It might not be a problem anymore but experienced issues when multiple of my dependencies go around that pattern. |
This can be also merged if rebased. I am fine with the renaming for now. |
include/common
is a very... er... common name for an include directory. Since it contains generic files like "common.h", "utils.h", etc it makes it extremely susceptible to include path clashes, where in certain scenarios it would be impossible to#include <common/defines.h>
and get the right thing.I'd say this is bordering on adding code in to a file called
stdio.h
. I think a library has no place of doing this to the include paths.This PR moves
common
tofinufft_common
to avoid clashes in projects which use the same directory for their common includes.Perhaps a better suggestion would be to move all headers to a distinct directory (say
finufft
orfi
orflatiron
) and get to a structure like like... but that's a decision better thought through within the team.
PS I am again trying to sneak the ninja commit of
.gitignore
from #725