I usually compile my own version of R, because I connect it to openmpi, and blas and a couple of other things. This configure statement appears to work fine
./configure --enable-R-shlib --with-blas=-lopenblas --enable-memory-profiling
but then when I try to make I get this error
gcc -Wl,--export-dynamic -fopenmp -L"../../lib" -L/usr/local/lib -o R.bin Rmain.o -lR
../../lib/libR.so: undefined reference to `ucol_strcollIter_58'
../../lib/libR.so: undefined reference to `u_getVersion_58'
which reading other threads appears to be related to the libicu-dev package? It appears to be looking for version 58, but I checked and currently have ubuntu version libicu-dev (60.2-3ubuntu3) installed. This might have something to do with a recent install of anaconda?
Reading package lists... Done
Building dependency tree
Reading state information... Done
libicu-dev is already the newest version (60.2-3ubuntu3).
libicu-dev set to manually installed.
Any suggestions how to get R to build against the newer installed version of libicu-dev?
I successfully install R with this commander "./configure --prefix=/path/to/location LDFLAGS="-L/usr/local/lib" . Where /usr/local/lib is the directory icu installed (wget https://github.com/unicode-org/icu/archive/release-58-3.tar.gz). I think it is the problem that anaconda/lib also contained libicuio.so.* files. After specifying certain LDFLAGS, it worked
Related
I have seen a number of different people post this problem (example: Tried to guess R's HOME but no R command in the PATH. OsX 10.6 and Installing rpy2 on Mac OSX 10.8.5), but I have yet to find a viable solution.
I have ensured that I have Python-2.7 installed in my terminal, and since I had recently upgraded by RStudio, I thought that my R was also updated. But everytime I tried to run either:
pip install rpy2
or
easy_install rpy2
I kept getting the same error of Error: Tried to guess R's HOME but no command 'R' in the PATH.
After some googling, I decided to try to download the latest version of R (v 3.4.1), even though I'm very certain it was already updated to begin with. But now I get the following behemoth of an error (I should note that I have condensed it):
In file included from ./rpy/rinterface/_rinterface.c:122:
./rpy/rinterface/sequence.c:2173:1: warning: unused function 'ComplexVectorSexp_AsSexp' [-Wunused-function]
ComplexVectorSexp_AsSexp(PyObject *pyfloat) {
^
11 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/./rpy/rinterface/_rinterface.o -L/usr/local/lib -Lbuild/temp.macosx-10.12-intel-2.7 -L/usr/local/lib -lpcre -llzma -lbz2 -lz -licucore -lm -liconv -lr_utils -o build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/_rinterface.so -fopenmp -F/Library/Frameworks/R.framework/.. -framework R
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-zT8DaX/rpy2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bDnbE5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-zT8DaX/rpy2/
So now I have a completely different error occurring. I thought that upgrading my R would automatically add it to my environmental variable PATH, but now I'm really at a loss at how to deal with this. I have tried to google this new error but I can't seem to find any solutions that are geared towards installing Rpy2 on a Mac OSX with Python-2.7 and R-3.4. Can anybody offer any kind of advice?
ADDENDUM
I have now tried a variety of other approaches, including downloading XCODE, and updating my GCC compiler, (one such approach is delineated in http://cs.millersville.edu/~gzoppetti/InstallingGccMac.html), and I have also tried to reinstall GCC with the command brew reinstall gcc --without-multilib. I have also edited my PATH environmental variables to include R, CC, and have still had no luck.
I have now figured out that rpy2 installation is contingent upon the right kind of compiler being used. The default compiler for Apple is clang, which does not support rpy2's set up process. So, after acquiring the gcc compiler via homebrew, you can then run brew ls gcc to see the file paths of what gcc compilers are present on your computer. I then ran the following commands in the terminal to change the default compiler from clang to the file path gcc-7, then set the proper flags (which I deduced from reading the error messages yielded by the compiler before), and then install rpy2.
export CC=/usr/local/Cellar/gcc/7.2.0/bin/x86_64-apple-darwin16.7.0-gcc-7
export CFLAGS="-W"
pip install rpy2==2.8.6
I should note that I installed rpy2 version 2.8.6 since my scripts are in Python 2.7, and rpy2 2.9.0 is only compatible with Python 3.x. Furthermore, I am aware that this answer might not adequately describe the problem for everyone, so I encourage other users to expand and/or correct this solution.
The error about "no R in the PATH" is exactly about what it says. To reproduce, open a terminal and enter "R": there should not be any such command found. The solution is to have R findable in the PATH.
Now starting with R-3.4 the tools needed to compile R and and R extensions in C have changed, and the requirements are less standard than one might hope for. This can be debated to be an issue with R and OS X, and there is an open issue in the rpy2 tracker about it.
edit: Note that the issue was resolved and a precompiled binary wheel for rpy2-2.9.3 is now available on pypi.
It's possible to do the GCC switch with a single env command:
env CC=/usr/local/Cellar/gcc/7.2.0/bin/gcc-7 pip install rpy2
The reason clang doesn't work with RPy2 is because clang 4.0.0 doesn't include the -fopenmp flag, which is used by R. There's an ongoing open problem thread on the RPy2 Bitbucket about it.
symphony is correctly installed and tested in terminal. R complains about missing header and libraries when trying to install Rsymphony from source. Any pointers are HIGHLY appreciated. thank you!
symphony installation directory: /Users/timo/Applications/symphony/
R install command:
install.packages("Rsymphony", configure.args="--with-SYMPHONY-include=/Users/timo/Applications/symphony/include/ --with-SYMPHONY-lib=/Users/timo/Applications/symphony/lib",type="source")
results in :
* installing *source* package ‘Rsymphony’
** package ‘Rsymphony’ successfully unpacked and MD5 sums checked
Cannot find SYMPHONY libraries and headers.
See <https://projects.coin-or.org/SYMPHONY>.ERROR: configuration failed for package ‘Rsymphony’* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rsymphony’* restoring previous‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rsymphony’
I also struggled to get Rsymphony installed, but finally got it working after many hours of messing around. Here's what I did, hopefully it'll save others some time. This works on Mac OS El Capitan (10.11) and R 3.3.0.
First, install the homebrew package manager if you don't already have it:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Next install SYMPHONY with homewbrew. I found this to be the best approach because it puts everything in the right place:
brew tap coin-or-tools/coinor
brew install symphony
Now install pkg-config, a tool for querying installed libraries for when compiling software source code. Not sure if this is strictly necessary, but pkg-config is used in the configuration script for Rsymphony:
brew install pkg-config
At this point Rsymphony should now be able to find the necessary SYMPHONY libraries, however, I still got the following compiler error:
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
Apparently it has something to do with needing a different version of the fortran compiler. This helpful post with instructions for getting the correct compiler saved me. Run the following commands:
curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /
Now, finally, you should be able to install Rsymphony with:
install.packages("Rsymphony", type = "source")
SOLUTION:
I have found the solution in this link (...I got RSymphony to install, but it involved some hacking ...)
Installing RSymphony using RStudio on macOS
I had also this issue: ..no checking for COIN-OR package CoinUtils... and it was solved by "export PKG_CONFIG=/usr/local/bin/pkg-config; export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/"
Installing statnet on mac 10.10.3 with R 3.2.x (RStudio 0.99.441).
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [latentnet.so] Error 1
ERROR: compilation failed for package ‘latentnet’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/latentnet’
Warning in install.packages :
installation of package ‘latentnet’ had non-zero exit status
ERROR: dependency ‘latentnet’ is not available for package ‘statnet’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/statnet’
Warning in install.packages :
installation of package ‘statnet’ had non-zero exit status
I tried updating XCode/Command Line Tools. Also tried not installing dependencies. I have been able to install other packages, such as ergm and sna.
It looks like the install is looking for the GCC folder and not finding it.
whereis gcc
reveals that my gcc is in /usr/bin/gcc
It looks like the install is looking for it in /usr/local/lib/gcc/
Is there a way to fix this?
This is a compilation error that you only get if you are trying to install packages from source, or when a package requires a library to be compiled from source. Normally, if you don’t use the latest version of R, you can install statnet from binary and thus R won’t have to compile the source package.
The version you are mentioning at the beginning of your message (0.99.441) is the version of your R-Studio, and not R. The version of your R is 3.2.x (Hence its address in the Library folder: /Library/Frameworks/R.framework/Versions/3.2/Resources…). Before trying to fix the compilation error you may want to try to roll back your R to a version like 3.1.2 or 3.1.3 on which you can probably download and install statnet in binary format.
For the compiler, my guess is that even if you fix the address of your gcc with a symlink, you will still get an error about gfortran or the version of gcc. Once I solved this issue by installing R and the right version of gcc through Homebrew, but right now I don’t have the possibility to try the solution and tell you exactly how.
My experience (on Yosemite) is that if you use 3.1.2 or 3.1.3, even if there is need for compilation, the error with gcc won’t occur.
sudo mkdir /usr/bin/lib && sudo ln -s /usr/bin/gcc /usr/bin/lib/gcc
Creates a new directory in /usr/bin called `lib' and creates a symbolic link to gcc in that new directory.
If that doesn't fix the error, you can undo it with:
sudo rm -i /usr/bin/lib/gcc && sudo rm -id /usr/bin/lib
I'm using the OS X devel version of R
R Under development (unstable) (2014-05-27 r65787)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
with GNU Fortran (GCC) 4.2.3 (from Simon's site) and version 5.1.1 of Xcode's command line tools.
When building from source, I get errors like:
gfortran-4.8 -fPIC -g -O2 -c altmov.f -o altmov.o
make: gfortran-4.8: No such file or directory
I'm not sure what to do here. I could create an alias to the version I have but I'm not sure if it really needs 4.8 or not.
Thanks,
Max
Type these two lines in your terminal, direct quote:
curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxj gfortran-4.8.2-darwin13.tar.bz2 -C /
It will download you the gfortran for Mavericks (which is missing in your system at the moment) and will install it in your system. At least, this solved the same problem for me
(I'm running late 2011 MacPro, Mavericks).
Edit: I now think this is best accomplished using Homebrew:
brew reinstall gcc48 --with-fortran
While I think the following procedure will work, it is not as clean. However, I still recommend configuring ~/.R/Makevars as described below.
To build on the answer by #TheBigMike, I used the following procedure to install gfortran-4.8 alongside homebrew, and then configured R to select this fortran compiler.
First, download and unpack gfortran 4.8:
su admin
curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
mkdir /tmp/gfortran
tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /tmp/gfortran
Delete the gfortran file alias that interferes with homebrew:
rm /tmp/gfortran/usr/local/bin/gfortran
Install gfortran 4.8
cp -r /tmp/gfortran/usr/local/ /usr/local
To tell R to use gfortran 4.8, create a file called ~/.R/Makevars:
mkdir -p ~/.R
touch ~/.R/Makevars
Put the following into ~/.R/Makevars:
FLIBS=""
F77="gfortran-4.8"
FC="gfortran-4.8"
Now restart R. Once R has been restarted, any packages that depend upon fortran 4.8 should now work. homebrew should be undisturbed.
I encountered the same problem, albeit on R Studio.
The following worked for me, although, I had to reinstall all my R packages after (note: the re-installations took awhile and look like quite a bit was going on, unsure if these were the appropriate steps, use at own risk):
Download latest R Studio version and then following in terminal:
brew install gcc
brew update && brew reinstall r
brew link --overwrite r
This is explained nicely in Rcpp FAQ, section 2.16. Basically you need to install gfortran (homebrew install gcc or the other way) and then modify Makeconf to point FLIBS to the relevant fortran libraries.
These were the steps which worked for me:
Install gcc48 via homebrew
Make sure that gfortran and gfortran-4.8 point to the newly installed versions.
Comment the FLIBS variable in /Library/Frameworks/R.framework/Resources/etc/Makeconf.
The step 3 was the most important one, because it is designed to work with the gfortran which is installed in the way #TheBigMike suggested, i.e. by downloading and extracting the archive gfortran-4.8.2-darwin13.tar.bz2.
The following worked for me on OSX High Sierra and RStudio 1.1.423:
Install gcc/gfortran via Homebrew: brew install gcc
Edit /Library/Frameworks/R.framework/Resources/etc/Makeconf and replace all instances of gfortran-4.8 with gfortran
Also replace FLIBS = -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 with FLIBS = -L/usr/local/lib/gcc/7/ -lgfortran -lquadmath -lm.
Reattempt installing the package.
Install gcc/gfortran via Homebrew: brew install gcc
Make sure you replace it is not done automatically: /Library/Frameworks/R.framework/Resources/etc/Makeconf and replace all instances of gfortran-4.8(or any number) with gfortran
Replace FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm to
FLIBS = -L/usr/local/lib/gcc/7/ -lgfortran -lquadmath -lm
Reinstall the package for me was robustbase that was required by fpc library
Got the same issue and found a statement in the R cran site (https://cran.ism.ac.jp/) In the latest OSX such as High Sierra, some necessary libs are not included and these have to be installed. The page kindly explains this, quoting
Important: this release uses Clang 6.0.0 and GNU Fortran 6.1, neither
of which is supplied by Apple. If you wish to compile R packages from
sources, you will need to download and install those tools - see the
tools directory.
I resolved the issues (missing gfortran etc.) with applying the following two packages, here.
clang-6.0.0.pkg (OS X 10.11+, signed, 64-bit)
MD5-hash: c29700c4e7b2914073ef7e741eb105bc
(ca. 418Mb)
gfortran-6.1.pkg (OS X 10.11+, signed, 64-bit)
MD5-hash: 201026216e8b373d9cd2efc0cc474bb8
(ca. 73Mb)
This answer by thebigmike suggests:
Type these two lines in your terminal, direct quote:
curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxj gfortran-4.8.2-darwin13.tar.bz2 -C /
but
curl -OL http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
Solves the problem for me!
Updated version of RStudio (Version 0.98.1091) seems to fix this.
Make sure R is updated to version >= 4.0 (for previous versions this might help: https://cran.ism.ac.jp/bin/macosx/tools/)
Download and install the GNU fortran compiler found here: https://mac.r-project.org/tools/
Make sure you add /usr/local/gfortran/bin to your PATH in order to use this compiler. This can be done, e.g. by
export PATH=$PATH:/usr/local/gfortran/bin
If you are having trouble installing software that depends on FORTRAN on Max OS 10.15 or later. The best solution is to update R to at least version 4.0.0
Installing gcc via homebrew give me gfortran:
brew install gcc
Then:
$which gfortran
/usr/local/bin/gfortran
I am new to Ubuntu and i am getting a message while building Qt 4.8.3 on Ubuntu 12:
Basic XLib functionality test failed! You might need to modify the
include and library search paths by editing QMAKE_INCDIR_X11 and
QMAKE_LIBDIR_X11 in
/home/majidmax/qt-everywhere-opensource-src-4.8.3/mkspecs/linux-g++.
what the proper steps to build Qt on Ubuntu?
http://qt-project.org/doc/qt-4.8/requirements-x11.html
the website provide the package list which must be installed
try it~
These are the packages you need to install and you'll be good to go. I just had this same problem and this worked for me. These came from the link provided by Garlic Tseng in the accepted answer. I am just putting these here for convenience:
libfontconfig1-dev
libfreetype6-dev
libx11-dev
libxcursor-dev
libxext-dev
libxfixes-dev
libxft-dev
libxi-dev
libxrandr-dev
libxrender-dev
One (copy pastable) command to install all:
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
What about sudo apt-get build-dep qt4-qmake?
Try to run that command before you compile Qt (on Debian-like distros).
Same problem i faced in fedora20 (64-bit) for Qt-4.8.3
1)- yum install libXext-devel
(internet connectivity should be there for checking the dependency and install all dependency).
2)- ./configure
3)- make
4)- make install
5)- Installation finish successfully.
The error message doesn't give a lot of information as to the actual issue of XLib failing.
To get more information on the error causing it to fail you can 'make' the xlib tests:
$ cd <Qt_Source_Directory>/config.tests/x11/xlib/
$ make
g++ -Wl,-O1 -o xlib xlib.o -L/usr/X11R6/lib -ltcg -lXext -lX11 -lm
/usr/bin/ld: cannot find -ltcg
collect2: error: ld returned 1 exit status
make: *** [xlib] Error 1
In my case above, I was using -ltcg which was being interpreted as an explicit library to include. I was using this option as it is listed on the qt 4.8 configure options as:
Use Link Time Code Generation
When I looked at the configure options using ./configure --help I noticed that this option isn't listed. Removing the option from my configure line fixed my issue.
what the proper steps to build Qt on Ubuntu?
Check the Qt supported Platforms.
Check Qt for X11 requirements.
3a. Check steps to install Qt on X11 platforms(along with build).
or
3b. Check steps to build static Qt.