gagolews / stringi

Fast and portable character string processing in R (with the Unicode ICU)
https://stringi.gagolewski.com/
Other
304 stars 44 forks source link

Building a distributable source package for an offline machine on a Mac #402

Closed adrienelena closed 4 years ago

adrienelena commented 4 years ago

Hi,

I want to install stringi on a CentOS (7.8.2003) machine with no internet access. I've seen the recommended procedure

Moreover, if you have absolutely no internet access on the machines you try to install stringi on, try fetching the latest development version of the package. It already includes the ICU data archives. You can build a distributable source package that includes all the required ICU data files (for off-line use) by omitting some relevant lines in the .Rbuildignore file. The following command sequence should do the trick:

wget https://github.com/gagolews/stringi/archive/master.zip -O stringi.zip
unzip stringi.zip
sed -i '/\/icu..\/data/d' stringi-master/.Rbuildignore
R CMD build stringi-master

Assuming the most recent development version is 1.3.1, a file named stringi_1.3.1.tar.gz is created in the current working directory. The package can now be installed (the source bundle may be propagated via scp etc.) by executing:

R CMD INSTALL stringi_1.3.1.tar.gz

or by calling install.packages("stringi_1.3.1.tar.gz", repos=NULL), from within an R session.

The problem is that I can't download the master.zip file. (edit: I solved that, see below) I'm working on a Mac (with internet access) with R 4.0.0 and I want to build the package for a CentOS machine with R 3.6.0. Would this pose a problem? I'm sorry if this is a stupid question, I'm new to this kind of issues.

Thank you. Adrien

adrienelena commented 4 years ago

I couldn't fetch the master.zip file using curl (no wget command on my Mac), or with Google Chrome, but I have been able to download it with Safari. My apologies.

I'm not sure whether the sed command worked properly though. Here is what it returns

sed: 1: "stringi-master/.Rbuildi ...": unterminated substitute in regular expression

Thank for your help

adrienelena commented 4 years ago

From this Stack Overflow discussion it appears that the sed version that ships with Mac OS expects an extension after the -i flag (it can be an empty string for no backup). It solved my sed problem.

I'll close the issue once the package is flawlessly installed on the CentOS machine.

gagolews commented 4 years ago

Or, as an alternative, you can edit the .Rbuildignore file manually - the sole purpose of this sed... command is to remove the following lines from this file:

^src/icu55/data
^src/icu61/data
adrienelena commented 4 years ago

Or, as an alternative, you can edit the .Rbuildignore file manually - the sole purpose of this sed... command is to remove the following lines from this file:

^src/icu55/data
^src/icu61/data

Thank you. I figured it out. I didn't need to edit the file manually once I added the "" after the -i flag.

adrienelena commented 4 years ago

The stringi package installation actually worked on the machine with no internet access.