Search code examples
rclangapple-m1

clang-16: error: no such file or directory: 'Welcome'


Compilation of some R packages with R CMD build or install runs into a common clang error as follows;

clang-16: error: no such file or directory: 'Welcome'
clang-16: error: no such file or directory: 'at'
clang-16: error: no such file or directory: 'Thu'
clang-16: error: no such file or directory: 'Apr'
clang-16: error: no such file or directory: '20'
clang-16: error: no such file or directory: '19:30:11'
clang-16: error: no such file or directory: '2023'

A line, Welcome at Thu Apr 20 19:30:06 2023 appears at the very begging of R CMD build or install output as follows;

R CMD build dada2

Welcome at Thu Apr 20 19:30:06 2023
* checking for file ‘dada2/DESCRIPTION’ ... OK
* preparing ‘dada2’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
      -----------------------------------

Welcome at Thu Apr 20 19:30:07 2023
* installing *source* package ‘dada2’ ...
** using staged installation
** libs

I am using M1 Mac with following;

sw_vers
ProductName:        macOS
ProductVersion:     13.3.1
BuildVersion:       22E261

R.version
               _                           
platform       aarch64-apple-darwin20      
arch           aarch64                     
os             darwin20                    
system         aarch64, darwin20           
status                                     
major          4                           
minor          2.2                         
year           2022                        
month          10                          
day            31                          
svn rev        83211                       
language       R                           
version.string R version 4.2.2 (2022-10-31)
nickname       Innocent and Trusting   

I am not sure this is a M1 Mac specific issue but happens occasionally with M1 Mac I'd really appreciate any pointers to address this issue.


Solution

  • I figured this one out. An issue was my .Rprofile;

    >more .Rprofile
    .First <- function(){
     library(magrittr)
     library(future)
     Sys.setenv(R_HISTSIZE='100000')
    options(future.globals.maxSize = 50 * 1024 ^ 3)
    options(parallelly.fork.enable=T)
    plan('multicore', workers=20)
    #cat("\nWelcome at", date(), "\n")
    }
    

    The last line create a welcome note and this was causing the issue that I described. Once I commented out, everything just compiled fine but still a question remains as to why compilation of some packages got affected while a majority of others were fine.