Opened 4 years ago
Closed 4 years ago
#61525 closed defect (fixed)
py38-scikit-learn fails to build on macOS 11 Big Sur
Reported by: | smeingast (Stefan Meingast) | Owned by: | stromnov (Andrey Stromnov) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.4 |
Keywords: | Cc: | cjones051073 (Chris Jones) | |
Port: | py-scikit-learn |
Description
After the latest fix to clang-9.0, I tried to build scikit-learn and immediately ran into a build error. Log attached.
Attachments (1)
Change History (17)
Changed 4 years ago by smeingast (Stefan Meingast)
comment:1 Changed 4 years ago by jmroot (Joshua Root)
Owner: | set to stromnov |
---|---|
Port: | py-scikit-learn added; py38-scikit-learn removed |
Status: | new → assigned |
Summary: | scikit-learn fails to build on macOS 11 Big Sur → py38-scikit-learn fails to build on macOS 11 Big Sur |
comment:2 Changed 4 years ago by cjones051073 (Chris Jones)
The port is using macports clang 9.0 compiler to build (not clear exactly why to me ?) but setting the deployment target to 11.0, which this older version of the compiler does not understand
:info:build clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.0'
The solution is to either move to a new compiler that knows about the 11.0 target, or set the target for this build to 10.16, e.g. something like
if { ${os.major} == 20 } { macosx_deployment_target 10.16 }
maybe with additional checks to only do that if macports clang 9.0 (or 10) is used. clang 11 (coming soon) might well understand 11.0.
comment:3 Changed 4 years ago by cjones051073 (Chris Jones)
Cc: | cjones051073 added |
---|
comment:4 Changed 4 years ago by cjones051073 (Chris Jones)
Another options is to patch the macports clang 9.0 and 10 compilers to understand 11.0 as a deployment target. I am not sure if this is just a matter of adjusting some logic to handle 11.x as well as 10.x, or more involved. Ken, thoughts ?
comment:5 Changed 4 years ago by cjones051073 (Chris Jones)
comment:6 Changed 4 years ago by cjones051073 (Chris Jones)
patch for clang-9.0 seems to have worked fine. Without patch
Oberon ~/cernbox/MacPorts/c++17 > MACOSX_DEPLOYMENT_TARGET=11.0 clang++-mp-9.0 -std=c++17 test.cpp clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.0'
with
Oberon ~/cernbox/MacPorts/c++17 > MACOSX_DEPLOYMENT_TARGET=11.0 clang++-mp-9.0 -std=c++17 test.cpp Oberon ~/cernbox/MacPorts/c++17 >
will test similar one for clang 10, and then look to preparing a PR.
comment:7 Changed 4 years ago by kencu (Ken)
seems to me the safest approach, and a simple backported one-liner. Might have to also apply in the lldb subport, NB.
I have another minor patch for clang 9 & 10 to do as well, so I can put a few of these small ones together and avoid everyone rebuilding clang too many times. It's the reinplace issue I fixed in the recent clang-devel.
There's a more complicated reinplace issue involving a debug variant of clang that I might never fix...
comment:8 Changed 4 years ago by cjones051073 (Chris Jones)
Yeah, definitely a good idea to avoid rev-bumping more than necessary...
I'm just test building clang-10. Once done I'll run few basic checks and then push what I have to a branch in GitHub, so you can take it from there...
comment:9 Changed 4 years ago by cjones051073 (Chris Jones)
comment:11 Changed 4 years ago by cjones051073 (Chris Jones)
py-scikit-learn now builds fine, with the patched clang-9.0. So when committed can be tagged to close this ticket.
comment:12 Changed 4 years ago by smeingast (Stefan Meingast)
have my thanks guys, you are just wonderful (and quick)! :)
comment:13 Changed 4 years ago by cjones051073 (Chris Jones)
Ken, could these clang fixes be committed asap ? There is a growing number of other tickets for this, e.g. ..
comment:14 Changed 4 years ago by kencu (Ken)
should be fixed by 99b6a78ddf9eabc4f76fb3deb00615721100092d/macports-ports
comment:15 Changed 4 years ago by cjones051073 (Chris Jones)
Thanks, although there is a typo in that link as it takes me to a ccache change from 4 years ago;)
https://github.com/macports/macports-ports/commit/99b6a78ddf9eabc4f76fb3deb00615721100092d
Looks like the right one
comment:16 Changed 4 years ago by cjones051073 (Chris Jones)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
log