Su root can install while sudo make can not
Posted: September 28 2018
When I compile CosmoMC, to run 'make', there's errors because the file can not be write by a normal user, so I run 'sudo make'. But it's still wrong, here is the error message:
And then I run 'su root' to get into root mode, and run make, the it works, but obviously the instruction 'mpirun -np ...' doesn't suggest to run this command in root mode, so I need to 'make' as a normal user, which means I still need to sudo make again which went wrong before. I really have no idea how to solve it.
Code: Select all
mkdir -p ReleaseMPI cd ../camb && \ make --file=Makefile_main libcamb OUTPUT_DIR=ReleaseMPI \ RECOMBINATION=recfast EQUATIONS=equations_ppf NONLINEAR=halofit_ppf make: Entering directory '/home/hossein/Soft/works/CosmoMC/camb' mkdir -p ReleaseMPI mpif90 -cpp -O3 -ffast-math -ffree-line-length-none -fopenmp -fmax-errors=4 -march=native -DMPI -JReleaseMPI -IReleaseMPI/ -c constants.f90 -o ReleaseMPI/constants.o make: mpif90: Command not found Makefile_main:136: recipe for target 'ReleaseMPI/constants.o' failed make: *** [ReleaseMPI/constants.o] Error 127 make: Leaving directory '/home/hossein/Soft/works/CosmoMC/camb' Makefile:321: recipe for target 'camb' failed make: *** [camb] Error 2