Skip to content

Compiling with Manylinux / Cross-platform compiling (cibuildwheel) / Setuptools based compling #277

Closed
@AlmogBaku

Description

@AlmogBaku

Hi,
Did you have a chance to compile the project with Manylinux?
I'm failing to compile it due to the dependency in libpython.

I tried to extract the shared-libraries using the following command which helped a bit:
yum -y install xz && cd /opt/_internal/ && XZ_OPT=-9e tar -xf static-libs-for-embedding-only.tar.xz && cd /project

But I'm still getting many errors when compiling the go

$ GCO_ENABLED=1 go build -mod=mod -buildmode=c-shared -o pyexp_go.so pyexp.go
tmp/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(bytesobject.o): relocation R_X86_64_32S against symbol `PyBytes_Type' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(call.o): relocation R_X86_64_32S against symbol `PyFunction_Type' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(complexobject.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(exceptions.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(floatobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(frameobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(funcobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(listobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(longobject.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(dictobject.o): relocation R_X86_64_32S against `.text.hot' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(memoryobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(methodobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(moduleobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(object.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(obmalloc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(capsule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(rangeobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(setobject.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(sliceobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(structseq.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(tupleobject.o): relocation R_X86_64_32 against symbol `_PyEval_SliceIndexNotNone' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(typeobject.o): relocation R_X86_64_32 against symbol `PyBaseObject_Type' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(unicodeobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(unicodectype.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(weakrefobject.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(_warnings.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(bltinmodule.o): relocation R_X86_64_32S against symbol `PyFilter_Type' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(ceval.o): relocation R_X86_64_32 against symbol `_PyRuntime' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(compile.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(codecs.o): relocation R_X86_64_32S against symbol `_Py_ctype_tolower' can not be used when making a shared object; recompile with -fPIC
/opt/rh/gcc-toolset-11/root/usr/bin/ld: /opt/_internal/cpython-3.7.13/lib/libpython3.7m.a(errors.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions