gmp

How to add a path to LDFLAGS

霸气de小男生 提交于 2019-12-03 19:04:59
问题 I'm trying to set up a library called PBC (Pairing-based cryptography). And this library requires another library called GMP -(GNU Multiple-Precision Library). My problem is after installing GMP correctly, PBC gives an error of: gmp library not found add its path to LDFLAGS I have no idea what LDFLAGS is and how to add it to the path. PS: I'm using MinGW. 回答1: The question is not really descriptive enough for anyone to answer well, but.... On a Unix-based system you would likely do something

Build GMP on 64bit Windows

扶醉桌前 提交于 2019-12-03 12:27:21
问题 I have followed the instruction on the "GMP Install Instruction for Windows Platform". I could build a 32bit version of GMP which can be used for Visual Studio. ./configure --prefix=${gmp-install} --disable-static --enable-shared make make install Then I installed mingw_w64 and msys on another machine (which is running 64bit Windows) and rerun the commands. ./configure was run without any problem. However, when I run "make", I got the following. m4 -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP

Pycrypto install fatal error: gmp.h file not found

偶尔善良 提交于 2019-12-03 04:57:55
问题 It seems like there are a number of people who have had a similar problem, however, after much searching I haven't been able to find a solution that works with my particular architecture. I'm trying to install Pycrypto (as a subsidiary of Fabric) to no avail. I'm running Mac 10.8.2, python 2.7.3 via Homebrew, and XCode 4.6 -- installing with pip or easy_install (I've tried both). From what I can tell, the problem could either be with respect to my version of XCode or because of my libraries.

Thread safety while looping with OpenMP

夙愿已清 提交于 2019-12-02 20:38:35
问题 I'm working on a small Collatz conjecture calculator using C++ and GMP, and I'm trying to implement parallelism on it using OpenMP, but I'm coming across issues regarding thread safety. As it stands, attempting to run the code will yield this: *** Error in `./collatz': double free or corruption (fasttop): 0x0000000001140c40 *** *** Error in `./collatz': double free or corruption (fasttop): 0x00007f4d200008c0 *** [1] 28163 abort (core dumped) ./collatz This is the code to reproduce the

Is there a method to use gmpxx.h together with c++98?

走远了吗. 提交于 2019-12-02 19:45:56
问题 Because of my project I need to use c++98 and gmpxx.h: But even for a simple project, it doesn't work: #include <gmp.h> #include <gmpxx.h> int main() { int xrange=5,yrange=5,component=5; return 0; } The error message is: I tried using the following compiling methods libc++: support c++11 and thus work libstdc++: only support c++98 and do not work Is there a way to use c++98 to implement gmpxx? thank you :) Detail of errors when using c98++ to implement: The breaking line is: cout<<r<<endl;

Pycrypto install fatal error: gmp.h file not found

余生颓废 提交于 2019-12-02 17:27:48
It seems like there are a number of people who have had a similar problem, however, after much searching I haven't been able to find a solution that works with my particular architecture. I'm trying to install Pycrypto (as a subsidiary of Fabric) to no avail. I'm running Mac 10.8.2, python 2.7.3 via Homebrew, and XCode 4.6 -- installing with pip or easy_install (I've tried both). From what I can tell, the problem could either be with respect to my version of XCode or because of my libraries. The Command Line Tools for XCode have been installed and I have tried placing setenv ARCHFLAGS "-arch

Is there a method to use gmpxx.h together with c++98?

こ雲淡風輕ζ 提交于 2019-12-02 10:57:34
Because of my project I need to use c++98 and gmpxx.h: But even for a simple project, it doesn't work: #include <gmp.h> #include <gmpxx.h> int main() { int xrange=5,yrange=5,component=5; return 0; } The error message is: I tried using the following compiling methods libc++: support c++11 and thus work libstdc++: only support c++98 and do not work Is there a way to use c++98 to implement gmpxx? thank you :) Detail of errors when using c98++ to implement: The breaking line is: cout<<r<<endl; But it works in c++11: The error report: 来源: https://stackoverflow.com/questions/25229930/is-there-a

Arbitrary precision arithmetic with GMP

帅比萌擦擦* 提交于 2019-12-02 08:02:10
I'm using the GMP library to make a Pi program, that will calculate about 7 trillion digits of Pi. Problem is, I can't figure out how many bits are needed to hold that many decimal places. 7 trillion digits can represent any of 10^(7 trillion) distinct numbers. x bits can represent 2^x distinct numbers. So you want to solve: 2^x = 10^7000000000000 Take the log-base-2 of both sides: x = log2(10^7000000000000) Recall that log(a^b) = b * log(a) : x = 7000000000000 * log2(10) I get 23253496664212 bits. I would add one or two more just to be safe. Good luck finding the petabytes to hold them,

gmpxx.h: no such file or directory

佐手、 提交于 2019-12-02 00:30:31
问题 I just installed a brand new copy of mingw (32 bit) downloading it from the official project page from Sourceforge. I installed everything in the package, all compilers and so on. Then I downloaded from here gmp for MinGW. I extracted gmp-5.0.1-1-mingw32-src.tar.lzma somewhere into my mingw folder, then ran ./pkgbuild from there. It went on running for some minutes, then printed out something like COMPLETED EVERYTHING OK, EVERYTHING PASS . Then I wrote down this simple example, to check if it

How do you write a bigint library / how does libgmp work?

隐身守侯 提交于 2019-12-01 19:44:49
I'm aware of a number of BigInt libraries for C on various platforms and how to use them but I'm intrigued: how do they work? How would I go about building my own library (I'm not going to try, no point re-inventing the wheel but I'm interested in how it might happen)? Can anyone point me towards tutorials etc that might explain the procedure / the basics? Thanks, Ninefingers. Yacoby I found that this wasn't a bad overview. However, if you want something more in depth (and almost guaranteed to be 100% correct), you probably want to read the relevant parts of The Art of Computer Programming ,