FW: Request help with compilation problem
David Bower
davidbower607 at hotmail.com
Fri Feb 8 15:12:41 CET 2013
Please help me get the GNU arbitrary precision arithmetic library working. Thanks. -- David Bower
--------------------------------------------------------------------------------------------------------------------------------------------
Here is the contents of the report attached to this email:
// file: arbitraryPrecisionArithmetic_1.cpp
#include <iostream>
#include <gmpxx.h>
int main()
{
mpz_class x("7612058254738945");
mpz_class y("9263591128439081");
std::cout << "\n " << x << "\n*\n " << y;
std::cout << "\n---------------\n" << x * y << "\n\n";
}
Description of what is wrong:
I am trying to run the simple program above on a MAC OS X Lion 10.7.4 command line. (This program was copied directly from the wikipedia webpage describing GNU arbitrary precision arithmetic.)
I get the following error when I run the command "gcc -lgmpxx -lgmp arbitraryPrecisionArithmetic_1.cpp" :
arbitraryPrecisionArithmetic_1.cpp:4:19: error: gmpxx.h: No such file or directory
I also tried the command "gcc -lgmpxx -lgmp -I/gmp-5.1.0 arbitraryPrecisionArithmetic_1.cpp" with the same results.
GMP version number: 5.1.0
Test program: See top of this file.
Configuration options:
1. I downloaded the tarred file gmp-5.1.0.tar.bz2 from the GNU arbitrary precision arithmetic website.
2. I unpacked the file with tar -xvf gmp-5.1.0.tar.bz2
3. This produced a directory "gmp-5.1.0".
4. I changed to the directory gmp-5.1.0
5. I ran the command ./configure --disable-shared --enable-static (sometimes preceeded with "sudo")
6. I ran the command "make install"
7. I ran the command "make check". Every test passed with this last command.
Compiler version. When I type gcc -v I get:
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --\
program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i\
686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Result of typing uname -a:
Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
Result of ./config.guess
coreisbr-apple-darwin11.4.0
Result of ./configfsf.guess : Command not found.
-- Any help you can give would be appreciated. Thanks,
David Bower
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bugReport
Type: application/octet-stream
Size: 2531 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-discuss/attachments/20130208/2dd67bbf/attachment.obj>
More information about the gmp-discuss
mailing list