[R] Build a package on one Mac but unable to load this on another Mac
Hi, I build a package on one Mac. I can install the package on another Mac but it cannot be loaded. The following is the error message. Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so': dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so, 6): Library not loaded: /usr/local/lib/libgfortran.3.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so Reason: image not found Error: package or namespace load failed for ‘mypkgfe’ If I install the gfortran on the user's Mac, the package can be installed and loaded successfully. But I don't think this is a good option to solve this problem as it requires too much on the user's end. Is there anyway to build the package so that it can be successfully loaded even the Mac doesn't have gfortran preinstalled? It seems the Mavericks OS X can load the package but not the Snow Leopard OS X. I am wondering if this has anything to do with the fact that R for Snow Leopard doesn't include GNU Fortran. Thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Build a package on one Mac but unable to load this on another Mac
On Oct 18, 2014, at 8:42 AM, althu07 wrote: Hi, I build a package on one Mac. I can install the package on another Mac but it cannot be loaded. The following is the error message. Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so': dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so, 6): Library not loaded: /usr/local/lib/libgfortran.3.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so Reason: image not found Error: package or namespace load failed for ‘mypkgfe’ If I install the gfortran on the user's Mac, the package can be installed and loaded successfully. But I don't think this is a good option to solve this problem as it requires too much on the user's end. Is there anyway to build the package so that it can be successfully loaded even the Mac doesn't have gfortran preinstalled? It seems the Mavericks OS X can load the package but not the Snow Leopard OS X. I am wondering if this has anything to do with the fact that R for Snow Leopard doesn't include GNU Fortran. As far as Macs are concerned there are two forks in the R versions: one running on Snow Leopard, Lion and Mountain Lion and the other running on Mavericks and Yosemite. If you submit the package to CRAN it will build two different versions using the correct toolchains (and the correct XQuartz and Java packages). If you are doing this on your own, you will need to have two different versions each with the correct toolchains. This is something that is described in the admin documents. And future questions should go to the correct mailing list: R-SIG-Mac: https://stat.ethz.ch/mailman/listinfo/r-sig-mac Thanks! [[alternative HTML version deleted]] And like rhelp, R-SIG-Mac is a plain text mailing list. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Build a package on one Mac but unable to load this on another Mac
You could include just that library in your distribution, and change the dynamic link path using install_name_tool. I assume how to do so in detail is beyond the intended scope of this mailing list. On Oct 18, 2014, at 11:42 AM, althu07 alth...@gmail.com wrote: Hi, I build a package on one Mac. I can install the package on another Mac but it cannot be loaded. The following is the error message. Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so': dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so, 6): Library not loaded: /usr/local/lib/libgfortran.3.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so Reason: image not found Error: package or namespace load failed for ‘mypkgfe’ If I install the gfortran on the user's Mac, the package can be installed and loaded successfully. But I don't think this is a good option to solve this problem as it requires too much on the user's end. Is there anyway to build the package so that it can be successfully loaded even the Mac doesn't have gfortran preinstalled? It seems the Mavericks OS X can load the package but not the Snow Leopard OS X. I am wondering if this has anything to do with the fact that R for Snow Leopard doesn't include GNU Fortran. Thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Build a package on one Mac but unable to load this on another Mac
On 18/10/2014 17:34, Amos B. Elberg wrote: You could include just that library in your distribution, and change the dynamic link path using install_name_tool. I assume how to do so in detail is beyond the intended scope of this mailing list. In fact you just need to change the path, as that library is included in the CRAN R distribution (which I guess is what it being used, although no one said which R it was). Look in /Library/Frameworks/R.framework/Versions/Current/Resources/lib It is also most likely possible to link against a static libgfortran, as we do on Windows. But this is indeed the wrong list: see the posting guide which it seems neither of you have read. Follow-ups to R-sig-mac On Oct 18, 2014, at 11:42 AM, althu07 alth...@gmail.com wrote: Hi, I build a package on one Mac. I can install the package on another Mac but it cannot be loaded. The following is the error message. Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so': dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so, 6): Library not loaded: /usr/local/lib/libgfortran.3.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/mypkgfe/libs/mypkgfe.so Reason: image not found Error: package or namespace load failed for ‘mypkgfe’ If I install the gfortran on the user's Mac, the package can be installed and loaded successfully. But I don't think this is a good option to solve this problem as it requires too much on the user's end. Is there anyway to build the package so that it can be successfully loaded even the Mac doesn't have gfortran preinstalled? It seems the Mavericks OS X can load the package but not the Snow Leopard OS X. I am wondering if this has anything to do with the fact that R for Snow Leopard doesn't include GNU Fortran. Thanks! [[alternative HTML version deleted]] -- Brian D. Ripley, rip...@stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.