#65555 closed defect (fixed)

py39-matplotlib is using libstdc++ (this installation is configured to use libc++)

Reported by: RobK88 Owned by: reneeotten (Renee Otten)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: lion Cc: mascguy (Christopher Nielsen)
Port: py-matplotlib

Description (last modified by RobK88)

py39-matplotlib fails on lion (10.7.5).

py39-matplotlib is using libstdc++ (this installation is configured to use libc++)

Why is py39-matplotlib usng libstc++? Macports switched over to libc++ a long time ago!

(Also please see Ticket #65554)

bash-3.2$ sudo port clean py39-matplotlib
--->  Cleaning py39-matplotlib
bash-3.2$ sudo port -v upgrade  py39-matplotlib
--->  Computing dependencies for py39-zopfli.
--->  Fetching distfiles for py39-zopfli
--->  Verifying checksums for py39-zopfli
--->  Checksumming zopfli-0.2.1.zip
--->  Extracting py39-zopfli
--->  Extracting zopfli-0.2.1.zip
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-zopfli/py39-zopfli/work" && /usr/bin/unzip -q '/opt/local/var/macports/distfiles/py-zopfli/zopfli-0.2.1.zip' -d /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-zopfli/py39-zopfli/work 
--->  Configuring py39-zopfli
--->  Building py39-zopfli
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-zopfli/py39-zopfli/work/zopfli-0.2.1" && /opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m build --wheel --no-isolation --outdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-zopfli/py39-zopfli/work 
/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-cpython-39
creating build/lib.macosx-10.7-x86_64-cpython-39/zopfli

etc
etc

--->  Cleaning py39-matplotlib
--->  Removing work directory for py39-matplotlib
--->  Scanning binaries for linking errors
--->  No broken files found.                             
py39-zopfli is using libstdc++ (this installation is configured to use libc++)
py39-matplotlib is using libstdc++ (this installation is configured to use libc++)
--->  Found 2 broken ports, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt:
 py39-zopfli @0.2.1
 py39-matplotlib @3.5.2+cairo+webagg
Continue? [Y/n]:

Change History (15)

comment:1 Changed 20 months ago by RobK88

Description: modified (diff)

comment:2 Changed 20 months ago by RobK88

Summary: py39-matplotlib fails on lion. py39-matplotlib is using libstdc++ (this installation is configured to use libc++)py39-matplotlib is using libstdc++ (this installation is configured to use libc++)

comment:3 Changed 20 months ago by RobK88

Renee -- I just remembered the workaround to this problem. When compiling on Lion, you can workaround the error by compiling py39-matplotlib using the clang-9.0 compiler.

See the ticket #62665

It looks like you tried to fix the problem so one would not need to specify clang-9.0 when compiling on Lion but it looks like your fix did not work. I am sorry I did not read your post earlier. Otherwise I would have tried your fix earlier.

bash-3.2$ sudo port uninstall py39-matplotlib
--->  Deactivating py39-matplotlib @3.5.2_0+cairo+webagg
--->  Cleaning py39-matplotlib
--->  Uninstalling py39-matplotlib @3.5.2_0+cairo+webagg
--->  Cleaning py39-matplotlib
bash-3.2$ 
bash-3.2$ sudo port clean py39-matplotlib
--->  Cleaning py39-matplotlib
bash-3.2$ 
bash-3.2$ sudo port install py39-matplotlib configure.compiler=macports-clang-9.0
--->  Computing dependencies for py39-zopfli
--->  Fetching distfiles for py39-zopfli
--->  Verifying checksums for py39-zopfli
--->  Extracting py39-zopfli
--->  Configuring py39-zopfli
--->  Building py39-zopfli
--->  Staging py39-zopfli into destroot                  
--->  Unable to uninstall py39-zopfli @0.2.1_0, the following ports depend on it:
--->  	py39-fonttools @4.34.4_0+lxml+unicode+woff
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating py39-zopfli @0.2.1_0
--->  Cleaning py39-zopfli
--->  Uninstalling py39-zopfli @0.2.1_0
--->  Cleaning py39-zopfli
--->  Computing dependencies for py39-zopfli
--->  Installing py39-zopfli @0.2.1_0
--->  Activating py39-zopfli @0.2.1_0
--->  Cleaning py39-zopfli
--->  Computing dependencies for py39-matplotlib
--->  Fetching distfiles for py39-matplotlib
--->  Verifying checksums for py39-matplotlib
--->  Extracting py39-matplotlib
--->  Applying patches to py39-matplotlib
Warning: reinplace s|^cairo=False|cairo=True| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-matplotlib/py39-matplotlib/work/matplotlib-3.5.2/mplsetup.cfg
--->  Configuring py39-matplotlib
--->  Building py39-matplotlib
--->  Staging py39-matplotlib into destroot              
--->  Installing py39-matplotlib @3.5.2_0+cairo+webagg   
--->  Activating py39-matplotlib @3.5.2_0+cairo+webagg
--->  Cleaning py39-matplotlib
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.
--->  Some of the ports you installed have notes:
  py39-matplotlib has the following notes:
    The default backend is the interactive Mac OS X backend. Different backends can be specified using the ~/.matplotlib/matplotlibrc file. More details regarding backends can be found in the matplotlib FAQ:
    
            https://matplotlib.org/stable/users/explain/backends.html
bash-3.2$
Last edited 20 months ago by RobK88 (previous) (diff)

comment:4 Changed 20 months ago by jmroot (Joshua Root)

Cc: reneeotten@… removed
Owner: set to reneeotten
Port: py-matplotlib added; py39-matplotlib removed
Status: newassigned

comment:5 Changed 20 months ago by reneeotten (Renee Otten)

as you said this is supposedly addressed by the fix for 62665. If that didn’t solve the problem (which you somehow didn’t notice for the last 1.5 years) then I don’t know. Sorry, but I do not have the time or interest to try and fix issues on old systems to which I do not have access. If you can come up with a robust patch please feel free to submit a PR which can be merged once verified by other Lion users. I am sorry I can not be of more help this time.

comment:6 Changed 20 months ago by RobK88

I understand Renee. It is hard to debug when you do not have access to an old Mac. When I get a chance, I will take a look at the source and see if I can get the source to honour CXXFLAGS. If I am successful, I will submit a patch.

In the meantime, at least there is a workaround that works. One just needs to manually specify the clang-9.0 compiler when installing or upgrading this port.

Last edited 20 months ago by RobK88 (previous) (diff)

comment:7 in reply to:  5 Changed 20 months ago by mascguy (Christopher Nielsen)

Replying to reneeotten:

as you said this is supposedly addressed by the fix for 62665. If that didn’t solve the problem (which you somehow didn’t notice for the last 1.5 years) then I don’t know. Sorry, but I do not have the time or interest to try and fix issues on old systems to which I do not have access. If you can come up with a robust patch please feel free to submit a PR which can be merged once verified by other Lion users. I am sorry I can not be of more help this time.

Renee, there are others here who do have VMs - and/or legacy Macs - running old macOS releases. So if you can provide guidance relative to a preferred fix, someone else can take care of it.

That being said, if compiling with clang-9.0 solves the issue... perhaps blacklisting might be a quick-and-easy approach? (With the caveat that I haven't looked at the portfile yet...)

comment:8 Changed 20 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:9 Changed 20 months ago by kencu (Ken)

I changed all the macports-clangs to choose the right stdlib, so you could just blacklist the xcode clangs for 10.8 and less to fix this via compiler blacklisting.

comment:10 Changed 20 months ago by Christopher Nielsen <mascguy@…>

In 2702c6eb1fdad104f2f72680e976cedcfb939cd4/macports-ports (master):

py-matplotlib: blacklist clang < 600
See: #62665
See: #65555

comment:11 Changed 20 months ago by mascguy (Christopher Nielsen)

@RobK88, sync your port tree after two hours, and give it another shot with the latest fix.

comment:12 Changed 20 months ago by kencu (Ken)

that doesn't seem to be fixing this. /usr/bin/clang is still being used for the build.

during the link, -stdlib=libc++ is not making it onto the link line, for backend_agg.cypython-310-darwin.so, at least, and it's linking against /usr/lib/libstdc++.dylib instead of libc++.

comment:13 Changed 20 months ago by kencu (Ken)

just for fun, installing the prebuilt binary off the package server seems to install one that is fine. It's only the one I build from source now that is broken, and linked against the wrong c++ stdlib.

So -- what changed?

comment:14 Changed 20 months ago by kencu (Ken)

this changed, I think, given other similar reports of the same issue.

https://github.com/macports/macports-ports/commit/5ef529c0ee398efc1d0d6ce8ed6d3a3c0dd19d46

comment:15 Changed 20 months ago by reneeotten (Renee Otten)

Resolution: fixed
Status: assignedclosed

In 7be41ed1448f92dcf910004c919c98014978e765/macports-ports (master):

py-matplotlib: use compiler_wrapper PG

Closes: #65555

Note: See TracTickets for help on using tickets.