Skip to content

Test failure on Mac OS X/MacPorts #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jhale opened this issue Nov 26, 2012 · 8 comments
Closed

Test failure on Mac OS X/MacPorts #15

jhale opened this issue Nov 26, 2012 · 8 comments
Assignees

Comments

@jhale
Copy link

jhale commented Nov 26, 2012

I get the following error when compiling Boost.Numpy:

ERROR: testIntegers (main.DtypeTestCase)

Traceback (most recent call last):
File "/Users/jack/src/ndarray/Boost.NumPy/libs/numpy/test/dtype.py", line 23, in testIntegers
self.assertEquivalent(fs(s(1)), numpy.dtype(s))
ArgumentError: Python argument types in
dtype_mod.accept_int64(numpy.int64)
did not match C++ signature:
accept_int64(long long)

with both the Apple clang compiler and MacPorts gcc 4.7. I am running numpy 1.6.2 and boost 1.52.0 both compiled with macports on an x64 system. Let me know if you need any more specific information. boost.numpy seems to work fine nonetheless, but then I don't think I pass any arrays with integers in them.

Jack

@ghost ghost assigned TallJimbo Nov 26, 2012
@TallJimbo
Copy link
Member

This is almost certainly a case of confusion about whether some int64_t typedef refers to long or long long. I've seen a lot of similar problems regarding int32_t being int or long on 32-bit systems, and it looks like I'll have to look into generalizing that solution. Thanks for the report; I may ask you to try a fix in a few days if I can't find a system I can reproduce the error on.

@jhale
Copy link
Author

jhale commented Nov 27, 2012

Thanks for the quick reply. Here is the info on the int types on my system:

#include <limits>
#include <iostream>

int main() {
    std::cout << std::numeric_limits<int64_t>::min();
    std::cout << std::endl;
    std::cout << std::numeric_limits<int64_t>::max();

    std::cout << std::endl;

    std::cout << std::numeric_limits<long long>::min();
    std::cout << std::endl;
    std::cout << std::numeric_limits<long long>::max();

    return 0;
}

has output:

Jacks-Mac-mini:limits_test jack$ ./limit_test 
-9223372036854775808
9223372036854775807
-9223372036854775808
9223372036854775807

and then on the python side:

import numpy as np

print np.iinfo(np.int64).min
print np.iinfo(np.int64).max

has output:

Jacks-Mac-mini:limits_test jack$ python limit_test.py 
-9223372036854775808
9223372036854775807

So int64_t is a long long on my system in C++ and numpy.

TallJimbo added a commit that referenced this issue Dec 11, 2012
…sions for pairs that have the same size; should avoid problems when Boost and NumPy typedef int64 differently (#15)
@TallJimbo
Copy link
Member

I've put a potential fix on branch #15. Could you let me know if allows the test to pass for you?

If not, could you let me what sizeof(boost::int64_t) (from boost/cstdint.hpp) and sizeof(long) are on your system as well?

@jhale
Copy link
Author

jhale commented Dec 11, 2012

Thanks, I don't think it's fixed it though. I'm not familiar with git, so to make sure I did this right here are the commands I followed to move to branch #15:

jacks-mac-mini:Boost.NumPy jack$ git branch
* master
jacks-mac-mini:Boost.NumPy jack$ git branch -a
* master
  remotes/origin/#10
  remotes/origin/#14
  remotes/origin/#15
  remotes/origin/#7
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/svn
jacks-mac-mini:Boost.NumPy jack$ git checkout -b 15 remotes/origin/#15
Branch 15 set up to track remote branch #15 from origin.
Switched to a new branch '15'
jacks-mac-mini:Boost.NumPy jack$ git branch
* 15
  master
jacks-mac-mini:Boost.NumPy jack$ git pull
Already up-to-date.
jacks-mac-mini:Boost.NumPy jack$ scons --with-boost=/opt/local

which gave the same error

======================================================================
ERROR: testIntegers (__main__.DtypeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jack/src/Boost.NumPy/libs/numpy/test/dtype.py", line 23, in testIntegers
    self.assertEquivalent(fs(s(1)), numpy.dtype(s))
ArgumentError: Python argument types in
    dtype_mod.accept_int64(numpy.int64)
did not match C++ signature:
    accept_int64(long long)

----------------------------------------------------------------------
Ran 2 tests in 0.001s

FAILED (errors=1)

With regards to the typedefs:

#include <limits>
#include <iostream>
#include <boost/cstdint.hpp>

int main() {
    std::cout << std::numeric_limits<boost::int64_t>::min();
    std::cout << std::endl;
    std::cout << std::numeric_limits<boost::int64_t>::max();
    std::cout << std::endl;
    std::cout << sizeof(boost::int64_t);

    std::cout << std::endl << std::endl;

    std::cout << std::numeric_limits<long>::min();
    std::cout << std::endl;
    std::cout << std::numeric_limits<long>::max();
    std::cout << std::endl;
    std::cout << sizeof(long);

    return 0;
}

gives:

jacks-mac-mini:limits_test_2 jack$ ./limit_test 
-9223372036854775808
9223372036854775807
8

-9223372036854775808
9223372036854775807
8

@TallJimbo
Copy link
Member

Oops, that last commit had some silly mistakes that would have kept it from working. I think that should be fixed now.

Try again? (And sorry about the slow turnaround times!)

@TallJimbo
Copy link
Member

Oh, and by the way, if you're already on branch #15, from there you can just do git pull to get the latest. If you aren't, you can do git checkout #15 and then git pull.

@jhale
Copy link
Author

jhale commented Jan 2, 2013

Still no luck!

@NavreetGill NavreetGill mentioned this issue Mar 7, 2013
@TallJimbo
Copy link
Member

I'm guessing this failure is broader than just OS X, as users on Windows have reported similar things, so I've opened #26 to follow up on it there. Perhaps that will produce a solution that works on OS X. If not, I'll eventually get back to hassling you about testing various fixes for me, but for now that's an inefficient way to make progress on this.

My understanding is that this isn't really standing in your way, as it's just a spurious test failure, not a problem with the library itself. If it is more serious than that, let me know, and I'll make it a higher priority.

@jhale jhale closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants