mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-08-24 14:11:44 +02:00
Fix pip install from sdist tarball
This commit is contained in:
parent
472671190c
commit
ec9c234add
@ -4,6 +4,7 @@ include examples/notebooks/*
|
||||
include examples/README.md
|
||||
include requirements.txt tools/set_NUMPY_INCLUDEDIR.sh
|
||||
include test/benzene_data.py
|
||||
include test/conftest.py
|
||||
|
||||
exclude examples/LICENSE
|
||||
exclude examples/requirements.txt
|
||||
|
@ -96,30 +96,33 @@ if h5_present:
|
||||
|
||||
# Define pytrexio extension module based on TREXIO source codes + SWIG-generated wrapper
|
||||
c_files.append('pytrexio_wrap.c')
|
||||
compile_args = [
|
||||
'-std=c99',
|
||||
'-Wno-discarded-qualifiers',
|
||||
'-Wno-unused-variable',
|
||||
'-Wno-unused-but-set-variable'
|
||||
]
|
||||
# if config.h is present then we are building via Autotools
|
||||
if os.path.isfile(os.path.join(srcpath, "config.h")):
|
||||
compile_args.append('-DHAVE_CONFIG_H')
|
||||
# explicit hack needed when building from sdist tarball
|
||||
if h5_present:
|
||||
compile_args.append('-DHAVE_HDF5')
|
||||
|
||||
# define C extension module
|
||||
if h5_present:
|
||||
pytrexio_module = Extension('pytrexio._pytrexio',
|
||||
sources = [os.path.join(srcpath, code) for code in c_files],
|
||||
include_dirs = [h5_cflags, srcpath, numpy_includedir],
|
||||
libraries = ['hdf5' ],
|
||||
extra_compile_args = [
|
||||
'-std=c99',
|
||||
'-Wno-discarded-qualifiers',
|
||||
'-Wno-unused-variable',
|
||||
'-Wno-unused-but-set-variable'
|
||||
],
|
||||
extra_compile_args = compile_args,
|
||||
extra_link_args = [h5_ldflags]
|
||||
)
|
||||
else:
|
||||
pytrexio_module = Extension('pytrexio._pytrexio',
|
||||
sources = [os.path.join(srcpath, code) for code in c_files],
|
||||
include_dirs = [srcpath, numpy_includedir],
|
||||
extra_compile_args = [
|
||||
'-std=c99',
|
||||
'-Wno-discarded-qualifiers',
|
||||
'-Wno-unused-variable',
|
||||
'-Wno-unused-but-set-variable'
|
||||
]
|
||||
extra_compile_args = compile_args
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user