Skip to content

data.table 1.18.0 could not be installed on FreeBSD #7516

Description

@jszhao

I tried to updated data.table from 1.17.8 to 1.18.0 in R 4.5.2 installed on FreeBSD system. However, I get the following error:

gcc14 -I"/usr/local/lib/R/include" -DNDEBUG   -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include    -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c utils.c -o utils.o
utils.c: In function 'is_direct_child':
utils.c:692:3: error: unknown type name 'siginfo_t'
  692 |   siginfo_t info;
      |   ^~~~~~~~~
utils.c:694:39: error: passing argument 3 of 'waitid' from incompatible pointer type [-Wincompatible-pointer-types]
  694 |     pret[i] = waitid(P_PID, ppids[i], &info, WCONTINUED | WEXITED | WNOHANG | WNOWAIT | WSTOPPED) == 0;
      |                                       ^~~~~
      |                                       |
      |                                       int *
In file included from utils.c:2:
/usr/include/sys/wait.h:160:32: note: expected 'struct __siginfo *' but argument is of type 'int *'
  160 | int     waitid(idtype_t, id_t, struct __siginfo *, int);
      |                                ^~~~~~~~~~~~~~~~~~
gmake: *** [/usr/local/lib/R/etc/Makeconf:202: utils.o] Error 1
ERROR: compilation failed for package ‘data.table’

Here is the output of sessionInfo():

> sessionInfo()
R version 4.5.2 (2025-10-31)
Platform: amd64-portbld-freebsd15.0
Running under: FreeBSD epyc 15.0-RELEASE-p1 FreeBSD 15.0-RELEASE-p1 releng/15.0-n280999-7bceec30b351 GENERIC amd64

Matrix products: default
LAPACK: /usr/local/lib/R/lib/libRlapack.so;  LAPACK version 3.12.1

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Asia/Shanghai
tzcode source: system (FreeBSD)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.5.2

Activity

  1. MichaelChirico commented on Dec 25, 2025

    @MichaelChirico
    Member

    Duplicate of #7512 which can suggest some possible workarounds -- I think something with Makevars will work.

    See #7499. Thanks for reporting!

  2. aitap commented on Dec 25, 2025

    @aitap
    Member

    Sorry for not merging #7499 in time for the release. It will be there in 1.18.2 probably around end of January. Two workarounds for now:

    Sys.setenv(PKG_CFLAGS='-D_POSIX_C_SOURCE=200809L')
    install.packages('data.table')

    or

    data.table::update_dev_pkg() # development version is almost the same as 1.18.0 for now

    If neither works, please let us know and we'll develop a better fix.

  3. jszhao commented on Dec 25, 2025

    @jszhao
    Author

    Sorry for not merging #7499 in time for the release. It will be there in 1.18.2 probably around end of January. Two workarounds for now:

    Sys.setenv(PKG_CFLAGS='-D_POSIX_C_SOURCE=200809L')
    install.packages('data.table')

    After the above solution I got the following error:

    gcc14 -I"/usr/local/lib/R/include" -DNDEBUG   -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include   '-D_POSIX_C_SOURCE=200809L' -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c fread.c -o fread.o
    fread.c: In function 'wallclock':
    fread.c:471:7: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
      471 |   if (gettimeofday(&tv, NULL) == 0)
          |       ^~~~~~~~~~~~
    

    or

    data.table::update_dev_pkg() # development version is almost the same as 1.18.0 for now

    After the above solution, I got the following error:

    gcc14 -I"/usr/local/lib/R/include" -DNDEBUG   -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include    -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c utils.c -o utils.o
    utils.c: In function 'is_direct_child':
    utils.c:693:3: error: unknown type name 'siginfo_t'
      693 |   siginfo_t info;
          |   ^~~~~~~~~
    utils.c:695:39: error: passing argument 3 of 'waitid' from incompatible pointer type [-Wincompatible-pointer-types]
      695 |     pret[i] = waitid(P_PID, ppids[i], &info, WCONTINUED | WEXITED | WNOHANG | WNOWAIT | WSTOPPED) == 0;
          |                                       ^~~~~
          |                                       |
          |                                       int *
    In file included from utils.c:3:
    /usr/include/sys/wait.h:160:32: note: expected 'struct __siginfo *' but argument is of type 'int *'
      160 | int     waitid(idtype_t, id_t, struct __siginfo *, int);
          |                                ^~~~~~~~~~~~~~~~~~
    

    If neither works, please let us know and we'll develop a better fix.

  4. added this to the 1.18.2 milestone on Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions