duckdb / duckdb-r

The duckdb R package
https://r.duckdb.org/
Other
106 stars 21 forks source link

Compilation error on Slackware Linux with gcc 14 #193

Open xbasics opened 2 weeks ago

xbasics commented 2 weeks ago

Tried compiling v1.0.0 within R environment as part of installation and getting the following error. Installed the latest version of the re2 package without any issue, yet there seems to be a problem with the one included.

duckdb/third_party/re2/re2/prog.cc: In member function ‘const void duckdb_re2::Prog::PrefixAccel_FrontAndBack(const void, size_t)’: duckdb/third_party/re2/re2/prog.cc:1146:45: error: ‘prefixfront’ was not declared in this scope 1146 | const __m256i f_set1 = _mm256_set1_epi8(prefixfront); | ^~~~~ duckdb/third_party/re2/re2/prog.cc:1147:45: error: ‘prefixback’ was not declared in this scope; did you mean ‘prefixsize’? 1147 | const __m256i b_set1 = _mm256_set1_epi8(prefixback); | ^~~~ | prefixsize make: *** [/usr/lib64/R/etc/Makeconf:200: duckdb/third_party/re2/re2/prog.o] Error 1 ERROR: compilation failed for package ‘duckdb’

The downloaded source packages are in ‘/tmp/RtmpQngRjl/downloaded_packages’

krlmlr commented 1 week ago

Thank you. What OS and version is this, what compiler are you using? Can you compile the duckdb sources at https://github.com/duckdb/duckdb ?

xbasics commented 1 week ago

Thanks for your reply! I'm running Linux (Slackware current) using GCC 14.1.0 w/ GLibc 2.39 on an AMD Ryzen 7 4800H processor. In terms of R environment, I'm using R 4.4.1. I compile R on my local machine using the following C/CXX flags, which are kept was part of the subsequent package installations.

-O3 -fPIC -march=native -pipe

In terms of compiling duckdb-r sources by themselves, I did clone the (current) main branch and compile it simply running make and encountered the following error (w/ jemalloc and duckdb_je_buferror).

[ 49%] Building C object extension/jemalloc/jemalloc/CMakeFiles/jemalloc.dir/src/malloc_io.c.o /home/x/duckdb/extension/jemalloc/jemalloc/src/malloc_io.c: In function ‘duckdb_je_buferror’: /home/x/duckdb/extension/jemalloc/jemalloc/src/malloc_io.c:107:16: error: returning ‘char *’ from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion] 107 | return strerror_r(err, buf, buflen); | ^~~~~~~~ gmake[3]: [extension/jemalloc/jemalloc/CMakeFiles/jemalloc.dir/build.make:552: extension/jemalloc/jemalloc/CMakeFiles/jemalloc.dir/src/malloc_io.c.o] Error 1 gmake[2]: [CMakeFiles/Makefile2:7952: extension/jemalloc/jemalloc/CMakeFiles/jemalloc.dir/all] Error 2 gmake[1]: [Makefile:136: all] Error 2 gmake[1]: Leaving directory '/home/x/duckdb/build/release' make: [Makefile:283: release] Error 2

The _duckdb_jebuferror function returns an int, but strerror_r(err, buf, buflen) is returning a char *. This error was just simply fixed by uncommenting the define instruction at 485...

/*

...of header file extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h and recompiling.

Also compiled both v1.0.0 and v1.0.0.9000 using R CMD INSTALL . again from the command-line with both resulting in the same originally identified error.

krlmlr commented 1 week ago

Thanks. Can you please raise this with https://github.com/duckdb/duckdb ?

xbasics commented 1 week ago

Appreciate your reply! Note that when compiling duckdb/duckdb v1.0.0 I don't encounter any errors. It's only when I compile duckdb/duckdb-r. So, you're saying that this nonetheless should be raised with them?

vishalbelsare commented 1 week ago

Facing same error trying to install duckdb in R under Arch Linux.

krlmlr commented 6 days ago

Thanks, Alex. I missed that part when you said that the upstream library compiles without error.

Is there a chance I can reproduce this locally with Docker?