Opened 3 years ago
Closed 3 years ago
#64016 closed defect (fixed)
tesseract: error: use of undeclared identifier '__cpuid_count'
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | markemer (Mark Anderson) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | lion | Cc: | mascguy (Christopher Nielsen) |
Port: | tesseract |
Description
tesseract fails to build on Mac OS X 10.7:
CXXLD libtesseract_native.la simddetect.cpp:110:7: error: use of undeclared identifier '__cpuid_count' __cpuid_count(7, 0, eax, ebx, ecx, edx); ^ 1 error generated.
However it succeeds on 10.8 and newer and on 10.6 with newer MacPorts clang, suggesting that this __cpuid_count
is simply missing from the default compiler on 10.7 and that the port could build if you blacklisted that compiler so that MacPorts will pick another. Use the compiler_blacklist_versions portgroup and specify an appropriate clang version specification in compiler.blacklist
.
Change History (5)
comment:1 Changed 3 years ago by mascguy (Christopher Nielsen)
Cc: | mascguy added |
---|
comment:2 Changed 3 years ago by markemer (Mark Anderson)
comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Since I'm in charge of the buildbot, I look at its waterfall view several times a day and sometimes I file bug reports for build failures I happen to see; that's how this ticket arose.
If you want to see if there have been build failures for your ports, use the ports web site's Details tab. For example, https://ports.macports.org/port/tesseract/details/ shows an overview of build status on different OS versions, showing the failure on Lion. You can click that to see more details, including the build log if the build was recent enough and has not already been cleaned up. The Builds tab at https://ports.macports.org/port/tesseract/builds/ is also useful. The ports web site's build overview is not always current (build status on the Details page shows the most recent build it knows about, which is not necessarily the most recent build that happened) but it is a good place to start investigations.
The build log for tesseract doesn't show the version of clang that was used, but you can find that information from the buildbot web site:
Here's the stats for the 10.7 machine at https://build.macports.org/buildslaves/ports-10.7_x86_64:
Mac OS X Lion v10.7.5 (11G63) Xcode v4.6.3 (4H1503) Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Architecture: x86_64 C++ library: libc++ CPU: 4 ⨉ 2.53 GHz RAM: 4 GB Boot date: 2021-11-14T20:52:00Z
And for the 10.8 machine at https://build.macports.org/buildslaves/ports-10.8_x86_64:
OS X Mountain Lion v10.8.5 (12F2560) Xcode v5.1.1 (5B1008) Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Architecture: x86_64 C++ library: libc++ CPU: 4 ⨉ 2.53 GHz RAM: 4 GB Boot date: 2021-11-15T00:26:00Z
flac also had this problem and was fixed awhile ago. According to comment:ticket:46038:32, clang 500 still had the problem, but clang 503 didn't, so flac blacklisted clang < 503, and also the equivalent versions of MacPorts clang in case those got used, so I would suggest doing the same in tesseract. Adding a comment explaining why a compiler is being excluded is a good idea too.
Add to the top of the portfile:
PortGroup compiler_blacklist_versions 1.0
And nearer the configure section:
# error: use of undeclared identifier '__cpuid_count' compiler.blacklist-append macports-clang-3.3 {clang < 503}
comment:4 Changed 3 years ago by markemer (Mark Anderson)
Awesome, thanks a lot for both the suggestion and the links from ports.macports.org are super helpful - I added my ports to my watch list. I'll try and get a PR up for these tickets today or tomorrow.
comment:5 Changed 3 years ago by markemer (Mark Anderson)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Thanks - I can see if I can take a look - I have no access to 10.7 in any form - so I'll have to depend on the buildbot.
Speaking of, How do you find these? I can't make hide nor hair of how to find anything in buildbot.