librime icon indicating copy to clipboard operation
librime copied to clipboard

linux arm64无法构建

Open Coloryr opened this issue 1 year ago • 8 comments

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 avatar Mar 18 '24 11:03 Coloryr

boost 1.74没法正常编译 1.84可以

Coloryr avatar Mar 19 '24 00:03 Coloryr

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

MokOopsing avatar Mar 19 '24 00:03 MokOopsing

apt-get安装的是1.74

Coloryr avatar Mar 19 '24 02:03 Coloryr

應該是這個原因: https://github.com/rime/librime/blob/1f3bf35691a5ad066ef36775e289525f3b092e28/CMakeLists.txt#L62 這裏的判斷 if(LINUX) 需要 cmake>=3.25 如果 cmake 版本較低不支持 LINUX 變量,就會要求 boost>=1.77 從而出錯

lotem avatar Apr 17 '24 12:04 lotem

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

Coloryr avatar Apr 18 '24 00:04 Coloryr

應該是這個原因:

https://github.com/rime/librime/blob/1f3bf35691a5ad066ef36775e289525f3b092e28/CMakeLists.txt#L62

這裏的判斷 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 avatar Apr 18 '24 00:04 Coloryr