An error regarding root permission I need to run the code

1,589 views
Skip to first unread message

Haotian Hang

unread,
Jun 17, 2021, 8:55:38 PM6/17/21
to IBAMR Users
Dear Prof.Griffith,
    I've successfully built the code with openmpi. The problem I'm facing is that when I'm running the code, I always need to run as root, or it will show this error message:

./main2d: error while loading shared libraries: libmpi.so.40: cannot open shared object file: No such file or directory

Do you have any advices on why does this happen and how to deal with it? Thank you!

This is no problem if I always run the code using only only core, but when I tried to run the code in parallel using openmpi as root by "mpiexec -np 2 ./main2d input2d", it will show a very scary message to me and prevent me from doing this. 

mpiexec has detected an attempt to run as root.

Running at root is *strongly* discouraged as any mistake (e.g., in

defining TMPDIR) or bug can result in catastrophic damage to the OS

file system, leaving your system in an unusable state.


You can override this protection by adding the --allow-run-as-root

option to your cmd line. However, we reiterate our strong advice

against doing so - please do so at your own risk.


Yours sincerely,
Haotian

Boyce Griffith

unread,
Jun 17, 2021, 9:15:01 PM6/17/21
to ibamr...@googlegroups.com

On Jun 17, 2021, at 8:55 PM, Haotian Hang <haot...@usc.edu> wrote:

Dear Prof.Griffith,
    I've successfully built the code with openmpi. The problem I'm facing is that when I'm running the code, I always need to run as root, or it will show this error message:

./main2d: error while loading shared libraries: libmpi.so.40: cannot open shared object file: No such file or directory

How is OpenMPI installed?

— Boyce

Do you have any advices on why does this happen and how to deal with it? Thank you!

This is no problem if I always run the code using only only core, but when I tried to run the code in parallel using openmpi as root by "mpiexec -np 2 ./main2d input2d", it will show a very scary message to me and prevent me from doing this. 

mpiexec has detected an attempt to run as root.

Running at root is *strongly* discouraged as any mistake (e.g., in

defining TMPDIR) or bug can result in catastrophic damage to the OS

file system, leaving your system in an unusable state.


You can override this protection by adding the --allow-run-as-root

option to your cmd line. However, we reiterate our strong advice

against doing so - please do so at your own risk.


Yours sincerely,
Haotian


--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibamr-users/a020116a-37cd-4216-b018-6259d3946702n%40googlegroups.com.

Haotian Hang

unread,
Jun 17, 2021, 9:51:53 PM6/17/21
to IBAMR Users
Dear Prof.Griffith,
    It is built according to the guidance on your IBAMR website. I was building these things as root. I don't know whether this maybe the problem. Thank you!
Yours sincerely,
Haotian

Boyce Griffith

unread,
Jun 17, 2021, 9:55:26 PM6/17/21
to ibamr...@googlegroups.com
On Jun 17, 2021, at 9:51 PM, Haotian Hang <haot...@usc.edu> wrote:

Dear Prof.Griffith,
    It is built according to the guidance on your IBAMR website. I was building these things as root. I don't know whether this maybe the problem.

Ah — I would suggest not to build these things as root. (Do the IBAMR instructions seem to suggest that you should build as root? Let me know if so — they probably should not do so.)

Alternatively, you may have a package manager that can install these kinds of libraries for you, or you can have PETSc install it for you.

— Boyce

Haotian Hang

unread,
Jun 17, 2021, 10:08:32 PM6/17/21
to IBAMR Users
Dear Prof.Griffith,
    Thank you so much for your advices. In the  instructions, it does not suggest me to do so, but I remembered some times when I'm doing configure, without sudo it does not work. And I just did everything under sudo su. I'll try to use  package manager to do so, and I'd like to ask if you have any suggestion on  package managers (I'm working on a Ubuntu platform)?  Thank you!
Yours sincerely,
Haotian

Boyce Griffith

unread,
Jun 17, 2021, 10:19:08 PM6/17/21
to ibamr...@googlegroups.com
On Jun 17, 2021, at 10:08 PM, Haotian Hang <haot...@usc.edu> wrote:

Dear Prof.Griffith,
    Thank you so much for your advices. In the  instructions, it does not suggest me to do so, but I remembered some times when I'm doing configure, without sudo it does not work. And I just did everything under sudo su.

This can be important if you want to install into /usr/local. However, I would recommend not doing this if you also use a package manager that installs things into /usr/local.

I'll try to use  package manager to do so, and I'd like to ask if you have any suggestion on  package managers (I'm working on a Ubuntu platform)?  Thank you!

On Ubuntu, you may be able to install one of these packages: https://packages.ubuntu.com/search?keywords=openmpi.

Ubuntu may also provide:


(Although, I usually build my own PETSc even if I can get it from a package manager, to have more control over the setup.)

— Boyce

Haotian Hang

unread,
Jun 17, 2021, 10:23:06 PM6/17/21
to IBAMR Users
Dear Prof.Griffith,
    Thank you so much for your help and advices. ActuallyI'm building these under /storage because I don't have enough pace under /usr/local. I will try this again, hopefully it will work. Thank you!
Yours sincerely,
Haotian
Reply all
Reply to author
Forward
0 new messages