Project

General

Profile

Bug #23417

Building Ceph on armhf fails due to a bunch of errors

Added by Ralf Kätzler over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
build
Target version:
Start date:
03/19/2018
Due date:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

Hi all,

I'm fighting hard to get the actual git repo running through the build process on an Odroid HC2 (armhf) with a full SATA-Port.
I'm using the latest ubuntu (bionic) with gcc 7.3.

At this point I have to excuse me for maybe bad, ugly or even funny ideas I used to get the compilation over the found problems.
I do have absolute no idea of c++ programming and nearly every found workaround is due to pure luck and looking at the surrounding code.
Some of the problems I have asked on #ceph-devel irc and got a "You can try ... this" ... for that "THANK YOU all" for helping a one-eyed.
So ... this means ... I had done changes to the source-code of an application without knowledge of what I have done ... uhhh this sounds very bad, if I want to use this ceph for storing my data.
So I beg you to review the changes I have done and put them on the right road. Maybe this will help to make ceph easy to compile on a nice device for homeuse or testlabs.

Here comes the beginning of my odyssey ... last break in compilationn was at 41 %

First there where some substitution errors ... I didn't note the original error (this was because of my thinking, this will be easy going :) )

Error in BlueFS.cc:
Errortext:

no matching function for call to ‘min(long unsigned int&, unsigned int&)

Changes in code to get the compiler go on:

uint64_t l = std::min(p->length - x_off, len);
uint64_t l = std::min((long)p->length - (long)x_off, (long)len);

Error in in BlueStore.cc
Errortext:

no matching function for call to ‘min(long unsigned int&, unsigned int&)

Changes in code to get the compiler go on:

size_t pos = max(e.first / granularity, prev_pos);
size_t pos = max((long)e.first / (long)granularity, (long)prev_pos);

Error in OSDMonitor.cc
Errortext:

no matching function for call to ‘min(long unsigned int&, unsigned int&)

Changes in code to get the compiler go on:

int n = std::min(max - pending_creatings.pgs.size(),
                p->second.end - p->second.start);
int n = std::min((long)max - (long)pending_creatings.pgs.size(),
                (long)p->second.end - (long)p->second.start);

Error in rgw_op.h
Errortext:

static assertion failed: boost::variant does not contain specified type U, call to boost::get<U>(const boost::variant<T...>&) will always throw boost::bad_get exception

Changes in code to get the compiler go on:

const size_t max_attr_name_len = \
        cct->_conf->get_val<size_t>("rgw_max_attr_name_len");
const size_t max_attr_name_len = \
        cct->_conf->get_val<Option::size_t>("rgw_max_attr_name_len");

and
const auto rgw_max_attrs_num_in_req = \
        cct->_conf->get_val<size_t>("rgw_max_attrs_num_in_req");
const auto rgw_max_attrs_num_in_req = \
        cct->_conf->get_val<Option::size_t>("rgw_max_attrs_num_in_req");

Error in rgw_sync_log_trim.cc
Errortext:

/mnt/ceph-src/ceph/src/rgw/rgw_sync_log_trim.cc:354:60: error: conversion from 'boost::optional<long unsigned int>' to non-scalar type 'boost::optional<unsigned int>' requested
   boost::optional<size_t> num_shards = boost::make_optional(false, 0UL);

Changes in code to get the compiler go on:

boost::optional<size_t> num_shards = boost::make_optional(false, 0UL);
boost::optional<size_t> num_shards = boost::none;

and
if (!num_shards ) {
if (num_shards == boost::none) {

Error in rgw_rest_swift.cc:
Errortext:

/mnt/ceph-src/ceph/src/rgw/rgw_rest_swift.cc:720:68:   required from here
/mnt/ceph-src/ceph/build/boost/include/boost/variant/get.hpp:289:5: error: static assertion failed: boost::variant does not contain specified type U, call to boost::get<U>(const boost::variant<T...>&) will always throw boost::bad_get exception

Changes in code to get the compiler go on:

% s->cct->_conf->get_val<size_t>("rgw_max_attrs_num_in_req"));
% s->cct->_conf->get_val<Option::size_t>("rgw_max_attrs_num_in_req"));

and

g_conf->get_val<size_t>("rgw_max_attr_name_len");
g_conf->get_val<Option::size_t>("rgw_max_attr_name_len");

and

g_conf->get_val<size_t>("rgw_max_attrs_num_in_req");
g_conf->get_val<Option::size_t>("rgw_max_attrs_num_in_req");


after I reached this point I ran into the bug reported under https://tracker.ceph.com/issues/23387
Solution presented by Daniel worked -> disable option "-g" and it will go on

Next stop is in ImageCtx.cc
Errortext:

/mnt/ceph-src/ceph/src/librbd/ImageCtx.cc:914:35:   required from here
/mnt/ceph-src/ceph/src/common/ceph_context.h:153:5: error: static assertion failed: Please increase largest singleton.
     static_assert(sizeof(T) <= largest_singleton,

At the moment the little HC2 tries this suggested solution from IRC:
Changes in ceph_context.h:

  static constexpr std::size_t largest_singleton = sizeof(void*) * 72;
  static constexpr std::size_t largest_singleton = sizeof(void*) * 128;

... still running ... this is not the fastest device for compiling big projects :)
I will continue to report ...

History

#1 Updated by Ralf Kätzler over 1 year ago

Found one last stop:

Errortext:

/usr/include/c++/7/bits/stl_algo.h:3456:5: note:   template argument deduction/substitution failed:
/mnt/ceph-src/ceph/src/test/rbd_mirror/test_ImageSync.cc:44:48: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   max_size = std::min(image_ctx->size, max_size);

Changes in test_ImageSync.cc:

max_size = std::min(image_ctx->size, max_size);
max_size = std::min((long)image_ctx->size, (long)max_size);

Build has completed now ...
If it is functional? ... needs to be tested.
Need comments from Dev-Team to trust the build ...

#2 Updated by Ralf Kätzler over 1 year ago

After some tries I was able to build debian-packages with this changes on the odroid hc2 native.
Time to compile was in the end more than 8 hours - maybe even 12. Successful try was over night.
It was essential to disable -g in CFLAGS and CXXFLAGS ... if not the endecoder.cc eats all memory and compilation will break with "unsufficent memory" ... luckily the hc2 has a SATA-Port ... without a swap-partition maybe the compile process wouldn't be possible or would have last even longer with swapping on the sd-card. Thanks to Daniel and his bug-report.
Next thing to look at was: Compilation has to be done with -j1 ... use only ONE core. Hard to accept, cause the compile-time rises even more with this setting ... clear at all, but necessary.
If not done in this way it will happen that a part of code is not ready compiled but have to be used by another job already starting on another core. This will bring "internal compiler errors".
I was able to install the resulting debian-packages with ceph-deploy from a local repository. The ceph-cluster is running and first test-data is on it. So far everything seems to be okay ...
I still do not trust my hot iron changes ... can someone please have a look and review my fiddly codechanges?

Also available in: Atom PDF