Skip to content

Xcode 10.3 and header flles

13 messages · Roy Mendelssohn - NOAA Federal, Simon Urbanek, Bryan Hanson

#
If like me you updated to Xcode 10.3,  in Apple's infinite wisdom the install again wipes out the header files.  So if you did the update and install from source remember to re-install the headers:
-Roy

**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
#
Roy,

that shouldn't be necessary if you use the CRAN release since it specifically points to the SDK. If you are compiling your own R you may want to add
CPPFLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include'
which is what the CRAN build uses. FWIW you can always check the current flags at
https://svn.r-project.org/R-dev-web/trunk/QA/Simon/R-build/conf.el-capitan-x86_64
 
If the above doesn't address the issue you're seeing, please provide details.

Thanks,
Simon
#
Hi Simon:

 I am using CRAN release,  recommended CRAN compilers.  Yesterday morning one updated package needed to be installed from source,  worked.  Yesterday afternoon did the update of Xcode (and OSX).  This morning installing a package update from source failed,  couldn't find header files (gee I have seen this before).  Ran the command I put below,  everybody was happy.  It does appear that the update literally deleted the headers.

HTH,

Roy

PS - not trying to build R from source,  just source updates of some packages
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
#
Roy,

thanks, I just wanted to clarify which headers have been deleted exactly. The system location (/usr/includes) is what Apple doesn't like, which is why we are now using the SDK. Can you check, please, whether you do have
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
I would hope that they don't touch that location. That said, if you have Xcode proper they may think that you no longer need command line tools or something like that -in principle that should be recoverable with
sudo xcode-select --install
hopefully.

Thanks,
Simon
#
Hi Simon:
Also when  have done:
I often get a message to install through App store (the command line tools).  I am not certain exactly what macOS_SDK_headers_for_macOS_10.14.pkg installs nor where,  but I as I said I went from being able to install packages from source to not being able to because headers couldn't be found to be able to.  And I have a feeling others will run into the same problem.

Thanks!

-Roy
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
#
Ah, I think I have an idea - is it possible that you were using an older version of R? That would explain.

Cheers,
Simon
#
If it helps troubleshoot, I updated more or less on the same timeline as Roy did and had the same problems Roy had, and Roy?s most recent response below gives the same response on my Mac.  Roy?s fix * fixed things for me.  Bryan

* open  /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
#
Thanks Bryan.  Given my age,  I always have to wonder if I am hallucinating or did something careless.  I want to emphasize that I don't think it is an R issue,  it really does look like when installing the new Xcode,  the headers got wiped out. Since both a new Xcode and a new Command Line Tools were installed,  I don't know which did the damage.

-Roy
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
#
I want to avoid that "fix" because it is not guaranteed to work in the future. Can someone who did NOT instal the system-level headers below please report the actual issue? The whole point of using the SDK was to make sure it's not necessary.

Thanks,
Simon
#
HI Simon:

Perhaps if you can find someone who hasn't done the Xcode and Command Line Update,  have them list the directories that you are interested in, and then list the same after the update to see what it is doing.  Also is it possible you have something in your .Rpofile of the like that points to the location you want that I do not?  The errors you get on build are just what you expect - whatever *.h files it needed could not be found. 

HTH,

-Roy
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
#
It's not what I'd expect because the system headers don't matter in the current CRAN release as it's not relying on the system headers anymore. That's why I'd need the actual full output - the command line and the error - so I could tract why it's failing.
#
But is there a difference in where headers are being looked for when building R as compared to when a package is built from source.  As I said,  what was failing was try to do source installs of packages from CRAN.  

-Roy
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
#
Ok, mystery solved: you will get the error if you override the provided CRAN flags with flags that remove the SDK. So the issue doesn't exist in released R unless you modify the flags yourself. So please don't do that - don't set CPPFLAGS or if you really have to, make sure you include at least what the released CRAN R uses:

$ R CMD config CPPFLAGS
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include

Cheers,
Simon