3

I'm currently using open source (R and ubuntu) to work for my organization. The problem is that we could NOT use internet which means if I want to install some package or software, I have to download it from other pc and transfer it to the working PC. As you might know by now, I'm having trouble with installing the nloptr package on Ubuntu 12.04 with R3.1.3.

Attempt 1

I've placed 'nlopt-2.4.2.tar.gz' on 'home' folder. The reason why I did this is that because the 'configure' source code shows that it uses download.file function in R and install it from there. But since I'm not able to use internet, I located 'nlopt-2.4.2.tar.gz' on the default directory (the directory where I open up the terminal) However, I've got an error saying

trying URL 'http://ab-initio.mit.edu/nlopt-2.4.2.tar.gz'
Error in download.file(url = "http://ab-initio.mit.edu/nlopt-2.4.2.tar.gz")
...
(Omit)
...
Execution halted
/bin/tar: This does not look like a tar archive
gzip: stdin: unexpected end of file
...
(Omit)
...
 ./configure: line 3325: cd: nlopt-2.4.2: No such file or directory. 

Attempt 2

It seems I could just install 'nlopt' by using 'sudo make install'. But, again, it seems I have to manually change some configure settings. The problem is that I really can't figure out what kind of configure that I have to change after the installation so that 'nloptr' could install successfully. The error message that I've got was

'relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object;'

It would be great if you could share your thoughts or any ideas.

Tay Shin
  • 528
  • 4
  • 17
  • `install.packages("~/nlopt-2.4.2.tar.gz", type = "source", repos = NULL)` –  Mar 27 '15 at 09:17
  • that could solve the problem so nicely but I'm not able to use internet in working pc.... that is the main reason why I have to install the package locally and facing the problems that I wrote – Tay Shin Mar 27 '15 at 09:23
  • This is the command to install a package from a file. Did you even try? –  Mar 27 '15 at 09:34
  • 1
    I did Pascal. But it causes an error exactly same as output that I've reported on Attempt 1. – Tay Shin Mar 27 '15 at 09:37
  • Then your archive is corrupted. Try to download it again. But in your attempt 1, you have this message: `trying URL 'http://ab-initio.mit.edu/nlopt-2.4.2.tar.gz'`. It shouldn't appear if you install from a local file. –  Mar 27 '15 at 09:54
  • Hm... not really. Inside of configure file in nlotr paclage, there is a download function that actuallu downloads from the website. It seems i need to install nlopt package first. But just installing it is noy really enough because i manually need to change some configures in order to use those nlopt package. However i really cant figure out what options to change. Those attempts were tried and mentioned on above. – Tay Shin Mar 28 '15 at 04:25

1 Answers1

2

I figured it out by modifying configure and configure.ac. All I did was fixing original NLOPT_URL to NLOPT_URL = "file:///home//usr//${NLOPT_TGZ} Now it works like a charm! Thanks for the help.

Tay Shin
  • 528
  • 4
  • 17