csdms / babelizer

Transform BMI-wrapped models into Python packages
https://babelizer.readthedocs.io
MIT License
4 stars 3 forks source link

Error compiling C/C++/Fortran projects with Python 3.8 on Linux #73

Closed mcflugen closed 8 months ago

mcflugen commented 2 years ago

We get the following error when compiling a C, C++, or Fortran babelized project with Python 3.8 on Linux,

/usr/share/miniconda/envs/test/compiler_compat/ld: cannot find /lib64/libpthread.so.0
/usr/share/miniconda/envs/test/compiler_compat/ld: cannot find /usr/lib64/libpthread_nonshared.a

As described on StackOverflow, this is a result of our babelized projects specifying a build-system in pyproject.toml. The requirements listed in the build-system section are installed from PyPI with pip but, unfortunately, these requirements are incompatible with the conda compilers.

mcflugen commented 2 years ago

72 fixes this issue in our continuous integration tests. The fix is to first install the build-system with conda and then pip-install the project. That is,

$ mamba install cython numpy setuptools wheel

and then when installing the babelized project,

$ pip install -e . --no-build-isolation
mdpiper commented 8 months ago

Closing with https://github.com/csdms/babelizer/commit/c3c567498735e51f73a4045f2b33e79aa5e85b4b and with #90.