LutzGross/esys-escript.github.io

Cannot find some headers

Opened this issue · 2 comments

bbhtt commented

I'm trying to update the flatpak package of this, but the build fails with Cannot find python library method Py_Exit. Any idea which library/dependency provides this function?

I modified this to python3.10:

https://github.com/esys-escript/esys-escript.github.io/blob/d036cf126c65d9ee799b54e476296ed7b06bf953/scons/flatpak_options.py#L37

scons: Reading SConscript files ...
3.10.11 (main, Jul 19 2023, 08:34:57) [GCC 12.2.0]
Using options in scons/flatpak_options.py.
Got git revision  1658965877
Checking whether the C++ compiler works... yes
Checking for C++ function gethostname()... yes
Checking for C++ header file byteswap.h... yes
Checking for C++ function SCbswap32()... yes
Checking for C++ header file sys/endian.h... no
Checking for C++ header file libkern/OSByteOrder.h... no
Checking for working complex std::acos()... yes
Checking for C++ header file Python.h... yes
Checking for C++ function Py_Exit()... no
Cannot find python library method Py_Exit (tried b'' in directory /app/lib)
Error: module escript: Child process exited with code 1
bbhtt commented

Looks like it is defined here https://github.com/python/cpython/blob/832c37d42a395d4ea45994daffa5e41bd74ac1bb/Include/pylifecycle.h#L30

But that header is included in the package. Any idea why it can't find it?

bbhtt commented

Ok this seems to fixed by adding a pythonlibname='python3.10'

But now it can't find some headers again even though they are installed:

Checking for C++ header file numpy/ndarrayobject.h... no
Checking for C++ library netcdf_c++4... no
RuntimeError: Unable to link against ['netcdf_c++4'] (paths: /app/include, /app/lib):
  File "/run/build/escript/SConstruct", line 593:
    env=checkOptionalLibraries(env)
  File "/run/build/escript/site_scons/dependencies.py", line 613:
    netcdf_inc_path,netcdf_lib_path=findLibWithHeader(env, env['netcdf_libs'], 'ncVar.h', env['netcdf_prefix'], lang='c++')
  File "/run/build/escript/site_scons/site_init.py", line 84:
    raise RuntimeError('Unable to link against %s (paths: %s, %s)'%(libs,inc_path,lib_path))
Error: module escript: Child process exited with code 2

1st issue is numpy/ndarrayobject.h this is in /app/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h. My guess is that it is looking in the wrong place?

2nd issue is ncVar.h which is in /app/include/ncVar.h not sure why it can't find it?. Try setting the netcdf_libs variable, didn't work.