Skip to content

python3 support and auto autodetect so file #1

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sword865
Copy link

@sword865 sword865 commented May 2, 2017

add python3 support and auto autodetect so file

@sword865 sword865 changed the title python3 support python3 support and auto autodetect so file May 3, 2017
Copy link
Owner

@PorkShoulderHolder PorkShoulderHolder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i try to manually compile this via
g++ --std=c++11 *.cpp -shared -o libmf.so
and then run
python mf_tests.py I get

dlsym(RTLD_DEFAULT, fit_interface): symbol not found
FAILED
testing predict method
(1000, 2)
OK
testing cross validation
FAILED
dlsym(RTLD_DEFAULT, cross_valid_interface): symbol not found

similarly if i merge with the current master and compile and use the new test script i get

➜  python-libmf git:(sword865-master) ✗ python -m tests.mf_tests
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/samuelroyston/python-libmf-workdir/python-libmf/tests/mf_tests.py", line 6, in <module>
    class TestMF(TestCase):
  File "/Users/samuelroyston/python-libmf-workdir/python-libmf/tests/mf_tests.py", line 9, in TestMF
    mf_engine.mf_fit(test_data)
  File "libmf/mf.py", line 139, in mf_fit
    mf.fit_interface.restype = ctypes.POINTER(MFModel)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, fit_interface): symbol not found

if you fix this and ensure the builds via setup.py also work I'll merge your changes. We will need more support for other platforms in the future so the lib_path file might make sense.

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

Successfully merging this pull request may close these issues.

2 participants