I am trying to install libsvm on my mac (OS-X 10.6.8). Libsvm installs fine for C++ (i can use svm-train, svm-predict binaries just fine). As per instructions I typed make in libsvm-3.12/python/ folder and got following output
<i>
make -C .. lib
if [ "Darwin" = "Darwin" ]; then \
SHARED_LIB_FLAG="-dynamiclib -W1,-install_name,libsvm.so.2"; \
else \
SHARED_LIB_FLAG="-shared -W1,-soname,libsvm.so.2"; \
fi; \
g++ ${SHARED_LIB_FLAG} svm.o -o libsvm.so.2
</i>
But when I try using it in python via "import svmutil" I get following error
<i>
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "svmutil.py", line 3, in <module>
from svm import *
File "svm.py", line 19, in <module>
'../libsvm.so.2'))
File "/Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(../libsvm.so.2, 6): no suitable image found. Did find:
../libsvm.so.2: mach-o, but wrong architecture
</i>
I don't know how to get around this error. I tried compiling with -m64 and -arch x86_64 flags for g++ as well (during "Make" process of libsvm) but I continue to get this error. Can someone please tell me how to get around this issue?