I have one huge C file. Within the file, there is a giant struct (~>1million lines). Is there a way to parallel compile this file using additional cores?
Edit: Sorry, after reviewing my code and my question, the actual giant thing is not “struct”, rather, it’s the struct array…
If it is the struct definition that is over 1 million lines, then you’re probably out of luck.
But if you’re declaring a struct variable that is an array of that struct type that is many lines (or not an array but just a very big struct) then I would suggest placing the variable declaration in a separate .c file by itself and using the extern keyword in any other c file that needs to access it. That way it will only need to be re-compiled when it changes.
For example if you had the following:
Then I would change it to the following:
and
and