Opened 6 years ago

Closed 5 years ago

#57403 closed defect (fixed)

ROOT 6 compilation via cling fails

Reported by: hansgans Owned by: cjones051073 (Chris Jones)
Priority: Normal Milestone:
Component: ports Version:
Keywords: mojave Cc:
Port: root6

Description

After updating to macOS10.14 (and reinstalling all ports) I cannot compile my ROOT macros anymore (interpreting does still work, as far as I see). Compiling a simple macro e.g.:

#include "TROOT.h"
#include <iostream>

void test() {
  std::cout<<"adsf"<<std::endl;
}

using root test.C+ fails with various unknown type errors:

Processing test.C+...
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/me/Desktop/./test_C.so
warning: no such sysroot directory: '-I/opt/local/libexec/root6/etc/root'
In file included from input_line_1:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:91:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:86:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
/opt/local/libexec/root6/etc/root/cling/lib/clang/5.0.0/include/stdlib.h:8:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
              ^~~~~~~~~~
In file included from input_line_3:1:
In file included from /opt/local/libexec/root6/include/root/RtypesCore.h:25:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stddef.h:46:
/opt/local/libexec/root6/etc/root/cling/lib/clang/5.0.0/include/stddef.h:51:9: error: unknown type name '__PTRDIFF_TYPE__'
typedef __PTRDIFF_TYPE__ ptrdiff_t;

ROOT seems to use header files for clang5 while AppleClang is currently at version 10.0. The full log file is attached.

Attachments (1)

log (9.3 KB) - added by hansgans 6 years ago.
log

Download all attachments as: .zip

Change History (14)

Changed 6 years ago by hansgans

Attachment: log added

log

comment:1 Changed 6 years ago by hansgans

Ok installing some headers solves the problem:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

comment:2 Changed 6 years ago by cjones051073 (Chris Jones)

Yes, its a requirement to have the command line tools installed.

comment:3 Changed 6 years ago by cjones051073 (Chris Jones)

b.t.w. compiling scripts with ACLiC is really no longer needed, with ROOT6. cling is a proper compiler so use run the scripts interpreted. i.e. without the + at the end...

It was recommended to do this with ROOT5, as CINT was not that good, but cling has fixed this and is fully standards compliant, so really its no longer needed.

comment:4 Changed 6 years ago by hansgans

I was aware the xcode-select --install is necessary. But nowhere is mentioned that installing macOS_SDK_headers_for_macOS_10.14.pkg is mandatory since mojave. Should this probably be mentioned in the MacPorts installation instructions?

comment:5 Changed 6 years ago by cjones051073 (Chris Jones)

Maybe... Please bring this up on the devel mailing list.

The issue is new and specific to macOS 10.14, which is why its not mentioned.

https://lists.macports.org/pipermail/macports-dev/2018-September/039399.html

comment:6 Changed 6 years ago by cjones051073 (Chris Jones)

Also note, not using ACLiC also works around the issue.

comment:7 Changed 6 years ago by mf2k (Frank Schima)

Priority: HighNormal

The Priority field is for use by Macports team members only.

comment:8 Changed 6 years ago by jmroot (Joshua Root)

A standard installation of the command line tools does not provide /usr/include on Mojave. You can't rely on it existing, and that extra package with the headers will likely go away at some point in the future. System headers are provided by the SDK.

comment:9 Changed 6 years ago by cjones051073 (Chris Jones)

Indeed. However, this is an issue that the upstream ROOT maintainers will have to eventually address. its not MP specific.

comment:11 Changed 5 years ago by kencu (Ken)

Summary: ROOT 6 compilation via cling failsROOT 6 compilation via clang fails

comment:12 Changed 5 years ago by kencu (Ken)

Summary: ROOT 6 compilation via clang failsROOT 6 compilation via cling fails

comment:13 Changed 5 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.