This is maybe a an issue with too strict gcc-7.3.0 ? x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/g dk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DVIKING_DATADIR=\""/usr/s hare/viking"\" -DVIKING_SYSCONFDIR=\""/etc/viking"\" -Wall -g -D_GNU_SOURCE -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr /include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/in clude -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -c -o vikgpslayer.o vikgpslayer.c vikgpslayer.c:1695:3: error: expected identifier or '(' before 'return' return FALSE; /* no further calling */ ^~~~~~ vikgpslayer.c:1696:1: error: expected identifier or '(' before '}' token } ^ vikgpslayer.c:1739:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token vgl->vgpsd->vgl = vgl; ^~ vikgpslayer.c:1741:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token vgl->realtime_fix.dirty = vgl->last_fix.dirty = FALSE; ^~ vikgpslayer.c:1743:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token vgl->realtime_fix.fix.altitude = vgl->last_fix.fix.altitude = VIK_DEFAULT_ALTITUDE; ^~ vikgpslayer.c:1744:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token vgl->realtime_fix.fix.speed = vgl->last_fix.fix.speed = NAN; ^~ vikgpslayer.c:1746:3: error: expected identifier or '(' before 'if' if (vgl->realtime_record) { ^~ vikgpslayer.c:1757:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token vgl->realtime_io_channel = g_io_channel_unix_new(vgl->vgpsd->gpsd.gps_fd); ^~ vikgpslayer.c:1758:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token vgl->realtime_io_watch_id = g_io_add_watch( vgl->realtime_io_channel, ^~ vikgpslayer.c:1768:3: error: expected identifier or '(' before 'return' return FALSE; /* no longer called by timeout */ ^~~~~~ vikgpslayer.c:1769:1: error: expected identifier or '(' before '}' token } ^ vikgpslayer.c:1698:15: warning: 'make_track_name' defined but not used [-Wunused-function] static gchar *make_track_name(VikTrwLayer *vtl) ^~~~~~~~~~~~~~~ vikgpslayer.c:1674:17: warning: 'gpsd_data_available' defined but not used [-Wunused-function] static gboolean gpsd_data_available(GIOChannel *source, GIOCondition condition, gpointer data) ^~~~~~~~~~~~~~~~~~~ vikgpslayer.c:1605:13: warning: 'gpsd_raw_hook' defined but not used [-Wunused-function] static void gpsd_raw_hook(VglGpsd *vgpsd, gchar *data) ^~~~~~~~~~~~~ make[3]: *** [Makefile:964: vikgpslayer.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory '/scratch/var/tmp/portage/sci-geosciences/viking-1.6.2-r1/work/viking-1.6.2/src' make[2]: *** [Makefile:1018: all-recursive] Error 1 make[2]: Leaving directory '/scratch/var/tmp/portage/sci-geosciences/viking-1.6.2-r1/work/viking-1.6.2/src' make[1]: *** [Makefile:704: all] Error 2 make[1]: Leaving directory '/scratch/var/tmp/portage/sci-geosciences/viking-1.6.2-r1/work/viking-1.6.2/src' make: *** [Makefile:454: all-recursive] Error 1 * ERROR: sci-geosciences/viking-1.6.2-r1::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sci-geosciences/viking-1.6.2-r1::gentoo'`, * the complete build log and the output of `emerge -pqv '=sci-geosciences/viking-1.6.2-r1::gentoo'`. * The complete build log is located at '/scratch/var/tmp/portage/sci-geosciences/viking-1.6.2-r1/temp/build.log'. * The ebuild environment file is located at '/scratch/var/tmp/portage/sci-geosciences/viking-1.6.2-r1/temp/environment'. * Working directory: '/scratch/var/tmp/portage/sci-geosciences/viking-1.6.2-r1/work/viking-1.6.2' * S: '/scratch/var/tmp/portage/sci-geosciences/viking-1.6.2-r1/work/viking-1.6.2' # emerge --info '=sci-geosciences/viking-1.6.2-r1::gentoo' Portage 2.3.40 (python 2.7.14-final-0, default/linux/amd64/17.0, gcc-7.3.0, glibc-2.27-r4, 4.16.10-default-pciehp x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.16.10-default-pciehp-x86_64-Intel-R-_Core-TM-_i7-2640M_CPU_@_2.80GHz-with-gentoo-2.6 KiB Mem: 16366200 total, 6956812 free KiB Swap: 26853460 total, 26698836 free Timestamp of repository gentoo: Fri, 15 Jun 2018 11:30:01 +0000 Head commit of repository gentoo: bde6e5a74325da403dfc1043816704922d60b36d sh bash 4.4_p23 ld GNU ld (Gentoo 2.30 p3) 2.30.0 app-shells/bash: 4.4_p23::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.26.9999::gentoo dev-lang/python: 2.7.14-r2::gentoo, 3.4.6-r1::gentoo, 3.5.5-r1::gentoo, 3.6.5-r1::gentoo dev-util/cmake: 3.11.3::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.6::gentoo sys-apps/openrc: 0.36::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15.1-r1::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.30-r3::gentoo sys-devel/gcc: 4.3.6-r1::gentoo, 4.4.7::gentoo, 4.6.4::gentoo, 4.7.4::gentoo, 4.9.4::gentoo, 5.4.0-r3::gentoo, 6.3.0::gentoo, 7.3.0-r3::gentoo sys-devel/gcc-config: 1.9.1::gentoo sys-devel/libtool: 2.4.6-r5::gentoo sys-devel/make: 4.2.1-r3::gentoo sys-kernel/linux-headers: 4.16-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.27-r4::gentoo Repositories: gentoo location: /scratch/usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: sync-rsync-verify-max-age: 24 science location: /scratch/mmokrejs/proj/sci masters: gentoo priority: 0 layman location: /var/lib/layman masters: gentoo priority: 1 x-portage location: /usr/local/portage masters: gentoo priority: 2 haskell location: /var/lib/layman/haskell masters: gentoo priority: 50 vmware location: /var/lib/layman/vmware masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x OPERA-2014 RAR Intel-SDP" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.2/conf /usr/share/maven-bin-3.3/conf /var/bind /var/lib/hsqldb /var/spool/torque" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.1/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize" DISTDIR="/scratch/usr/portage/distfiles" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en_US en_GB en cs" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/scratch/var/tmp" USE="R X acpi alsa amd64 amr apache apache2 asm avx berkdb bluetooth boost bzip2 cairo cgi cli coin consolekit cracklib crypt cryptlib cryptsetup cups cxx dbus device-mapper dhcp directfb dri drm dvd emboss encode fax fbcon ffmpeg flac fontconfig fortran fuse gbm gcrypt gd gdbm geoip geolocation gimp glpk gmp gnutls gpm gps gtk hal hpijs hwdb iconv id3tag imaging innodb inotify java javafx javascript jce jpeg jpg js jscript keymap ladspa lame lapack laptop lcms libnotify libtirpc lm_sensors mad matroska mmx modemmanager modules mp3 multicore multilib multimedia mysql ncurses networkmanager nfs nls nptl nptlonly nscd ntfs ntfsdecrypt ntfsprogs objc ocr ogg opengl openmp pam parport pcre pcre16 pdf pdfimport pdl perl php pkcs11 plplot png policykit polkit postproc postscript ppds ppp pppd pptx python qt3support qt4 qt5 readline rendering resolvconf samba scanner sctp seccomp server session sha512 slideshow sna sndfile sparsehash sqlite sse sse2 sse3 sse4_1 sse4_2 ssh ssh-agent ssl sslv2 sslv3 ssse3 startup-notification suexec svg syslog tcl tcpd threads tiff tk truetype twolame udev unicode upower usb v4l v4l2 vim-syntax vnc wavpack wifi x11 xattr xcb xml xorg xrandr xv xvid xvmc zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias authz_host auth_basic auth_digest cgi cgid deflate dir env filter include info mem_cache mime mime_magic negotiation remoteip setenvif status userdir vhost_alias rewrite usertrack cache file_cache disk_cache charset_lite log_config log_forensic" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="aivdm ashtech earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 navcom ntrip oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tnt tripmate tsip ublox fury geostar nmea0183 nmea2000 passthrough" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="en-US en en-GB cs" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5 python3_6" RUBY_TARGETS="ruby20 ruby21 ruby23 ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="vesa vmware fbdev intel i915" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 536976 [details] build.log
I brought it upstream at https://sourceforge.net/p/viking/bugs/151/
It compiles fine for me with gcc 7.3.0. Have you tried with default CFLAGS? Which USE flags do you have enabled for viking?
# emerge -pv viking These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] sci-geosciences/viking-1.6.2-r1::gentoo USE="doc exif gps libexif magic mapnik nls sqlite" 0 KiB ... # CFLAGS="" CXXFLAGS="" emerge viking fives me same error. I tried also gcc-6.3.0, 5.4.0, even 4.9.4 with same error. I also tried -fpermissive in CFLAGS but it works only for g++.
I can't reproduce this issue with these USE flags either. The code in question is related to gpsd, so perhaps there is something specific about that?
I assume vikgpslayer.c is something about gps, indeed. Would you mind checking the lines of the code by eye? Maybe that is easiser. Thank you.
The comment in the middle of line 1725 seems weird: 1714 static gboolean rt_gpsd_try_connect(gpointer *data) 1715 { 1716 VikGpsLayer *vgl = (VikGpsLayer *)data; 1717 #if GPSD_API_MAJOR_VERSION == 3 1718 struct gps_data_t *gpsd = gps_open(vgl->gpsd_host, vgl->gpsd_port); 1719 1720 if (gpsd == NULL) { 1721 #elif GPSD_API_MAJOR_VERSION == 4 1722 vgl->vgpsd = g_malloc(sizeof(VglGpsd)); 1723 1724 if (gps_open_r(vgl->gpsd_host, vgl->gpsd_port, /*(struct gps_data_t *)*/vgl->vgpsd) != 0) { 1725 #elif GPSD_API_MAJOR_VERSION == 5 || GPSD_API_MAJOR_VERSION == 6 1726 vgl->vgpsd = g_malloc(sizeof(VglGpsd)); 1727 if (gps_open(vgl->gpsd_host, vgl->gpsd_port, &vgl->vgpsd->gpsd) != 0) { 1728 #else 1729 // Delibrately break compilation... 1730 #endif 1731 g_warning("Failed to connect to gpsd at %s (port %s). Will retry in %d seconds", 1732 vgl->gpsd_host, vgl->gpsd_port, vgl->gpsd_retry_interval); 1733 return TRUE; /* keep timer running */ 1734 }
https://www.archlinux.org/packages/community/x86_64/viking/ https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/viking&id=1d598f93a32402d6c6e2a758004ed02f17ab76d8 Ubuntu has some patches too: https://launchpad.net/ubuntu/+source/viking/1.6.2-3 http://launchpadlibrarian.net/294074830/viking_1.6.2-2_1.6.2-3.diff.gz I cannot easily see changes between viking_1.6.2.orig.tar.gz and viking_1.6.2-3.debian.tar.xz . :(
Created attachment 538740 [details] viking-9999.ebuild The autogen.sh call is ugly, but it is a good step ahead to have more recent version from https://sourceforge.net/p/viking/code/ci/master/tree/ Unfortunately, I am getting same compile error.
Created attachment 538742 [details] build.log (git master)
Which version of gpsd do you have installed? And what is the GPSD_API_MAJOR_VERSION in /usr/include/gps.h ?
$ grep GPSD_API_MAJOR_VERSION /usr/include/gps.h #define GPSD_API_MAJOR_VERSION 7 /* bump on incompatible changes */ $ # emerge -pv gpsd These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R *] sci-geosciences/gpsd-9999:0/23::gentoo USE="X bluetooth dbus ncurses python qt5 shm sockets udev usb -debug -ipv6 -latency_timing -ntp -static {-test}" GPSD_PROTOCOLS="aivdm ashtech earthmate evermore fury fv18 garmin garmintxt geostar gpsclock isync itrax mtk3301 navcom nmea0183 nmea2000 ntrip oceanserver oncore passthrough rtcm104v2 rtcm104v3 sirf skytraq superstar2 tnt tripmate tsip ublox" PYTHON_TARGETS="python2_7" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB My ubx8-based gps does not work with the last release, I need some patches which landed since Jan2018 or so.
(In reply to Martin Mokrejš from comment #12) > $ grep GPSD_API_MAJOR_VERSION /usr/include/gps.h > #define GPSD_API_MAJOR_VERSION 7 /* bump on incompatible changes */ Right, so your GPSD is too new and does not compile with viking on purpose. Please file a bug with viking upstream to get this sorted.
Thank your for your analysis, I updated the https://sourceforge.net/p/viking/bugs/151/ report.
Upstream has a patch for this as of now, see the above URL.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8fcac400708dbe252ac8c710ca702dde49ba290 commit c8fcac400708dbe252ac8c710ca702dde49ba290 Author: Hans de Graaff <graaff@gentoo.org> AuthorDate: 2019-01-22 16:27:18 +0000 Commit: Hans de Graaff <graaff@gentoo.org> CommitDate: 2019-01-22 16:27:42 +0000 sci-geosciences/viking: add 1.7 Fixes: https://bugs.gentoo.org/658886 Signed-off-by: Hans de Graaff <graaff@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 sci-geosciences/viking/Manifest | 1 + sci-geosciences/viking/metadata.xml | 3 ++ sci-geosciences/viking/viking-1.7.ebuild | 87 ++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+)