在龙芯3A4000上移植ceph15.2.13

记录一次龙芯移植,当初花了我很多时间,移植ceph推荐使用新一点的系统,不然会缺少很多依赖包。我使用的系统是银河麒麟v10服务器版(龙芯),所以打包出来的是rpm包。

打rpm包较为简单的方法是找到srpm源码包,这样在别人spec文件的基础上进行修改,然后使用命令rpmbuild -ba xxx.spec就能方便的打出包了。

rpmbuild -ba xxx.spec

我喜欢在fedora koji上找srpm包,他们的包还是比较全的(毕竟我是小菜鸡,写不了spec文件),这个网站百度直接搜就能找到,还是挺靠前的,搜索框输入ceph*,找到对应的版本,把他的src.rpm下载下来就好。下面也有已经打好的rpm包,显然没有龙芯的,安心移植就行。

在龙芯3A4000上移植ceph15.2.13_第1张图片

 下载下来之后使用命令 rpm -ivh xxx.src.rpm安装

rpm -ivh xxx.src.rpm

说是安装其实进行的是解压的操作,解压到~/rpmbuild文件夹下,所以普通用户执行这个会解压在/home/用户名下,root用户解压会在/root下,因为我这是一次性系统,装完系统干完移植后就装别的了,所以直接用的root用户移植。

进入SPEC目录,先不急着rpmbuild,进入SPEC目录,先对spec文件进行前期的修改,一般来说主要是看那些if判断,首先是架构相关的,这是他支持的cpu架构

ExclusiveArch:  x86_64 aarch64 ppc64 ppc64le

因为我移植的是龙芯,反正看见x86,aarch64之类,在他们后面加个mips,是否加el看具体cpu,3A4000是mips64el。

ExclusiveArch:  x86_64 aarch64 ppc64 ppc64le mips64el

然后是一些系统相关的,他会用一些宏来判断是什么系统

%if 0%{?fedora} || 0%{?rhel}

麒麟也不在里面,得给他加上

%if 0%{?fedora} || 0%{?rhel} || 0%{?kylin}

把两千多行spec都过一遍,把这些if判断都改了,顺便提一句如果是判断rhel大于等于8的,也能把kylin加上,v10的内核版本能大致对上rhel8

然后就能rpmbuild的了,正常的话会报一堆依赖缺失,把他们都一个个yum install了,经过非常机械化的劳动之后(新时代民工是这样的),会有几个yum源里没有包,这时候可以去龙芯ftp上看看,他们的网址是这个Index of /os/loongnix/1.0/osicon-default.png?t=LA92http://ftp.loongnix.cn/os/loongnix/1.0/os/或者也能在repo里把他加入baseurl,这样就能直接yum安装了,如果这样还是没有,那就需要你再移植依赖了,恭喜恭喜。。。

反正一通安装完依赖后总算开编了,由于龙芯性能非常的拉跨,编译过程非常久,编了四五个小时在55%的时候报错了,因为使用rpmbuild会把build目录删除,然后重新解压编译,所以非常耗时,为了缩短时间,需要修改下spec文件,搜索一下%build找到build过程,往下翻,发现是使用cmake构建的

mkdir build
cd build
%if 0%{?rhel} == 7
%global cmake cmake3
%endif
%{cmake} .. \

build过程中test是非常耗时的,使用这个宏把它关掉-DWITH_TESTS=OFF 

%{cmake} .. \
    -DWITH_TESTS=OFF \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \

这样编起来就快多了,大约节约了一半时间,(现在想想完全可以进入报错的子模块调用makefile单独make,只能说当初太年轻了,笨比的每次改完重新rpmbuild)

然后回头看一下报错

cd /root/rpmbuild/BUILD/ceph-15.2.13/build/src/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/unittest_log.dir/link.txt --verbose=1
/usr/bin/c++  -O2 -g -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -rdynamic -O2 -g -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -O2 -g -DNDEBUG  -latomic -pie CMakeFiles/unittest_log.dir/__/log/test.cc.o  -o ../../bin/unittest_log -Wl,-rpath,/root/rpmbuild/BUILD/ceph-15.2.13/build/lib ../../lib/libgmock_main.so ../../lib/libgmock.so ../../lib/libgtest.so -lpthread /usr/lib64/libldap.so /usr/lib64/liblber.so -ldl ../../lib/libglobal.a ../../lib/libgmock.so ../../lib/libgtest.so ../../lib/libceph-common.so.2 ../../lib/libjson_spirit.a ../../lib/libcommon_utf8.a ../../lib/liberasure_code.a ../../lib/libcrc32.a ../../lib/libarch.a /usr/lib64/libboost_thread.so /usr/lib64/libboost_chrono.so /usr/lib64/libboost_atomic.so /usr/lib64/libboost_system.so /usr/lib64/libboost_random.so /usr/lib64/libboost_program_options.so /usr/lib64/libboost_date_time.so /usr/lib64/libboost_iostreams.so /usr/lib64/libboost_regex.so -lstdc++fs ../../lib/libfmt.so.5.3.1 -Wl,--as-needed /usr/lib64/libblkid.so -lpthread -ldl /usr/lib64/libcrypto.so /usr/lib64/libudev.so /usr/lib64/libibverbs.so /usr/lib64/librdmacm.so /usr/lib64/librt.so -lresolv 
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `__gnu_cxx::new_allocator::deallocate(char*, unsigned long)':
/usr/include/c++/8/ext/new_allocator.h:125:(.text+0x30): relocation truncated to fit: R_MIPS_CALL16 against `operator delete(void*)@@GLIBCXX_3.4'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `std::default_delete, std::allocator > >::operator()(std::__cxx11::basic_string, std::allocator >*) const':
/usr/include/c++/8/bits/unique_ptr.h:81:(.text+0x3c): relocation truncated to fit: R_MIPS_CALL16 against `operator delete(void*, unsigned long)@@CXXABI_1.3.9'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `std::__cxx11::basic_string, std::allocator >::_M_create(unsigned long&, unsigned long)':
/usr/include/c++/8/bits/basic_string.tcc:143:(.text+0x98): relocation truncated to fit: R_MIPS_CALL16 against `operator new(unsigned long)@@GLIBCXX_3.4'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `__gnu_cxx::new_allocator::allocate(unsigned long, void const*)':
/usr/include/c++/8/ext/new_allocator.h:111:(.text+0xc0): relocation truncated to fit: R_MIPS_CALL16 against `operator new(unsigned long)@@GLIBCXX_3.4'
/usr/include/c++/8/ext/new_allocator.h:111:(.text+0xe4): relocation truncated to fit: R_MIPS_CALL16 against `operator new(unsigned long)@@GLIBCXX_3.4'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `std::__cxx11::basic_string, std::allocator >::_M_create(unsigned long&, unsigned long)':
/usr/include/c++/8/bits/basic_string.tcc:138:(.text+0x110): relocation truncated to fit: R_MIPS_CALL16 against `std::__throw_length_error(char const*)@@GLIBCXX_3.4'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `Log_TimeFormat_Test::TestBody()':
/root/rpmbuild/BUILD/ceph-15.2.13/src/log/test.cc:261:(.text+0x14c): relocation truncated to fit: R_MIPS_GOT_DISP against `__stack_chk_guard@@GLIBC_2.4'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `ceph::time_detail::coarse_real_clock::now()':
/root/rpmbuild/BUILD/ceph-15.2.13/src/common/ceph_time.h:171:(.text+0x15c): relocation truncated to fit: R_MIPS_CALL16 against `clock_gettime@@GLIBC_2.2'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `ceph::logging::append_time(std::chrono::time_point > > const&, char*, int)':
/root/rpmbuild/BUILD/ceph-15.2.13/src/log/LogClock.h:133:(.text+0x1b0): relocation truncated to fit: R_MIPS_CALL16 against `localtime_r@@GLIBC_2.0'
/root/rpmbuild/BUILD/ceph-15.2.13/src/log/LogClock.h:135:(.text+0x204): relocation truncated to fit: R_MIPS_CALL16 against `strftime@@GLIBC_2.0'
CMakeFiles/unittest_log.dir/__/log/test.cc.o: in function `Log_TimeFormat_Test::TestBody()':
/usr/include/bits/stdio2.h:67:(.text+0x268): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make[2]: *** [src/test/CMakeFiles/unittest_log.dir/build.make:117: bin/unittest_log] Error 1
make[2]: Leaving directory '/root/rpmbuild/BUILD/ceph-15.2.13/build'
make[1]: *** [CMakeFiles/Makefile2:11118: src/test/CMakeFiles/unittest_log.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

报错一大坨,但核心都是R_MIPS_CALL16 against `xxx@@GLIBC_2.0',网上查了一下,说是

静态库的符号表存储方式不一样,一个库使用32位方式,另一个库使用16位方式,导致调用时不同而造成此问题。

显然mips用了16位,加上gcc的编译选项 -mxgot 可以让他们位对其,问题就是在哪里加上呢,翻一翻spec文件的build阶段

%if 0%{?suse_version}
# the following setting fixed an OOM condition we once encountered in the OBS
RPM_OPT_FLAGS="$RPM_OPT_FLAGS --param ggc-min-expand=20 --param ggc-min-heapsize=32768"
%endif

export CPPFLAGS="$java_inc"
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
export LDFLAGS="$RPM_LD_FLAGS"

发现了这个,因为ceph是cmake构建的,所以修改cmake的宏就行,我们要在CXXFLAGS里加上-mxgot,所以在RPM_OPT_FLAGS里加上就行,依葫芦画瓢给他添上

%if 0%{?suse_version}
# the following setting fixed an OOM condition we once encountered in the OBS
RPM_OPT_FLAGS="$RPM_OPT_FLAGS --param ggc-min-expand=20 --param ggc-min-heapsize=32768"
%endif

RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mxgot"

export CPPFLAGS="$java_inc"
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
export LDFLAGS="$RPM_LD_FLAGS"

成了,再rpmbuild吧,这会到了67%又报错了

[ 67%] Linking CXX executable ../../../bin/ceph_test_rados_api_asio
cd /root/rpmbuild/BUILD/ceph-15.2.13/build/src/test/librados && /usr/bin/cmake -E cmake_link_script CMakeFiles/ceph_test_rados_api_asio.dir/link.txt --verbose=1
/usr/bin/c++  -O2 -g -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -mxgot -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -rdynamic -O2 -g -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -mxgot -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -O2 -g -DNDEBUG  -latomic -pie CMakeFiles/ceph_test_rados_api_asio.dir/asio.cc.o  -o ../../../bin/ceph_test_rados_api_asio -Wl,-rpath,/root/rpmbuild/BUILD/ceph-15.2.13/build/lib: ../../../lib/libglobal.a ../../../lib/librados.so.2.0.0 ../../../lib/libgmock_main.so ../../../lib/libgmock.so ../../../lib/libgtest.so -lpthread /usr/lib64/libldap.so /usr/lib64/liblber.so -ldl /usr/lib64/libboost_coroutine.so /usr/lib64/libboost_context.so ../../../lib/libceph-common.so.2 ../../../lib/libjson_spirit.a ../../../lib/libcommon_utf8.a ../../../lib/liberasure_code.a ../../../lib/libcrc32.a ../../../lib/libarch.a /usr/lib64/libboost_thread.so /usr/lib64/libboost_chrono.so /usr/lib64/libboost_atomic.so /usr/lib64/libboost_system.so /usr/lib64/libboost_random.so /usr/lib64/libboost_program_options.so /usr/lib64/libboost_date_time.so /usr/lib64/libboost_iostreams.so /usr/lib64/libboost_regex.so -lstdc++fs ../../../lib/libfmt.so.5.3.1 -Wl,--as-needed /usr/lib64/libblkid.so /usr/lib64/libcrypto.so /usr/lib64/libudev.so /usr/lib64/libibverbs.so /usr/lib64/librdmacm.so /usr/lib64/librt.so -lresolv ../../../lib/libgmock.so ../../../lib/libgtest.so -lpthread -ldl 
/usr/bin/ld: /usr/lib64/libboost_coroutine.so: undefined reference to `jump_fcontext'
/usr/bin/ld: /usr/lib64/libboost_coroutine.so: undefined reference to `make_fcontext'
collect2: error: ld returned 1 exit status
make[2]: *** [src/test/librados/CMakeFiles/ceph_test_rados_api_asio.dir/build.make:120: bin/ceph_test_rados_api_asio] Error 1
make[2]: Leaving directory '/root/rpmbuild/BUILD/ceph-15.2.13/build'
make[1]: *** [CMakeFiles/Makefile2:18029: src/test/librados/CMakeFiles/ceph_test_rados_api_asio.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

关键的就是这一句/usr/bin/ld: /usr/lib64/libboost_coroutine.so: undefined reference to `jump_fcontext'

boost库的coroutine报错了,未定义的引用一般都是链接的时候没链接上,但这个boost库是本地的,不是ceph编译生成的。

查了查这两个符号应该属于boost-context库,所以我尝试链接的时候加上-lboost_context ,但很奇怪的是没有生效,编译还是报错了,(boost相关的库我都安装好了),现在我怀疑是那个链接选项添加的位置不对,但当时我选择跳过这个问题,在spec的cmake选项那里有这个选项

%ifarch aarch64 armv7hl mips mipsel ppc ppc64 ppc64le %{ix86} x86_64
    -DWITH_BOOST_CONTEXT=ON \
%else
    -DWITH_BOOST_CONTEXT=OFF \
%endif

这个库和协程功能有关,上面mips都支持,理论上mips64el应该也支持的,我之前在这里添加了mips64el,现在把他删了,这样就会执行-DWITH_BOOST_CONTEXT=OFF了,这样可能会缺失一些功能,但应该问题不大(

继续rpmbuild,这次进度到了90%才报错,可喜可贺,看看报了啥

[ 91%] Generating ../../../lib/cython_modules/lib.3/rbd.cpython-37m-mips64el-linux-gnuabi64.so
cd /root/rpmbuild/BUILD/ceph-15.2.13/src/pybind/rbd && env CC="/usr/bin/cc -O2 -g -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -mxgot -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -rdynamic -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fdiagnostics-color=auto -iquote/root/rpmbuild/BUILD/ceph-15.2.13/src/include -w -D'void0=dead_function(void)' -D'__Pyx_check_single_interpreter(ARG)=ARG ## 0'" CXX="/usr/bin/c++" LDSHARED="/usr/bin/cc -shared" OPT="-DNDEBUG -g -fwrapv -O2 -w" LDFLAGS=-L/root/rpmbuild/BUILD/ceph-15.2.13/build/lib CYTHON_BUILD_DIR=/root/rpmbuild/BUILD/ceph-15.2.13/build/src/pybind/rbd CEPH_LIBDIR=/root/rpmbuild/BUILD/ceph-15.2.13/build/lib /usr/bin/python3.7 /root/rpmbuild/BUILD/ceph-15.2.13/src/pybind/rbd/setup.py build --verbose --build-base /root/rpmbuild/BUILD/ceph-15.2.13/build/lib/cython_modules --build-platlib /root/rpmbuild/BUILD/ceph-15.2.13/build/lib/cython_modules/lib.3
/usr/bin/ld: /root/rpmbuild/BUILD/ceph-15.2.13/build/lib/librbd.so: undefined reference to `__atomic_store_16'
/usr/bin/ld: /root/rpmbuild/BUILD/ceph-15.2.13/build/lib/librbd.so: undefined reference to `__atomic_load_16'
/usr/bin/ld: /root/rpmbuild/BUILD/ceph-15.2.13/build/lib/librbd.so: undefined reference to `__atomic_compare_exchange_16'
collect2: error: ld returned 1 exit status

Link Error: RBD library not found
make[2]: *** [src/pybind/rbd/CMakeFiles/cython_rbd.dir/build.make:65: lib/cython_modules/lib.3/rbd.cpython-37m-mips64el-linux-gnuabi64.so] Error 1
make[2]: Leaving directory '/root/rpmbuild/BUILD/ceph-15.2.13/build'
make[1]: *** [CMakeFiles/Makefile2:4675: src/pybind/rbd/CMakeFiles/cython_rbd.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

可以看到也是未定义的引用问题,但这个librbd.so是ceph的一个模块的so库,所以是编译之后的链接阶段出错了,查了下那几个符号,应该是属于libatomic这个库,我发现没安装,我天真的以为把它安装了之后再编就能过了,但并不是,还是报错了,所以应该要把它手动链接上。

最开始我觉得在spec里改一下就行,查了查在cmake那里添加了这个宏

-DCMAKE_EXE_LINKER_FLAGS="-latomic"

但发现这样添加的-latomic在链接的时候,加入位置在so文件之前,但是只有在之后才能生效,所以依然报错了,据说使用clang会添加在末尾(羡慕了),不过这种宏网上也说不推荐使用,那想想别的办法吧。

能想到的是修改makefile文件,但是makefile文件是通过cmake生成的,在源码包里是没有的,后来折腾的难受,就尝试一次性修改法了,就是修改最终生成的build文件,通过上面的报错我们可以发现有一个build.make文件,他是make直接接触的build文件,所以修改它就行了

打开build.make发现有一大串这样的东西

build/src/librbd/CMakeFiles/librbd.dir/build.make:lib/librbd.so.1.12.0: /usr/lib64/libblkid.so
build/src/librbd/CMakeFiles/librbd.dir/build.make:lib/librbd.so.1.12.0: /usr/lib64/libcrypto.so
build/src/librbd/CMakeFiles/librbd.dir/build.make:lib/librbd.so.1.12.0: /usr/lib64/libudev.so
build/src/librbd/CMakeFiles/librbd.dir/build.make:lib/librbd.so.1.12.0: /usr/lib64/libibverbs.so
build/src/librbd/CMakeFiles/librbd.dir/build.make:lib/librbd.so.1.12.0: /usr/lib64/librdmacm.so
build/src/librbd/CMakeFiles/librbd.dir/build.make:lib/librbd.so.1.12.0: src/librbd/CMakeFiles/librbd.dir/link.txt

应该是这个模块要链接的so库吧,依葫芦画瓢添上一行,库改成/usr/lib64/libatomic.so就行,但这有个很坑的是,libatomic安装后是没有libatomic.so的,是libatomic.so.几我忘了,所以要么你直接把小版本号写清楚,要么在/usr/lib64/里创建个软链接连到那个so库上。

我发现上面那些链接库的末尾还调用了个link.txt,里面也有一些链接库,理论上libatomic.so加在那里也行,应该两个文件只要加一个就行,但我都加了,报错报怕了,幸好改了好使。对了,这两个文件应该是由makefile文件生成,所以你得在开始build之后,才能找到,所以是在build过程中,进入BUILD文件夹修改的。

继续编吧,这次都快100%了,报错了

[ 96%] Building CXX object src/tools/rbd/CMakeFiles/rbd.dir/action/Migration.cc.o
cd /root/rpmbuild/BUILD/ceph-15.2.13/build/src/tools/rbd && /usr/bin/c++  -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DFMT_SHARED -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D__CEPH__ -D__STDC_FORMAT_MACROS -D__linux__ -I/root/rpmbuild/BUILD/ceph-15.2.13/build/src/include -I/root/rpmbuild/BUILD/ceph-15.2.13/src -isystem /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include -isystem /root/rpmbuild/BUILD/ceph-15.2.13/build/include -isystem /root/rpmbuild/BUILD/ceph-15.2.13/src/xxHash -isystem /root/rpmbuild/BUILD/ceph-15.2.13/src/rapidjson/include -isystem /root/rpmbuild/BUILD/ceph-15.2.13/src/fmt/include  -O2 -g -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -mxgot -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -rdynamic -O2 -g -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -mxgot -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -O2 -g -DNDEBUG -fPIE   -std=c++17 -o CMakeFiles/rbd.dir/action/Migration.cc.o -c /root/rpmbuild/BUILD/ceph-15.2.13/src/tools/rbd/action/Migration.cc
In file included from /usr/include/c++/8/cmath:1892,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/config/no_tr1/cmath.hpp:21,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/numeric/conversion/converter_policies.hpp:16,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/numeric/conversion/converter.hpp:14,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/numeric/conversion/cast.hpp:33,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/lexical_cast/detail/converter_numeric.hpp:36,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/lexical_cast/try_lexical_convert.hpp:43,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/lexical_cast.hpp:32,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/program_options/value_semantic.hpp:14,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/program_options/options_description.hpp:13,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/build/boost/include/boost/program_options.hpp:15,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/src/tools/rbd/ArgumentTypes.h:12,
                 from /root/rpmbuild/BUILD/ceph-15.2.13/src/tools/rbd/action/Migration.cc:6:
/usr/include/c++/8/bits/specfun.h: In substitution of 'template _Tp std::__detail::__assoc_laguerre(unsigned int, unsigned int, _Tp) [with _Tp = long double]':
/usr/include/c++/8/bits/specfun.h:217:65:   required from here
/usr/include/c++/8/bits/specfun.h:217:65: internal compiler error: Illegal instruction
   { return __detail::__assoc_laguerre(__n, __m, __x); }
                                                                 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [src/tools/rbd/CMakeFiles/rbd.dir/build.make:456: src/tools/rbd/CMakeFiles/rbd.dir/action/Migration.cc.o] Error 1
make[2]: Leaving directory '/root/rpmbuild/BUILD/ceph-15.2.13/build'
make[1]: *** [CMakeFiles/Makefile2:7325: src/tools/rbd/CMakeFiles/rbd.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

看了半天没看懂,里面有一句The bug is not reproducible, so it is likely a hardware or OS problem.我懂了,不是我的锅。感觉应该是编ceph编太久了,电脑累坏了,重启了一下,重新编就没这个问题了,无语了,感觉自己有点bug体质。

编译结束之后,还进行了一些test检查,里面运行了些.py报错了,是因为python链接的是python2,重新软链接到python3就行。

总之到这就打包成功了,安装试一下能不能用,离谱的来了

错误:依赖检测失败:
	libfmt.so.5()(64bit) 被 ceph-base-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-common-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-fuse-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-immutable-object-cache-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-mds-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-mgr-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-mon-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-osd-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 ceph-radosgw-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 libcephfs2-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 librados2-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 libradosstriper1-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 librbd1-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 librgw2-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 rbd-fuse-2:15.2.13-2.ky10.ky10.mips64el 需要
	libfmt.so.5()(64bit) 被 rbd-mirror-2:15.2.13-2.ky10.ky10.mips64el 需要

这个fmt在编译的依赖里,是装过的,发现是kylin源里版本太低了,得自己移植个高版本的,幸好这个包很小,移植起来很轻松。

安装完ceph之后发现基础功能用不了,非常的无语,后来发现是因为编译的时候使用的是低版本的fmt,用高版本的再编一遍就行,所以是spec文件没写好,应该指定下fmt版本的,唉。总之的总之,总算是移植完了。

你可能感兴趣的:(linux,ceph)