FORTRAN runtime error: Cannot write to file opened for READ

722 views
Skip to first unread message

Ahmad Osama

unread,
Mar 6, 2021, 12:53:30 PM3/6/21
to Nek5000
Hello all,

I am having this weird issue which I did not encounter before. I have tried installing NEK5000 on multiple devices, and was successful. However, in my latest attempts, I get this error when trying to run the eddy_uv example:
Fortran runtime error: Cannot write to file opened for READ

I am confused because I was following the exact steps I used previously in other computers. And I could not identify what the problem is.
When trying running makenek, I get the following error:
using source path: /home/user_name/Nek5000
cat: .tmp: No such file or directory
cat: .tmp: No such file or directory
cat: .tmp: No such file or directory
ERROR: Cannot find a supported compiler!

Although gfortran is already installed! 
Anyone has a clue of what is going on? 
PS: I am using Windows Subsystem for Linux 
Thank you.

YuHsiang Lan

unread,
Mar 7, 2021, 10:42:03 PM3/7/21
to Nek5000
Hi,

I'm not familiar to Windows Subsystem for Linux, but it seems that this happpens when it tried to detect the compiler.

When FC=mpif77, the following line inside Nek5000/core/makenek.inc should print the output of "mpif77 -showme" into a temperal file ".tmp"
FCcomp_=`$FC -showme 2>/dev/null | head -1 2>/dev/null 1>.tmp || true`

Even if you don't have the right compiler, an empty .tmp file should be there.
So, maybe this is related to some write permission in your filesystem?

Hope this helps,
Yu-Hsiang
--

Ahmad Osama

unread,
Mar 8, 2021, 4:41:10 AM3/8/21
to Nek5000
Thanks to anyone who replied!
And apparently it is a permission issue (exactly as YuHsiang Lan said). I only changed the permissions and allowed all users to perform operations on NEK5000 folder and the issue got fixed. The issue however was not related to the packages because I am sure that I have them all.

Thanks again.

‫في الاثنين، 8 مارس 2021 في 6:42 ص تمت كتابة ما يلي بواسطة ‪YuHsiang Lan‬‏ <‪seanl...@gmail.com‬‏>:‬
--
You received this message because you are subscribed to a topic in the Google Groups "Nek5000" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nek5000/pBhI7B6AOWA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nek5000+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nek5000/9ff0ad50-63d4-46ca-b492-37737409ecfbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages