GithubHelp home page GithubHelp logo

Comments (9)

qiankanglai avatar qiankanglai commented on May 22, 2024

I've encountered this too.

Easiest (& dirty) patch:

  • add #define SOABI "cpython-34m"
  • add #define _Py_END_SUPPRESS_IPH

Trying to figure a better way now

from klayge.

speakfool avatar speakfool commented on May 22, 2024

Just don't know if this is the only problem.
These macros are provided by configure, in the original automake system.
I think maybe a better way is to use the provided configure/make on linux-based system?
Is this easy to integrate with CMake?
I'll see to this later after work.

from klayge.

qiankanglai avatar qiankanglai commented on May 22, 2024

I've just tested yesterday. Other problems like Assimp has been fixed.

Python src doesn't provide a CMakeFiles...so every time I have to maintain it manually after updating 😞

from klayge.

speakfool avatar speakfool commented on May 22, 2024

Add -DSOABI='"cpython-35m-darwin"' -DPy_BUILD_CORE in c compiler flag can work. But where should I add these options? I tried "makefile-variables.in" but not working. And the SOABI value is platform specified.

It turn out you should only add the -DPy_BUILD_CORE for the core modules, not for tests. Or you will get _testcapimodule.c not compile.

I'm going with the dirty way now 😒

from klayge.

gongminmin avatar gongminmin commented on May 22, 2024

This is something I don't understand. The first line of External\Python\Build\cmake\cmake\libpython\CMakeLists.txt is add_definitions(-DPy_BUILD_CORE). But somehow on OSX, Py_BUILD_CORE doesn't get through to compiler.

SOABI is definitely required. Can you confirm it's "cpython-35m-darwin"? If so, I can fix this problem by adding it to CMakeLists.txt.

from klayge.

speakfool avatar speakfool commented on May 22, 2024

I tried just add it to CMAKE_C_FLAGS in the root CMakeLists.txt, and it's working somehow. I'm not familiar with CMake syntax, especially the quote rules. I don't have my Mac with me right now, hope it helps.

SOABI is platform specific, as I see in configure.ac: 4074

# ABI version string for Python extension modules.  This appears between the
# periods in shared library file names, e.g. foo.<SOABI>.so.  It is calculated
# from the following attributes which affect the ABI of this Python build (in
# this order):
#
# * The Python implementation (always 'cpython-' for us)
# * The major and minor version numbers
# * --with-pydebug (adds a 'd')
# * --with-pymalloc (adds a 'm')
# * --with-wide-unicode (adds a 'u')
#
# Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
# would get a shared library ABI version tag of 'cpython-32dmu' and shared
# libraries would be named 'foo.cpython-32dmu.so'.

....
SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}
....

Update:
Above is from windows machine. On my Mac, the SOABI line is slightly different

SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}

from klayge.

speakfool avatar speakfool commented on May 22, 2024

To be clear, I didn't finally add Py_BUILD_CORE. Because I modified the root CMakeList.txt., it would affect the test files and cause build failure.
I added the -D_Py_BEGIN_SUPPRESS_IPH and -D_Py_END_SUPPRESS_IPH instead.

The "cpython-35m-darwin" is what I got from running the ./configure and checked the Makefile.

from klayge.

speakfool avatar speakfool commented on May 22, 2024

I thought you added Py_BUILD_CORE in libpython, but not in extensions.
I got first compile error in extension-time and extension-datetime.

update:
in External\Python\Build\cmake\cmake\extensions\CMakeLists.txt,
adding

DEFINITIONS Py_BUILD_CORE

in add_python_extension for datetime and time solves the first issue.

from klayge.

gongminmin avatar gongminmin commented on May 22, 2024

Thanks for you help. I'll move the Py_BUILD_CORE to root CMakeLists, and add cpython-35m-darwin as SOABI. New commit will be pushed very soon.

from klayge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.