You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I (we) have encountered an interesting error when compiling with cons. This issue came up when StEnumerations.h was changed and StVertex.h was changed along with a few others but those are not relevant to the issue. I think this error is only happening because we are trying to build on top of existing STAR headers and code and depending on how the code was written to specify the various needed headers it causes the cons build system to sometimes grab the existing ones in the $STAR directory instead of the ones in your current directory.
To help explain, here is the offending compiler command which returns an error because it couldn't find the new changes in StEnumerations.h.
These are symlinks that cons created before building the code and are most likely the only the headers that were changed. When I run cons on a clean build making the symlinks is part of the "install" step
Now let's take a look at the file we are compiling which is StEventHelper.cxx in StEventUtilites/. In StEventHelper.cxx we see the following relevant include lines
#include "StEvent.h" //not modified but includes "StEnumerations.h" which was modified
#include "StObject.h"
...
#include "StVertex.h" //modified file
So the first STAR header to include is StEvent.h which would be priority number 7 because cons did not create a StEvent.h in priority 3 (I am guessing this is because StEvent.h is unchanged from the dev version). So when cons found StEvent.h in priority 7, the StEnumerations.h file it uses is also coming from priority 7 and not priority 3. This results in the incorrect StEnumerations.h file being loaded which doesn't have the new changes. This can be avoided if you include "StEnumerations.h" before StEvent.h because it will load the one from priority 3 and the include guards will prevent re-inclusion.
This error only happens because we have another StEvent.h file to fall back on. I don't think this will happen in the official build when we integrate the code because there is no other StEvent.h, or StEnumerations.h file it can use. I just thought I should bring this up in case anyone else encounters this kind of error and to figure out what is the best solution in this case.
The text was updated successfully, but these errors were encountered:
I (we) have encountered an interesting error when compiling with
cons
. This issue came up when StEnumerations.h was changed and StVertex.h was changed along with a few others but those are not relevant to the issue. I think this error is only happening because we are trying to build on top of existing STAR headers and code and depending on how the code was written to specify the various needed headers it causes thecons
build system to sometimes grab the existing ones in the $STAR directory instead of the ones in your current directory.To help explain, here is the offending compiler command which returns an error because it couldn't find the new changes in StEnumerations.h.
If we break down the search paths of the include directories and get rid of reduncies we find this list of priorities.
.
StRoot
.sl73_gcc485/include
StRoot/StEventUtilities
folder we are building/afs/rhic.bnl.gov/star/packages/DEV
/afs/rhic.bnl.gov/star/packages/DEV/StRoot
/afs/rhic.bnl.gov/star/packages/DEV/.sl73_gcc485/include
/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86/gcc-4.8.5/root-5.34.38-llsepmmfuwlsucogcwbjiodncxanoudt/include
/afs/rhic.bnl.gov/star/packages/DEV/StRoot/StEventUtilities
/afs/rhic.bnl.gov/star/packages/DEV
/afs/rhic.bnl.gov/star/packages/DEV/StRoot
/afs/rhic.bnl.gov/star/packages/DEV/.sl73_gcc485/include
/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86/gcc-4.8.5/root-5.34.38-llsepmmfuwlsucogcwbjiodncxanoudt/include
If we look at folder in priority 3 we find:
These are symlinks that
cons
created before building the code and are most likely the only the headers that were changed. When I runcons
on a clean build making the symlinks is part of the "install" stepNow let's take a look at the file we are compiling which is StEventHelper.cxx in StEventUtilites/. In StEventHelper.cxx we see the following relevant include lines
So the first STAR header to include is StEvent.h which would be priority number 7 because
cons
did not create a StEvent.h in priority 3 (I am guessing this is because StEvent.h is unchanged from the dev version). So whencons
found StEvent.h in priority 7, the StEnumerations.h file it uses is also coming from priority 7 and not priority 3. This results in the incorrect StEnumerations.h file being loaded which doesn't have the new changes. This can be avoided if you include "StEnumerations.h" before StEvent.h because it will load the one from priority 3 and the include guards will prevent re-inclusion.This error only happens because we have another StEvent.h file to fall back on. I don't think this will happen in the official build when we integrate the code because there is no other StEvent.h, or StEnumerations.h file it can use. I just thought I should bring this up in case anyone else encounters this kind of error and to figure out what is the best solution in this case.
The text was updated successfully, but these errors were encountered: