Root 6.16.00 installation problem in ubantu 18.04

i am trying to install root 6.16.00 on my core i3 machine with 2GB ram and 500GB space. i built all prerequisites required but i m facing the following error when i use cmake --build . --j2 command

[ 54%] Copying /home/wajahat/Products/root-6.16.00/macros/Dialogs.C
[ 54%] Built target move_artifacts
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2 ~~~
plz help me i m biggener on ubantu so kindly tell me brief command syntax 
. thanks in advance

BTW. With only 2GB RAM, you should always use “-j 1”.

i increase the ram now 4GB but now the problem shown is as under [ 72%] Linking CXX shared library …/…/…/lib/libCling.so
…/…/interpreter/llvm/src/lib/libLLVMPasses.a: error adding symbols: Archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status
core/rootcling_stage1/CMakeFiles/rootcling_stage1.dir/build.make:223: recipe for target ‘core/rootcling_stage1/src/rootcling_stage1’ failed
make[2]: *** [core/rootcling_stage1/src/rootcling_stage1] Error 1
CMakeFiles/Makefile2:19072: recipe for target ‘core/rootcling_stage1/CMakeFiles/rootcling_stage1.dir/all’ failed
make[1]: *** [core/rootcling_stage1/CMakeFiles/rootcling_stage1.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
…/…/…/interpreter/llvm/src/lib/libLLVMPasses.a: error adding symbols: Archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status
core/metacling/src/CMakeFiles/Cling.dir/build.make:211: recipe for target ‘lib/libCling.so’ failed
make[2]: *** [lib/libCling.so] Error 1
CMakeFiles/Makefile2:17668: recipe for target ‘core/metacling/src/CMakeFiles/Cling.dir/all’ failed
make[1]: *** [core/metacling/src/CMakeFiles/Cling.dir/all] Error 2
Makefile:151: recipe for target ‘all’ failed
make: *** [all] Error 2

is this still memory problem plz suggest me what should i do?