0
votes

I have the typical nonzero exit status problem that I have seen a lot on this forum. However I have tried all of the fixes that one traditionally uses in order to fix this problem and none work. For the full code please see below. I am running Linux Mint OS 64 bit, which I recently installed to run MATLAB, and I suspect that my issue has something to do with that. I had Linux Mint OX 32 bit before and did not have these kind of problems.

A new problem occurred while trying to install plm. The below script comes out, including the error message at the bottom, and then R crashed, which never happened before:

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... g++
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 g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking nlopt.h usability... no
checking nlopt.h presence... no
checking for nlopt.h... no
configure: Need to download and build NLopt
trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Error in download.file(url = "http://ab-initio.mit.edu/nlopt/nlopt-  2.4.2.tar.gz",  : 
cannot open URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Execution halted
/bin/tar: This does not look like a tar archive

gzip: stdin: unexpected end of file /bin/tar: Child returned status 1 /bin/tar: Error is not recoverable: exiting now Warning message: In untar(tarfile = "nlopt-2.4.2.tar.gz") : '/bin/tar -xf 'nlopt-2.4.2.tar.gz'' returned error code 2 configure: Starting to install library to /tmp/RtmpKVJuVy/R.INSTALL129b11f84296/nloptr/nlopt-2.4.2 ./configure: line 3325: cd: nlopt-2.4.2: No such file or directory

1
You say you "tried all of the fixes that one traditionally uses in order to fix this problem and none work." Just making sure... have you tried making sure g++ is installed by opening a terminal (using Ctrl+Alt+T) and using the command sudo apt install g++?duckmayr
I was hoping no one would ask this... I did after I posted this and noticed that part of the text. It does allow me to download Rcpp as in the post, but I still cannot download the package 'plm', which is my real goal. I am updating the post now to put in the text from the plm failed download.MathStudent
Thank you for your help though, I did not want to imply that I did not appreciate it. Your solution was the correct solution.MathStudent
I'm glad you were able to get Rcpp installed, sorry you're still having problems with 'plm'. I don't see anything unusual in the text you posted from the package installation... if you can post the entire output I might be able to see what the problem is.duckmayr
Sorry for the late response. The post was updated with the error message that occurs while attempting to install plm.MathStudent

1 Answers

0
votes

The reason is that package uses old location.

Do following, to see where this file was moved.

> curl "http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz" -o nlopt-2.4.2.tar.gz
> cat nlopt-2.4.2.tar.gz
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://github.com/stevengj/nlopt/releases/download/nlopt-2.4.2/nlopt-2.4.2.tar.gz">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at ab-initio.mit.edu Port 80</address>
</body></html>

Then, try to download file: https://github.com/stevengj/nlopt/releases/download/nlopt-2.4.2/nlopt-2.4.2.tar.gz

And install this package using R

curl "https://github.com/stevengj/nlopt/releases/download/nlopt-2.4.2/nlopt-2.4.2.tar.gz" -o nlopt-2.4.2.tar.gz
R CMD INSTALL nlopt-2.4.2.tar.gz