r-dbi / RSQLite

R interface for SQLite
https://rsqlite.r-dbi.org
GNU Lesser General Public License v2.1
327 stars 79 forks source link

Installation of RSQLite failed with cpp11-ver0.4.6 in Ubuntu 22.04 #469

Closed gaospecial closed 1 year ago

gaospecial commented 1 year ago

I failed the installation of RSQLite in Ubuntu 22.04. And I believe it is caused by the upgrade of cpp11 from 0.4.2 to 0.4.6. As the install log says:

g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I. -Ivendor -Ivendor/extensions -Ivendor/sqlite3 -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DSQLITE_USE_URI=1 -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I'/home/gaoch/lib/R/plogr/include' -I'/home/gaoch/lib/R/cpp11/include'    -fvisibility=hidden -fpic  -g -O2 -ffile-prefix-map=/build/r-base-MHXHhT/r-base-4.3.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c DbColumn.cpp -o DbColumn.o

During the make process, it includes the shared library of plogr and cpp11 by default. If cpp11 is found in .libPaths() and the version is system default, which is 0.4.2, the installation will success. However, if you install a recent CRAN release of cpp11, the install will fail. The end of the log is.

g++ -std=gnu++17 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o RSQLite.so DbColumn.o DbColumnDataSource.o DbColumnDataSourceFactory.o DbColumnStorage.o DbConnection.o DbDataFrame.o DbResult.o SqliteColumnDataSource.o SqliteColumnDataSourceFactory.o SqliteDataFrame.o SqliteResult.o SqliteResultImpl.o affinity.o connection.o cpp11.o ext-csv.o ext-math.o ext-regexp.o ext-series.o extensions.o import-file.o result.o rsqlite.o vendor/sqlite3/sqlite3.o -L/usr/lib/R/lib -lR
installing to /tmp/RtmpkGuxIU/00LOCK-RSQLite/00new/RSQLite/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Error in readRDS(nsInfoFilePath) : 读取链结时发生了错误
Calls: <Anonymous> ... loadNamespace -> namespaceImport -> loadNamespace -> readRDS
停止执行
ERROR: lazy loading failed for package ‘RSQLite’
* removing ‘/tmp/RtmpkGuxIU/RSQLite’

This error is strange to me. So could you help to find the reason and fix it?

krlmlr commented 1 year ago

Thanks. The package builds cleanly on Ubuntu 22.04 (https://github.com/r-dbi/RSQLite/actions/runs/6091540416/job/16528391360) and also on my Mac, with latest cpp11. Do you need to install any of RSQLite's dependencies? Perhaps start with a fresh package library?

gaospecial commented 1 year ago

@krlmlr Thanks for your reply. It really help and have solved my problem with a fresh package library.

By the way, do we have a method to debug such issue and find out which library presented in current library path caused the failure of installation?

github-actions[bot] commented 3 weeks ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.