fuzzylogician / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

ImportError and Symbol not found: _RNDC, when running test/runtests.py #57

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Building gmpy2-2.0.0b1 using python2.7 on OSX 10.6.8 with x86_64 architecture
2. Trying to import gmpy2 module in python

What is the expected output? What do you see instead?
I expected the tests to run fine since the module builds without any errors or 
warning messages

What version of the product are you using? On what operating system?
Refer above

Please provide any additional information below.
Below are the sequence of commands run and the outputs and error messages,

$ python setup.py build_ext -Ddir=/usr/local/lib install
running build_ext
building 'gmpy2' extension

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot 
/Developer/SDKs/MacOSX10.6.sdk -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DWITHMPFR=1 
-DWITHMPC=1 -Ddir=/usr/local/lib=1 -I/usr/local/include 
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c 
src/gmpy2.c -o build/temp.macosx-10.6-x86_64-2.7/src/gmpy2.o

creating build/lib.macosx-10.6-x86_64-2.7

gcc-4.2 -bundle -undefined dynamic_lookup -arch x86_64 -isysroot 
/Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g 
build/temp.macosx-10.6-x86_64-2.7/src/gmpy2.o -L/usr/local/lib -L/usr/local/lib 
-lgmp -lmpfr -lmpc -o build/lib.macosx-10.6-x86_64-2.7/gmpy2.so

running install
running build
running install_lib

copying build/lib.macosx-10.6-x86_64-2.7/gmpy2.so -> 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
running install_egg_info

Writing 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gm
py2-2.0.0b1-py2.7.egg-info

$ python test/runtests.pyTraceback (most recent call last):
  File "test/runtests.py", line 5, in <module>
    import gmpy2

ImportError: 
dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pack
ages/gmpy2.so, 2): Symbol not found: _RNDC

  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gmpy2.so

  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gmpy2.so

Original issue reported on code.google.com by thakur.g...@gmail.com on 8 Sep 2012 at 5:37

GoogleCodeExporter commented 8 years ago
I forgot to mention, I am using gmp5.0.5, mpfr 3.1.1 and mpc 1.0.0

I have been looking at mpc 0.9 & mpc 1.0.
mpc 0.9 had a macro RNDC, which has been named MPC_RND in mpc 1.0

Could this be the problem? What can I do to resolve this? I'll keep digging and 
put up an update if I find something.

Original comment by thakur.g...@gmail.com on 8 Sep 2012 at 6:41

GoogleCodeExporter commented 8 years ago
I think it is fixed in the SVN repository. Can you try that?

Original comment by casevh on 8 Sep 2012 at 6:44

GoogleCodeExporter commented 8 years ago
I have the same problem. Are you saying the zip package is outdated?

Original comment by gokoproject on 8 Sep 2012 at 10:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Sorry for spamming. But if I deleted the folder that was extracted by the 
latest zip, and replaced it with SVN checkout, I get this after running the 
setup

Traceback (most recent call last):
  File "test_pack.py", line 2, in <module>
    import gmpy2
ImportError: libmpc.so.3: cannot open shared object file: No such file or 
directory

>> sudo locate libmpc.so
/usr/lib/libmpc.so.2
/usr/lib/libmpc.so.2.0.0

There is no libmpc3, how do you get so.3 ? 

I am on Ubuntu 11.10

/opt/local$ ls
gmp-5.0.5  gmp-5.0.5.tar.xz  gmpy-read-only  include  lib  mpc-1.0.1  
mpc-1.0.1.tar.gz  mpfr-3.1.1  mpfr-3.1.1.tar.gz  share

Original comment by gokoproject on 8 Sep 2012 at 10:34

GoogleCodeExporter commented 8 years ago
I've been trying to release a beta2 version but work has gotten in the way. I 
haven't tested with MPC 1.0.1 but I'll do that later tonight. 

You need to tell gmpy2 where the mpc and mpfr libraries are located. Try:

python setup.py build_ext -f -Ddir=/opt/local install -f

Original comment by casevh on 8 Sep 2012 at 11:04

GoogleCodeExporter commented 8 years ago
Using the latest svn code worked for me. However some of the mpfr tests failed, 
looking at the output it seems the issues are - 
1) o/p text for InvalidOperationError differs on my PC compared to that in the 
test, which should be fine
2) an issue with math functions returning numbers with 15 decimal places, 
compared to gmpy2 functions returning 16 decimal places, I guess this has more 
to do with my python settings
3) lastly - gmpy2.local_context() returns <gmpy2.ContextManagerObject>,  
instead of context(....) as expected by the test ... is this ok?

Thanks for the help!

Original comment by thakur.g...@gmail.com on 9 Sep 2012 at 2:25

GoogleCodeExporter commented 8 years ago
Several problems all occurred at the same. First, there was a minor change in 
MPC between 0.9 -> 1.0rc1 and the final release of 1.0. That is fixed in SVN 
and will be released as beta2 soon.

Second, the -Ddir option should specify the top-level directory that contains 
GMP, MPFR, and MPC. It should not include a trailing /lib or /include as they 
are automatically added by setup.py.

Lastly, I'm fixing the failures in the test suite. Those failures should be 
fixed in beta2 also.

Thanks for the bug report. Please report any other issues you encounter.

Original comment by casevh on 9 Sep 2012 at 5:38

GoogleCodeExporter commented 8 years ago
gmpy2 2.0.0b2 has been released and should solve these issues.

Original comment by casevh on 12 Oct 2012 at 6:07

GoogleCodeExporter commented 8 years ago
Same problem with gmpy2 2.0.0b2, see issue 64

Original comment by alexande...@gmail.com on 10 Dec 2012 at 9:11