[MacPorts] #66352: clang-15: fatal error: '*.h' file not found

MacPorts noreply at macports.org
Tue Nov 29 07:01:52 UTC 2022


#66352: clang-15: fatal error: '*.h' file not found
-----------------------+-----------------------------
  Reporter:  judaew    |      Owner:  (none)
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.8.0
Resolution:            |   Keywords:  ventura, x86_64
      Port:  clang-15  |
-----------------------+-----------------------------

Comment (by kencu):

 my build of macports-clang-15 finds the SDK, whether Xcode is installed or
 not:
 {{{
  % clang++-mp-15  -c -v test2.cpp
 clang version 15.0.5
 Target: x86_64-apple-darwin22.1.0
 Thread model: posix
 InstalledDir: /opt/local/libexec/llvm-15/bin
  (in-process)
  "/opt/local/libexec/llvm-15/bin/clang" -cc1 -triple x86_64-apple-
 macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-
 objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all
 --mrelax-relocations -disable-free -clear-ast-before-backend -disable-
 llvm-verifier -discard-value-names -main-file-name test2.cpp -mrelocation-
 model pic -pic-level 2 -mframe-pointer=all -ffp-contract=on -fno-rounding-
 math -funwind-tables=2 -target-sdk-version=13.0 -fcompatibility-qualified-
 id-block-type-checking -fvisibility-inlines-hidden-static-local-var
 -target-cpu penryn -tune-cpu generic -mllvm -treat-scalable-fixed-error-
 as-warning -debugger-tuning=lldb -target-linker-version 820.1 -v
 -fcoverage-compilation-dir=/Users/cunningh/Desktop -resource-dir
 /opt/local/libexec/llvm-15/lib/clang/15.0.5 -isysroot
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
 -I/usr/local/include -stdlib=libc++ -internal-isystem
 /opt/local/libexec/llvm-15/bin/../include/c++/v1 -internal-isystem
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include
 -internal-isystem /opt/local/libexec/llvm-15/lib/clang/15.0.5/include
 -internal-externc-isystem
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 -fdeprecated-macro -fdebug-compilation-dir=/Users/cunningh/Desktop
 -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-
 signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fcxx-
 exceptions -fexceptions -fmax-type-align=16 -fcolor-diagnostics
 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o test2.o -x c++ test2.cpp
 clang -cc1 version 15.0.5 based upon LLVM 15.0.5 default target x86_64
 -apple-darwin22.1.0
 ignoring nonexistent directory "/usr/local/include"
 ignoring nonexistent directory
 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
 ignoring nonexistent directory
 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
 #include "..." search starts here:
 #include <...> search starts here:
  /opt/local/libexec/llvm-15/bin/../include/c++/v1
  /opt/local/libexec/llvm-15/lib/clang/15.0.5/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
 (framework directory)
 End of search list.
 }}}

 {{{
 % sudo mv /Applications/Xcode.app /Applications/Xcode-hidden.app
 }}}
 {{{
  % clang++-mp-15  -c -v test2.cpp
 clang version 15.0.5
 Target: x86_64-apple-darwin22.1.0
 Thread model: posix
 InstalledDir: /opt/local/libexec/llvm-15/bin
  (in-process)
  "/opt/local/libexec/llvm-15/bin/clang" -cc1 -triple x86_64-apple-
 macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-
 objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all
 --mrelax-relocations -disable-free -clear-ast-before-backend -disable-
 llvm-verifier -discard-value-names -main-file-name test2.cpp -mrelocation-
 model pic -pic-level 2 -mframe-pointer=all -ffp-contract=on -fno-rounding-
 math -funwind-tables=2 -target-sdk-version=13.0 -fcompatibility-qualified-
 id-block-type-checking -fvisibility-inlines-hidden-static-local-var
 -target-cpu penryn -tune-cpu generic -mllvm -treat-scalable-fixed-error-
 as-warning -debugger-tuning=lldb -target-linker-version 820.1 -v
 -fcoverage-compilation-dir=/Users/cunningh/Desktop -resource-dir
 /opt/local/libexec/llvm-15/lib/clang/15.0.5 -isysroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include
 -stdlib=libc++ -internal-isystem
 /opt/local/libexec/llvm-15/bin/../include/c++/v1 -internal-isystem
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include
 -internal-isystem /opt/local/libexec/llvm-15/lib/clang/15.0.5/include
 -internal-externc-isystem
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 -fdeprecated-macro -fdebug-compilation-dir=/Users/cunningh/Desktop
 -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-
 signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fcxx-
 exceptions -fexceptions -fmax-type-align=16 -fcolor-diagnostics
 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o test2.o -x c++ test2.cpp
 clang -cc1 version 15.0.5 based upon LLVM 15.0.5 default target x86_64
 -apple-darwin22.1.0
 ignoring nonexistent directory "/usr/local/include"
 ignoring nonexistent directory
 "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
 ignoring nonexistent directory
 "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
 #include "..." search starts here:
 #include <...> search starts here:
  /opt/local/libexec/llvm-15/bin/../include/c++/v1
  /opt/local/libexec/llvm-15/lib/clang/15.0.5/include
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks
 (framework directory)
 }}}

 I have no real idea how it has come to pass that your build does not find
 the SDK, to be honest. You might look through your initialization scripts
 and make 100% sure you are not overwriting any environment variables
 setting the SDK or any such thing. You can play around with xcrun and
 xcodebuild on your system and see if they can find the SDK that should be
 there.

 In the end, you can uninstall your copy of clang-15 and rebuild it from
 source.

 But -- whatever is going on -- it is on your system and not a general
 MacPorts issue...

-- 
Ticket URL: <https://trac.macports.org/ticket/66352#comment:13>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list