Su root can install while sudo make can not

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Zhaoyi Zhou
Posts: 10
Joined: September 22 2018
Affiliation: Shandong University

Su root can install while sudo make can not

Post by Zhaoyi Zhou » 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:

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[1]: 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[1]: mpif90: Command not found
Makefile_main:136: recipe for target 'ReleaseMPI/constants.o' failed
make[1]: *** [ReleaseMPI/constants.o] Error 127
make[1]: Leaving directory '/home/hossein/Soft/works/CosmoMC/camb'
Makefile:321: recipe for target 'camb' failed
make: *** [camb] Error 2
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.

Zhaoyi Zhou
Posts: 10
Joined: September 22 2018
Affiliation: Shandong University

Re: Su root can install while sudo make can not

Post by Zhaoyi Zhou » September 28 2018

Okay, I‘ll solved it by 'su root' to change the right of the file:

Code: Select all

su root
chmod 777 filename

Post Reply