Torch '!./install.sh' returns error in Colab when installing Torch - 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.

Related

R package 'RcppArmadillo' error during installation

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

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.

R compilation failed for package fst

I'm trying to install fst R package from CRAN but I get error:
gcc -I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/lib64/R/include" -DNDEBUG
-fopenmp -I. -Ifstcore -Ifstcore_v1 -Ifstcore/LZ4 -Ifstcore/ZSTD -Ifstcore/ZSTD/common
-Ifstcore/ZSTD/decompress -Ifstcore/ZSTD/compress
-I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/r_libs_site/Rcpp/include"
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include -fpic
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include
-c fstcore/ZSTD/compress/huf_compress.c -o fstcore/ZSTD/compress/huf_compress.o
gcc -I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/lib64/R/include" -DNDEBUG
-fopenmp -I. -Ifstcore -Ifstcore_v1 -Ifstcore/LZ4 -Ifstcore/ZSTD -Ifstcore/ZSTD/common
-Ifstcore/ZSTD/decompress -Ifstcore/ZSTD/compress
-I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/r_libs_site/Rcpp/include"
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include -fpic
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include
-c fstcore/ZSTD/decompress/zstd_decompress.c -o fstcore/ZSTD/decompress/zstd_decompress.o
/tmp/cc0LoSFX.s: Assembler messages:
/tmp/cc0LoSFX.s:7353: Error: no such instruction: `shlx %rax,%rdx,%rax'
/tmp/cc0LoSFX.s:8204: Error: no such instruction: `shlx %rax,%rdx,%rax'
/tmp/cc0LoSFX.s:8608: Error: no such instruction: `shlx %rax,%rdx,%rax'
make: *** [fstcore/ZSTD/decompress/zstd_decompress.o] Error 1
ERROR: compilation failed for package ‘fst’
I there any required linux library that can be compiled from source? What else I can do?
EDIT:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/path/apps/gcc/6.3.0/x86_64-linux-2.6-rhel6/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/path/apps/gcc/6.3.0/x86_64-linux-2.6-rhel6 --disable-multilib
Thread model: posix
gcc version 6.3.0 (GCC)
Putting this here for posterity in case others eventually land on this question when facing similar issues.
It turns out that as far as we can tell, the problem was incompatible versions of the assembler (/usr/bin/as) and gcc (our non-system 6.3.0 installation).
So if you landed here at the end of your rope with no idea why you're seeing these errors, looking into getting a compatible version of the assembler (in linux world this is part of the binutils module/project). Hope that helps.

Not able to install packages on RStudio Server

I am using RStudio Server and trying to install basic packages and getting the below error -
g++ -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -
I../inst/include/ -DU_STATIC_IMPLEMENTATION -fpic -
DU_STATIC_IMPLEMENTATIN -O2 -g -c Date.cpp -o Date.o
sh: g++: command not found
make: *** [Date.o] Error 127
ERROR: compilation failed for package ‘Rcpp’
Does anyone face the same issue ? Please advise what needs to be done to resolve this.
sh: g++: command not found
You should install development tools suite first, then back to install the packag again.
On Ubuntu, you can try:
sudo apt-get install build-essential
On CentOS, you can try:
yum groupinstall "Development Tools"

installing venneuler and/or rJava R package

I'm trying to install the venneuler R package on linux.
Running: install.packages("venneuler") gives this error:
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.
ERROR: configuration failed for package ârJavaâ
* removing â/home/nruns/R/rJavaâ
Warning in install.packages :
installation of package ârJavaâ had non-zero exit status
ERROR: dependency ârJavaâ is not available for package âvenneulerâ
* removing â/home/nruns/R/venneulerâ
Warning in install.packages :
installation of package âvenneulerâ had non-zero exit status
The downloaded source packages are in
â/tmp/RtmpjiRTHN/downloaded_packagesâ
Trying to install the rJava package produces the same error.
So I then run R CMD javareconf as suggested and get this error:
trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c conftest.c -o conftest.o
conftest.c:1:17: fatal error: jni.h: No such file or directory
#include <jni.h>
I updated java using:
sudo yum install java-1.8.0-openjdk
which completed fine but am still getting the same error trying to install venneuler
Any idea?
For rjava try installing following packages. It helped me
libbz2-dev
libpcre3-dev or libpcre2-dev
liblzma-dev
sudo apt-get install packagename

Resources