Summary: | app-office/gnucash-3.8b-r1 with dev-libs/boost-1.73.0 - import-export/csv-imp/assistant-csv-price-import.cpp:270:10: error: ‘replace’ is not a member of ‘std’ | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Dennis Schridde <dschridde+gentoobugs> |
Component: | Current packages | Assignee: | Aaron W. Swenson <titanofold> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | admnd, adpc, chris, creideiki+gentoo-bugzilla, dan, eXt, jstein, kpet |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 726804 | ||
Bug Blocks: | 719924 | ||
Attachments: |
build.log
Patch setting -std=gnu++17 to compile with gcc-10 |
Description
Dennis Schridde
2020-05-09 08:23:23 UTC
Happened here as well, after upgrading to gcc-10 (same version compiled fine with gcc-9). Created attachment 637010 [details, diff] Patch setting -std=gnu++17 to compile with gcc-10 It seems that gcc-10 is more restrictive with the C++ standards than gcc-9. gnucash uses -std=gnu++11 in CMakeLists.txt but the code uses constructs such as std::replace which were introduced in C++-17 (cf. https://en.cppreference.com/w/cpp/algorithm/replace). Bumping to current gnucash 3.10 had other issues (more tests needing to be disabled it seems) but I saw that -std=gnu++11 is also set in that version, so it probably will need this patch as well. Upcoming version 4.0 will use -std=gnu++17 though... (cf. https://www.gnucash.org/news.phtml) (In reply to Bernd Feige from comment #1) > Happened here as well, after upgrading gnucash to gcc-10 (same version compiled fine > with gcc-9). I am seeing the same issue when trying to re-compile gnucash-3.8b-r1 as a result of boost being upgraded from 1.72.0-r1 to 1.73.0. However, although gcc-10.1.0 is installed on my system it is neither my system default: # gcc-config -l [1] x86_64-pc-linux-gnu-8.4.0 [2] x86_64-pc-linux-gnu-9.3.0 * [3] x86_64-pc-linux-gnu-10.1.0 nor is it actually being used in the build: FAILED: gnucash/import-export/csv-imp/CMakeFiles/gncmod-csv-import.dir/assistant-csv-price-import.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++-9.3.0 -DG_LOG_DOMAIN=\"gnc.import.csv\" -DHAVE_CONFIG_H -DHAVE_GUILE22 -D_GNU_SOURCE -Dgncmod_csv_import_EXPORTS -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/borrowed/goffice -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-export -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/gnome-utils -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/libgnucash/app-utils -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/libgnucash/engine -Icommon -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/common -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/borrowed/libc -Ilibgnucash/core-utils -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/libgnucash/core-utils -I/usr/include/guile/2.2 -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/libgnucash/gnc-module -I/usr/include/libxml2 -I/tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/libgnucash/backend/xml -isystem /usr/include/gtk-3.0 -isystem /usr/include/at-spi2-atk/2.0 -isystem /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0 -isystem /usr/lib64/dbus-1.0/include -isystem /usr/include/gio-unix-2.0 -isystem /usr/include/cairo -isystem /usr/include/pango-1.0 -isystem /usr/include/fribidi -isystem /usr/include/atk-1.0 -isystem /usr/include/pixman-1 -isystem /usr/include/uuid -isystem /usr/include/freetype2 -isystem /usr/include/harfbuzz -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/libpng16 -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/lib64/libffi/include -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -DNDEBUG -Wno-error=deprecated-declarations -Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses -std=gnu++11 -march=core2 -mtune=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -mfpmath=sse -mstackrealign -fomit-frame-pointer -frecord-gcc-switches -fstack-clash-protection -fuse-ld=gold -O2 -pipe -Wno-expansion-to-defined -Wno-error=unused -z now -fuse-ld=bfd -fPIC -pthread -MD -MT gnucash/import-export/csv-imp/CMakeFiles/gncmod-csv-import.dir/assistant-csv-price-import.cpp.o -MF gnucash/import-export/csv-imp/CMakeFiles/gncmod-csv-import.dir/assistant-csv-price-import.cpp.o.d -o gnucash/import-export/csv-imp/CMakeFiles/gncmod-csv-import.dir/assistant-csv-price-import.cpp.o -c /tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp /tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp: In function ‘void csv_price_imp_preview_settings_text_inserted_cb(GtkEditable*, gchar*, gint, gint*, CsvImpPriceAssist*)’: /tmp_portage/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp:270:10: error: ‘replace’ is not a member of ‘std’ 270 | std::replace (mod_txt.begin(), mod_txt.end(), '[', '('); | ^~~~~~~ So, I'm wondering if the problem is actually gcc-10 specific. What gcc/boost combinations do others have? ================================================================= Package Settings ================================================================= dev-libs/boost-1.73.0::gentoo was built with the following: USE="bzip2 icu lzma nls python threads zlib zstd -context -debug -doc -mpi -numpy -static-libs -tools" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7 python3_6 python3_7 -python3_8" CXXFLAGS="-pipe -O2 -march=znver1 -std=c++14" (In reply to Adrian Bassett from comment #3) > So, I'm wondering if the problem is actually gcc-10 specific. What > gcc/boost combinations do others have? Here, gcc-10 and boost-1.73 occurred practically simultaneously. So it's possible that it is a boost problem. This would mean that boost previously provided std::replace but doesn't do this any longer, requiring those functions to be in the standard C++ library (i.e., C++-17 compiler support). The patch fixes the problem here. Did anybody try it? (In reply to Bernd Feige from comment #5) > (In reply to Adrian Bassett from comment #3) > > So, I'm wondering if the problem is actually gcc-10 specific. What > > gcc/boost combinations do others have? > > Here, gcc-10 and boost-1.73 occurred practically simultaneously. > So it's possible that it is a boost problem. This would mean that boost > previously provided std::replace but doesn't do this any longer, requiring > those functions to be in the standard C++ library (i.e., C++-17 compiler > support). The patch fixes the problem here. Did anybody try it? I have now. I edited the CMakeLists.txt in my previously failing build tree as per the patch and then successfully completed the compile ('ebuild gnucash-3.8b-r1.ebuild package') which installed (emerge -K) and runs OK. This was using gcc-9.3 and boost-1.73 as previously described. I hit similar errors after upgrading to boost-1.73.0: /var/tmp/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-expo rt/csv-imp/gnc-imp-settings-csv-tx.cpp: In function ‘const preset_vec_trans& get _import_presets_trans()’: /var/tmp/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-expo rt/csv-imp/gnc-imp-settings-csv-tx.cpp:127:10: error: ‘sort’ is not a member of ‘std’ 127 | std::sort(preset_names.begin(), preset_names.end()); | ^~~~ /var/tmp/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-expo rt/csv-imp/gnc-imp-settings-csv-tx.cpp: In member function ‘bool CsvTransImpSett ings::load()’: /var/tmp/portage/app-office/gnucash-3.8b-r1/work/gnucash-3.8/gnucash/import-expo rt/csv-imp/gnc-imp-settings-csv-tx.cpp:182:34: error: ‘find_if’ is not a member of ‘std’; did you mean ‘find’? 182 | auto col_types_it = std::find_if (gnc_csv_col_type_strs.begin(), | ^~~~~~~ | find Applying the patch provided by Bernd Feige allowed the build to succeed. Like Adrian Bassett I have gcc-10.1.0 installed on my system, but am still using gcc-9.3.0. - I have exactly the same problem after update to boost-1.73 (but with gcc-8.3.0 - Bernd's patch fixes the problem (maybe emerge --info should show the boost library too) emerge --info Portage 2.3.99 (python 3.7.7-final-0, default/linux/amd64/17.1/no-multilib, gcc-8.3.0, glibc-2.31-r3, 5.6.13-gentoo x86_64) ================================================================= System uname: Linux-5.6.13-gentoo-x86_64-Intel-R-_Core-TM-_i7-4712MQ_CPU_@_2.30GHz-with-gentoo-2.7 KiB Mem: 24453664 total, 14954540 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Thu, 14 May 2020 13:45:01 +0000 Head commit of repository gentoo: 6f06043f20e600f906005790631fc6fc85a95b68 sh bash 5.0_p17 ld GNU ld (Gentoo 2.34 p1) 2.34.0 distcc 3.3.3 x86_64-pc-linux-gnu [disabled] ccache version 3.7.9 [enabled] app-shells/bash: 5.0_p17::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.30.2::gentoo dev-lang/python: 2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::mv dev-util/ccache: 3.7.9::gentoo dev-util/cmake: 3.17.2::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1::gentoo sys-apps/sandbox: 2.18::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.2::gentoo sys-devel/binutils: 2.34::gentoo sys-devel/gcc: 8.3.0-r3::gentoo sys-devel/gcc-config: 2.2.1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.6::gentoo (virtual/os-headers) sys-libs/glibc: 2.31-r3::gentoo I can confirm the issue: gcc 9.3.0 and boost 1.73.0 used here. So the core of the problem is not gcc 10.1.0 note: At least on my system, the patch fixes the boost issue with gcc-9.3 but it still does not build with gcc-10.1 so I think there is still a gcc-10.1 issue. Can anyone confirm. (In reply to Harris Landgarten from comment #10) > note: At least on my system, the patch fixes the boost issue with gcc-9.3 > but it still does not build with gcc-10.1 so I think there is still a > gcc-10.1 issue. Can anyone confirm. Well, with the patch from https://bugs.gentoo.org/721804#c2 applied, gnucash-3.8b-r1 built fine for me with gcc-10.1.0. No other changes were needed as against compiling with gcc-9.3.0. Confirmed, patch works also here, gcc-10.1.0 This is an issue with Boost 1.73.0 from what I saw on gnucash https://bugs.gnucash.org/show_bug.cgi?id=797748 https://bugs.gnucash.org/show_bug.cgi?id=797771 The patch here: https://github.com/Gnucash/gnucash/commit/4e9990ddb5a457707f7927c4369d1cbe802ff884 Seems to fix ever file except for: gnc-imp-settings-csv-price.cpp Which still needs #include <algorithm> The patch worked for me as well. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd49805f4672f456ac5812b17e7f3590f9e4b714 commit dd49805f4672f456ac5812b17e7f3590f9e4b714 Author: Aaron W. Swenson <titanofold@gentoo.org> AuthorDate: 2020-07-21 12:08:38 +0000 Commit: Aaron W. Swenson <titanofold@gentoo.org> CommitDate: 2020-07-21 12:08:41 +0000 app-office/gnucash: Bump to 4.0 Thanks to Jan Seeger for helping get this revision done. Bug: https://bugs.gentoo.org/721804 Bug: https://bugs.gentoo.org/726804 Package-Manager: Portage-2.3.99, Repoman-2.3.23 Signed-off-by: Aaron W. Swenson <titanofold@gentoo.org> app-office/gnucash/Manifest | 1 + app-office/gnucash/gnucash-4.0.ebuild | 235 ++++++++++++++++++++++++++++++++++ 2 files changed, 236 insertions(+) |