Opened 2 weeks ago

Closed 5 days ago

#64016 closed defect (fixed)

tesseract: error: use of undeclared identifier '__cpuid_count'

Reported by: ryandesign (Ryan Schmidt) Owned by: markemer (Mark Anderson)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: lion Cc: mascguy (Christopher Nielsen)
Port: tesseract


tesseract fails to build on Mac OS X 10.7:

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 2 weeks ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:2 Changed 13 days ago by markemer (Mark Anderson)

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.

comment:3 Changed 13 days ago by ryandesign (Ryan 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, 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 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

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
Boot date: 2021-11-14T20:52:00Z

And for the 10.8 machine at

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
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 12 days ago by markemer (Mark Anderson)

Awesome, thanks a lot for both the suggestion and the links from 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 5 days ago by markemer (Mark Anderson)

Resolution: fixed
Status: assignedclosed

In 719d557396819aee894e316174e4dd532184142f/macports-ports (master):

tesseract: fix 10.7, variants, and configure

  • Add --disable-silent-rules to configure
  • Blacklist compiler to fix on 10.7
  • Move variants to subports only
  • Change kurdish from kur to kmr as done upstream
  • Mark kur as obsolete

Closes: #64015
Closes: #64016
Closes: #64014

Note: See TracTickets for help on using tickets.