duckdb-r icon indicating copy to clipboard operation
duckdb-r copied to clipboard

Unable to build 0.10.0 from source for windows for R 4.1.2

Open JamesLMacAulay opened this issue 11 months ago • 7 comments

I have been having trouble with timestamps and microseconds with duckdb 0.7.1 in R 4.1.2 (https://stackoverflow.com/questions/78187731/support-microseconds-when-storing-posixct-column-in-duckdb-file)

I thought I'd try the latest build to try to address it, but CRAN doesn't have a 4.1.2 windows binary available.

When I try to build it I get the following error:

* installing *source* package 'duckdb' ...
** package 'duckdb' successfully unpacked and MD5 sums checked
** using staged installation
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture

"C:/rtools40/mingw64/bin/"g++  -std=gnu++17 -I"C:/PROGRA~1/R/R-41~1.2/include" -DNDEBUG -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -Iduckdb/src/include -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/re2 -Iduckdb/third_party/miniz -Iduckdb/third_party/utf8proc/include -Iduckdb/third_party/utf8proc -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/skiplist -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/tdigest -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/libpg_query -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/pcg -Iduckdb/third_party/httplib -Iduckdb/third_party/fast_float -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/snappy -Iduckdb/third_party/zstd/include -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY -DDUCKDB_PLATFORM_RTOOLS=1         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c duckdb/ub_src_catalog.cpp -o duckdb/ub_src_catalog.o

...

In file included from duckdb/ub_src_common.cpp:39:
duckdb/src/common/local_file_system.cpp: In function 'std::__cxx11::string duckdb::AdditionalLockInfo(std::__cxx11::wstring)':
duckdb/src/common/local_file_system.cpp:698:8: error: 'QueryFullProcessImageNameW' was not declared in this scope
    if (QueryFullProcessImageNameW(process, 0, full_path, &full_path_size) && full_path_size <= MAX_PATH) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [C:/PROGRA~1/R/R-41~1.2/etc/x64/Makeconf:245: duckdb/ub_src_common.o] Error 1
ERROR: compilation failed for package 'duckdb'
* removing 'C:/_dev/R/win-library/4.0/duckdb'

JamesLMacAulay avatar Mar 19 '24 18:03 JamesLMacAulay

Thanks. Is it difficult for you to upgrade to R 4.3?

krlmlr avatar Mar 21 '24 06:03 krlmlr

Unfortunately it is at this time, but it may happen in the future.

The issue I was trying to deal with, that I posted about on stackoverflow (https://stackoverflow.com/questions/78187731/support-microseconds-when-storing-posixct-column-in-duckdb-file) I was able to work around by writing wrapper functions that converts the posix columns into numeric before writing and then back to posix after reading.

I didn't bother posting that as an issue since it's such an old version (0.7-1) and I see that there are several new data types that have been introduced by the time it got to 0.10.

Luckily the workaround is getting the job done for now!

JamesLMacAulay avatar Mar 22 '24 18:03 JamesLMacAulay

Thanks. What workaround do you refer to?

krlmlr avatar Mar 23 '24 05:03 krlmlr

It seems more difficult than anticipated to build for R < 4.2 on Windows.

krlmlr avatar Mar 24 '24 16:03 krlmlr

Thanks. What workaround do you refer to?

Writing POSIXct columns to a duckdb file were having their subseconds stripped. The workaround I am using is to convert those columns to numeric before writing them to the duckdb file, and then converting them back to POSIXct after reading in the data.

JamesLMacAulay avatar Mar 25 '24 02:03 JamesLMacAulay

Can you please try from the current v0.10.1 tag?

https://github.com/duckdb/duckdb-r/commit/498dc55b9ec48c016de9e99ebb4fadf3c0177949

krlmlr avatar Mar 29 '24 22:03 krlmlr

@JamesLMacAulay: are you still experiencing problems building duckdb from source?

krlmlr avatar Apr 24 '24 07:04 krlmlr