Packrat with nloptr on a machine with no internet connection or admin access

421 views
Skip to first unread message

Josh Whitney

unread,
Nov 19, 2015, 4:59:23 PM11/19/15
to packrat-discuss
Hi All,
I'm trying to use packrat to isolate my code and move it to another machine.  One of the packages I'm using is nloptr, but once I move the packrat bundle to the new machine, which does not have internet access or admin privileges, the packrat bootstrapping process freezes up when it gets to nloptr.  When I kill the process it gives the error below, basically saying that it can't get to the NLopt website to install the package.  This is not surprising because there is no connection to the internet.  Any ideas how to remedy this?  

[1] "Command failed (1)\n\nFailed to run system command:\n\n\t'/machine/app/R-3.1.2/bin/R' --vanilla CMD INSTALL '/tmp/RtmpfxhlOM/nloptr' --librar86_64-unknown-linux-gnu/3.1.2' --install-tests --no-docs --no-multiarch --no-demo \n\nThe command failed with output:\n* installing *source* package 'nlonpacked and MD5 sums checked\nchecking for g++... g++\nchecking whether the C++ compiler works... yes\nchecking for C++ compiler default output file names... \nchecking whether we are cross compiling... no\nchecking for suffix of object files... o\nchecking whether we are using the GNU C++ compiler... yesecking how to run the C++ preprocessor... g++ -E\nchecking whether we are using the GNU C++ compiler... (cached) yes\nchecking whether g++ accepts -g... \nconfigure: Now testing for NLopt header file.\nchecking for grep that handles long lines and -e... /bin/grep\nchecking for egrep... /bin/grep -E\ncheck for sys/types.h... yes\nchecking for sys/stat.h... yes\nchecking for stdlib.h... yes\nchecking for string.h... yes\nchecking for memory.h... yes\ncheckies.h... yes\nchecking for stdint.h... yes\nchecking for unistd.h... yes\nchecking nlopt.h usability... no\nchecking nlopt.h presence... no\nchecking for nd build NLopt\ntrying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'\nError in download.file(url = \"http://ab-initio.mit.edu/nlopt/nlopt-2.4.2-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'\nIn addition: Warning message:\nIn download.file(url = \"http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz\",  ' on port 80.\nExecution halted\n/bin/gtar: This does not look like a tar archive\n\ngzip: stdin: unexpected end of file\n/bin/gtar: Child returned statuiting now\nWarning message:\nIn untar(tarfile = \"nlopt-2.4.2.tar.gz\") :\n  '/bin/gtar -xf 'nlopt-2.4.2.tar.gz'' returned error code 2\nconfigure: Startoptr/nlopt-2.4.2\n./configure: line 3325: cd: nlopt-2.4.2: No such file or directory\nconfigure: Done installing library to /tmp/RtmpfxhlOM/nloptr/nlopt-ile or directory\nconfigure: creating ./config.status\nconfig.status: error: cannot find input file: `src/Makevars.in'\nERROR: configuration failed for ptest/code/packrat/lib/x86_64-unknown-linux-gnu/3.1.2/nloptr'"
Error: Command failed (1)
Failed to run system command:
        '/machine/app/R-3.1.2/bin/R' --vanilla CMD INSTALL '/tmp/RtmpfxhlOM/nloptr' --library='/home/test/code/packrat/lib/x86_64-unkncs --no-multiarch --no-demo
The command failed with output:
* 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

Jonathan McPherson

unread,
Nov 19, 2015, 5:11:23 PM11/19/15
to Josh Whitney, packrat-discuss
There are a couple of ways around this:

1) The NLopt R package only tries to download NLopt if it isn't already present on the system, so you could install NLopt locally on the system prior to installing the Packrat bundle. You can see where the R package looks for an existing NLopt installation here: https://github.com/jyypma/nloptr/blob/dc6c3baccfe787d828c573309f8cf732627230b7/configure#L3250-L3251

2) You could clone the NLopt package and alter its configure script so it uses a local NLopt tarball instead of trying to download one (see https://github.com/jyypma/nloptr/blob/dc6c3baccfe787d828c573309f8cf732627230b7/configure#L3330

Jonathan.

--
You received this message because you are subscribed to the Google Groups "packrat-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packrat-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Josh Whitney

unread,
Nov 19, 2015, 6:14:32 PM11/19/15
to packrat-discuss, josh.r....@gmail.com
Thanks for the prompt reply.  I'm trying solution 1, and I was able to install NLopt in a local directory.  I don't understand shell script very well, but I think I have a general idea of what's going on in the line you linked.  They're checking to make sure the nlopt.h header is present, correct?  According to the nlopt installation instructions here: http://ab-initio.mit.edu/wiki/index.php/NLopt_Installation, I need to let the C compiler know where to find the header files (using -I).  I assume that I need to do something similar here?  If so, how would I go about that?

Thanks again.
Reply all
Reply to author
Forward
0 new messages