installation error: libuv-1.44.2/include/uv/unix.h:105:28: error: ‘sem_t’ does not name a type
siriusb-nox opened this issue · 2 comments
siriusb-nox commented
Hi there!
I am trying to install fs in R 4.3.0 (on ubuntu 20.04) but I am encountering the following error:
* installing *source* package ‘fs’ ...
** package ‘fs’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C++ compiler: ‘g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0’
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I./libuv-1.44.2/include -I. -pthread -fpic -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c id.cc -o id.o
In file included from ./libuv-1.44.2/include/uv.h:68,
from utils.h:3,
from id.cc:1:
./libuv-1.44.2/include/uv/unix.h:105:28: error: ‘sem_t’ does not name a type
105 | # define UV_PLATFORM_SEM_T sem_t
| ^~~~~
./libuv-1.44.2/include/uv/unix.h:137:9: note: in expansion of macro ‘UV_PLATFORM_SEM_T’
137 | typedef UV_PLATFORM_SEM_T uv_sem_t;
| ^~~~~~~~~~~~~~~~~
In file included from utils.h:3,
from id.cc:1:
./libuv-1.44.2/include/uv.h:1740:27: error: ‘uv_sem_t’ was not declared in this scope; did you mean ‘uv_req_t’?
1740 | UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
| ^~~~~~~~
| uv_req_t
./libuv-1.44.2/include/uv.h:1740:37: error: ‘sem’ was not declared in this scope
1740 | UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
| ^~~
./libuv-1.44.2/include/uv.h:1740:42: error: expected primary-expression before ‘unsigned’
1740 | UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
| ^~~~~~~~
./libuv-1.44.2/include/uv.h:1740:60: error: expression list treated as compound expression in initializer [-fpermissive]
1740 | UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
| ^
./libuv-1.44.2/include/uv.h:1741:31: error: variable or field ‘uv_sem_destroy’ declared void
1741 | UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
| ^~~~~~~~
./libuv-1.44.2/include/uv.h:1741:31: error: ‘uv_sem_t’ was not declared in this scope; did you mean ‘uv_req_t’?
1741 | UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
| ^~~~~~~~
| uv_req_t
./libuv-1.44.2/include/uv.h:1741:41: error: ‘sem’ was not declared in this scope
1741 | UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
| ^~~
./libuv-1.44.2/include/uv.h:1742:28: error: variable or field ‘uv_sem_post’ declared void
1742 | UV_EXTERN void uv_sem_post(uv_sem_t* sem);
| ^~~~~~~~
./libuv-1.44.2/include/uv.h:1742:28: error: ‘uv_sem_t’ was not declared in this scope; did you mean ‘uv_req_t’?
1742 | UV_EXTERN void uv_sem_post(uv_sem_t* sem);
| ^~~~~~~~
| uv_req_t
./libuv-1.44.2/include/uv.h:1742:38: error: ‘sem’ was not declared in this scope
1742 | UV_EXTERN void uv_sem_post(uv_sem_t* sem);
| ^~~
./libuv-1.44.2/include/uv.h:1743:28: error: variable or field ‘uv_sem_wait’ declared void
1743 | UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
| ^~~~~~~~
./libuv-1.44.2/include/uv.h:1743:28: error: ‘uv_sem_t’ was not declared in this scope; did you mean ‘uv_req_t’?
1743 | UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
| ^~~~~~~~
| uv_req_t
./libuv-1.44.2/include/uv.h:1743:38: error: ‘sem’ was not declared in this scope
1743 | UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
| ^~~
./libuv-1.44.2/include/uv.h:1744:30: error: ‘uv_sem_t’ was not declared in this scope; did you mean ‘uv_req_t’?
1744 | UV_EXTERN int uv_sem_trywait(uv_sem_t* sem);
| ^~~~~~~~
| uv_req_t
./libuv-1.44.2/include/uv.h:1744:40: error: ‘sem’ was not declared in this scope
1744 | UV_EXTERN int uv_sem_trywait(uv_sem_t* sem);
| ^~~
make: *** [/usr/lib/R/etc/Makeconf:198: id.o] Error 1
ERROR: compilation failed for package ‘fs’
I do have libuv1-dev installed (1.34) - Any help with this error is much appreciated!
Best,
Oscar
gaborcsardi commented
Ubuntu 20.04 comes with R 3.6.3. How did you install R 4.3.0?
Do you have a custom ~/.R/Makevars
file? If yes, try to remove it.
gaborcsardi commented
Please reopen with more information if you still have problems.