make: *** [Makefile:156: all] Error 2

I did this command make -j8 until 97% of the installation, I got this Error:

make[2]: *** [source/persistency/CMakeFiles/G4persistency.dir/build.make:398: source/persistency/CMakeFiles/G4persistency.dir/ascii/src/G4tgrEvaluator.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4310: source/persistency/CMakeFiles/G4persistency.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Do you have any idea how to fixe this error ?

More context is needed. What shows up with a plain make (no parallelism). Note that parallel make will stop scheduling jobs when it detects an error, so there can be as many as N-1 outputs before the error message at the very bottom.

so what I should do now

Just run make and get the error from the compiler itself (make is just reporting that something failed when building the G4persistency target and is not very useful otherwise).

Maybe I can make Ben’s answer more clear.

The messages you pasted into your question are not the error messages that tell you why the build failed. They are just messages from make telling you about the fact that some build command failed, for some reason.

To know which command failed and why (the reason), you have to look at the output BEFORE these messages and find the error messages that were generated by the command that failed (in this case, the compiler). The compiler will tell you what was wrong. Then you fix that thing, and re-run the build.

If you didn’t save all the output of the previous build, you can re-run the build which will re-run the compiler which will fail again and then you can see the compiler error messages.

Make is just a simple tool that runs other commands (like the compiler) in a specific order. It’s the other commands that actually do the work of building your code into a program and so it’s the output from the other commands that will show you what is wrong with your code.

1 Like