Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find some headers #96

Open
bbhtt opened this issue Jul 19, 2023 · 2 comments
Open

Cannot find some headers #96

bbhtt opened this issue Jul 19, 2023 · 2 comments

Comments

@bbhtt
Copy link

bbhtt commented Jul 19, 2023

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
Copy link
Author

bbhtt commented Jul 20, 2023

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
Copy link
Author

bbhtt commented Jul 20, 2023

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.

@bbhtt bbhtt changed the title Cannot find python library method Py_Exit Cannot find some headers Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant