Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Compilation failed with Ubuntu 24.04

Compilation failed with Ubuntu 24.04 6 months 1 day ago #46036

Hello,
Currently I am using the following system:
Ubuntu: 24.04
python: 3.12.3
numpy: 1.26.4
meson: 1.6.1

Referring to similar problems due to f2py on the forum and GitLab, I tried Telemac V9.0 which should solve this problem. But it still did not succeed in compiling, and it report:
Building the Python API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~> Wrap_api built
~> Generating the API Python wrapper
~> First part of F2PY passed
Traceback (most recent call last):
File "/home/ed/Telemac/v9.0/scripts/python3/compilation/compil_tools.py", line 993, in compile_api_f2py
output = check_output(cmd, shell=True, stderr=STDOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'f2py --quiet -c /home/ed/Telemac/v9.0/builds/gfortranHPC/wrap_api/lib/api.pyf --opt="" -I/home/ed/Telemac/v9.0/builds/gfortranHPC/wrap_api/include -L/home/ed/Telemac/v9.0/builds/gfortranHPC/wrap_api/lib -lapi -ltelemac3d4api -ltelemac2d4api -lgaia4api -lnestor4api -ltomawac4api -lartemis4api -lkhione4api -lwaqtel4api -lgretel4api -lpartel4api -lbief4api -lparallel4api -lhermes4api -ldamocles4api -lspecial4api -lmascaret -L$MUMPSHOME -ldmumps -lmumps_common -lpord -L$BLASHOME -lopenblas -lblas -L$SCALAPACKHOME -lscalapack-openmpi -L$HDF5HOME/lib -lhdf5 -ldl -lstdc++ -lz -L$MEDHOME/lib -lmed -L$METISHOME/lib -lmetis -L$MPIHOME/lib -lmpi_mpifh -lmpi --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 "/home/ed/Telemac/v9.0/scripts/python3/compile_telemac.py", line 138, in <module>
sys.exit(main())
^^^^^^
File "/home/ed/Telemac/v9.0/scripts/python3/compile_telemac.py", line 130, in main
compile_api_files(silent=not options.verbose,
File "/home/ed/Telemac/v9.0/scripts/python3/compilation/compil_tools.py", line 1047, in compile_api_files
compile_api_f2py('api', api_dir, source_api, skip_source, ld_flags,
File "/home/ed/Telemac/v9.0/scripts/python3/compilation/compil_tools.py", line 995, in compile_api_f2py
raise TelemacException(\
utils.exceptions.TelemacException: Error during the second part of F2PY: 1
Cannot use distutils backend with Python>=3.12, using meson backend instead.
Ignoring -m untitled.
/home/ed/Telemac/v9.0/builds/gfortranHPC/wrap_api/lib/api.pyf defines _api to be the modulename.
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '40'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '200'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '40'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '200'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '40'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '200'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '40'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '200'}, 'attrspec': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '32'}, 'attrspec': [], 'dimension': }
getstrlength:intent(hide): expected a string with defined length but got: {'typespec': 'character', 'charselector': {'*': '(*)'}, 'attrspec': [], 'intent': }
getstrlength:intent(hide): expected a string with defined length but got: {'typespec': 'character', 'charselector': {'*': '(*)'}, 'attrspec': [], 'intent': }
getstrlength:intent(hide): expected a string with defined length but got: {'typespec': 'character', 'charselector': {'*': '(*)'}, 'attrspec': [], 'intent': }
getstrlength:intent(hide): expected a string with defined length but got: {'typespec': 'character', 'charselector': {'*': '(*)'}, 'attrspec': [], 'intent': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '40'}, 'attrspec': [], 'intent': , 'dimension': }
getstrlength: expected a signature of a string but got: {'typespec': 'character', 'charselector': {'len': '200'}, 'attrspec': [], 'intent': , 'dimension': }
The Meson build system
Version: 1.6.1
Source dir: /home/ed/Telemac/v9.0/builds/gfortranHPC/wrap_api/lib/tmp_f2py
Build dir: /home/ed/Telemac/v9.0/builds/gfortranHPC/wrap_api/lib/tmp_f2py/bbdir
Build type: native build

meson.build:57:0: ERROR: Assignment target must be an id.
scalapack-openmpi = declare_dependency(link_args : )
^

A full log can be found at /home/ed/Telemac/v9.0/builds/gfortranHPC/wrap_api/lib/tmp_f2py/bbdir/meson-logs/meson-log.txt
Traceback (most recent call last):
File "/home/ed/.local/bin/f2py", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/ed/.local/share/pipx/venvs/numpy/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 781, in main
run_compile()
File "/home/ed/.local/share/pipx/venvs/numpy/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 753, in run_compile
builder.compile()
File "/home/ed/.local/share/pipx/venvs/numpy/lib/python3.12/site-packages/numpy/f2py/_backends/_meson.py", line 192, in compile
self.run_meson(self.build_dir)
File "/home/ed/.local/share/pipx/venvs/numpy/lib/python3.12/site-packages/numpy/f2py/_backends/_meson.py", line 185, in run_meson
self._run_subprocess_command(setup_command, build_dir)
File "/home/ed/.local/share/pipx/venvs/numpy/lib/python3.12/site-packages/numpy/f2py/_backends/_meson.py", line 181, in _run_subprocess_command
subprocess.run(command, cwd=cwd, check=True)
File "/usr/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '' returned non-zero exit status 1.

I also tried the compil_tools.py on
otm/telemac-mascaret#946
Yet it raised similar error.

You may find in the attachment the systel.cfg

File Attachment:

File Name: systel.cfg
File Size: 2 KB
I used.

Thanks!
Edouard
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 6 months 14 hours ago #46038

B) Hello friends,

I have been testing on this issue and finally found the solution. The version v9.0 is fine and it is all because the systel parameters.

The old systel.cfg has been used from v8p3 to v8p5 and it was fine.

Under the new version of numpy and python, the following lines should be modified:
f2py_name:     f2py3 ⟶ f2py_name:     f2py
-L$SCALAPACKHOME -lscalapack-openmpi ⟶ -L$SCALAPACKHOME -Lscalapack-openmpi
-L$HDF5HOME/lib -lhdf5 -ldl -lstdc++ -lz ⟶ -L$HDF5HOME/lib -lhdf5 -ldl -Lstdc++ -lz

Then the API compilation should pass.

Regards,

Edouard
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 3 months 2 weeks ago #46460

Hi,
There are some corrections regarding the linkage of libraries:
It is needed to keep the -l in lower case. The real reason is that the new compiler cannot recognize like - or + in the name of library, and one may use soft links to change another name. For example. I used _ and plus for replacement.
Regard,
Edouard
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 3 months 3 weeks ago #46408

Hi, I am having similar issues when building python api.
Te meson version you mention, comes with numpy or you installed it apart?

Thank you
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 3 months 2 weeks ago #46459

Hi,
I don't remember in fact, but I didn't choose the version of meson intentionally. So it should be the one that was recommended at the time.
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 1 month 3 days ago #46671

  • phmusiedlak
  • phmusiedlak's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 28
  • Thank you received: 5
Hello,

I am facing the same problem here - with the same configuration
- WSL Ubuntu 24
- python 3.12.3
- numpy : 1.26.4 (the one from the apt repo : apt-get install python3-numpy)
- meson: no idea ?

I am relativelly convinced this error comes from numpy as :
numpy.org/doc/1.26/user/building.html

So far changing "f2py3" to "f2py" in sysetl.cfg did not solved the error.

I thought of downgrading numpy to a lower version - TELEMAC used to work on my previous machine with numpy 1.21.5 - but I did not find how to install this version using apt-get (I wanted to avoid setting up a virtual environment that seems require to use pip install numpy).

I also get the same error when using a virtual environment where numpy 2.2.6 is running.

And so far I can't setup an environment with numpy 1.21.5 (or lower) with Python version 12.3 because:
installing with pip
> "1.21.5 Requires-Python >=3.7,<3.11"



Any help would be appreciated

Thanks

Pierre-Henri
Attachments:
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 1 month 3 days ago #46672

Hi, I installed meson with this:

sudo apt install meson ninja-build

Hope it helps

Esteban
The administrator has disabled public write access.
The following user(s) said Thank You: phmusiedlak

Compilation failed with Ubuntu 24.04 4 weeks 1 day ago #46674

  • phmusiedlak
  • phmusiedlak's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 28
  • Thank you received: 5
:D perfect thanks
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 3 weeks 6 days ago #46680

  • phmusiedlak
  • phmusiedlak's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 28
  • Thank you received: 5
Troubles are not finished :|

- fails to run in parallel due to (I think) the reconstruct. Following is the log file of the examples/telemac2d/dragforce case using 4 procs:

--> see error file

and indeed there is only a single RES file: T2DRES (not one per proc used)

However I can reconstruct my case after:
telemac2d.py --merge -w t2d_dragforce.cas_2025-06-12-11h01min50s/ t2d_dragforce.cas

gretel seems compiled in my builds/gofortranHPC/bin

... any ideas ?

(.cfg file was uploaded in previous post)


Pierre-Henri
Attachments:
The administrator has disabled public write access.

Compilation failed with Ubuntu 24.04 3 weeks 6 days ago #46681

  • phmusiedlak
  • phmusiedlak's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 28
  • Thank you received: 5
Just in case I attached the log obtained by:
compile_telemac.py --clean &> log_compile_telemac_gfortranHPC.out

there is some WARNINGS so I thought it will be good enough (but apparently not)
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: borisb

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