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

linux arm64无法构建 #856

Closed
6 tasks
Coloryr opened this issue Mar 18, 2024 · 11 comments · Fixed by #932
Closed
6 tasks

linux arm64无法构建 #856

Coloryr opened this issue Mar 18, 2024 · 11 comments · Fixed by #932
Labels

Comments

@Coloryr
Copy link

Coloryr commented Mar 18, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the bug:

  1. sudo apt-get insall gcc g++
  2. ./action-install-linux.sh
  3. export CC=gcc
  4. export CXX=g++
  5. make

Expected behavior
build in docker

Log

root@67e2c8750702:~/librime# apt-cache policy libboost-locale-dev
libboost-locale-dev:
  Installed: 1.74.0.3ubuntu7
  Candidate: 1.74.0.3ubuntu7
  Version table:
 *** 1.74.0.3ubuntu7 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 Packages
        100 /var/lib/dpkg/status
root@67e2c8750702:~/librime# make
cmake . -Bbuild \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_MERGED_PLUGINS=OFF \
-DENABLE_EXTERNAL_PLUGINS=ON
-- Could NOT find Boost: Found unsuitable version "1.74.0", but required is at least "1.77.0" (found /usr/include, )
-- Found gflags: /usr/lib/aarch64-linux-gnu/libgflags.so
-- Found glog: /usr/lib/aarch64-linux-gnu/libglog.so
-- Found yaml-cpp: /usr/lib/aarch64-linux-gnu/libyaml-cpp.so
-- Found leveldb: /usr/lib/aarch64-linux-gnu/libleveldb.so
-- Found marisa: /usr/lib/aarch64-linux-gnu/libmarisa.so
-- Found opencc: /usr/lib/aarch64-linux-gnu/libopencc.so
-- Found X11/keysym.h at /root/librime/include
-- rime_plugins_libs: 
-- rime_plugins_modules: plugins
-- Configuring done
-- Generating done
-- Build files have been written to: /root/librime/build
cmake --build build
gmake[1]: Entering directory '/root/librime/build'
gmake[2]: Entering directory '/root/librime/build'
gmake[3]: Entering directory '/root/librime/build'
Consolidate compiler generated dependencies of target rime-plugins-objs
gmake[3]: Leaving directory '/root/librime/build'
gmake[3]: Entering directory '/root/librime/build'
[  0%] Building CXX object plugins/CMakeFiles/rime-plugins-objs.dir/plugins_module.cc.o
/root/librime/plugins/plugins_module.cc: In member function 'void rime::PluginManager::LoadPlugins(rime::path)':
/root/librime/plugins/plugins_module.cc:52:69: error: no matching function for call to 'boost::dll::shared_library::shared_library(rime::path&)'
   52 |             auto plugin_lib = boost::dll::shared_library(plugin_file);
      |                                                                     ^
In file included from /usr/include/boost/dll.hpp:16,
                 from /root/librime/plugins/plugins_module.cc:8:
/usr/include/boost/dll/shared_library.hpp:136:5: note: candidate: 'boost::dll::shared_library::shared_library(const boost::filesystem::path&, boost::dll::load_mode::type, boost::system::error_code&)'
  136 |     shared_library(const boost::dll::fs::path& lib_path, load_mode::type mode, boost::dll::fs::error_code& ec) {
      |     ^~~~~~~~~~~~~~
/usr/include/boost/dll/shared_library.hpp:136:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/boost/dll.hpp:16,
                 from /root/librime/plugins/plugins_module.cc:8:
/usr/include/boost/dll/shared_library.hpp:131:5: note: candidate: 'boost::dll::shared_library::shared_library(const boost::filesystem::path&, boost::system::error_code&, boost::dll::load_mode::type)'
  131 |     shared_library(const boost::dll::fs::path& lib_path, boost::dll::fs::error_code& ec, load_mode::type mode = load_mode::default_mode) {
      |     ^~~~~~~~~~~~~~
/usr/include/boost/dll/shared_library.hpp:131:5: note:   candidate expects 3 arguments, 1 provided
/usr/include/boost/dll/shared_library.hpp:118:14: note: candidate: 'boost::dll::shared_library::shared_library(const boost::filesystem::path&, boost::dll::load_mode::type)'
  118 |     explicit shared_library(const boost::dll::fs::path& lib_path, load_mode::type mode = load_mode::default_mode) {
      |              ^~~~~~~~~~~~~~
/usr/include/boost/dll/shared_library.hpp:118:57: note:   no known conversion for argument 1 from 'rime::path' to 'const boost::filesystem::path&'
  118 |     explicit shared_library(const boost::dll::fs::path& lib_path, load_mode::type mode = load_mode::default_mode) {
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/boost/dll/shared_library.hpp:106:5: note: candidate: 'boost::dll::shared_library::shared_library(boost::dll::shared_library&&)'
  106 |     shared_library(BOOST_RV_REF(shared_library) lib) BOOST_NOEXCEPT
      |     ^~~~~~~~~~~~~~
/usr/include/boost/dll/shared_library.hpp:106:49: note:   no known conversion for argument 1 from 'rime::path' to 'boost::dll::shared_library&&'
  106 |     shared_library(BOOST_RV_REF(shared_library) lib) BOOST_NOEXCEPT
      |                                                 ^
/usr/include/boost/dll/shared_library.hpp:93:5: note: candidate: 'boost::dll::shared_library::shared_library(const boost::dll::shared_library&, boost::system::error_code&)'
   93 |     shared_library(const shared_library& lib, boost::dll::fs::error_code& ec)
      |     ^~~~~~~~~~~~~~
/usr/include/boost/dll/shared_library.hpp:93:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/boost/dll/shared_library.hpp:78:5: note: candidate: 'boost::dll::shared_library::shared_library(const boost::dll::shared_library&)'
   78 |     shared_library(const shared_library& lib)
      |     ^~~~~~~~~~~~~~
/usr/include/boost/dll/shared_library.hpp:78:42: note:   no known conversion for argument 1 from 'rime::path' to 'const boost::dll::shared_library&'
   78 |     shared_library(const shared_library& lib)
      |                    ~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/boost/dll/shared_library.hpp:68:5: note: candidate: 'boost::dll::shared_library::shared_library()'
   68 |     shared_library() BOOST_NOEXCEPT {}
      |     ^~~~~~~~~~~~~~
/usr/include/boost/dll/shared_library.hpp:68:5: note:   candidate expects 0 arguments, 1 provided
gmake[3]: *** [plugins/CMakeFiles/rime-plugins-objs.dir/build.make:76: plugins/CMakeFiles/rime-plugins-objs.dir/plugins_module.cc.o] Error 1
gmake[3]: Leaving directory '/root/librime/build'
gmake[2]: *** [CMakeFiles/Makefile2:189: plugins/CMakeFiles/rime-plugins-objs.dir/all] Error 2
gmake[2]: Leaving directory '/root/librime/build'
gmake[1]: *** [Makefile:146: all] Error 2
gmake[1]: Leaving directory '/root/librime/build'
make: *** [Makefile:69: release] Error 2
root@67e2c8750702:~/librime# 

Screenshots
If applicable, add screenshots to help explain your problem.

Flavor(please complete the following information):
Select your flavor:

  • ibus-rime
  • fcitx-rime
  • fcitx5-rime
  • Squirrel
  • Trime
  • Weasel

Package:

  • OS: [e.g. openSUSE Tumbleweed]
  • Version: [e.g. 5.0.7]
  • URI: [e.g. https://software.opensuse.org/package/fcitx5-rime?search_term=fcitx5-rime]

Additional context

@Coloryr Coloryr added the bug label Mar 18, 2024
@Coloryr
Copy link
Author

Coloryr commented Mar 19, 2024

boost 1.74没法正常编译
1.84可以

@mokapsing
Copy link
Contributor

-- Could NOT find Boost: Found unsuitable version "1.74.0", but required is at least "1.77.0" (found /usr/include, )

@Coloryr
Copy link
Author

Coloryr commented Mar 19, 2024

apt-get安装的是1.74

@lotem
Copy link
Member

lotem commented Apr 17, 2024

應該是這個原因:

if(LINUX)

這裏的判斷 if(LINUX) 需要 cmake>=3.25
如果 cmake 版本較低不支持 LINUX 變量,就會要求 boost>=1.77 從而出錯

@Coloryr
Copy link
Author

Coloryr commented Apr 18, 2024

感觉不是这个原因,是boost版本不对,导致头文件不一样

@Coloryr
Copy link
Author

Coloryr commented Apr 18, 2024

應該是這個原因:

if(LINUX)

這裏的判斷 if(LINUX) 需要 cmake>=3.25
如果 cmake 版本較低不支持 LINUX 變量,就會要求 boost>=1.77 從而出錯

Arm64的Cmake只有3.22.1

root@67e2c8750702:~/librime# apt-get install cmake
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
cmake is already the newest version (3.22.1-1ubuntu1.22.04.2).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
root@67e2c8750702:~/librime

@Coloryr
Copy link
Author

Coloryr commented Jul 5, 2024

现在使用qemu+docker编译,会导致内存溢出,这是librime的问题吗

@Coloryr
Copy link
Author

Coloryr commented Jul 5, 2024

我发现如果我在外面执行make指令就会溢出,进入build文件夹执行make -j16就不会

@ksqsf
Copy link
Member

ksqsf commented Aug 30, 2024

It's a cmake-related problem. It seems cmake will use make -j if no job count is specified (sometimes?). This should be fixed by specifying -j in the Makefile.

edit: no, it's here:

export MAKEFLAGS+=" -j$(( $(nproc) + 1)) "

@Coloryr
Copy link
Author

Coloryr commented Aug 31, 2024

yse, remove + 1 fixed

@ksqsf
Copy link
Member

ksqsf commented Aug 31, 2024

it's a portability issue. This problem also affects macos because macos does not have the nproc command.

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

Successfully merging a pull request may close this issue.

4 participants