-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows build #115
Comments
Windows seems to be problematic. I've hadn't had success yet. Maybe you could try dynamic linking instead of compiling the amalgamation file. Download the latest release from DuckDB for Windows and run the following:
|
i have try this, but run error, like others who tried in windows |
Dynamic linking is working for my, btw. |
I've done extensive work on getting it to link statically on Windows, but had no success. The main problem is, that CGO complains about missing
They are available in the |
This seems a solution, I mentioned under #51 . Current a success workflow is:
Notes: Also I tested the example (within the engine ), seems that all functional.
|
Test Results:
|
@ZenLiuCN I've tried to integrate the go-duckdb windows deps from your engine repo but I'm getting
And the Do you have any idea why there are still missing references? Do the tests work for you? Even running |
I was use mingw64_posix_seh. Does it the same? PS use msvc maybe a better option, I can't get mysql fdw to compiled by mingw.
|
@marcboeker 13.2.0 is the gcc version which I used. I saw that you was using 10.3.0. It may the difference.
=== RUN TestAppender
--- PASS: TestAppender (0.68s)
=== RUN TestOpen
=== PAUSE TestOpen
=== RUN TestConnPool
--- PASS: TestConnPool (0.01s)
=== RUN TestConnInit
--- PASS: TestConnInit (7.10s)
=== RUN TestExec
=== PAUSE TestExec
=== RUN TestQuery
=== PAUSE TestQuery
=== RUN TestStruct
=== PAUSE TestStruct
=== RUN TestMap
=== PAUSE TestMap
=== RUN TestList
=== PAUSE TestList
=== RUN TestDecimal
=== PAUSE TestDecimal
=== RUN TestUUID
=== PAUSE TestUUID
=== RUN TestENUMs
=== PAUSE TestENUMs
=== RUN TestHugeInt
=== PAUSE TestHugeInt
=== RUN TestVarchar
=== PAUSE TestVarchar
=== RUN TestBlob
=== PAUSE TestBlob
=== RUN TestBoolean
=== PAUSE TestBoolean
=== RUN TestJSON
=== PAUSE TestJSON
=== RUN TestDate
=== PAUSE TestDate
=== RUN TestTimestamp
=== PAUSE TestTimestamp
=== RUN TestInterval
=== PAUSE TestInterval
=== RUN TestEmpty
=== PAUSE TestEmpty
=== RUN TestTypeNamesAndScanTypes
=== RUN TestTypeNamesAndScanTypes/BOOLEAN
=== RUN TestTypeNamesAndScanTypes/TINYINT
=== RUN TestTypeNamesAndScanTypes/SMALLINT
=== RUN TestTypeNamesAndScanTypes/INTEGER
=== RUN TestTypeNamesAndScanTypes/BIGINT
=== RUN TestTypeNamesAndScanTypes/UTINYINT
=== RUN TestTypeNamesAndScanTypes/USMALLINT
=== RUN TestTypeNamesAndScanTypes/UINTEGER
=== RUN TestTypeNamesAndScanTypes/UBIGINT
=== RUN TestTypeNamesAndScanTypes/FLOAT
=== RUN TestTypeNamesAndScanTypes/DOUBLE
=== RUN TestTypeNamesAndScanTypes/TIMESTAMP
=== RUN TestTypeNamesAndScanTypes/DATE
=== RUN TestTypeNamesAndScanTypes/TIME
=== RUN TestTypeNamesAndScanTypes/INTERVAL
=== RUN TestTypeNamesAndScanTypes/HUGEINT
=== RUN TestTypeNamesAndScanTypes/VARCHAR
=== RUN TestTypeNamesAndScanTypes/BLOB
=== RUN TestTypeNamesAndScanTypes/DECIMAL(30,17)
=== RUN TestTypeNamesAndScanTypes/TIMESTAMP_S
=== RUN TestTypeNamesAndScanTypes/TIMESTAMP_MS
=== RUN TestTypeNamesAndScanTypes/TIMESTAMP_NS
=== RUN TestTypeNamesAndScanTypes/VARCHAR[][]
=== RUN TestTypeNamesAndScanTypes/STRUCT("key1"_VARCHAR,_"key2"_INTEGER,_"key3"_DOUBLE)
=== RUN TestTypeNamesAndScanTypes/STRUCT("key1_(,)_\_\""_""""_"""_INTEGER)
=== RUN TestTypeNamesAndScanTypes/MAP(INTEGER,_VARCHAR)
=== RUN TestTypeNamesAndScanTypes/UUID
--- PASS: TestTypeNamesAndScanTypes (0.02s)
--- PASS: TestTypeNamesAndScanTypes/BOOLEAN (0.00s)
--- PASS: TestTypeNamesAndScanTypes/TINYINT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/SMALLINT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/INTEGER (0.00s)
--- PASS: TestTypeNamesAndScanTypes/BIGINT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/UTINYINT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/USMALLINT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/UINTEGER (0.00s)
--- PASS: TestTypeNamesAndScanTypes/UBIGINT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/FLOAT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/DOUBLE (0.00s)
--- PASS: TestTypeNamesAndScanTypes/TIMESTAMP (0.00s)
--- PASS: TestTypeNamesAndScanTypes/DATE (0.00s)
--- PASS: TestTypeNamesAndScanTypes/TIME (0.00s)
--- PASS: TestTypeNamesAndScanTypes/INTERVAL (0.00s)
--- PASS: TestTypeNamesAndScanTypes/HUGEINT (0.00s)
--- PASS: TestTypeNamesAndScanTypes/VARCHAR (0.00s)
--- PASS: TestTypeNamesAndScanTypes/BLOB (0.00s)
--- PASS: TestTypeNamesAndScanTypes/DECIMAL(30,17) (0.00s)
--- PASS: TestTypeNamesAndScanTypes/TIMESTAMP_S (0.00s)
--- PASS: TestTypeNamesAndScanTypes/TIMESTAMP_MS (0.00s)
--- PASS: TestTypeNamesAndScanTypes/TIMESTAMP_NS (0.00s)
--- PASS: TestTypeNamesAndScanTypes/VARCHAR[][] (0.00s)
--- PASS: TestTypeNamesAndScanTypes/STRUCT("key1"_VARCHAR,_"key2"_INTEGER,_"key3"_DOUBLE) (0.00s)
--- PASS: TestTypeNamesAndScanTypes/STRUCT("key1_(,)_\_\""_""""_"""_INTEGER) (0.00s)
--- PASS: TestTypeNamesAndScanTypes/MAP(INTEGER,_VARCHAR) (0.00s)
--- PASS: TestTypeNamesAndScanTypes/UUID (0.00s)
=== RUN TestMultipleStatements
--- PASS: TestMultipleStatements (0.01s)
=== RUN TestParquetExtension
--- PASS: TestParquetExtension (0.05s)
=== RUN TestPrepareQuery
--- PASS: TestPrepareQuery (0.01s)
=== RUN TestPrepareWithError
--- PASS: TestPrepareWithError (0.02s)
=== CONT TestOpen
=== CONT TestHugeInt
=== CONT TestBoolean
=== CONT TestBlob
=== CONT TestVarchar
=== CONT TestJSON
=== CONT TestTimestamp
=== CONT TestInterval
=== RUN TestOpen/without_config
=== RUN TestBlob/select_as_string
=== RUN TestInterval/bind_interval
=== RUN TestBlob/select_as_hex
=== RUN TestVarchar/size_is_smaller_than_12
=== RUN TestBoolean/scan
=== RUN TestInterval/scan_interval
=== RUN TestTimestamp/epoch
=== RUN TestInterval/scan_interval/simple_interval
=== RUN TestVarchar/size_is_exactly_12
=== RUN TestHugeInt/scan_hugeint
=== RUN TestHugeInt/scan_hugeint/0
=== RUN TestTimestamp/before_1970
=== RUN TestInterval/scan_interval/interval_arithmetic
=== RUN TestVarchar/size_is_13
=== RUN TestBoolean/bind
=== RUN TestHugeInt/scan_hugeint/1
=== RUN TestTimestamp/after_1970
=== RUN TestVarchar/size_is_greater_than_12
=== RUN TestInterval/scan_interval/timestamp_arithmetic
=== RUN TestJSON/select_empty_JSON
=== RUN TestHugeInt/scan_hugeint/-1
=== RUN TestTimestamp/HH:MM:SS
=== RUN TestJSON/select_from_marshalled_JSON
=== RUN TestTimestamp/HH:MM:SS.DDDD
=== RUN TestHugeInt/scan_hugeint/9223372036854775807
=== RUN TestHugeInt/scan_hugeint/-9223372036854775808
=== RUN TestHugeInt/scan_hugeint/170141183460469231731687303715884105727
=== RUN TestJSON/select_JSON_array
=== RUN TestHugeInt/scan_hugeint/-170141183460469231731687303715884105727
=== RUN TestHugeInt/bind_hugeint
--- PASS: TestBoolean (0.01s)
--- PASS: TestBoolean/scan (0.00s)
--- PASS: TestBoolean/bind (0.00s)
=== CONT TestEmpty
--- PASS: TestVarchar (0.02s)
--- PASS: TestVarchar/size_is_smaller_than_12 (0.00s)
--- PASS: TestVarchar/size_is_exactly_12 (0.00s)
--- PASS: TestVarchar/size_is_13 (0.00s)
--- PASS: TestVarchar/size_is_greater_than_12 (0.00s)
=== CONT TestDate
--- PASS: TestInterval (0.02s)
--- PASS: TestInterval/bind_interval (0.00s)
--- PASS: TestInterval/scan_interval (0.00s)
--- PASS: TestInterval/scan_interval/simple_interval (0.00s)
--- PASS: TestInterval/scan_interval/interval_arithmetic (0.00s)
--- PASS: TestInterval/scan_interval/timestamp_arithmetic (0.00s)
=== CONT TestUUID
=== RUN TestOpen/with_config
--- PASS: TestBlob (0.02s)
--- PASS: TestBlob/select_as_string (0.00s)
--- PASS: TestBlob/select_as_hex (0.00s)
=== CONT TestQuery
--- PASS: TestTimestamp (0.02s)
--- PASS: TestTimestamp/epoch (0.00s)
--- PASS: TestTimestamp/before_1970 (0.00s)
--- PASS: TestTimestamp/after_1970 (0.00s)
--- PASS: TestTimestamp/HH:MM:SS (0.00s)
--- PASS: TestTimestamp/HH:MM:SS.DDDD (0.00s)
=== CONT TestENUMs
--- PASS: TestJSON (0.02s)
--- PASS: TestJSON/select_empty_JSON (0.00s)
--- PASS: TestJSON/select_from_marshalled_JSON (0.00s)
--- PASS: TestJSON/select_JSON_array (0.00s)
=== CONT TestDecimal
--- PASS: TestHugeInt (0.02s)
--- PASS: TestHugeInt/scan_hugeint (0.00s)
--- PASS: TestHugeInt/scan_hugeint/0 (0.00s)
--- PASS: TestHugeInt/scan_hugeint/1 (0.00s)
--- PASS: TestHugeInt/scan_hugeint/-1 (0.00s)
--- PASS: TestHugeInt/scan_hugeint/9223372036854775807 (0.00s)
--- PASS: TestHugeInt/scan_hugeint/-9223372036854775808 (0.00s)
--- PASS: TestHugeInt/scan_hugeint/170141183460469231731687303715884105727 (0.00s)
--- PASS: TestHugeInt/scan_hugeint/-170141183460469231731687303715884105727 (0.00s)
--- PASS: TestHugeInt/bind_hugeint (0.00s)
=== CONT TestStruct
=== RUN TestDate/before_1970
=== RUN TestDate/after_1970
=== RUN TestDate/epoch
=== RUN TestQuery/simple
--- PASS: TestEmpty (0.01s)
=== RUN TestDecimal/decimal_widths
=== CONT TestList
=== RUN TestQuery/large_number_of_rows
--- PASS: TestDate (0.01s)
--- PASS: TestDate/before_1970 (0.00s)
--- PASS: TestDate/after_1970 (0.00s)
--- PASS: TestDate/epoch (0.00s)
=== CONT TestExec
=== RUN TestOpen/with_invalid_config
=== RUN TestStruct/scan_single_struct
--- PASS: TestOpen (0.03s)
--- PASS: TestOpen/without_config (0.02s)
--- PASS: TestOpen/with_config (0.01s)
--- PASS: TestOpen/with_invalid_config (0.00s)
=== CONT TestMap
=== RUN TestStruct/scan_slice_of_structs
--- PASS: TestUUID (0.02s)
--- PASS: TestENUMs (0.02s)
=== RUN TestList/integer_list
--- PASS: TestStruct (0.01s)
--- PASS: TestStruct/scan_single_struct (0.00s)
--- PASS: TestStruct/scan_slice_of_structs (0.00s)
=== RUN TestMap/select_map
=== RUN TestMap/select_nested_map
--- PASS: TestExec (0.01s)
=== RUN TestMap/insert_map
=== RUN TestDecimal/multiple_decimal_types
--- PASS: TestMap (0.01s)
--- PASS: TestMap/select_map (0.00s)
--- PASS: TestMap/select_nested_map (0.00s)
--- PASS: TestMap/insert_map (0.00s)
--- PASS: TestList (0.02s)
--- PASS: TestList/integer_list (0.01s)
=== RUN TestDecimal/huge_decimal
=== RUN TestDecimal/decimal_to_float64
--- PASS: TestDecimal (0.03s)
--- PASS: TestDecimal/decimal_widths (0.01s)
--- PASS: TestDecimal/multiple_decimal_types (0.00s)
--- PASS: TestDecimal/huge_decimal (0.00s)
--- PASS: TestDecimal/decimal_to_float64 (0.00s)
=== RUN TestQuery/wrong_syntax
=== RUN TestQuery/missing_parameter
=== RUN TestQuery/null
--- PASS: TestQuery (0.61s)
--- PASS: TestQuery/simple (0.00s)
--- PASS: TestQuery/large_number_of_rows (0.60s)
--- PASS: TestQuery/wrong_syntax (0.00s)
--- PASS: TestQuery/missing_parameter (0.00s)
--- PASS: TestQuery/null (0.00s)
PASS
ok github.com/marcboeker/go-duckdb 9.835s
|
I suggest that maybe not merge the windows static link with go-duckdb for using mingw as compile now.
|
Ps those extensions I compiled is under folder. And the extension compile script not finish yet. |
Ps, those three file are the script I use to compile the lib.
|
ilammy/msvc-dev-cmd seems should get a try. I will try on it (it may take some time) |
done try. there still no stable method to link a static lib built with msvc . |
I moved relative codes to here, Cause the engine module is too big for pull from go mod server. I will try to add a github workflow to build the mingw libs, maybe that will do a little help. But also should notice that no official extensions provided for PS: I suggest that maybe put binaries to a seprated location or as release binary archives (so avoid to reach the go mod size limit , it'll broken everything, if with mingw lib and extensions it will reach the limit, maybe about 50mega bytes after zip compressed ) |
Hi. This very helpful, somehow it doesn't work in my computer. Do you have full build command? I think I'm missing some flags :( It might help others as well who does not have too much experience of compiling stuff. |
Here the the script for compile duckdb with mingw (GCC v13), You not need #!/bin/sh
mkdir -p build && \
cmake -G "MinGW Makefiles" \
-DENABLE_EXTENSION_AUTOLOADING=1 \
-DENABLE_EXTENSION_AUTOINSTALL=1 \
-DDUCKDB_EXTENSION_CONFIGS="./.github/config/bundled_extensions.cmake" \
-DBUILD_SHELL=0 \
-DBUILD_BENCHMARK=0 \
-DBUILD_JDBC=0 \
-DBUILD_TPCH=0 \
-DBUILD_TPCDS=0 \
-DBUILD_ODBC=0 \
-DBUILD_PYTHON=0 \
-DDISABLE_UNITY=1 \
-DCMAKE_BUILD_TYPE=Release -B build &&\
cd build &&\
MAKEFLAGS=-j6 cmake --build . --config Release &&\
cd ../ &&\
mkdir -p lib |
The DuckDb part compiled very well. Thank you! I'm still don't understand how I can include it to my Go project's building process (like the simple Go project that initiates DuckDb database, writes one record). I need to create a Golang microservice using my linux, then compile it to other platforms: win and mac. It compiles to linux very well, no problem at all. But not for windows. $ GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CGO_LDFLAGS="-L./deps/windows_amd64_mingw" CGO_CFLAGS="-I./deps/includes" CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -tags=duckdb_use_lib -o builds/app.exe cmd/main.go returns result:
and the same command but I remove the -tags=duckdb_use_lib I'll got this one:
|
And if I put the .a files into project own directory (someone told me that -l option doesn't go for other directories?) I got errors like this:
|
That requires modify the go-duck source, I suggest use dynamic link for windows ( also ship the dll with yourbuilt go service) That will much easier.
I doesn't tried cross-compile from linux to windows.
See [level 6](#115 (comment)) for details of modify go-duckdb.
(Really not suggest use this solution for production , use dynamic linked will more stable, at least for windows)
|
Hi! |
use dynamic lib link via tags. it is the most stable for current. unless U real need a standalone executable.
|
Is there any config or guidance for compiling on windows?
The text was updated successfully, but these errors were encountered: