构建 shogun 时出错:没有匹配函数来调用 'PyUnicode_AsUTF8AndSize'

Error building shogun: no matching function for call to 'PyUnicode_AsUTF8AndSize'

我正在尝试按照此 link https://github.com/shogun-toolbox/shogun/blob/develop/doc/readme/INSTALL.md#manual

中给出的说明手动编译 shogun

这是我在 运行 make 上的终端输出:

$make -j4

[100%] Building CXX object src/interfaces/python/CMakeFiles/_interface_python.dir/sg_print_functions.cpp.o
In file included from /Users/krishna/shogun/build/src/interfaces/python/shogunPYTHON_wrap.cxx:6158:
/Users/krishna/shogun/src/shogun/distance/DirectorDistance.h:61:3: warning: control may reach end of non-void function [-Wreturn-type]
            }
            ^
In file included from /Users/krishna/shogun/build/src/interfaces/python/shogunPYTHON_wrap.cxx:6196:
/Users/krishna/shogun/src/shogun/evaluation/TimeSeriesSplitting.h:80:23: warning: 'get_name' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
            virtual const char* get_name() const
                                ^
/Users/krishna/shogun/src/shogun/base/SGObject.h:180:22: note: overridden virtual function is here
    virtual const char* get_name() const = 0;
                        ^
/Users/krishna/shogun/build/src/interfaces/python/shogunPYTHON_wrap.cxx:7696:39: error: no matching function for call to 'PyUnicode_AsUTF8AndSize'
                const char* str = PyUnicode_AsUTF8AndSize(o, &len);
                                  ^~~~~~~~~~~~~~~~~~~~~~~
/Users/krishna/.edm/envs/py3/include/python3.6m/unicodeobject.h:1126:20: note: candidate function not viable: no known conversion from 'int64_t *' (aka 'long long *') to 'Py_ssize_t *' (aka 'long *') for 2nd
  argument
PyAPI_FUNC(char *) PyUnicode_AsUTF8AndSize(
               ^
/Users/krishna/shogun/build/src/interfaces/python/shogunPYTHON_wrap.cxx:10278:25: warning: 'tmpnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent
  in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
        char* fname=tmpnam(NULL);
                    ^
/usr/include/stdio.h:275:1: note: 'tmpnam' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
^/usr/include/sys/cdefs.h:180:48: note: expanded from macro '__deprecated_msg'
    #define __deprecated_msg(_msg) __attribute__((deprecated(_msg)))
                                                  ^
/Users/krishna/shogun/build/src/interfaces/python/shogunPYTHON_wrap.cxx:10322:25: warning: 'tmpnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent
  in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
        char* fname=tmpnam(NULL);
                    ^
/usr/include/stdio.h:275:1: note: 'tmpnam' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
^
/usr/include/sys/cdefs.h:180:48: note: expanded from macro '__deprecated_msg'
    #define __deprecated_msg(_msg) __attribute__((deprecated(_msg)))
                                                  ^
4 warnings and 1 error generated.
make[2]: *** [src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o] Error 1
make[1]: *** [src/interfaces/python/CMakeFiles/_interface_python.dir/all] Error 2
make: *** [all] Error 2

谢谢。

这是一个错误,应由 ca4360e483c115444864bef0925417f479923a43 commit

修复