Closed MatthieuSchaller closed 3 months ago
Hmm, I suspect that the compiler isn't respecting #pragma once
(which, admittedly, is non-standard). Interestingly, the Intel 2024.1 compiler that I have locally seems to compile Corrfunc fine. Might be worth trying to downgrade as a debugging step, if it's easy.
We're using #pragma once
in 25 files. Maybe you could try changing the one in utils/cellarray_float.h.src
to a traditional include guard to see if that changes anything? Then we can change the rest if it does.
Thanks @MatthieuSchaller for reporting the issue.
Yeah this seems like a compiler issue rather than a code issue. If this is a double-include case (which seems likely), then Lehman's suggestion might be sufficient to fix the underlying issue.
If not a double-include situation, then one option to try could be to coalesce the typedef declaration with the definition that follows - something like
typedef struct
{
....
} cellarray_DOUBLE;
Related: I don't understand the "linker" warnings (about the -Wl,-rpath ...
) from the compiler - the linker should not be involved at all since this is a compile-only stage.
I'll try those. The llvm-based "oneAPI" is the new intel compiler replacing the regular icc
pretty much everywhere.
I wonder whether enforcing -std=c99
is possibly the issue here since the pragmas and the duplicate definitions are extensions to that standard.
Mmmh. Ok, identify the issue.
It looks like somehow the auto-generated files (like cellarray_float.h
and some in mocks
) have received their content twice. That then trips up the compiler. I am not sure how that happened... Maybe trying different branches broke things?
Clearing all these files and starting from scratch worked smoothly. This can be closed.
Glad it's working! That explains why the line numbers were weird in the error message, I guess. (Did you try make -j
at any point? I wonder if that could have caused something like this...)
I am definitely guilty of overusing make -j
...
Ahh yes - the Corrfunc Makefiles do not function in parallel. And yes make -j
produces all kinds of fun compilation errors :)
General information
(I use this branch since I only have numpy 2 on this system)
Issue description
I am compiling with "Intel(R) oneAPI DPC++/C++ Compiler 2024.2.0 (2024.2.0.20240602)" and the compilation fails with C version errors: