Discussion:
[R-SIG-Mac] Library not loaded: /usr/local/lib/libquadmath.0.dylib
Xiao He
2014-09-03 08:18:50 UTC
Permalink
Hi all,

I tried to load a package which includes a shared object on one of my Macs,
and I got an error message below, which suggests that the file "
libquadmath.0.dylib" is missing in the /usr/local/lib folder. On my other
Mac however, I have no problem loading the package, and the file "
libquadmath.0.dylib" is in the /usr/local/lib folder. I wonder where this
libquadmath.0.dylib file is from, and how I can install it on the computer
where it is missing. Thanks!

library(WRScpp)
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object
'/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so':

dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so,
6): Library not loaded: /usr/local/lib/libquadmath.0.dylib
Referenced from:
/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so
Reason: image not found
Error: package or namespace load failed for ?WRScpp??

[[alternative HTML version deleted]]
Simon Urbanek
2014-09-03 14:20:52 UTC
Permalink
Post by Xiao He
Hi all,
I tried to load a package which includes a shared object on one of my Macs,
and I got an error message below, which suggests that the file "
libquadmath.0.dylib" is missing in the /usr/local/lib folder. On my other
Mac however, I have no problem loading the package, and the file "
libquadmath.0.dylib" is in the /usr/local/lib folder. I wonder where this
libquadmath.0.dylib file is from, and how I can install it on the computer
where it is missing. Thanks!
libquadmath is part of the Fortran compiler, it is not a standard library, so it will be only present if you install the compiler.

Note that the Mavericks build of R on CRAN also ships with the quadmath library and Mavericks CRAN package binaries use it from there. If you compile a package yourself and want others to be able to use it, you may want to change the path from /usr/local/lib/libquadmath.0.dylib to /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libquadmath.0.dylib via install_name_tool --- the same goes for libgfortran.3.dylib.

Cheers,
Simon
Post by Xiao He
library(WRScpp)
unable to load shared object
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so,
6): Library not loaded: /usr/local/lib/libquadmath.0.dylib
/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so
Reason: image not found
Error: package or namespace load failed for ?WRScpp??
[[alternative HTML version deleted]]
_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Xiao He
2014-09-03 16:28:02 UTC
Permalink
Dear Simon,

Thanks for the quick reply. I tried to do what you suggested:

install_name_tool -id
/Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libquadmath.0.dylib
/usr/local/lib/libquadmath.0.dylib

But I got the following error messages:

error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
can't open input file: /usr/local/lib/libquadmath.0.dylib for writing
(Permission denied)
error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
can't lseek to offset: 0 in file: /usr/local/lib/libquadmath.0.dylib for
writing (Bad file descriptor)
error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
can't write new headers in file: /usr/local/lib/libquadmath.0.dylib (Bad
file descriptor)
error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
can't close written on input file: /usr/local/lib/libquadmath.0.dylib (Bad
file descriptor)


The first error (Permission denied) can be solved by using "sudo" I
suppose. But I am not sure what caused the other three errors. Do you
happen know what may have been the root of the errors? Thank you again.

Best,
-Xiao





On Wed, Sep 3, 2014 at 3:20 PM, Simon Urbanek <simon.urbanek at r-project.org>
Post by Xiao He
Post by Xiao He
Hi all,
I tried to load a package which includes a shared object on one of my
Macs,
Post by Xiao He
and I got an error message below, which suggests that the file "
libquadmath.0.dylib" is missing in the /usr/local/lib folder. On my other
Mac however, I have no problem loading the package, and the file "
libquadmath.0.dylib" is in the /usr/local/lib folder. I wonder where this
libquadmath.0.dylib file is from, and how I can install it on the
computer
Post by Xiao He
where it is missing. Thanks!
libquadmath is part of the Fortran compiler, it is not a standard library,
so it will be only present if you install the compiler.
Note that the Mavericks build of R on CRAN also ships with the quadmath
library and Mavericks CRAN package binaries use it from there. If you
compile a package yourself and want others to be able to use it, you may
want to change the path from /usr/local/lib/libquadmath.0.dylib to
/Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libquadmath.0.dylib
via install_name_tool --- the same goes for libgfortran.3.dylib.
Cheers,
Simon
Post by Xiao He
library(WRScpp)
unable to load shared object
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so,
Post by Xiao He
6): Library not loaded: /usr/local/lib/libquadmath.0.dylib
/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so
Post by Xiao He
Reason: image not found
Error: package or namespace load failed for ?WRScpp??
[[alternative HTML version deleted]]
_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
[[alternative HTML version deleted]]
Simon Urbanek
2014-09-03 16:37:23 UTC
Permalink
Post by Xiao He
Dear Simon,
install_name_tool -id /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libquadmath.0.dylib /usr/local/lib/libquadmath.0.dylib
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open input file: /usr/local/lib/libquadmath.0.dylib for writing (Permission denied)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't lseek to offset: 0 in file: /usr/local/lib/libquadmath.0.dylib for writing (Bad file descriptor)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't write new headers in file: /usr/local/lib/libquadmath.0.dylib (Bad file descriptor)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't close written on input file: /usr/local/lib/libquadmath.0.dylib (Bad file descriptor)
The first error (Permission denied) can be solved by using "sudo" I suppose. But I am not sure what caused the other three errors. Do you happen know what may have been the root of the errors? Thank you again.
sudo should solve them all - the FD is invalid because it could not be opened in the first place.

Note that if you can't sudo, you can also use install_name_tool -change on the package .so to change the path there instead. But the above would be a more permanent solution.

Cheers,
Simon
Post by Xiao He
Best,
-Xiao
Post by Xiao He
Hi all,
I tried to load a package which includes a shared object on one of my Macs,
and I got an error message below, which suggests that the file "
libquadmath.0.dylib" is missing in the /usr/local/lib folder. On my other
Mac however, I have no problem loading the package, and the file "
libquadmath.0.dylib" is in the /usr/local/lib folder. I wonder where this
libquadmath.0.dylib file is from, and how I can install it on the computer
where it is missing. Thanks!
libquadmath is part of the Fortran compiler, it is not a standard library, so it will be only present if you install the compiler.
Note that the Mavericks build of R on CRAN also ships with the quadmath library and Mavericks CRAN package binaries use it from there. If you compile a package yourself and want others to be able to use it, you may want to change the path from /usr/local/lib/libquadmath.0.dylib to /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libquadmath.0.dylib via install_name_tool --- the same goes for libgfortran.3.dylib.
Cheers,
Simon
Post by Xiao He
library(WRScpp)
unable to load shared object
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so,
6): Library not loaded: /usr/local/lib/libquadmath.0.dylib
/Library/Frameworks/R.framework/Versions/3.1/Resources/library/WRScpp/libs/WRScpp.so
Reason: image not found
Error: package or namespace load failed for ?WRScpp??
[[alternative HTML version deleted]]
_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Loading...