Conversation
We want <include-path>/quest.h and <include-path>/quest/<header>.h in final installed structure, so update files accordingly. This is particularly important as we plan on installing quest.h, but quest.h is also included by the local code, so it needs to use paths that are both source-tree layout and install-tree layout.
Use build directory to “stage” includes at install position
|
Hi Luc, Thanks very much for the PR! I like your approach, though am still investigating the problem. If possible, I'd wish to avoid changing the hundreds of include paths. I've so far been using a variant of Kolpackov's structure, using the include path to semantically separate what's frontend and backend. Consider the includes in #include "quest/include/types.h"
#include "quest/include/qureg.h"
#include "quest/include/paulis.h"
#include "quest/include/matrices.h"
#include "quest/src/core/accelerator.hpp"
#include "quest/src/core/errors.hpp"
#include "quest/src/core/memory.hpp"
#include "quest/src/core/bitwise.hpp"
#include "quest/src/cpu/cpu_config.hpp"
#include "quest/src/gpu/gpu_config.hpp"
#include "quest/src/cpu/cpu_subroutines.hpp"
#include "quest/src/gpu/gpu_subroutines.hpp"
#include <vector>
#include <algorithm>A change like this PR's then seems to mislead about the location of the headers #include "quest/types.h"
...
#include "quest/src/core/accelerator.hpp"
...It also creates an asymmetry in the working directory of frontend and backend includes within a backend file. No need to explore this further yourself, I'll tinker when I get a chance to see if the existing paths can be preserved without being terribly non-standard and hacky. Finally, note the PR should point to |
|
Sure, no worries! I’ll close this down as it’s pointing to the wrong branch. Just thought I’d share because this is what I’m using currently to run v4 and install different versions to different prefixes on the same machine. It seems to me though that the structure you’re referring to recommends includes of the type You should be able install to headers as |
|
I see Tyson has beat me to it, but chiming in to say thanks for this @lucjaulmes! Especially for solving the headache of leaking compile definitions, which I'd been sitting on until I had more time. Apologies for not picking up the install bug sooner, but as ever it worked on my RE: foreach, I think that and a few other issues could be solved using file sets, except we would need to bump to CMake 3.23. I can look at that later, no need to do it all once in this PR. Anddddd I was still too slow 😆 @lucjaulmes yes, if you have time to make the revised PR to |
Fixes #611 header issues:
quest.hand other headers underquest/subdirectory all in the usual include path.quest.hconfigured so it contains the pre-processor defines ifVERBOSE_LIB_NAMEis false, and make those target defines private so they don’t appear in exported cmake files.quest.hand keep them in the exported cmake ifVERBOSE_LIB_NAMEis true.$LIB_NAMEas well, so the matching cmake files link to the right verbosely-named libraries and provide the right compile-time flags, with a single set of header files.I think all of the CMakeFiles machinery (in particular
foreach()which seems to be discouraged) can be simplified at the cost of having all the files already in the final layout in the source directory. So all headers atquest/include/quest.h.inandquest/include/quest/*.hrespectively. I can update the PR that way if that’s preferred.