Cython编译在计算机上工作,但在s上失败

2024-09-30 10:42:41 发布

您现在位置:Python中文网/ 问答频道 /正文

当我在家用计算机上编译这个程序时,它工作得很好,但在服务器上却不工作,这很奇怪,因为两个文件都是相同的,我使用conda来管理这两个文件上的环境。以下是我在服务器上收到的错误消息:

running build_ext
building 'LDFMap' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/rpandit2/miniconda3/envs/LDFMap/lib/python3.4/site-packages/numpy/core/include -I/home/rpandit2/LDFMap/src/include -I/home/rpandit2/miniconda3/envs/LDFMap/include/python3.4m -c LDFMap.cpp -o build/temp.linux-x86_64-3.4/LDFMap.o -I /home/rpandit2/LDFMap/src/include -I /usr/local/include
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from /home/rpandit2/miniconda3/envs/LDFMap/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from LDFMap.cpp:284:
/home/rpandit2/miniconda3/envs/LDFMap/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^
In file included from /usr/include/stdio.h:929:0,
                 from /home/rpandit2/miniconda3/envs/LDFMap/include/python3.4m/Python.h:25,
                 from LDFMap.cpp:43:
/usr/include/bits/stdio.h: In function ‘__ssize_t getline(char**, size_t*, FILE*)’:
/usr/include/bits/stdio.h:118:52: error: ‘__getdelim’ was not declared in this scope
   return __getdelim (__lineptr, __n, '\n', __stream);
                                                    ^
In file included from /home/rpandit2/miniconda3/envs/LDFMap/include/python3.4m/Python.h:30:0,
                 from LDFMap.cpp:43:
/usr/include/string.h: At global scope:
/usr/include/string.h:548:5: error: ‘__locale_t’ has not been declared
     __locale_t __loc)
     ^
In file included from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/features.h:338:0,
                 from /usr/include/limits.h:27,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/limits.h:168,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/syslimits.h:7,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/limits.h:34,
                 from /home/rpandit2/miniconda3/envs/LDFMap/include/python3.4m/Python.h:11,
                 from LDFMap.cpp:43:
/usr/include/string.h:549:33: error: nonnull argument references non-pointer operand (argument 1, operand 3)
      __THROW __attribute_pure__ __nonnull ((1, 2, 3));
                                 ^
In file included from /home/rpandit2/miniconda3/envs/LDFMap/include/python3.4m/Python.h:30:0,
                 from LDFMap.cpp:43:
/usr/include/string.h:552:18: error: ‘__locale_t’ has not been declared
      size_t __n, __locale_t __loc)
                  ^
In file included from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/features.h:338:0,
                 from /usr/include/limits.h:27,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/limits.h:168,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/syslimits.h:7,
                 from /home/rpandit2/miniconda3/envs/LDFMap/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed/limits.h:34,
                 from /home/rpandit2/miniconda3/envs/LDFMap/include/python3.4m/Python.h:11,
                 from LDFMap.cpp:43:
/usr/include/string.h:553:33: error: nonnull argument references non-pointer operand (argument 1, operand 4)
      __THROW __attribute_pure__ __nonnull ((1, 2, 4));
                                 ^
/home/rpandit2/LDFMap/src/include/rmsd.h:46:93: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
In file included from /home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/bits/localefwd.h:40:0,
                 from /home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/ios:41,
                 from /home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/istream:38,
                 from /home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/sstream:38,
                 from /home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/complex:45,
                 from LDFMap.cpp:488:
/home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++locale.h: At global scope:
/home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++locale.h:52:23: error: ‘uselocale’ was not declared in this scope
   extern "C" __typeof(uselocale) __uselocale;
                       ^
/home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++locale.h:52:45: error: invalid type in declaration before ‘;’ token
   extern "C" __typeof(uselocale) __uselocale;
                                             ^
/home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++locale.h: In function ‘int std::__convert_from_v(__locale_struct* const&, char*, int, const char*, ...)’:
/home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++locale.h:75:53: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
     __c_locale __old = __gnu_cxx::__uselocale(__cloc);
                                                     ^
/home/rpandit2/miniconda3/envs/LDFMap/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++locale.h:100:33: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
     __gnu_cxx::__uselocale(__old);
                                 ^
 ^

在我的计算机上运行的gcc命令与在服务器上运行的命令相同

^{pr2}$

最后,这是我的设置.py(在服务器上):

^{3}$

Tags: fromgnuhomeincludelinuxlibusrlocale

热门问题