Bitcoin Forum
March 29, 2024, 04:52:07 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: libsecp256k1 as a library/dll/etc  (Read 948 times)
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
September 23, 2017, 10:05:27 AM
Merited by ABCbits (1)
 #1

I want to use libsecp256k1 in my project.
But I can not compile it - there is no <gmp.h> in my system.
I use Qt/C++ out-from-the-box package in windows.

Is it possible to use a dll for windows or library (.a) file to add it
to current project without installing dependances and compiling sources?

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
1711687927
Hero Member
*
Offline Offline

Posts: 1711687927

View Profile Personal Message (Offline)

Ignore
1711687927
Reply with quote  #2

1711687927
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1711687927
Hero Member
*
Offline Offline

Posts: 1711687927

View Profile Personal Message (Offline)

Ignore
1711687927
Reply with quote  #2

1711687927
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3346
Merit: 6473


Just writing some code


View Profile WWW
September 23, 2017, 04:27:24 PM
 #2

Is it possible to use a dll for windows or library (.a) file to add it
to current project without installing dependances and compiling sources?
Sure, but AFAIK, no one publishes builds for it.

You can use mingw or cygwin to compile it and get the .dll/.a files for it.

amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
September 23, 2017, 04:33:09 PM
 #3

Sure, but AFAIK, no one publishes builds for it.
You can use mingw or cygwin to compile it and get the .dll/.a files for it.
I tried to do it, but got an error that there is no <gmp.h>
(indeed, there is no such file on my disk)
And I am not familar with configure/make/etc tools

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1344


aka tonikt


View Profile WWW
September 23, 2017, 04:39:17 PM
 #4

Try this, if you want: https://sourceforge.net/projects/gocoin/files/secp256k1_win.zip/download


Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
September 23, 2017, 04:46:21 PM
 #5

Thanks a lot. I'll try.
The library files are dated by 2016, so I would like to use more current version.

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3346
Merit: 6473


Just writing some code


View Profile WWW
September 23, 2017, 04:48:56 PM
 #6

I tried to do it, but got an error that there is no <gmp.h>
(indeed, there is no such file on my disk)
And I am not familar with configure/make/etc tools
Install libgmp. Mingw and cygwin both have their own package manager things and you should be able to install it through those.

piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1344


aka tonikt


View Profile WWW
September 24, 2017, 02:06:09 PM
Merited by ABCbits (3)
 #7

Thanks a lot. I'll try.
The library files are dated by 2016, so I would like to use more current version.

Here is how you can build it yourself.

1. Install MSYS2 and the gcc compiler(s) you want, following the first answer from here: https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2

2. From the msys shell use "pacman -S ..." command to install the following packages: autoconf, perl, automake-wrapper, libtool, make

3. Fetch the latest sources from https://github.com/bitcoin/bitcoin/ and copy the "src/secp2561k" folder to the "home" of your msys2 shell (you don't need the rest of the core's code - just secp2561k)

4. Go inside the secp2561k folder and excute "./autogen.sh", then "./configure", then "make"

Your lib will be inside the ".libs" folder.
You can do "make install" to install it for you msys2 toolset.
To convert it into a dll, see the bat file from the zip I gave you before.

I might have missed something, so let me know if it didn't work.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
September 24, 2017, 02:11:52 PM
 #8

Here is how you can build them yourself.
Fucking routine! Smiley))))))))
I need two files. One library file and one .h file for compiling my c++ sources for my windows Smiley
I do not want to install addional msys/mingw/compilers/tools/managers/etc/etc/etc
Why the things in modern software development are so complicated?  Grin

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
ScripterRon
Full Member
***
Offline Offline

Activity: 136
Merit: 120


View Profile
September 25, 2017, 02:47:37 PM
 #9

Here is how you can build them yourself.
Fucking routine! Smiley))))))))
I need two files. One library file and one .h file for compiling my c++ sources for my windows Smiley
I do not want to install addional msys/mingw/compilers/tools/managers/etc/etc/etc
Why the things in modern software development are so complicated?  Grin
I feel your pain Smiley

The Windows 10 Creators Fall Update includes the Linux subsystem.  It allows you to run Linux under Windows with better integration than using a separate virtual machine (such as VirtualBox).  I'm part of the Windows Insider program and I installed Ubuntu without any problems and can directly read/write files in the Windows filesystem from my Ubuntu session (the reverse is not true - you cannot access Linux files from a Windows session).  I successfully ran bitcoind in the Linux session.

Unfortunately, there is no official GUI support in the Linux session, although I have seen reports of people who have gotten Gnome up and running.  I may look into this some more after the Fall Update is officially released (it is getting close - I have been getting new builds every 2-4 days recently).
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
September 25, 2017, 03:22:20 PM
 #10

The Windows 10 Creators Fall Update includes the Linux subsystem.
I have Win7 and I do not have time and money want to upgrade to Win10

Quote
I successfully ran bitcoind in the Linux session.
I want to use libsecp256k1 not for bitcoin-related project.
I have some experience running Ubuntu under OracleVM, but the main tool for me now is Windows

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
samson
Legendary
*
Offline Offline

Activity: 2097
Merit: 1068


View Profile
September 26, 2017, 10:55:53 PM
 #11

If you can't be bothered to install a dependency then thats hard luck.

mbedTLS will build without any external dependencies, it has its own MPI functions and supports secp256k1 primitives - you're still going to have to download it and build it from scratch though.
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8343



View Profile WWW
September 26, 2017, 11:13:38 PM
 #12

Libsecp256k1 works fine with no dependencies at all.  You're having dependency issues because you're bypassing the build system and doing something horrible.  Read the fine instructions.  Otherwise it's like drilling into someone's head and then complaining that you have to provide infrastructure to keep the blood circulating or they stop being able to give you advice. Smiley

> mbedTLS will build without any external dependencies, it has its own MPI functions and supports secp256k1 primitives

And is probably not even remotely constant time for it and is probably also super slow...
btctousd81
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


View Profile WWW
September 27, 2017, 02:42:45 PM
 #13

i am not sure, if this is what you are looking for .,
ref https://github.com/bitcoin-core/secp256k1/issues/451

Quote
You can configure libsecp256k1 not to use GMP at all. Option is --with-bignum=none.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!