This question already has an answer here:
Error installing r packages (Linux Mint 17.1) "error: C preprocessor "g++ -E" fails sanity check"
(1 answer)
Closed 7 years ago.
I have problem with installing packages in RStudio.
I'm using Linux Mint and have already installed libgdal-dev and libproj-dev.
Here's the text in the terminal:
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /usr/lib/R
checking for R... /usr/lib/R/bin/R
checking for R >= 3.1.0... no
*** disabling C++11 use
checking for cat... /bin/cat
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... g++ -E
configure: error: in `/tmp/Rtmp3NFJZN/R.INSTALL28c32774afde/stringi':
configure: error: C preprocessor "g++ -E" fails sanity check
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/home/varum/R/x86_64-pc-linux-gnu-library/3.0/stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpv9QKWM/downloaded_packages’
Any ideas where the problem is?
checking for R >= 3.1.0... no
It might help to update your R version. The current release is version 3.2.2
Check the installation guidelines here.
Maybe installing the g++ could help
sudo apt-get install g++
Related
I would like to install 'readline' using Cabal on Windows. When running the command it is saying that readline isn't found. Cabal is up to date.
Command
cabal install readline
Output
Resolving dependencies...
Notice: installing into a sandbox located at
C:\Users\Michael\Desktop\haskell-project\.cabal-sandbox
Configuring readline-1.0.3.0...
Failed to install readline-1.0.3.0
Build log ( C:\Users\Michael\Desktop\haskell-project\.cabal-sandbox\logs\readline-1.0.3.0.log ):
Configuring readline-1.0.3.0...
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for GNUreadline.framework... checking for readline... no
checking for tputs in -lncurses... no
checking for tputs in -ltermcap... no
checking for tputs in -lcurses... no
checking for rl_readline_version... no
configure: error: readline not found, so this package cannot be built
See `config.log' for more details.
cabal: Error: some packages failed to install:
readline-1.0.3.0 failed during the configure step. The exception was:
ExitFailure 1
What could be the reason for this?
If you are using an msys distro that includes pacman (the one that ships with the windows haskell platform installer should be such a distro) then you can use pacman to install the readline library, and this should let you link against it.
Also note that ghc ships with the haskeline library, which is a pure-haskell replacement for readline that is more portable.
I have this error when I add this dependencie to my project.cabal file.
Warning: defaultUserHooks in Setup script is deprecated.
Configuring readline-1.0.3.0...
checking for gcc... /usr/bin/gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking for GNUreadline.framework... checking for readline... no
checking for tputs in -lncurses... yes
checking for readline in -lreadline... no
checking for rl_readline_version... no
configure: error: readline not found, so this package cannot be built
See `config.log' for more details.
what I have to do to solve this?
Say your are on OSX
$ brew install readline
[...]
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/readline/lib
CPPFLAGS: -I/usr/local/opt/readline/include
Now you know where the library got installed you can set some environmental variables that ./configure will pick up
LDFLAGS=-L/usr/local/opt/readline/lib \
CFLAGS=-I/usr/local/opt/readline/include \
stack install readline --extra-include-dirs=/usr/local/opt/readline/include --extra-lib-dirs=/usr/local/opt/readline/lib
I'm trying to install terminfo cabal package on my Windows Cygwin installation, but it fails because of curses headers:
$ cabal install terminfo
Resolving dependencies...
Configuring terminfo-0.3.2.5...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
...
checking ncurses.h usability... no
checking ncurses.h presence... no
checking for ncurses.h... no
checking curses.h usability... no
checking curses.h presence... no
checking for curses.h... no
configure: error: in `/tmp/terminfo-0.3.2.5-620/terminfo-0.3.2.5':
configure: error: curses headers could not be found, so this package cannot be built
See `config.log' for more details
Failed to install terminfo-0.3.2.5
cabal.exe: Error: some packages failed to install:
terminfo-0.3.2.5 failed during the configure step. The exception was:
ExitFailure 1
At the same time, NCurses is installed correctly (/usr/include/ncursesw and ncurses).
If before compilation I explicitly add that sub-folder to GCC, it proceeds
export C_INCLUDE_PATH=/usr/include/ncursesw
re-running cabal produced another error:
...
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking for setupterm in -lncursesw... yes
configure: creating ./config.status
config.status: creating terminfo.buildinfo
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
cabal.exe: Missing dependency on a foreign library:
* Missing (or bad) header file: ncurses.h
* Missing C library: ncursesw
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
Failed to install terminfo-0.3.2.5
cabal.exe: Error: some packages failed to install:
terminfo-0.3.2.5 failed during the configure step. The exception was:
ExitFailure 1
So I tried cabal install terminfo --extra-lib-dirs=/lib/ncursesw, but then I realized that cabal is a windows app, so I've also tried --extra-lib-dirs=c:/cygwin/lib/ncursesw
In the end, final solution is as follows:
Install Cygwin and ncursesw-devel package there
Run cygwin and configure GCC:
$ export C_INCLUDE_PATH=/usr/include/ncursesw
Since C:\cygwin\usr\include\ncursesw\ncurses.h is a soft-reference in Cygwin, you should manually replace this file with curses.h from the same folder
From the same Cygwin terminal you can now start Cabal (it's a Windows program!):
$ cabal install terminfo --extra-lib-dirs=c:/cygwin/lib --extra-include-dirs=c:/cygwin/usr/include/ncursesw --extra-include-dirs=c:/cygwin/usr/include
So, the library was installed. But when I try to actually use that function, ghc complains:
Loading package terminfo-0.3.2.5 ... linking ... ghc.exe: c:/cygwin/lib\libncursesw.a: unknown symbol `__imp____ctype_ptr__'
Hell I have been having an extremely tough time installing libtorrent and am unsure what the problems are. I have seen plenty similar errors online but the solutions were not helpful and I am pretty sure the error message is just too vague for comparison.
When I run ./configure I get
**
Building libtorrent-rasterbar 0.16.5
Checking for a C/C++ compiler to use:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether g++ understands -c and -o together... yes
.
..
.
Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
configure: error: Boost.System library not found. Try using --with-boost-system=lib
**
I then use the suggestion and the difference is that the bottom says
**
Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
checking for exit in -llib... no
checking for exit in -lboost_system-lib... no
configure: error: Could not link against boost_system-lib !
**
the config.log file has an error
**
configure:16572: result: no
configure:16537: checking for exit in -lboost_system-lib
configure:16562: gcc -o conftest -lpthread -g -O2 -fvisibility=hidden -I/usr/include -L/usr/lib conftest.c -lboost_system-lib -lpthread >&5
conftest.c:33: warning: conflicting types for built-in function 'exit'
/usr/bin/ld: cannot find -lboost_system-lib
collect2: ld returned 1 exit status
**
Any insight would be enormously appreciated
after installing
apt-get install libboost-system-dev
apt-get install libboost-filesystem-dev libboost-thread-dev
Checking features to be enabled:
checking whether encryption support should be enabled... yes
configure: encryption support: now checking for the OpenSSL library...
checking for pkg-config... /usr/bin/pkg-config
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
configure: error: OpenSSL library not found. Try using --with-openssl=DIR or disabling encryption at all.
You need to install libboost-system.
If you are using Debian/Ubuntu, use apt-get as follows.
$ apt-get install libboost-system-dev
You may also need to install ...
$ apt-get install libboost-filesystem-dev libboost-thread-dev
The easiest way to install all the dependencies is with apt-get.
sudo apt-get build-dep python-libtorrent
I know this is a bit old, but to solve your OpenSSL problem you need to install the OpenSSL libraries with sudo apt-get install libssl-dev.
For CentOS users, you will want to install boost-devel.
# yum install boost-devel
But I still got the same error. Just want to point out one more thing, the CentOS 6.4 I work with had an old gcc compiler:
# g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Installing a newer version of gcc helped me to get rid of that particular error. I used g++ (GCC) 4.8.2 version and this time calling the following command worked:
# ./configure --with-boost-libdir=/usr/lib64
After this point you might still run into not finding openssl headers like the OP posted here, this post will help to overcome the error. You may have to install openssl-devel (for CentOS) or libssl-dev (for Debian), or you can run with
# ./configure --with-boost-libdir=/usr/lib64 --without-ssl
If you have openssl headers installed in your system, you don't need to use --with-openssl flag, or at least I didn't need to use it.
Although this is old post, hope it will help someone else like me.
To avoid OpenSSL issues you can build "libtorrent-rasterbar" disabling OpenSSL encryption.
For instance:
./configure --disable-debug --disable-encryption --prefix=/opt/libtorrent-rasterbar
And then "make" + "make install"
Regards
The accepted answer didn't work for me. What did work was editing the configure script file and removing those lines from it:
if test -z "$BOOST_SYSTEM_LIB"; then :
as_fn_error $? "Boost.System library not found. Try using --with-boost-system=lib" "$LINENO" 5
fi
Those lines seemed to check that the BOOST_SYSTEM_LIB environment variable exists and is not empty.
For Arch users (ex. Manjaro) install the boost pkg from pacman. Search for "boost" and install from Official Repo(extra).
Here's the message I get when trying to install in via cabal-install:
$ cabal install --extra-include-dirs="C:\no_spaces\cygwin\usr\include" --extra-lib-dirs="C:\no_spaces\cygwin\lib" readline
Resolving dependencies...
Configuring readline-1.0.1.0...
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for GNUreadline.framework... checking for readline... no
checking for tputs in -lncurses... yes
checking for readline in -lreadline... yes
checking for rl_readline_version... yes
checking for rl_begin_undo_group... yes
checking for rl_erase_empty_line... yes
checking for rl_free_undo_list... yes
checking for rl_completion_word_break_hook in -lreadline... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating readline.buildinfo
config.status: creating include/HsReadlineConfig.h
config.status: include/HsReadlineConfig.h is unchanged
cabal.exe: Missing dependencies on foreign libraries:
* Missing header file: HsReadline.h
* Missing C libraries: readline, ncurses
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal.exe: Error: some packages failed to install:
readline-1.0.1.0 failed during the configure step. The exception was:
ExitFailure 1
I have readline.h and whatnot, and clearly it seems to find them. The lack of HsReadline.h being an issue seems strange: isn't that part of the package I'm trying to install?
Any advice on how to get this working would be appreciated. I've spent days mucking around trying to get this to work, whether under gnuWin32 readline, MinGW, or cygwin.
I'm going to venture a guess that what's throwing Cygwin off is the DOS/Windows-style path: "C:\no_spaces\cygwin\usr\include"
Try navigating to these files in the Cygwin shell. It'll probably look something like "/cygdrive/c/no_spaces/cygwin/usr/include"
The message about HsReadline.h is probably a red herring. The real issue is that Cabal can't find the underlying dev library to compile against.