[pymvpa] Nick? Re: LinearCSVMC not found in PyMVPA-upstream-2.4.0 release

Nick Oosterhof n.n.oosterhof at googlemail.com
Wed Jul 15 16:45:09 UTC 2015


> On 15 Jul 2015, at 17:23, Yaroslav Halchenko <debian at onerussian.com> wrote:
> 
> 
> On Wed, 15 Jul 2015, Melanie Boly wrote:
>> [EXT ] DBG:  Presence of libsvm is NOT verified. Caught exception was:
>> cannot import name C_SVC
> 
>> WARNING: None of SVM implementation libraries was found
> 
>> * Please note: warnings are printed only once, but underlying problem
>> might occur many times *
> 
>> Traceback (most recent call last):
> 
>>  File "<string>", line 1, in <module>
> 
>> ImportError: cannot import name LinearCSVMC
> 
> heh ... I was able to replicate this and not yet sure how to overcome.
> May be Nick would know better (I am not using OSX myself)

Yes, at least on 2.4.0 (haven’t checked other versions) a basic install does not provide any SVM implementation.

On my computer (OS X 10.10) it works fine, but unfortunately I don’t remember the details how I got it to work in the past. Starting from scratch following the installation instructions [1], running “make 3rd” works fine, but then trying to build the SVM stuff does not work:

- "python setup.py build_ext”: after this, running “from mvpa2.suite import *" reports "Failed to load fast implementation of SMLR. “ and "SMLR: C implementation is not available. “
- "python setup.py build_ext --with-libsvm”: it fails to build: "fatal error: 'svm.h' file not found”
- "python setup.py build_ext --with-libsvm -I3rd/libsvm” it also fails to build, but with a different error (full output pasted below).

I can see and try tomorrow if I can get the svm stuff to work again starting from scratch. In the meantime, if anyone has suggestions, or has solved this issue before *and* (unlike me) remembers how they fixed it, it would be appreciated if you could share this with us.

[1] http://www.pymvpa.org/installation.html

bash output:

$ python setup.py build_ext --with-libsvm 
running build_ext
running build_src
build_src
building extension "mvpa2.clfs.libsmlrc.smlrc" sources
building extension "mvpa2.clfs.libsvmc._svmc" sources
building data_files sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
#### ['clang', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-Wstrict-prototypes', '-I/usr/local/include', '-I/usr/local/include'] #######
Missing compiler_cxx fix for UnixCCompiler
customize UnixCCompiler using build_ext
building 'mvpa2.clfs.libsvmc._svmc' extension
compiling C++ sources
C compiler: clang++ -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/include

compile options: '-I/usr/include/libsvm-3.0/libsvm -I/usr/include/libsvm-2.0/libsvm -I/usr/include/libsvm -I/usr/local/include/libsvm -I/usr/local/include/libsvm-2.0/libsvm -I/usr/local/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
clang++: build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.cpp
build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.cpp:3085:10: fatal error: 'svm.h' file not found
#include "svm.h"
         ^
1 error generated.
build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.cpp:3085:10: fatal error: 'svm.h' file not found
#include "svm.h"
         ^
1 error generated.
error: Command "clang++ -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/include -I/usr/include/libsvm-3.0/libsvm -I/usr/include/libsvm-2.0/libsvm -I/usr/include/libsvm -I/usr/local/include/libsvm -I/usr/local/include/libsvm-2.0/libsvm -I/usr/local/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.cpp -o build/temp.macosx-10.9-x86_64-2.7/build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.o" failed with exit status 1


$ python setup.py build_ext --with-libsvm -I3rd/libsvm
running build_ext
running build_src
build_src
building extension "mvpa2.clfs.libsmlrc.smlrc" sources
building extension "mvpa2.clfs.libsvmc._svmc" sources
building data_files sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
#### ['clang', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-Wstrict-prototypes', '-I/usr/local/include', '-I/usr/local/include'] #######
Missing compiler_cxx fix for UnixCCompiler
customize UnixCCompiler using build_ext
building 'mvpa2.clfs.libsvmc._svmc' extension
compiling C++ sources
C compiler: clang++ -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/include

compile options: '-I/usr/include/libsvm-3.0/libsvm -I/usr/include/libsvm-2.0/libsvm -I/usr/include/libsvm -I/usr/local/include/libsvm -I/usr/local/include/libsvm-2.0/libsvm -I/usr/local/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I3rd/libsvm -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
clang++: build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.cpp
In file included from build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.cpp:3087:
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
 ^
1 warning generated.
creating build/lib.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc
clang++ -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib -L/usr/local/lib -I/usr/local/include -I/usr/local/include build/temp.macosx-10.9-x86_64-2.7/build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.o -lsvm -o build/lib.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/_svmc.so -bundle
ld: library not found for -lsvm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lsvm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Command "clang++ -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib -L/usr/local/lib -I/usr/local/include -I/usr/local/include build/temp.macosx-10.9-x86_64-2.7/build/src.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/svmc_wrap.o -lsvm -o build/lib.macosx-10.9-x86_64-2.7/mvpa2/clfs/libsvmc/_svmc.so -bundle" failed with exit status 1





More information about the Pkg-ExpPsy-PyMVPA mailing list