Opened 18 months ago

Closed 4 months ago

Last modified 4 months ago

#66242 closed defect (fixed)

python311 @3.11.0 +lto +optimizations fails to build with broken symlink in include path

Reported by: bakergilx (Dennis Baker) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: upstream Cc: chillin-, DaveStrickland (Dave Strickland)
Port: python311 python310

Description (last modified by jmroot (Joshua Root))

Installation of python311 on OS 13.0.1, Arm64 architecture, Xcode 14.1, generates the following configure warning:

Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  dbm_open: found in Python-3.11.0/config.log,
  getrandom: found in Python-3.11.0/config.log,
  le64toh: found in Python-3.11.0/config.log

In addition, the port failed to build with the following error message:

Error: Failed to build python311: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python311/python311/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port python311 failed

config.log and build.log attached

Attachments (3)

main.log (198.1 KB) - added by bakergilx (Dennis Baker) 18 months ago.
main.log for python311
config.log (1.1 MB) - added by bakergilx (Dennis Baker) 18 months ago.
config.log for python311
mojave.python310.main.log (161.7 KB) - added by chillin- 15 months ago.
python310 main.log

Download all attachments as: .zip

Change History (19)

Changed 18 months ago by bakergilx (Dennis Baker)

Attachment: main.log added

main.log for python311

Changed 18 months ago by bakergilx (Dennis Baker)

Attachment: config.log added

config.log for python311

comment:1 Changed 18 months ago by reneeotten (Renee Otten)

Cc: jmr@… removed
Owner: set to jmroot
Status: newassigned

comment:2 Changed 18 months ago by jmroot (Joshua Root)

Description: modified (diff)
Keywords: ventura added
Summary: Python @3.11 +lto +optimizations failed to buildpython311 @3.11.0 +lto +optimizations failed to build
:info:build error: [Errno 2] No such file or directory: '/opt/local/include/proj_api.h'

Unfortunately there's no indication in the logs of what is trying to include this header. It would be provided by the various versions of proj, but none of those should be required by python. Would you be able to find out what is referencing this either in the python build dir or the installed files of python311's dependencies?

comment:3 Changed 16 months ago by kencu (Ken)

Summary: python311 @3.11.0 +lto +optimizations failed to buildpython311 @3.11.0 +lto +optimizations failed to build: No such file or directory: '/opt/local/include/proj_api.h'

current python311 does install on arm Ventura:

% port -v installed python311
The following ports are currently installed:
  python311 @3.11.1_0+lto+optimizations (active) requested_variants='' platform='darwin 22' archs='arm64' date='2022-12-25T21:37:07-0800'

I don't have any version of proj installed, however.

comment:4 Changed 16 months ago by kencu (Ken)

Keywords: ventura removed

comment:5 Changed 15 months ago by jmroot (Joshua Root)

Is /opt/local/include/proj_api.h a broken symlink on your system, by any chance?

comment:6 Changed 15 months ago by jmroot (Joshua Root)

Keywords: upstream added
Port: python310 added
Summary: python311 @3.11.0 +lto +optimizations failed to build: No such file or directory: '/opt/local/include/proj_api.h'python311 @3.11.0 +lto +optimizations fails to build with broken symlink in include path

comment:7 Changed 15 months ago by jmroot (Joshua Root)

Has duplicate #66889. Deleting the broken symlinks in the include directory is an effective workaround.

comment:8 Changed 15 months ago by chillin-

Cc: chillin- added

Changed 15 months ago by chillin-

Attachment: mojave.python310.main.log added

python310 main.log

comment:9 Changed 15 months ago by chillin-

python310 was failing to build on Mountain Lion, but succeeded today. python310 still failing to build on Mojave.

comment:10 Changed 15 months ago by JDLH (Jim DeLaHunt)

Has similar or duplicate report #66892. That report mentions the error I saw, which is:

:info:build error: [Errno 2] No such file or directory: '/opt/local/include/lapacke_utils.h'

The proximate problem seems to be that the python310 compilation refers to a broken symlink to a library:

% ls -l /opt/local/include/lapacke_utils.h /opt/local/include/cblas/lapacke_utils.h
ls: /opt/local/include/cblas/lapacke_utils.h: No such file or directory
lrwxr-xr-x  1 root  wheel  21  4 Feb 15:55 /opt/local/include/lapacke_utils.h -> cblas/lapacke_utils.h

It looks like the port OpenBLAS supplies the broken link:

% port installed \*blas
The following ports are currently installed:
  OpenBLAS @0.3.21_2+gcc12+lapack+native (active)
% port contents OpenBLAS | grep lapack
  /opt/local/include/lapack.h
  /opt/local/include/lapacke.h
  /opt/local/include/lapacke_config.h
  /opt/local/include/lapacke_mangling.h
  /opt/local/include/lapacke_utils.h
  /opt/local/include/openblas/lapack.h
  /opt/local/include/openblas/lapacke.h
  /opt/local/include/openblas/lapacke_config.h
  /opt/local/include/openblas/lapacke_mangling.h
  /opt/local/include/openblas/lapacke_utils.h

I see no listing for a port cblas, but there is a port clblas. I do not have it installed.

comment:11 Changed 15 months ago by JDLH (Jim DeLaHunt)

The underlying cause for the lapacke symlink error may be #66881 . There is a PR for that ticket. It is awaiting review. That ticket acknowledges that the problem blocks compilation of python310 and python311 ports.

comment:12 Changed 15 months ago by bakergilx (Dennis Baker)

On my system (Ventura 13.2, Apple M1 Max, Xcode 14.2, MacPorts 2.8.1) OpenBlas is installed but the Symlinks that port created (I assume) are all incorrect. For example, the link lapack.h -> cblas/lapack.h should be lapack.h -> openblas/lapack.h (and so for all the others). I manually corrected each link and now both Python310 and Python311 build successfully.

comment:13 Changed 15 months ago by jmroot (Joshua Root)

Yes, those specific broken symlinks are #66881, as mentioned in comment:11.

comment:14 Changed 15 months ago by DaveStrickland (Dave Strickland)

Cc: DaveStrickland added

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

Resolution: fixed
Status: assignedclosed

In bb5475d62360fd200b5d79cdecc9e90eb9aca30e/macports-ports (master):

python311: fix dangling symlinks breaking the build

Closes: #66242

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

In 32fa32f26eea92dbe86afb60a41ae671f11536b4/macports-ports (master):

python310: fix dangling symlinks breaking the build

Closes: #66242

Note: See TracTickets for help on using tickets.