Sporadic CMake major rebuilding (+CLHEP error)

The way I usually work is to run aliBuild once, then cd into the build tree and then simply enter a typical development loop : edit code; ninja && ctest; edit code; ninja …

Usually ninja (and the cmake it reruns only when needed) takes a fraction of time (because each code edit phase is focused on a very limited number of files, most often only one, so the build only deals with a handful of files) and all is good.

But sometimes the rebuild is jumping to rebuild hundred of files, for no apparent reason (well, there must be a reason, but so far I failed to identify it). What’s worse, in those cases the build fails with :

ld: warning: directory not found for option ‘-L/lib’
ld: warning: directory not found for option ‘-L/lib’
ld: library not found for -lG4clhep

and then my way out is to scratch the build tree and start again, which is of course very disrupting.

Has anyone else experience such issue ? Any idea what the cause might be ?

I’ve observed this on macOS for sure, not quite remember if it ever happened on CentOS (which is not my go-to dev platform).

Thanks, and sorry for what I realize is a very vague bug report…

I have also seen this issue (only on macOS).

Sometimes compilation fails with a -lG4clhep not found by ld. Did’n save the log .
By the way, I am on Linux (Debian 9).

I have never seen that which would indicate that it is a problem related to the components disabled in o2-dataflow.

For the sake of completeness, I just got the error again when running

cd ~/alice/sw/BUILD/O2-latest/O2
alienv setenv GCC-Toolchain/latest -c make install -j4

Here’s the relevant part of the log:

..../lib/gcc/x86_64-unknown-linux-gnu/7.3.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lG4clhep
collect2: error: ld returned 1 exit status
Detectors/gconfig/CMakeFiles/O2lib-SimSetup.dir/build.make:244: recipe for target 'stage/lib/libO2SimSetup.so' failed
make[2]: *** [stage/lib/libO2SimSetup.so] Error 1
CMakeFiles/Makefile2:21179: recipe for target 'Detectors/gconfig/CMakeFiles/O2lib-SimSetup.dir/all' failed
make[1]: *** [Detectors/gconfig/CMakeFiles/O2lib-SimSetup.dir/all] Error 2

aliBuild solved the problem.

Thanks for the confirmation that there is a genuine issue, and that’s it located somewhere in the packages not in o2-dataflow.

Will investigate…

Since a few weeks this has error has been the standard on my laptop after pulling dev branch or after a git checkout on a different branch. Deleting GEANT4 build and rebuilding with AliBuild solves the problem temporarily.

@laphecet, any ideia of what’s causing this? Not a big deal, though.

Hi Rafael,

No idea for the moment. Unfortunately I’ve not investigated yet (as I have been developing lately under o2-dataflow where the issue is not present :wink: )
But it’s not forgotten.

Hi there,

No news on this front, except I’ve created a JIRA ticket (O2-1044) so it does not get completely forgotten :wink: