Welcome, Guest
Username: Password: Remember me

TOPIC: Building the python API compiling Error

Building the python API compiling Error 1 year 7 months ago #42291

  • ayyaali
  • ayyaali's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
I got upto compiling until building python API.
Compilation fails after giving the following error

~> Wrap_api built
~> Compiling Modules api
~> First part of f2py for api passed
~> Second part of f2py of api passed
~> Compiling hermes api
~> First part of f2py for hermes passed
Traceback (most recent call last):
File "/mnt/d/TELMAC/openTELEMAC/scripts/python3/compilation/compil_tools.py", line 948, in compile_api_f2py
output = check_output(cmd, shell=True, stderr=STDOUT)
File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'f2py3 --quiet -c /mnt/d/TELMAC/openTELEMAC/builds/gfortranHPC/wrap_api/lib/hermes.pyf --fcompiler=gnu95 --opt="" -I/mnt/d/TELMAC/openTELEMAC/builds/gfortranHPC/wrap_api/include -L/mnt/d/TELMAC/openTELEMAC/builds/gfortranHPC/wrap_api/lib -lhermes4api -lspecial4api -L$METISHOME/lib -lmetis --build-dir tmp_f2py' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/mnt/d/TELMAC/openTELEMAC/scripts/python3/compile_telemac.py", line 142, in <module>
main()
File "/mnt/d/TELMAC/openTELEMAC/scripts/python3/compile_telemac.py", line 134, in main
compile_api_files(silent=not options.verbose,
File "/mnt/d/TELMAC/openTELEMAC/scripts/python3/compilation/compil_tools.py", line 1007, in compile_api_files
compile_api_f2py('hermes', api_dir, source_hermes, '',
File "/mnt/d/TELMAC/openTELEMAC/scripts/python3/compilation/compil_tools.py", line 950, in compile_api_f2py
raise TelemacException(\
utils.exceptions.TelemacException: Error during second part of f2py for hermes 1

Any help to go forward is appreciated.
The administrator has disabled public write access.

Building the python API compiling Error 1 year 7 months ago #42363

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
Hi,

Could you share your configuration file?
The administrator has disabled public write access.

Building the python API compiling Error 1 year 7 months ago #42385

  • ayyaali
  • ayyaali's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi Boris,

Thanks for coming back on this. Attached are the files used. I tried many ways with no luck. Sorry am very new to this kind of trouble shooting. Thanks
Attachments:
The administrator has disabled public write access.

Building the python API compiling Error 1 year 7 months ago #42386

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
Your configuration file is correct, so your problem may be related to F2PY. Could you tell me what is your version of NumPy using the following command:
pip3 list | grep numpy

Could you also try to recompile using the "--verbose" flag, and post the error message here?
The administrator has disabled public write access.

Building the python API compiling Error 1 year 7 months ago #42393

  • ayyaali
  • ayyaali's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Thanks. The command gives the following

numpy 1.22.4
The administrator has disabled public write access.

Building the python API compiling Error 1 year 7 months ago #42394

  • ayyaali
  • ayyaali's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Also I have attached the error with the verbose command
Attachments:
The administrator has disabled public write access.

Building the python API compiling Error 1 year 7 months ago #42395

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
Thanks. The problem comes from a bug in F2PY from NumPy 1.22. Unfortunately, although this bug has been fixed in later versions of NumPy, another one prevents Hermes from working properly.

So for now, the only solution is to stick with NumPy 1.21.6:
pip3 install numpy==1.21.6 --force-reinstall
The administrator has disabled public write access.

Building the python API compiling Error 1 year 7 months ago #42396

  • ayyaali
  • ayyaali's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi Boris,

This change of Numpy worked like a charm. Now its compiled. I wouldnt have a clue if it was something to do with numpy.

Any ways, I wonder change of this numpy would cause any problems with other python codes.?
If I change it back, will TELMAC have issues during runtime? I assume not cause its compiled. I know this is not related to the model, but wanted your expert advice on this.

Many thanks for solving the issue. I will start my test of model now.
The administrator has disabled public write access.
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.