Skip to content

Fix compilation with OpenMP on latest macOS Xcode without headers in /usr/include #3698

@fox34

Description

@fox34

When installing according to the docs on macOS 10.14.5, compilation with OpenMP support fails on newer macOS/Xcode versions.

Latest versions of Xcode do not provide the mentioned package macOS_SDK_headers_for_macOS_10.14.pkg any more, as documented in the Xcode 10 release notes.

As such, /usr/include does not exist and cannot be created. Thus, the compilation always fails with the error stdio.h file not found.

Modifying the last line of Makevars from the recommended

CPPFLAGS=-I/usr/local/opt/gettext/include -I$(LLVM_LOC)/include

to

CPPFLAGS=-I/usr/local/opt/gettext/include -I$(LLVM_LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

solved the issue for me.
However, a lot of warnings and notes about nullability were issued during compilation, but I do not know whether this is associated with my fix or not.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions