openSUSE 12.3 compilation problems

Get help for specific problems
Posts: 17
Joined: 5 May 2003

mitsch81

To begin with I cannot find any 32 Bit precompiled version of FreeFileSync - which I desperately need. :-)

Therefore I thought it would be nice to have an rpm package to integrate with the openSUSE build service. There was already some work done (https://build.opensuse.org/package/live_build_log/home:hcooh/FreeFileSync/openSUSE_12.3/x86_64). But currently there are some compilation problems.

To debug this I tried to compile FreeFileSync_5.23_Source.zip on my openSUSE 12.3 64 Bit machine and I identified some sources of compilation errors in the code:

"1." In /Source/lib/dir_exist_async.h / line 33 I removed these lines
    -    std::list<std::pair<Zstring, boost::unique_future<bool>>> futureInfo;
    -    for (const Zstring& dirname : dirnames)
    -        if (!dirname.empty()) //skip empty dirs
    -            futureInfo.push_back(std::make_pair(dirname, async2<bool>([=]() -> bool
    -        {
    -#ifdef ZEN_WIN
    -            //1. login to network share, if necessary
    -            loginNetworkShare(dirname, allowUserInteraction);
    -#endif
    -            //2. check dir existence
    -            return dirExists(dirname);
    -        })));
to resolve this compiliation error message:
[   30s] In file included from /usr/include/c++/4.7/bits/stl_algobase.h:65:0,
[   30s]                  from /usr/include/c++/4.7/bits/char_traits.h:41,
[   30s]                  from /usr/include/c++/4.7/string:42,
[   30s]                  from ./zen/i18n.h:10,
[   30s]                  from <command-line>:0:
[   30s] /usr/include/c++/4.7/bits/stl_pair.h: In instantiation of 'struct std::pair<zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>, boost::unique_future<bool> >':
[   30s] /usr/include/c++/4.7/bits/stl_pair.h:268:5:   required from 'constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = const zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>&; _T2 = boost::unique_future<bool>; typename std::__decay_and_strip<_T2>::__type = boost::unique_future<bool>; typename std::__decay_and_strip<_Tp>::__type = zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>]'
[   30s] lib/dir_exist_async.h:44:11:   required from here
[   30s] /usr/include/c++/4.7/bits/stl_pair.h:119:17: error: 'constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>; _T2 = boost::unique_future<bool>; std::pair<_T1, _T2> = std::pair<zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>, boost::unique_future<bool> >]' declared to take const reference, but implicit declaration would take non-const
Do you have an idea what is causing this and how to resolve it without removing it? What functionality is affected by these lines?

"2." In /Source/ui/progress_indicator.cpp / line 1086
    -               _P("1 sec", "%x sec", numeric::round(timeElapsed)) :
    +               wxString(_P("1 sec", "%x sec", numeric::round(timeElapsed))) :
the string has to be put into a wxString ctor in order to remove compiler errors. Can this be integrated into the upstream code?

Same thing on line 1869:
-            const wxString overallBytesPerSecond = timeDelta == 0 ? wxString() : filesizeToShortString(dataCurrent * 1000 / timeDelta) + _("/sec");
-            const wxString overallItemsPerSecond = timeDelta == 0 ? wxString() : replaceCpy(_("%x items/sec"), L"%x", formatThreeDigitPrecision(itemsCurrent * 1000.0 / timeDelta));
+            const wxString overallBytesPerSecond = timeDelta == 0 ? wxString() : wxString(filesizeToShortString(dataCurrent * 1000 / timeDelta) + _("/sec"));
+            const wxString overallItemsPerSecond = timeDelta == 0 ? wxString() : wxString(replaceCpy(_("%x items/sec"), L"%x", formatThreeDigitPrecision(itemsCurrent * 1000.0 / timeDelta)));

Replacing the first two lines with the last two fixes the compilation errors.

Thanks for help.
Posts: 17
Joined: 5 May 2003

mitsch81

To begin with I cannot find any 32 Bit precompiled version of FreeFileSync - which I desperately need. :-)

Therefore I thought it would be nice to have an rpm package to integrate with the openSUSE build service. There was already some work done (https://build.opensuse.org/package/live_build_log/home:hcooh/FreeFileSync/openSUSE_12.3/x86_64). But currently there are some compilation problems.

To debug this I tried to compile FreeFileSync_5.23_Source.zip on my openSUSE 12.3 64 Bit machine and I identified some sources of compilation errors in the code:

"1." In /Source/lib/dir_exist_async.h / line 33 I removed these lines
    -    std::list<std::pair<Zstring, boost::unique_future<bool>>> futureInfo;
    -    for (const Zstring& dirname : dirnames)
    -        if (!dirname.empty()) //skip empty dirs
    -            futureInfo.push_back(std::make_pair(dirname, async2<bool>([=]() -> bool
    -        {
    -#ifdef ZEN_WIN
    -            //1. login to network share, if necessary
    -            loginNetworkShare(dirname, allowUserInteraction);
    -#endif
    -            //2. check dir existence
    -            return dirExists(dirname);
    -        })));
to resolve this compiliation error message:
[   30s] In file included from /usr/include/c++/4.7/bits/stl_algobase.h:65:0,
[   30s]                  from /usr/include/c++/4.7/bits/char_traits.h:41,
[   30s]                  from /usr/include/c++/4.7/string:42,
[   30s]                  from ./zen/i18n.h:10,
[   30s]                  from <command-line>:0:
[   30s] /usr/include/c++/4.7/bits/stl_pair.h: In instantiation of 'struct std::pair<zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>, boost::unique_future<bool> >':
[   30s] /usr/include/c++/4.7/bits/stl_pair.h:268:5:   required from 'constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = const zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>&; _T2 = boost::unique_future<bool>; typename std::__decay_and_strip<_T2>::__type = boost::unique_future<bool>; typename std::__decay_and_strip<_Tp>::__type = zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>]'
[   30s] lib/dir_exist_async.h:44:11:   required from here
[   30s] /usr/include/c++/4.7/bits/stl_pair.h:119:17: error: 'constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>; _T2 = boost::unique_future<bool>; std::pair<_T1, _T2> = std::pair<zen::Zbase<char, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked>, boost::unique_future<bool> >]' declared to take const reference, but implicit declaration would take non-const
Do you have an idea what is causing this and how to resolve it without removing it? What functionality is affected by these lines?

"2." In /Source/ui/progress_indicator.cpp / line 1086
    -               _P("1 sec", "%x sec", numeric::round(timeElapsed)) :
    +               wxString(_P("1 sec", "%x sec", numeric::round(timeElapsed))) :
the string has to be put into a wxString ctor in order to remove compiler errors. Can this be integrated into the upstream code?

Same thing on line 1869:
-            const wxString overallBytesPerSecond = timeDelta == 0 ? wxString() : filesizeToShortString(dataCurrent * 1000 / timeDelta) + _("/sec");
-            const wxString overallItemsPerSecond = timeDelta == 0 ? wxString() : replaceCpy(_("%x items/sec"), L"%x", formatThreeDigitPrecision(itemsCurrent * 1000.0 / timeDelta));
+            const wxString overallBytesPerSecond = timeDelta == 0 ? wxString() : wxString(filesizeToShortString(dataCurrent * 1000 / timeDelta) + _("/sec"));
+            const wxString overallItemsPerSecond = timeDelta == 0 ? wxString() : wxString(replaceCpy(_("%x items/sec"), L"%x", formatThreeDigitPrecision(itemsCurrent * 1000.0 / timeDelta)));

Replacing the first two lines with the last two fixes the compilation errors.

Thanks for help.mitsch81
Update: I found 32 Bit builds of an older version of FreeFileSync (v5.12) here: [404, Invalid URL: http://download.opensuse.org/repositories/home:/hcooh/openSUSE_12.3/i586/]

I forked this project to here: https://build.opensuse.org/package/show/home:codeminister/FreeFileSync and made the changes described above to have the latest FreeFileSync version compiled. The patches can be reviewed in the "Source Files" section. The builds succeed for all projects (openSUSE 12.3, 13.1 and Factory). But it is currently NOT recommended to use the created rpm packages because I cannot assess the consequences of patch p0003-QUICK-and-DIRTY-build-fix-Code.patch.

@zenju: Did you already had the time to have a look? Is there a reason why on the SF download page there are no 32 bit builds for linux?
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

The compilation issues can be resolved by updating to a newer compiler: GCC 4.8
Posts: 17
Joined: 5 May 2003

mitsch81

I installed gcc 4.8
$ g++-4.8 --version
g++-4.8 (GCC) 4.8.2

modified the Makefile
-COMPILER_BIN=g++ -pthread
+COMPILER_BIN=g++-4.8 -pthread

still the same errors (which can be resolved as described above). I also made sure to rename the original g++ (4.7) executable that it cannot be called by accident.
Posts: 17
Joined: 5 May 2003

mitsch81

Hi,

on the buildservice for openSUSE 13.1 FreeFileSync 5.23 compiles when this patch is applied:

(cherry picked from commit e79bdcae9811ea7aa9bc7961a81fdc33f0c071fe)
---
FreeFileSync/Source/ui/progress_indicator.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/FreeFileSync/Source/ui/progress_indicator.cpp b/FreeFileSync/Source/ui/progress_indicator.cpp
index 0bfd238..dd24637 100644
--- a/FreeFileSync/Source/ui/progress_indicator.cpp
+++ b/FreeFileSync/Source/ui/progress_indicator.cpp
@@ -1084,7 +1084,7 @@ struct LabelFormatterTimeElapsed : public LabelFormatter
{
if (!drawLabel_) return wxString();
return timeElapsed < 60 ?
- _P("1 sec", "%x sec", numeric::round(timeElapsed)) :
+ wxString(_P("1 sec", "%x sec", numeric::round(timeElapsed))) :
timeElapsed < 3600 ?
wxTimeSpan::Seconds(timeElapsed).Format( L"%M:%S") :
wxTimeSpan::Seconds(timeElapsed).Format(L"%H:%M:%S");
@@ -1869,8 +1869,8 @@ void SyncProgressDialogImpl<TopLevelDialog>::processHasFinished(SyncResult resul
//set overall speed (instead of current speed)
const int64_t timeDelta = timeElapsed.timeMs() - phaseStartMs; //we need to consider "time within current phase" not total "timeElapsed"!

- const wxString overallBytesPerSecond = timeDelta == 0 ? wxString() : filesizeToShortString(dataCurrent * 1000 / timeDelta) + _("/sec");
- const wxString overallItemsPerSecond = timeDelta == 0 ? wxString() : replaceCpy(_("%x items/sec"), L"%x", formatThreeDigitPrecision(itemsCurrent * 1000.0 / timeDelta));
+ const wxString overallBytesPerSecond = timeDelta == 0 ? wxString() : wxString(filesizeToShortString(dataCurrent * 1000 / timeDelta) + _("/sec"));
+ const wxString overallItemsPerSecond = timeDelta == 0 ? wxString() : wxString(replaceCpy(_("%x items/sec"), L"%x", formatThreeDigitPrecision(itemsCurrent * 1000.0 / timeDelta)));

pnl.m_panelGraphBytes->setAttributes(pnl.m_panelGraphBytes->getAttributes().setCornerText(overallBytesPerSecond, Graph2D::CORNER_TOP_LEFT));
pnl.m_panelGraphItems->setAttributes(pnl.m_panelGraphItems->getAttributes().setCornerText(overallItemsPerSecond, Graph2D::CORNER_TOP_LEFT));
--
Posts: 17
Joined: 5 May 2003

mitsch81

I will post One Click Install links for openSUSE 13.1 in another thread: viewtopic.php?t=2090