Skip to content

Commit

Permalink
rebuild check
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Nov 5, 2023
1 parent f81beab commit 83b326a
Show file tree
Hide file tree
Showing 20 changed files with 2,772 additions and 2,391 deletions.
151 changes: 27 additions & 124 deletions .devel/sphinx/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,152 +2,66 @@

In most cases, installing *stringi* is as simple as calling:


```r
install.packages("stringi")
```


However, due to the overwhelming complexity of the ICU4C library,
upon which *stringi* is based, and the colourful diversity of operating systems,
their flavours, and particular setups, some users may still experience
a few issues that hopefully can be resolved with the help of this short manual.
upon which *stringi* is based, and the diversity of environments
it operates on, you might still experience a few issues.
Hopefully, they can be resolved with the help of this short manual.

Also, some build tweaks are possible.
Below we also describe some available build process tweaks.


## ICU4C

The stringi package depends on the ICU4C >= 55 library.

The stringi package depends on the ICU4C >= 61 library.

If we install the package from sources and either:
ICU will be built together with stringi based on the customised
ICU4C 74.1 source bundle that is shipped with the package
if we install the package from sources and one of the following is true:

* this requirement is not met (check out <https://icu.unicode.org/download>,
the `libicu-devel` rpm on Fedora/CentOS/OpenSUSE,
`libicu-dev` on Ubuntu/Debian, etc.),
the `libicu-devel` package on Fedora/CentOS/OpenSUSE,
`libicu-dev` on Ubuntu/Debian, etc.), or

* `pkg-config` fails to find appropriate build settings
for ICU-based projects, or
for ICU-based projects, or

* `R CMD INSTALL` is called with the `--configure-args='--disable-pkg-config'`
argument, or environment variable `STRINGI_DISABLE_PKG_CONFIG` is
set to non-zero or
argument, or the `STRINGI_DISABLE_PKG_CONFIG` environment variable
is set to non-zero or
`install.packages("stringi", configure.args="--disable-pkg-config")`
is executed,
is executed.

then ICU will be built together with stringi.
A custom subset of ICU4C 69.1 is shipped with the package.
We also include ICU4C 55.1 which can be used as a fallback version
(e.g., on older Solaris boxes).


> To get the most out of stringi, you are strongly encouraged to rely on our
> ICU4C package bundle. This ensures maximum portability across all platforms
> (Windows and macOS users by default fetch the pre-compiled binaries
> Actually, to get the most out of stringi, you are strongly encouraged to rely
> on our ICU4C bundle. This ensures maximum portability across all platforms
> (Windows and macOS users fetch the pre-compiled binaries
> from CRAN built precisely this way).


## ICU Data Library and No Internet Access

Note that if you choose to use our ICU4C bundle, then -- by default -- the
ICU data library will be downloaded from one of our mirror servers.
However, if you have already downloaded a version of `icudt*.zip` suitable
for your platform (big/little-endian), you may wish to install the
package by calling:

```r
install.packages("stringi", configure.vars="ICUDT_DIR=<icudt_dir>")
```

Moreover, if you have **no internet access** on the machines
you try to install stringi on, try fetching the latest development version
of the package, as it is shipped with 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:

```sh
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 of the package is numbered x.y.z,
a file named `stringi_x.y.z.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:

```sh
R CMD INSTALL stringi_x.y.z.tar.gz
```

Alternatively, call from within an R session:

```r
install.packages("stringi_x.y.z.tar.gz", repos=NULL)
```


## C++11 Issues

A decent C++11 compiler is required to build ICU4C 69.1 from sources.

Note that Pre-4.9.0 GCC has a
[bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56019) where
`::max_align_t` has been defined, but not `std::max_align_t`.
If our built-in workaround does not work, you may try calling:

```r
install.packages("stringi", configure.args="--with-extra-cxxflags='-std=c++11'")
```

Overall, your build chain may be misconfigured, check out,
amongst others, `<R_inst_dir>/etc/Makeconf` (e.g., are you using
`-std=gnu++11` instead of `-std=c++11`?). Refer to
<https://cran.r-project.org/doc/manuals/r-release/R-admin.html>
for more details.

There is an option of using the fallback version of ICU4C 55.1.
However, it requires the support of the `long long` type in a few functions,
(this is not part of the C++98 standard; works on Solaris, though). Try:

```r
install.packages("stringi", configure.args="--disable-cxx11")
```


## Customising the Build Process

Additional features and options of the `./configure` script:

* `--disable-cxx11`: Disable C++11; if you build ICU4C from
sources, make sure your C++ compiler supports the `long long` type.

* `--disable-icu-bundle`: Enforce system ICU.

* `--disable-pkg-config`: Disable `pkg-config`;
ICU4C will be compiled from sources.

* `--with-extra-cflags=FLAGS`: Additional C compiler flags.

* `--with-extra-cppflags=FLAGS`: Additional C/C++ preprocessor flags.

* `--with-extra-cxxflags=FLAGS`: Additional C++ compiler flags.

* `--with-extra-cppflags=FLAGS`: Additional C++ preprocessor flags.

* `--with-extra-ldflags=FLAGS`: Additional linker flags.

* `--with-extra-libs=FLAGS`: Additional libraries to link against.



Some influential environment variables:

* `ICUDT_DIR`: Optional directory with an already downloaded ICU data
archive (`icudt*.zip`); either an absolute path or a
path relative to `<package source dir>/src`; defaults to `icuXX/data`.
Some environment variables:

* `PKG_CONFIG_PATH`: An optional list of directories to search for
`pkg-config`'s `.pc` files.
Expand All @@ -160,41 +74,33 @@ Some influential environment variables:
* `PKG_CONFIG`:The `pkg-config` command used to fetch the necessary compiler
flags to link to the existing `libicu` installation.

* `STRINGI_DISABLE_CXX11`: Disable C++11;
see also `--disable-cxx11`.

* `STRINGI_DISABLE_PKG_CONFIG`: Compile ICU from sources;
see also `--disable-pkg-config`.

* `STRINGI_DISABLE_ICU_BUNDLE`: Enforce system ICU;
see also `--disable-icu-bundle`.

* `STRINGI_CFLAGS`: see `--with-extra-cflags`.
* `STRINGI_CXXFLAGS`: see `--with-extra-cxxflags`.

* `STRINGI_CPPFLAGS`: see `--with-extra-cppflags`.

* `STRINGI_CXXFLAGS`: see `--with-extra-cxxflags`.

* `STRINGI_LDFLAGS`: see `--with-extra-ldflags`.

* `STRINGI_LIBS`: see `--with-extra-libs`.




## Conclusion
## Final Notes

We expect that with a correctly configured C++11 compiler and properly
installed system ICU4C distribution, you should face no problems
installing the package, especially if you use our ICU4C bundle and
have a working internet access.

If you do not manage to set up a successful stringi build, do not
If you do not manage to set up a successful build, do not
hesitate to [file a bug report](https://github.com/gagolews/stringi/issues).
However, please check the list of archived (closed) issues first --
it is very likely that a solution to your problem has already been posted.
it is quite likely that a solution to your problem has already been posted.

To help diagnose your error further, please run (from the terminal):
To help diagnose your error further, please run (from the terminal)
the following commands and submit the output from `./configure`
as well as the contents of `config.log`.

```bash
cd /tmp
Expand All @@ -203,6 +109,3 @@ unzip master.zip
cd stringi-master
./configure
```

And submit the output from `./configure` as well as the contents of
`config.log`.
43 changes: 34 additions & 9 deletions .devel/sphinx/news.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,61 @@
# Changelog


## 1.8.1 (under development)

* [GENERAL] ICU bundle updated to version 74.1 (Unicode 15.1, CLDR 44).

* [BUILD TIME] As per the suggestion of Prof. Brian Ripley, `icudt74l` (ICU data)
is now included in the source tarball (compressed with xz to save space).
This allows for building *stringi* on systems with no internet access.

* [BUILD TIME] Support for Solaris has now been dropped. The package is no
longer shipped with the very outdated ICU55 bundle. A compiler supporting
at least C++11 is now required. ICU >= 61 is now required.



* [NEW FEATURE] TODO.... #469: `stri_datetime_parse` .. new argument -
`default_time`
a Calendar set on input to the date and time to be used for missing values in the date/time string being parsed

* [BUGFIX] TODO.... #469: `stri_datetime_parse` did not reset the `Calendar` object
when parsing multiple dates.

* [NEW FEATURE] TODO... #476 U_USING_DEFAULT_ERROR on unknown locales



## 1.7.12 (2023-01-09)

* [BUGFIX] Fixed some potential problems reported by `rchk`.

* [NOTE] [BACKWARD INCOMPATIBLE CHANGE IF ICU >= 72]
If building against ICU >= 72,
note a backward incompatible change: `@` is no longer a word break;
see <https://github.com/unicode-org/cldr/pull/2256> for more details.
If building against ICU >= 72, note a backward incompatible change:
`@` is no longer considered a word break; for more details, see
<https://github.com/unicode-org/cldr/pull/2256>.


## 1.7.8 (2022-07-11)

* [DOCUMENTATION] Paper on *stringi* has been published in
the *Journal of Statistical Software*;
see <https://doi.org/10.18637/jss.v103.i02>.
the *Journal of Statistical Software*;
see <https://doi.org/10.18637/jss.v103.i02>.

* [BUGFIX] #473, #397: Fixed buffer overflow in `stri_dup`.
`stri_dup`, `stri_paste`, ... fail more graciously on attempts to
generate strings of length >= 2^31 each.
`stri_dup`, `stri_paste`, ... fail more graciously on attempts to
generate strings of length >= 2^31 each.

* [BUILD TIME] #480: Using `Rf_isNull` instead of `isNull`.

* [DOCUMENTATION] #462: That the `numeric=TRUE` collator
does not handle negative numbers correctly is now mentioned in the manual.
does not handle negative numbers correctly is now mentioned in the manual.


## 1.7.6 (2021-11-29)

* [BUILD TIME] #463: Added loongarch support in ICU's double conversion
(@liuxiang88).
(@liuxiang88).

* [BUGFIX] #467: The UCRT build on Windows was not marking strings as `latin1`.

Expand Down
4 changes: 2 additions & 2 deletions .devel/sphinx/rapi/stri_datetime_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ print(x)
```

```
## [1] "2024-01-02 13:33:10 AEDT"
## [1] "2024-01-05 11:12:24 AEDT"
```

```r
stri_datetime_add(x, -2, units='months')
```

```
## [1] "2023-11-02 13:33:10 AEDT"
## [1] "2023-11-05 11:12:24 AEDT"
```

```r
Expand Down
8 changes: 4 additions & 4 deletions .devel/sphinx/rapi/stri_datetime_fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ stri_datetime_fields(stri_datetime_now())

```
## Year Month Day Hour Minute Second Millisecond WeekOfYear WeekOfMonth
## 1 2023 11 2 13 33 10 601 44 1
## 1 2023 11 5 11 12 24 801 45 1
## DayOfYear DayOfWeek Hour12 AmPm Era
## 1 306 5 1 2 2
## 1 309 1 11 1 2
```

```r
Expand All @@ -88,9 +88,9 @@ stri_datetime_fields(stri_datetime_now(), locale='@calendar=hebrew')

```
## Year Month Day Hour Minute Second Millisecond WeekOfYear WeekOfMonth
## 1 5784 2 18 13 33 10 605 8 3
## 1 5784 2 21 11 12 24 805 8 3
## DayOfYear DayOfWeek Hour12 AmPm Era
## 1 48 5 1 2 1
## 1 51 1 11 1 1
```

```r
Expand Down
8 changes: 4 additions & 4 deletions .devel/sphinx/rapi/stri_datetime_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ stri_datetime_parse(x, 'yyyy-MM-dd')
```

```
## [1] "2015-02-28 13:33:10 AEDT" NA
## [1] "2015-02-28 11:12:24 AEDT" NA
```

```r
stri_datetime_parse(x, 'yyyy-MM-dd', lenient=TRUE)
```

```
## [1] "2015-02-28 13:33:10 AEDT" "2015-03-01 13:33:10 AEDT"
## [1] "2015-02-28 11:12:24 AEDT" "2015-03-01 11:12:24 AEDT"
```

```r
Expand All @@ -213,13 +213,13 @@ stri_datetime_parse('19 lipca 2015', 'date_long', locale='pl_PL')
```

```
## [1] "2015-07-19 13:33:10 AEST"
## [1] "2015-07-19 11:12:24 AEST"
```

```r
stri_datetime_format(stri_datetime_now(), 'datetime_relative_medium')
```

```
## [1] "today, 1:33:10 pm"
## [1] "today, 11:12:24 am"
```
7 changes: 4 additions & 3 deletions .devel/sphinx/rapi/stri_datetime_symbols.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ stri_datetime_symbols(width='abbreviated')

```
## $Month
## [1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
## [1] "Jan" "Feb" "Mar" "Apr" "May" "June" "July" "Aug" "Sept" "Oct"
## [11] "Nov" "Dec"
##
## $Weekday
## [1] "Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"
Expand All @@ -472,10 +473,10 @@ stri_datetime_symbols(width='narrow')
## [1] "J" "F" "M" "A" "M" "J" "J" "A" "S" "O" "N" "D"
##
## $Weekday
## [1] "Su." "M." "Tu." "W." "Th." "F." "Sa."
## [1] "S" "M" "T" "W" "T" "F" "S"
##
## $Quarter
## character(0)
## [1] "1" "2" "3" "4"
##
## $AmPm
## [1] "am" "pm"
Expand Down
Loading

0 comments on commit 83b326a

Please sign in to comment.