Ensure everything compiles individually & sort includes #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just like in libff pull request 9, I have made almost every file in libfqfft compile individually by adding all missing includes, and also sorted all includes.
Additionally, I added a helpful compilation error message in case someone tries to compile
libfqfft/profiling/profile/profile.cpp
without-DPROFILE_OP_COUNTS
.Now for the almost in that first paragraph. There is a set of files, all in
libfqfft/evaluation_domain
, that still cannot be compiled individually, and this cannot be fixed easily because they have circular dependencies (files indomains/*
depend onevaluation_domain.hpp
, and vice-versa).I see two solutions to this:
add an explicit compiler error message to each file in
domains/*
saying that it cannot be compiled or included individually and must only be used by includingevaluation_domain.hpp
move
get_evaluation_domain()
fromevaluation_domain.hpp
to a separate file, likeget_evaluation_domain.hpp
, eliminating the circular dependencyPersonally, I support the second solution, because I don't see why a user should be unable to include a specific evalution domain if they want to. However, this would be a breaking change for all users of libfqfft (so, basically, libsnark), although it would also be really easy to fix (by adding/replacing just one include).
I invite everybody else to discuss this issue in the comments for this pull request. If there is support for either of the solutions, I will implement it and submit another PR to libfqfft (or just add more commits to this one), and also implement the necessary changes in libsnark if there are any.