Comments (10)
Hi - this runs just fine on Windows, as I was able to make larger lib depending on this work:) But I built GMP myself and version 6.1.2 Maybe it's an issue of an older version of GMP?
from curv.
Thank you for comment.
My GMP majar ver is 4, yours is 6, maybe too old? I try to install same version.
- DL from gmp-6.1.2-1-mingw32-src.tar.xz
- compile by MYSYS way
config with --disable-static --enable-shared
, I cannot find gmp.lib file but libgmp.a.
What I do next? or wrong way?
from curv.
.a files are static library in Unix format. It's basically the same as .lib file, though you need to convert it to Windows format. Actually - I don't quite can tell you how to convert(or even if it's possible at all), but I can tell you that you don't wanna follow that way for sure π In short, you will need to
make your own gmp.lib
- follow this link.
I tried option with dumpbin
and lib
(the one with 50 upvotes) but you may try answer with implib
tool. Actually the links you provided are for MSYS version of GMP - it's a bit different then MSVC I tried. I just remember I had some issue with converting MSYS .dll to .lib from Windows, so I had to do the other way around - generate .lib file inside MSYS, unfortunately I don't remeber for sure. Then rustup target add i686-pc-windows-msvc
target installed and copy both gmp.dll and gmp.lib to C:\Users\<yourUserName>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc
Note: files like libgmp-10.dll , libgmp.a etc - try to rename them to gmp.dll , gmp.a etc - since on Windows rustc( or linker) doesn't try libgmp.dll as gmp.dll
I have my copy of gmp.dll and gmp.lib that just passed all curv tests (on x64 Windows 10).
Running target\i686-pc-windows-msvc\debug\deps\curv-20a4d04f88163998.exe
running 12 tests
test arithmetic::big_gmp::tests::invalid_range_test ... ok
test arithmetic::big_gmp::tests::sample_below_zero_test ... ok
test arithmetic::big_gmp::tests::sample_below_test ... ok
test arithmetic::big_gmp::tests::sample_range_test ... ok
test arithmetic::big_gmp::tests::test_from_hex ... ok
test arithmetic::big_gmp::tests::test_mod_mul ... ok
test arithmetic::big_gmp::tests::strict_sample_test ... ok
test arithmetic::big_gmp::tests::strict_sample_range_test ... ok
test arithmetic::big_gmp::tests::test_mod_pow ... ok
test arithmetic::big_gmp::tests::test_mod_sub_modulo ... ok
test arithmetic::big_gmp::tests::test_mod_sub_negative_modulo ... ok
test arithmetic::big_gmp::tests::test_to_hex ... ok
test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Let me know if you can't make your copy and I will create the repo with binary distro of GMP I compiled (under LGPL) Unfortunately, I can't recreate all steps I performed that nasty day π - there was some black magik before it all worked. But I can tell you to save yourself some mental health by running it all on Ubuntu. Anyway you won't compile GMP for 64 bit as it's almost impossible on MSYS - and even if - it will be so unstable you would cry. And 32 bit GMP has huge performance handicap comparing to 64. But if you still wanna Windows - just don't give up too early on making your own GMP - since with my version curv may compile just fine on your machine but crash immediately uppon launch, for reasons beyound this realm π
from curv.
Thank you for help! I tried
- DL from gmp-6.1.2.tar.xz
- compile by MYSYS -> make check success
- dumpbin, add
EXPORTS
to top, rename togmp.def
and link. - failed
gmp.def(2) : fatal error LNK1118: syntax error in '(R)' statement
- but I find
libgmp-3.dll.def
from build folder and can creategmp.lib
cargo test
failed by many errors
Next, implibtool
- DL Digital Mars's IMPLIB tool
- create gmp.lib by dll -> looks success?
- copy to toolchain folder (gmp.lib, gmp.dll, gmp.dll.a)
- failed, this lib is broken?
note: Non-UTF-8 output: C:\\Users\\home\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\gmp.lib
fatal error LNK1136: \x83t\x83@\x83C\x83\x8b\x82\xaa\x96\xb3\x8c\xf8\x82\xc5\x82\xa0\x82\xe9\x82\xa9\x81A\x82\xdc\x82\xbd\x82\xcd\x89\xf3\x82\xea\x82\xc4\x82\xa2\x82\xdc\x82\xb7\x81B\r\n
Note
GMP is not good for Winodws, I feel.
I tried replase to pure Rust bignum, but I found deap dependency of KZen-networks's library. I need to check work on Windows/Linux/Raspibian ('Ο')
I want to test your gmp.lib, please distribute binaryπ° if you can.
from curv.
I changed to lib /MACHINE:x64 /def:libgmp-3.dll.def /out:gmp.lib
I maybe success cargo test
.
but raise error error: test failed, to rerun pass '--lib'
.
I directly exec curv.exe and said cannot find libgmp-3.dll.dll
so I renamed gmp.dll to libgmp-3.dll.dll and moved to same folder.
I re-exec and said error 0xc000007b
, the option is wrong?
one of long error -> https://pastebin.com/EntqsbE7
Note
I find below comment now. ops
from curv.
Hmm - pls note that you are still using default target ...\x86_64-pc-windows-msvc\lib\gmp.lib
while it should be i686-pc-windows-msvc
. Hence maybe your 6. cargo test
failed by many errors - may be actually sign of a good library, because on default target (that is x86_64-pc-windows-msvc
in your case) it will complain on x86 library and will give something like '108 unresolved externals...' Also you may want to read more on #35785
Try with the first way again, but pls do cargo test --target=i686-pc-windows-msvc
this time (I thought it's guessable - my fault π) Also you don't need gmp.dll.a
- well I would say don't copy it, anyway seems like binaries obtained form IMPLIB are corrupted. In the meanwhile you can try my GMP release - but for production you would still be better with your own binaries as I could be a nasty hacker π You never now...
from curv.
Looked at your log at pastebin - seems like I was correct and you have there localized version of
warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'
Seems indeed like all you have to do is use library from way with dumpbin and with correct target cargo test --target=i686-pc-windows-msvc
BTW - I suggest you to switch your system default language to english;)
from curv.
Thank you! your binary work fine!
- make curv.exe by
cargo test --features=ec_secp256k1 --target=i686-pc-windows-msvc
- copy gmp.dll to folder with curv.exe
And I can make binary too! I need MinGW-w64 (32bit).
But I will use as Python extension so I need to build by x86_64.
I find good info build-gmp-on-64bit-windows, will try after.
I know how to use on X86_64.
Summary
- DL GMP source from gmp-6.1.2.tar.xz
- DL MESYS2 from msys2-x86_64-20180531.exe
- use MinGW-w64 (64bit) and install toolchain by
pacman -Syuu
,pacman -S base-devel
andpacman -S mingw-w64-x86_64-toolchain
JP - build by Install GMP with Windows
- into
.lib
and rename togmp.lib
gmp.dll
lib /MACHINE:X64 /def:gmp.def /out:gmp.lib
and copy gmp.dll to folder with curv.exe- copy gmp.lib to
C:\Users\home\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib
- check by
cargo test
Note
error: test failed, to rerun pass '--lib'
, exec curv.exe and find error message.
from curv.
btw - just placing gmp.dll and gmp.lib into target lib folder like from 6.) should be just fine too - then no need to copy dll manually back and forth, and pls close the issue if u r fine now:)
from curv.
Thank you for support! I solved the problem and go next step.
from curv.
Related Issues (20)
- Update `hmac` dependency HOT 1
- Suboptimal serialization of certain structs HOT 4
- Feature request: serialization in v0.7 HOT 1
- suggested additions to Polynomial HOT 2
- Zero Polynomial degree is returning 0
- Implement Zeroize for `Point<E>`
- ed25519::GE fails in serialization and deserialization HOT 10
- Serialization doesn't work with bincode
- Build error: could not find `traits` in `super` HOT 4
- Update crate to latest revision of source code. HOT 1
- generate pk should know the curve
- Bump p256 to 0.11.1 HOT 3
- Incorrect documentation for `check_point_order_equals_group_order` HOT 2
- Updating `curv` dependency in `kzen-paillier`
- Choices between G1Point and Point<Bls12_381_1> in v0.10.0
- Add support for RustCrypto's crypto-bigint HOT 3
- Why use a point as generator instead of a number in feldman vss?
- Deserialization fails for `Secp256k1Scalar`
- Is pairing still considered experimental?
- Build failing on rust 1.73.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curv.