如何构建cjellyfish来创建python 2.7轮子

问题描述 投票:0回答:0

我需要将水母放到 aws redshift 上,这当然是 2.7,我不知道它是 manylinux1/manylinux2010/manylinux2014 还是 x86_64/i686/aarch64/god 知道什么。

Python udfs 运行速度比 lambda udfs 快得多,刚刚用虚拟函数测试过,所以是的,我真的需要用困难的方式来做。

当然水母只是 python 3,但幸运的是他们创造了cjellyfish所以我希望我可以从中编译一个轮子。

问题是,我似乎无法弄清楚到底该怎么做...

我打开一个aws commandshell并粘贴这个

sudo yum -y groupinstall "Development Tools"
sudo yum -y install python-devel
git clone https://github.com/jamesturk/cjellyfish.git
cd cjellyfish
echo 'from distutils.core import setup, Extension' > setup.py
echo "module1 = Extension('jellyfish', sources = ['jellyfishmodule.c'])" >> setup.py
echo "setup (name = 'jellyfish', version = '1.0', description = 'cjellyfish', ext_modules = [module1])" >> setup.py
sudo python setup.py build

但是构建吐出各种错误:

jellyfishmodule.c:26:38: error: ‘PyUnicode_4BYTE_KIND’ undeclared (first use in this function); did you mean ‘PyUnicode_GET_SIZE’?
     return PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, (void*)str, len);
                                      ^~~~~~~~~~~~~~~~~~~~
jellyfishmodule.c:502:15: error: variable ‘moduledef’ has initializer but incomplete type
 static struct PyModuleDef moduledef = {
               ^~~~~~~~~~~
jellyfishmodule.c:503:5: error: ‘PyModuleDef_HEAD_INIT’ undeclared here (not in a function); did you mean ‘PyObject_HEAD_INIT’?
     PyModuleDef_HEAD_INIT,
     ^~~~~~~~~~~~~~~~~~~~~
jellyfishmodule.c:502:27: error: storage size of ‘moduledef’ isn’t known
 static struct PyModuleDef moduledef = {
                           ^~~~~~~~~

我如何得到它来构建和使用 python 2.7?

amazon-redshift user-defined-functions python-2.x python-wheel
© www.soinside.com 2019 - 2024. All rights reserved.