ld: warning: text-based stub file are out of sync. Falling back to library file for linking - r

When I am trying to sourceCpp, it gives a warning:
ld: warning: text-based stub file
/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd
and library file
/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation
are out of sync. Falling back to library file for linking.
But the function actually works. Just wondering how to solve this warning.

Using MacOS Mojave 10.14.2, the fix for me was to use the solution from this comment on GitHub:
export SDKROOT=macosx10.14
Put the line above in your ~/.bash_profile. Replace 10.14 with your specific version of MacOSX Xcode tools. Find out what version you have by doing:
xcrun --show-sdk-path
It will print something like:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
Just grab the last word, make it all lower caps and replace it in the export command above.
Update Sep 2019
In the latest release, they removed the version number from the sdk. Just grab the full path and export it as SDKROOT, like this:
export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
Update Aug 2021
To avoid having to continuously update the exported value whenever you upgrade your OS, you can place the xcrun command directly in the shell script:
export SDKROOT=$(xcrun --show-sdk-path)

I had this problem while compiling Go code on my Mac too.
The tld files were out of sync in /System/Library/Frameworks/.
The solution:
Just links the recent frameworks from MacOSX.sdk to /Library/Frameworks/
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework /Library/Frameworks/CoreFoundation.framework

Edit: this seems to have stopped working post 10.13.16. Trying it will not hurt your mac after the re-install but i'm not sure how to fix it going forward.
Came across this recently, just remove the command line tools for mac and re-install.
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
After these steps you will see a pop to install the new version of the tools.

Reinstalling may help, but also may not.
It's Apple's fault and they need to fix it with another command line tools update.
Just ignore the warning for now.
(See a bunch of other people experiencing the issue here: https://github.com/vim/vim/issues/3445 and here: https://github.com/golang/go/issues/26073)

I think this has nothing to do with Rcpp.
This is related to your system.
I show first lines of one tbd file below. It is just a text file. You can open it using a text editor.
--- !tapi-tbd-v3
archs: [ i386, x86_64, x86_64h ]
uuids: [ 'i386: 17321B27-67AB-3D26-B9DF-A69624B1C82B', 'x86_64: 358C547D-E227-3228-8218-62327F4605C8',
'x86_64h: 945E5C0A-86C5-336E-A64F-5BF06E78985A' ]
platform: macosx
install-name: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
current-version: 1452.23
compatibility-version: 150
exports:
- archs: [ i386 ]
symbols: [ '$ld$add$os10.5$.objc_class_name_NSObject', '$ld$add$os10.6$.objc_class_name_NSObject',
'$ld$add$os10.7$.objc_class_name_NSObject', '$ld$hide$os10.4$.objc_class_name_NSArray',
'$ld$hide$os10.4$.objc_class_name_NSCalendar', '$ld$hide$os10.4$.objc_class_name_NSData',
...
As I understand, the tbd file contains the version and location of the real library file. It is like a "link". (Just my personal understanding. Please correct me if this is wrong.)
After the upgrade of Xcode, your tbd file and real library are out of sync. Then you got the warning.
I think you can ignore this warning for now, since your compiler has fallen back and found the correct library.

The dates of CoreFoundation and CoreFoundation.tbd show that the latter is much older. This suggests it can be ignored. The out of sync problem can easily be cured by deleting the .tbd file. It is not needed and if not present cannot generate the out of sync error.
I use CoreFoundation and IOKit on 10.13.6 and this is a simple solution avoiding reloading CommandLine tools or setting links or trying to export SDKs etc.
John

If you previously set SDKROOT in your ~/.bash_profile or ~/.zshrc you either need to update it whenever you update macOS or delete (if you do not need it).
This was the case for me export SDKROOT=macosx10.14 was in my ~/.bash_profile, after I updated to macOS Catalina 10.15.7 so it was causing the problem.
If you choose to update, it will look like this (based on previous answers)
export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"

Related

Why am I getting a zsh: exec format error?

I am trying to run the metal executable from my zsh terminal in order to meta-analyze GWAS data. I have the executable in the correct directory and have checked that it is not 0MB due to truncation.
Reproducible:
Download the Linux file from http://csg.sph.umich.edu/abecasis/metal/download/
In terminal:
PATH TO EXECUTABLE ./metal
zsh: exec format error: ./metal
You probably install wrong OS of go, for example, you might install go for MacOS in Linux
I solve this problem by installing go for correct OS
The executable has been pre-compiled on a certain distribution with libraries at a certain places at certain versions.
If you have a different distribution, libraries versions, it won't work and you better compile from the source.
Basically what you have to do is to download and extract the sources, go in the folder and execute make. (You will have probably to install make first.)
I think that's not your job at all so maybe you can find a geeky person to help you, because you may stumble upon problems, libraries to install, old versions not supported anymore, new versions not supported yet...
It happened to me when I emptied an executable by mistake.
~>true > a
~>wc -c a
0 a
~>./a
zsh: exec format error: ./a

Building Tools are missing in RStudio

First of all, I am working on a Mac. I am trying to install Blotter from GitHub. I found several descriptions of how to do that but my RStudio tells me that I am missing Building tools and gives me a link (https://www.cnet.com/how-to/install-command-line-developer-tools-in-os-x/) where it is described to do that. So far so good. I downloaded Xcode and the command line tools for Mac and installed those. Nothing changed even after restarting R. Then I found this https://cran.r-project.org/bin/macosx/tools/. I installed it and during that, it told me that I had to do the following
"This package will install clang 6.0.0 for OS X 10.11 (El Capitan) or higher with OpenMP support in /usr/local/clang6
In order to use this compiler you have to add /usr/local/clang6/bin to the PATH environment variable such as
export PATH=/usr/local/clang6/bin:$PATH"
So I changed the environmental variable path as follows http://blog.tonytsai.name/blog/2018-05-07-setting-path-variable-for-gs-command-in-rstudio/.
How I changed the PATH variable.
Again I restarted R but still, nothing changed. I still get the notice that the building tool is missing.
Somehow it seems to me that I installed everything correctly but R doesn't recognize the Programmes. Does anyone have an idea? I tried to search for settings to tell R that I installed the command line tool but couldn't really find anything helpful.
Ok, a bit of an update.
Best I can see it that Blotter is built and stored on R-Forge packages under a package called RStrategist
In R console type/cut & paste this.
install.packages('RStrategist',repos='http://R-Forge.r-project.org')
See R forR-Forge for more details. Once this has been installed run instead.
library(RStrategist)
Unfortunately, I am not willing to install this package and see if it works mainly because 1) don't need it nor know how to use it, 2) not sure how good packages are from R-forge, though it seems legit, but, this brings me back to point one.
So before i read the updated answer of Conrad Thiele i was trying around bit. Basically i deleted R, R Studio, Xcode and Command Line tools. Then i installed Xcode, Command Line tools, R and RStudio. Then i followed the notice on https://cran.r-project.org about the tools and installed both stated tools. As mentioned in the original question the Clang package tells you to change the Environmental Variable. And there was the mistake i believe. I originally simply pasted "PATH=/usr/local/clang6/bin:$PATH" into the the ".Renviron" file. With reading up online i noticed that "export PATH=/usr/local/clang6/bin:$PATH" is actually a Command for the Mac Terminal. After executing it, it sill didn't work but then i remembered that i still had the Path "PATH=/usr/local/clang6/bin:$PATH" in the the ".Renviron" file. Once i deleted that it worked. So i guess the key was that with changing the Environmental Variable correctly R found the connection with the right tool. Patients paid off.

How do I initialize LLVM's external symbolizer?

When compiling with -fsanitize=memory I get WARNING: Trying to symbolize code, but external symbolizer is not initialized! when running the program. How do I initialize the external symbolizer?
I solved my own problem using MSAN_SYMBOLIZER_PATH=$(which llvm-symbolizer-3.4) ./a.out. The problem is that Ubuntu postfixes the version number but the binary doesn't know that. Of course you need to use MSAN instead of ASAN when using the memory sanitizer.
You are supposed to be able to set the ASAN_FILTER environment variable to point at a symbolizer, but I could not get it to work. However, you can redirect stderr into a symbolizer after the fact. You'll still get the warnings about the uninitialized symbolizer, but the filenames and line numbers will be correct.
You can use asan_symbolizer.py as the external symbolizer. After downloading it from that link (to /tmp, for example), invoke your program like so (in bash, for this example):
./myprogram 2>&1 | /tmp/asan_symbolize.py | c++filt
On my Ubuntu system, the issue is that LLVM's tools are installed under /usr/bin with version suffixes (like llvm-symbolizer-4.0), and the sanitizer tools are looking for them without version suffixes.
LLVM also installs its binaries to, e.g., /usr/lib/llvm-4.0/bin; the tools under /usr/bin are actually just symlinks. So an easy solution is to add the appropriate /usr/lib/llvm-*/bin directory to your path when working with sanitizers.
I received such warning when I run program debug version (compiled with -fsanitize=address) on Linux machine that didn't contain clang installation. The problem disappeared after I installed clang from devtoolset.

R 3.0.0 crashes on startup

I just updated R from version 2.15.1 to version 3.0.0 on my MAC running 10.6.8 and now R crashes on startup.
I get the error:
Error in getLoadedDLLs() : there is no .Internal function 'getLoadedDLLs'
Error in checkConflicts(value) :
".isMethodsDispatchOn" is not a BUILTIN function
Any ideas on how to go about?
The most common cause of this is having a corrupted ".Rdata" file in your working directory. Using the Mac Finder.app you will not by default be able to see files that begin with a ".", so-called dotfiles. Those files can be "seen" if you execute a change to the plist controlling the behavior of Finder.app. Open a Terminal.app window and run this bit of code:
defaults write com.apple.Finder AppleShowAllFiles YES
Then /point/-/click/-/hold/ on Dock-Finder-icon, and choose "Relaunch"
If you to do so, you can then change it back with the obvious modfication to that procedure. I happen to like seeing the hidden files so that's the way I run my Mac all the time, but some people may feel it is too dangerous to expose the "hidden secrets" to their own bumbling.
Paul raises a good point: I run the following R function in the R console after updating:
update.packages(checkBuilt=TRUE, ask=FALSE)
I have a lot of installed packages and paging through the entire list has gotten too tiresome so I bypass the ask-messages. Sometimes you will get errors because there may be dependencies on r-forge or Omegahat packages or on packages that need to be compiled from source. These may need to be updated "by hand". And you may need more than one pass through such an effort. Take notes of which packages are missing and fill them in.
I had the same problem running RKWard on ubuntu 12.04.
Check your r-base-core, like Paul suggested, to make sure the version is also at the latest version. Mine didn't update automatically. I had a platform dependent version, but RKWard was calling the new version. To solve this problem, I simply marked r-base-core for removal and reinstalled the latest version or r-base-core. poof problem fixed, bippity boppity boo!
I suspect that your error is similar to mine because I had also JUST updated RKWard. Start at updating r-base-core or try to get all of the dependencies to match up the versions.
I hope that you can translate this into what to do on a MAC,
SU

Creating a custom .vimrc gives me an E216 error on opening vim

I am trying to set ignorecase by default in my vim environment.
Curently, ~/.vimrc doesn't exist. When I open vim and use :scriptnames to see what scripts are loaded, I have a bunch of *.vim files loaded.
When I create my own ~/.vimrc containing only:
set ic
I get the following error:
E216: No such group or event: SpellFileMissing * call
spellfile#LoadFile(expand('')) Hit ENTER or type command to
continue
when opening vim. When I use :scriptnames to see what scripts are loaded again, on top of the list is my '.vimrc' file followed by all the same '*.vim' files as before...
Why would this happen?
Thanks...
P.S. I am using vim version 6.3
This looks like a mismatch of (newer) Vim runtime files and your ancient Vim version; the SpellFileMissing event is related to spell checking, which was introduced in Vim 7.0. You seem to have runtime files that initialize the (non-existing) spell checking.
Upgrading Vim looks like the easiest and best way to resolve this.
Vim 6.3 is from 2004 and very outdated. It should be possible to install the latest version 7.3; if you can't find a proper package for your distribution (for Windows, check the binaries from the Cream project, it's also not very difficult to compile (e.g. from the Mercurial sources) on Linux.

Resources