Skip to content

Add compilers to conda environment#28352

Merged
tacaswell merged 2 commits into
matplotlib:mainfrom
QuLogic:cf-compiler
Mar 18, 2025
Merged

Add compilers to conda environment#28352
tacaswell merged 2 commits into
matplotlib:mainfrom
QuLogic:cf-compiler

Conversation

@QuLogic

@QuLogic QuLogic commented Jun 6, 2024

Copy link
Copy Markdown
Member

PR summary

This fixes issues with libstdc++.so when using a system with a newer compiler. In such cases, the compiler will create links to new symbols, but the shared library available at runtime from conda-forge will not have them available.

This results in errors such as:

ImportError: /home/elliott/micromamba/envs/mpl-dev/bin/../lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /home/elliott/code/matplotlib/build/cp39/src/_c_internal_utils.cpython-39-x86_64-linux-gnu.so)

I'm fairly certain we have seen similar issues here or on Gitter, but am not aware of one at the moment.

@jakirkham also suggested adding python even if we don't pin it just to be explicit.

PR checklist

@tacaswell tacaswell added this to the v3.10.0 milestone Jun 7, 2024
Comment thread environment.yml Outdated
@tacaswell

Copy link
Copy Markdown
Member

Anyone can merge when green.

@jakirkham

jakirkham commented Jun 10, 2024

Copy link
Copy Markdown

Are CodeCov or AppVeyor relevant here? Mentioning as those appear to be the only failures

@tacaswell

Copy link
Copy Markdown
Member

Unfortunately, yes. We use the environment file on appveyor

@jakirkham

jakirkham commented Jun 11, 2024

Copy link
Copy Markdown

The error on AppVeyor suggests the compiler is not on the path

..\..\meson.build:1:0: ERROR: Unknown compiler(s): [['cl.exe']]
  The following exception(s) were encountered:
  Running `cl.exe /?` gave "[WinError 2] The system cannot find the file specified"

Edit: When we used AppVeyor in conda-forge in the past, we would typically add a line like this to activate the compiler. Am not seeing that line in the AppVeyor configuration file in this repo, but maybe I'm missing it?

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

@QuLogic

QuLogic commented Jun 12, 2024

Copy link
Copy Markdown
Member Author

Originally, we told Meson to enable the MSVC environment automatically; this was because AppVeyor had Strawberry Perl with its totally broken compilers on the path first. It seems that adding compilers from conda-forge causes MSVC to be hidden entirely, but that's sort of what we want anyway.

I'll remove the --vsenv flag so that AppVeyor uses the conda compilers. We test MSVC on Azure, so we aren't losing anything by that change.

This fixes issues with `libstdc++.so` when using a system with a newer
compiler. In such cases, the compiler will create links to new symbols,
but the shared library available at runtime from conda-forge will not
have them available.

This results in errors such as:
```
ImportError: /home/elliott/micromamba/envs/mpl-dev/bin/../lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /home/elliott/code/matplotlib/build/cp39/src/_c_internal_utils.cpython-39-x86_64-linux-gnu.so)
```
@jakirkham

Copy link
Copy Markdown

FWIW we now have pikepdf in conda-forge (think we were just missing Windows before)

- pikepdf

xref: conda-forge/pikepdf-feedstock#119

@dstansby

Copy link
Copy Markdown
Member

All seems to be working now - just in case I'm missing something I'll let this sit for a few days, but if no-one objects after that I'll merge.

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

Successfully merging this pull request may close these issues.

6 participants