Error in compiling subroutines - Code Saturne 5.2

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
JeremyA
Posts: 31
Joined: Fri Jul 26, 2019 10:33 am

Error in compiling subroutines - Code Saturne 5.2

Post by JeremyA »

Hello,

In order to learn how to use subroutines in Code_Saturne, I am doing Full Domain tutorial (case2)
However I have an error message when I try to run calculation in Code_Saturne
Here's the message obtained with code_saturne compile :

The version of Code_Saturne is Code_Saturne 5.2 from Salome_CFD (Development version)

Thank you for your help

gfortran -o cs_f_user_boundary_conditions.o -I /home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/include/code_saturne -x f95-cpp-input -Wall -pedantic-errors -std=f2003 -fopenmp -O -c /home/jarancio/Simulations_CodeSaturne/fulldomain/case2/SRC/cs_user_boundary_conditions.f90
Traceback (most recent call last):
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/bin/code_saturne", line 76, in <module>
retcode = cs.execute()
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_script.py", line 91, in execute
return self.commands[command](options)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_script.py", line 138, in compile
return cs_compile.main(options, self.package)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 643, in main
keep_going=keep_going)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 608, in compile_and_link
stderr=stderr)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 569, in compile_and_link
keep_going, stdout, stderr)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 431, in compile_src
stdout=stdout, stderr=stderr) != 0:
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_exec_environment.py", line 536, in run_command
p = subprocess.Popen(cmd, universal_newlines=True, env = env, **kwargs)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/prerequisites/Python-2710/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/prerequisites/Python-2710/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Attachments
setup.xml
(13.21 KiB) Downloaded 163 times
compile.log
(354 Bytes) Downloaded 175 times
cs_user_boundary_conditions.f90
(20.97 KiB) Downloaded 166 times
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in compiling subroutines - Code Saturne 5.2

Post by Yvan Fournier »

Hello,

Is gfortran installed on your machine ?

Best regards,

Yvan
JeremyA
Posts: 31
Joined: Fri Jul 26, 2019 10:33 am

Re: Error in compiling subroutines - Code Saturne 5.2

Post by JeremyA »

It wasn't
I have just installed it with apt-get install gfortran-8
However I have got the same error message when I run calculation

Regards
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in compiling subroutines - Code Saturne 5.2

Post by Yvan Fournier »

Hello,

do you have a "gfortran" executable or only "gfortran8" ? This may depend on your distribution.

Could you post your new compile.log ? You might have a similar but slightly different issue if some other tool is missing.

Best regards,

Yvan
JeremyA
Posts: 31
Joined: Fri Jul 26, 2019 10:33 am

Re: Error in compiling subroutines - Code Saturne 5.2

Post by JeremyA »

I downloaded only gfortran8

Here's the new compile.log

Regards

gfortran -o cs_f_user_boundary_conditions.o -I /home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/include/code_saturne -x f95-cpp-input -Wall -pedantic-errors -std=f2003 -fopenmp -O -c /home/jarancio/Simulations_CodeSaturne/fulldomain/case2/SRC/cs_user_boundary_conditions.f90
Traceback (most recent call last):
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/bin/code_saturne", line 76, in <module>
retcode = cs.execute()
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_script.py", line 91, in execute
return self.commands[command](options)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_script.py", line 138, in compile
return cs_compile.main(options, self.package)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 643, in main
keep_going=keep_going)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 608, in compile_and_link
stderr=stderr)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 569, in compile_and_link
keep_going, stdout, stderr)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_compile.py", line 431, in compile_src
stdout=stdout, stderr=stderr) != 0:
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_exec_environment.py", line 536, in run_command
p = subprocess.Popen(cmd, universal_newlines=True, env = env, **kwargs)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/prerequisites/Python-2710/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/prerequisites/Python-2710/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in compiling subroutines - Code Saturne 5.2

Post by Yvan Fournier »

Again: does the "gfortran" command work on your machine now ?

Regards,
JeremyA
Posts: 31
Joined: Fri Jul 26, 2019 10:33 am

Re: Error in compiling subroutines - Code Saturne 5.2

Post by JeremyA »

Hello Yvan,

gfortran command works on my machine
Here's a test :

jarancio@arancio:~/Bureau$ ls
boarding-pass.pdf 'Reprenez le contrôle avec Linux'
hello.f90 Salome-CFD_SCFD_V8_5_0.desktop
jarancio@arancio:~/Bureau$ gfortran-8 hello.f90 -o hello
jarancio@arancio:~/Bureau$ ls
boarding-pass.pdf 'Reprenez le contrôle avec Linux'
hello Salome-CFD_SCFD_V8_5_0.desktop
hello.f90

Best regards

Jérémy
Attachments
hello.f90
(56 Bytes) Downloaded 168 times
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in compiling subroutines - Code Saturne 5.2

Post by Yvan Fournier »

Hello,

Could you also check if gfortran works when run under "salome shell" ?

If it is not related, we would need to modify a salome_cfd file to instrument it, but starting with the simplest test first may be better...

Best regards,

Yvan
JeremyA
Posts: 31
Joined: Fri Jul 26, 2019 10:33 am

Re: Error in compiling subroutines - Code Saturne 5.2

Post by JeremyA »

Yes it works too :

[NS=no_host:no_port]$ gfortran-8 hello.f90 -o hello
[NS=no_host:no_port]$ ls
boarding-pass.pdf hello hello.f90 'Reprenez le contrôle avec Linux' Salome-CFD_SCFD_V8_5_0.desktop


Jérémy
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in compiling subroutines - Code Saturne 5.2

Post by Yvan Fournier »

Hello,

A further test would be to edit "/home/jarancio/salome-cfd/Salome_CFD-SCFD_V8_5_0-Code_Saturne-5_2-univ_d54f597c/modules/CFDSTUDY_v52/lib/python2.7/site-packages/code_saturne/cs_exec_environment.py",
line 536, replacing:

Code: Select all

        p = subprocess.Popen(cmd, universal_newlines=True, env = env, **kwargs)
with:

Code: Select all

        print(cmd)
        p = subprocess.Popen(cmd, universal_newlines=True, env = env, **kwargs)
(i.e. inserting a print command) to check which exact command causes the issue.

Best regards,

Yvan
Post Reply