R package 'RcppArmadillo' error during installation - r

I'm trying to install RcppArmadillo in my R environment.
I have created a Docker container starting from a Ubuntu:20.04 image and installing miniconda to manage the environment and install R.
When I install RcppArmadillo I have this error:
checking whether the C++ compiler works... no
configure: error: in `/tmp/Rtmp1znFrE/R.INSTALL3901267e6e22/RcppArmadillo':
configure: error: C++ compiler cannot create executables
I have checked the config.log file to search the error, and I found this:
gcc version 9.4.0 (conda-forge 9.4.0-15)
configure:1931: $? = 0
configure:1920: aarch64-conda-linux-gnu-c++ -std=gnu++14 -V >&5
aarch64-conda-linux-gnu-c++: error: unrecognized command line option '-V'
aarch64-conda-linux-gnu-c++: fatal error: no input files
compilation terminated.
configure:1931: $? = 1
configure:1920: aarch64-conda-linux-gnu-c++ -std=gnu++14 -qversion >&5
aarch64-conda-linux-gnu-c++: error: unrecognized command line option '-qversion'; did you mean '--version'?
aarch64-conda-linux-gnu-c++: fatal error: no input files
compilation terminated.
configure:1931: $? = 1
configure:1951: checking whether the C++ compiler works
configure:1973: aarch64-conda-linux-gnu-c++ -std=gnu++14 -fvisibility-inlines-hidden -fmessage-length=0 -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem /root/miniconda3/include -fdebug-prefix-map=/drone/src/build_artifacts/r-base-split_1630154255557/work=/usr/local/src/conda/r-base-4.1.1 -fdebug-prefix-map=/root/miniconda3=/usr/local/src/conda-prefix conftest.cpp >&5
/root/miniconda3/bin/../lib/gcc/aarch64-conda-linux-gnu/9.4.0/../../../../aarch64-conda-linux-gnu/bin/ld: /root/miniconda3/bin/../lib/gcc/aarch64-conda-linux-gnu/9.4.0/libstdc++.so: undefined reference to `__cxa_thread_atexit_impl#GLIBC_2.18'
collect2: error: ld returned 1 exit status
I don't understand if it's a problem of GCC (I have tried to uninstall and install again through apt-get but nothing changed), but seems really strange to me.
If I echo $PATH I get as result /root/miniconda3/bin:/usr/bin:/bin, but If I find / -name gcc I get:
/root/miniconda3/lib/R/library/BH/include/boost/mpl/aux_/preprocessed/gcc
/root/miniconda3/lib/gcc
/root/miniconda3/libexec/gcc
/root/miniconda3/libexec/gcc/aarch64-conda-linux-gnu/9.4.0/gcc
/root/miniconda3/share/licenses/gcc
/root/miniconda3/pkgs/gcc_impl_linux-aarch64-9.4.0-h603953f_15/libexec/gcc
/root/miniconda3/pkgs/gcc_impl_linux-aarch64-9.4.0-h603953f_15/libexec/gcc/aarch64-conda-linux-gnu/9.4.0/gcc
/root/miniconda3/pkgs/gcc_impl_linux-aarch64-9.4.0-h603953f_15/share/licenses/gcc
/root/miniconda3/pkgs/gcc_impl_linux-aarch64-9.4.0-h603953f_15/lib/gcc
/root/miniconda3/pkgs/libgcc-devel_linux-aarch64-9.4.0-h85f5abf_15/lib/gcc
/root/miniconda3/pkgs/libstdcxx-devel_linux-aarch64-9.4.0-h85f5abf_15/lib/gcc
/root/miniconda3/pkgs/gfortran_impl_linux-aarch64-9.4.0-h54cdb55_15/libexec/gcc
/root/miniconda3/pkgs/gfortran_impl_linux-aarch64-9.4.0-h54cdb55_15/lib/gcc
/root/miniconda3/pkgs/gxx_impl_linux-aarch64-9.4.0-h603953f_15/libexec/gcc
/usr/share/gcc
/usr/share/doc/gcc
/usr/share/doc/gcc-9-base/gcc
/usr/lib/gcc
/usr/bin/gcc
so maybe there are some mistakes in all these GCC instances.
Thanks for your help

Related

Error in R CMD SHLIB compiling Fortran code

I'm trying to compile a Fortran subroutine in the remote machine, when I run:
R CMD SHLIB -fPIC vintp2p_afterburner_wind.f
I get the following error:
gcc -shared -L/sw/installed/R/3.6.2-fosscuda-2019b/lib64/R/lib -L/sw/installed/pocl/1.4-GCC-8.3.0/lib64 -L/sw/installed/ImageMagick/7.0.9-5-GCCcore-8.3.0/lib -L/sw/installed/GSL/2.6-GCC-8.3.0/lib -L/sw/installed/UDUNITS/2.2.26-GCCcore-8.3.0/lib -L/sw/installed/HDF5/1.10.5-gompic-2019b/lib -L/sw/installed/ICU/64.2-GCCcore-8.3.0/lib -L/sw/installed/libsndfile/1.0.28-GCCcore-8.3.0/lib -L/sw/installed/FFTW/3.3.8-gompic-2019b/lib -L/sw/installed/NLopt/2.6.1-GCCcore-8.3.0/lib64 -L/sw/installed/GMP/6.1.2-GCCcore-8.3.0/lib -L/sw/installed/libxml2/2.9.9-GCCcore-8.3.0/lib -L/sw/installed/cURL/7.66.0-GCCcore-8.3.0/lib -L/sw/installed/Tk/8.6.9-GCCcore-8.3.0/lib -L/sw/installed/Java/11.0.2/lib -L/sw/installed/LibTIFF/4.0.10-GCCcore-8.3.0/lib -L/sw/installed/libjpeg-turbo/2.0.3-GCCcore-8.3.0/lib64 -L/sw/installed/libpng/1.6.37-GCCcore-8.3.0/lib -L/sw/installed/PCRE/8.43-GCCcore-8.3.0/lib -L/sw/installed/SQLite/3.29.0-GCCcore-8.3.0/lib -L/sw/installed/zlib/1.2.11-GCCcore-8.3.0/lib -L/sw/installed/XZ/5.2.4-GCCcore-8.3.0/lib -L/sw/installed/bzip2/1.0.8-GCCcore-8.3.0/lib -L/sw/installed/ncurses/6.1-GCCcore-8.3.0/lib -L/sw/installed/libreadline/8.0-GCCcore-8.3.0/lib -L/sw/installed/cairo/1.16.0-GCCcore-8.3.0/lib -L/sw/installed/libGLU/9.0.1-GCCcore-8.3.0/lib -L/sw/installed/Mesa/19.1.7-GCCcore-8.3.0/lib -L/sw/installed/X11/20190717-GCCcore-8.3.0/lib -L/sw/installed/ScaLAPACK/2.0.2-gompic-2019b/lib -L/sw/installed/OpenBLAS/0.3.7-GCC-8.3.0/lib -L/sw/installed/GCCcore/8.3.0/lib64 -L/sw/installed/GCCcore/8.3.0/lib -L/sw/installed/CUDA/10.1.243/lib64 -o vintp2p_afterburner_wind.so vintp2p_afterburner_wind.o -fPIC -lgfortran -L/sw/installed/R/3.6.2-fosscuda-2019b/lib64/R/lib -lR
/sw/installed/binutils/2.28-GCCcore-6.4.0/bin/ld.gold: error: vintp2p_afterburner_wind.o: requires dynamic R_X86_64_PC32 reloc against 'log' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
make: *** [vintp2p_afterburner_wind.so] Error 1
The subroutine has a log() function. I'm totally new to this error and I don't know where to start with!
Maybe someone will find it useful: compiling is done by :
gfortran -fPIC -shared -ffree-form vintp2p_afterburner_wind.f -o vintp2p_afterburner_wind.so

Torch '!./install.sh' returns error in Colab when installing Torch

I followed http://torch.ch/docs/getting-started.html#_ to install Torch.
I always get the following error when running
!./install.sh
in google colab
error:
...
-- Installing: /root/torch/install/include/luaT.h
-- Installing: /root/torch/install/share/cmake/torch/luaTConfig.cmake
Updating manifest for /root/torch/install/lib/luarocks/rocks
torch scm-1 is now built and installed in /root/torch/install/ (license: BSD)
Updating manifest for /root/torch/install/lib/luarocks/rocks
dok scm-1 is now built and installed in /root/torch/install/ (license: BSD)
gcc -O2 -fPIC -I/root/torch/install/include -c utils.c -o utils.o
gcc -shared -o treplutils.so -L/root/torch/install/lib utils.o
gcc -O2 -fPIC -I/root/torch/install/include -c readline.c -o readline.o
readline.c:8:10: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Error: Build error: Failed compiling object readline.o
.
Please I need help fixing this error.
Probably you need something like
!apt-get install libreadline-dev
before attempting to run the install.sh script.

Linux issue happens on Windows? "fatal error: fftw3.h: No such file or directory"

I am running MRO 3.5.0 on Win10, and trying to install a package image.CannyImage from bnosac/image on the github. But it keeps reporting fatal errors as following.
* installing *source* package 'image.CannyEdges' ...
** libs
c:/Rtools/mingw_64/bin/g++ -m64 -I"C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/include" -DNDEBUG -I"C:/Users/eric1/Documents/R/win-library/3.5/Rcpp/include" -I"C:/swarm/workspace/External-R-3.5.0/vendor/extsoft/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/include" -DNDEBUG -I"C:/Users/eric1/Documents/R/win-library/3.5/Rcpp/include" -I"C:/swarm/workspace/External-R-3.5.0/vendor/extsoft/include" -O2 -Wall -std=gnu99 -mtune=core2 -c adsf.c -o adsf.o
c:/Rtools/mingw_64/bin/g++ -m64 -I"C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/include" -DNDEBUG -I"C:/Users/eric1/Documents/R/win-library/3.5/Rcpp/include" -I"C:/swarm/workspace/External-R-3.5.0/vendor/extsoft/include" -O2 -Wall -mtune=core2 -c rcpp_canny.cpp -o rcpp_canny.o
In file included from rcpp_canny.cpp:13:0:
canny.h:8:19: fatal error: fftw3.h: No such file or directory
#include <fftw3.h>
^
compilation terminated.
make: *** [C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/etc/x64/Makeconf:215: rcpp_canny.o] Error 1
ERROR: compilation failed for package 'image.CannyEdges'
* removing 'C:/Users/eric1/Documents/R/win-library/3.5/image.CannyEdges'
In R CMD INSTALL
Installation failed: Command failed (1)
^
compilation terminated.
Google says I can solve the issue by sudo apt-get remove libfftw3-dev. Unfortunately, I am on Windows, and some advised, apply lib /machine:i386 /def:libfftw3-3.def on cmd mode. Ouch, there is no such command or file called lib.exe on Win10.
Please advise, how I can solve this issue on my Win10+MRO system. Thanks.
Even though this question is already a bit old:
By now (Feb 2020) there are precompiled packages available that work also under Windows:
Canny Edges - Package
and more general:
List of all available packages
I have tried installing them and (at least for me) it worked.

Install RODBC Mac OS Sierra 10.12.3

Fresh install at 10.12.1 with upgrades to 10.12.3.
I did the brew install unixodbc.
I then tried R CMD INSTALL RODBC_1.3-14.tar.gz
with error:
checking for gcc... /usr/local/opt/llvm/bin/clang -fopenmp
checking whether the C compiler works... no
configure: error: in `/private/var/folders/7f/3n9kqyy13glcwlrx7h8cb5dc0000gn/T/RtmpYQnA2y/R.INSTALL354a771740af/RODBC':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘RODBC’
I then unpacked RODBC and tried to ./configure and got the following error message in the log:
configure:2690: /usr/local/opt/llvm/bin/clang -fopenmp -v >&5
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
configure:2701: $? = 0
configure:2690: /usr/local/opt/llvm/bin/clang -fopenmp -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:2701: $? = 1
configure:2690: /usr/local/opt/llvm/bin/clang -fopenmp -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:2701: $? = 1
configure:2721: checking whether the C compiler works
configure:2743: /usr/local/opt/llvm/bin/clang -fopenmp -Wall -mtune=core2 -g -O2 -I/usr/local/opt/llvm/include -I. conftest.c >&5
ld: library not found for -lomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:2747: $? = 1
configure:2785: result: no
I had the same issue For me, the problem was that the R installer was relying on the clang compiler that shipped with OS X (Sierra, 10.12.4), which does not support openmp.
I also couldn't get any of the usual means for specifying a different compiler to configure to work (such as examples here) because, as it turns out, RODBC's configure script is hard-coded to use the compilers and lib/include paths specified by your R installation, which are described here.
I was able to resolve the problem by editing ~/.R/Makevars to point to a version of gcc I installed via macports (sudo port install gcc6), as such:
CC=/opt/local/bin/gcc-mp-6 -fopenmp
CXX=/opt/local/bin/g++-mp-6
LDFLAGS=-L/opt/local/lib -L/usr/local/opt/llvm/lib
CPPFLAGS=-I/opt/local/include -I/usr/local/opt/llvm/include
Then the normal installation process (R CMD INSTALL ./RODBC_1.3-15.tar.gz) worked as expected.

Error while compiling Exim (directadmin custombuild)

I'm currently running DirectAdmin on my Debian 6.0.9 and got a message that Exim needed to be updated. So i did my regular commands:
./build update
./build versions
./build update_versions
But, whenever I run these commands, i get the following error:
In file included from tls.c:121:
tlscert-openssl.c: In function ‘asn1_time_copy’:
tlscert-openssl.c:114: warning: passing argument 2 of ‘ASN1_TIME_print’ discards qualifiers from pointer target type
/usr/include/openssl/asn1.h:1006: note: expected ‘struct ASN1_TIME *’ but argument is of type ‘const struct ASN1_TIME *’
gcc tod.c
gcc transport.c
gcc tree.c
gcc verify.c
gcc lookups/lf_quote.c
gcc lookups/lf_check_file.c
gcc lookups/lf_sqlperform.c
gcc local_scan.c
cc perl.c
gcc malware.c
gcc mime.c
gcc regex.c
gcc spam.c
gcc spool_mbox.c
gcc demime.c
gcc bmi_spam.c
gcc spf.c
gcc srs.c
gcc dcc.c
gcc dmarc.c
gcc dane.c
gcc version.c
gcc -o exim
/usr/bin/ld: cannot find -lgdbm
collect2: ld returned 1 exit status
make[1]: *** [exim] Error 1
make[1]: Leaving directory `/usr/local/directadmin/custombuild/exim-4.85/build-Linux-x86_64'
make: *** [all] Error 2
*** The make has failed, would you like to try to make again? (y,n): n
Google doesn't really help and I'm running out of ideas.
Credits go to tripleee
The server was missing libgdbm-dev. So after
sudo apt-get install libgdbm-dev
It was working fine.

Resources