NVFORTRAN-F-0005-Unable to open temporary file - (XXX.f90)

Hi,

I just installed the NVIDIA HPC SDK 21.7 on Window 10 WSL (Ubuntu 20.04.2 LTS). Unfortunately, a problem was encountered when I run a simple Fortran program.

unable_open_temp_file

I have tried to install the SDK in another PC, but the same problem was occurred again.

Please help. Thank you.

Cheers,
Kelvin

1 Like

Hi Kelvin,

By default, the compiler uses “/tmp” store intermediary temp files during compilation. I suspect that this directory doesn’t existing in your WSL environment given the path you show. Though you should be able to work around this by explicitly setting the “TMP” environment variable to a directory that exists and is writable. The compiler will then use this directory for it’s temp files.

Hope this helps,
Mat

Hi Mat,

Thanks for your reply.

I have checked on my PC. The “/tmp” is available in my WSL environment. Also, it seems that the intermediary temp file for nvfortran could access the “/tmp”.

Do you have any hints? Thank you.

Kelvin

Ok, though did you try setting “TMP” to some other directory just in case?

Also, can you post the output from the command “nvfortran -v triangle.f90” so I can see the verbose output?

Hai Mat,

I haven’t to do any setting for “TMP” to specific directory.

The output from the “nvfortran” is as below.
image

By the way, anyone has done the installation of NVHPC successfully in Win 10 WSL?

Thanks.

Kelvin

any solution for this problem yet?

Thanks

Hi Kelvin,

Can you please post the verbose output from the compilation? i.e. add “-v” to the compilation.

I understand that you haven’t set the “TMP” environment variable, I’m asking if you can please try setting TMP to a directory where you know you have read/write permissions?

By the way, what are the permissions on “/tmp”?

By the way, anyone has done the installation of NVHPC successfully in Win 10 WSL?

Note that we don’t officially support WSL2 but I have had reports from users that it works fine for them.

Hi Kelvin,

After some digging, this turns out to be compiler issue due to a recent change on how temp files are formed. Since we don’t officially support WSL2 as of yet, we missed it during our QA process. I’ve added a problem report, TPR #30467, and asked our engineers to investigate.

-Mat

Hi Mat,

Many thanks for your update!

Looking forward to resolve this issue soon.

Best regards,
Kelvin

Engineering took a look and it seems that this issue only occurs on WSL1 not the newer WSL2. Can you try updating to WSL2 and try again?

Hi Mat,

After I updated the WSL from 1 to 2, I can compile a Fortran file successfully !

image

Many thanks!

Kelvin