Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在centos上无法通过POSIX/Python下的cmake #1337

Closed
hxxyyangyong opened this issue Jul 3, 2024 · 4 comments
Closed

在centos上无法通过POSIX/Python下的cmake #1337

hxxyyangyong opened this issue Jul 3, 2024 · 4 comments

Comments

@hxxyyangyong
Copy link

hxxyyangyong commented Jul 3, 2024

我在mac上所有的步骤都能成功,但是迁移到centos上就出现了错误

各种版本:
cmake 3.20.2
Python 3.9.18
clang 16.0.6

不论是我自己构建:
cd mmkv/POSIX mkdir build cd build cmake .. make

还是直接
python3 setup.py install

都是如下的报错
报错信息如下:

- The C compiler identification is GNU 11.4.1
-- The CXX compiler identification is GNU 11.4.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- pybind11 v2.8.0 
-- Found PythonInterp: /usr/bin/python3.9 (found version "3.9.18") 
-- Found PythonLibs: /usr/lib64/libpython3.9.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring done
-- Generating done
-- Build files have been written to: XXX/MMKV/POSIX/Python/build
[  2%] Building CXX object Core/CMakeFiles/core.dir/MMKV.cpp.o
[  5%] Building CXX object Core/CMakeFiles/core.dir/MMKV_Android.cpp.o
[  8%] Building CXX object Core/CMakeFiles/core.dir/MMKV_IO.cpp.o
[ 11%] Building CXX object Core/CMakeFiles/core.dir/MMKV_OSX.cpp.o
[ 13%] Building CXX object Core/CMakeFiles/core.dir/MMKVLog.cpp.o
[ 16%] Building CXX object Core/CMakeFiles/core.dir/MMKVLog_Android.cpp.o
[ 19%] Building CXX object Core/CMakeFiles/core.dir/CodedInputData.cpp.o
[ 22%] Building CXX object Core/CMakeFiles/core.dir/CodedInputData_OSX.cpp.o
[ 25%] Building CXX object Core/CMakeFiles/core.dir/CodedInputDataCrypt.cpp.o
[ 27%] Building CXX object Core/CMakeFiles/core.dir/CodedInputDataCrypt_OSX.cpp.o
[ 30%] Building CXX object Core/CMakeFiles/core.dir/CodedOutputData.cpp.o
[ 33%] Building CXX object Core/CMakeFiles/core.dir/KeyValueHolder.cpp.o
[ 36%] Building CXX object Core/CMakeFiles/core.dir/PBUtility.cpp.o
In file included from xxx/MMKV/Core/PBUtility.cpp:20:
XXX/MMKV/Core/PBUtility.h: In function ‘uint32_t mmkv::pbMMBufferSize(const mmkv::MMBuffer&)’:
XXX/MMKV/Core/PBUtility.h:151:46: error: invalid use of incomplete type ‘const class mmkv::MMBuffer’
  151 |     auto valueLength = static_cast<uint32_t>(data.length());
      |                                              ^~~~
In file included from XXX/MMKV/Core/PBUtility.h:25,
                 from XXX/MMKV/Core/PBUtility.cpp:20:
XXX/MMKV/Core/MMKVPredef.h:171:7: note: forward declaration of ‘class mmkv::MMBuffer’
  171 | class MMBuffer;
      |       ^~~~~~~~
make[2]: *** [Core/CMakeFiles/core.dir/build.make:244: Core/CMakeFiles/core.dir/PBUtility.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:144: Core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
@lingol
Copy link
Collaborator

lingol commented Jul 4, 2024

I currently don't have a CentOS env at hand, it will take some time.
I noticed that in your posted log, you are using GCC. What's the version of it?
And what is the version of your CentOS?

@lingol
Copy link
Collaborator

lingol commented Jul 5, 2024

I just noticed that your code is not up to date. Line 20 of PBUtility.cpp in the master branch.
https://github.com/Tencent/MMKV/blob/master/Core/PBUtility.cpp#L20

PS: the master branch is known for some GCC & Linux compile failures. You can checkout the dev branch for testing.

lingol added a commit that referenced this issue Jul 5, 2024
@hxxyyangyong
Copy link
Author

我可以试试dev分支,
但我在mac上执行都是OK的,只是将执行环境迁移到了centOS而已,当然两边的基础环境工具版本是不一致的。

@hxxyyangyong
Copy link
Author

dev branch is ok, need run setup.py ,custom build Still failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants