Many lines like the following: /usr/include/GL/osmesa.h:322:1: error: ‘GLAPI’ does not name a type; did you mean ‘GLEWAPI’? 322 | GLAPI void GLAPIENTRY | ^~~~~ | GLEWAPI Reproducible: Always # emerge --info media-gfx/asymptote Portage 3.0.17 (python 3.8.8-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-10.2.0, glibc-2.32-r7, 5.10.27-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-5.10.27-gentoo-x86_64-AMD_Ryzen_9_3950X_16-Core_Processor-with-glibc2.2.5 KiB Mem: 65795288 total, 27314708 free KiB Swap: 33554428 total, 33549756 free Timestamp of repository gentoo: Tue, 13 Apr 2021 08:15:01 +0000 Head commit of repository gentoo: 4e0baecd65f9d725095d48add7977f23a3b26ff9 sh bash 5.0_p18 ld GNU ld (Gentoo 2.35.2 p1) 2.35.2 app-shells/bash: 5.0_p18::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.30.3::gentoo dev-lang/python: 2.7.18_p8::gentoo, 3.8.8_p1::gentoo, 3.9.2_p1::gentoo dev-lang/rust: 1.47.0-r2::gentoo dev-util/cmake: 3.18.5::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1-r1::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.16.2-r1::gentoo sys-devel/binutils: 2.35.2::gentoo sys-devel/gcc: 10.2.0-r5::gentoo sys-devel/gcc-config: 2.4::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.32-r7::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.namerica.gentoo.org/gentoo-portage/ priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: sync-rsync-verify-metamanifest: yes sync-rsync-verify-jobs: 1 local location: /usr/local/portage masters: gentoo ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE vmware" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--jobs=8 --load-average=32" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH 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="-march=native -O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=native -O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en en_US" MAKEOPTS="--jobs=32 --load-average=35" PKGDIR="/var/cache/binpkgs" 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="/var/tmp" USE="X a52 aac acl acpi activities alsa amd64 apache2 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord crypt cups curl dbus declarative doc dri dts dvd dvdr elogind emboss encode examples exif flac fontconfig fortran gcj gd gdbm gif gtk gtk-doc gui handbook iconv icu ipv6 jack java jbig jpeg kde kipi kpathsea kwallet lcms libglvnd libnotify libtirpc lzma mad mbox mng mp3 mp4 mpeg multilib ncurses nls nptl odbc ogg openexr opengl openmp pam pango pcre pdf phonon plasma png policykit postgres ppds qml qt5 readline screencast sdl seccomp semantic-desktop source spell split-usr ssl startup-notification svg t1lib tcpd threads tiff truetype udev udisks unicode upower usb vim-syntax vorbis webp widgets wxwidgets x264 xattr xcb xinerama xml xpm xv xvid zlib" ABI_X86="64 32" ADA_TARGET="gnat_2018" 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="actions alias auth_basic auth_digest authn_anon authn_core authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers http2 ident imagemap include info lbmethod_byrequests log_config log_forensic logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http proxy_http2 rewrite setenvif slotmem_shm socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput wacom joystick" KERNEL="linux" L10N="en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver wiki-publisher" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" SANE_BACKENDS="epson2" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi fbdev vesa vmware" XFCE_PLUGINS="clock trash" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS ================================================================= Package Settings ================================================================= media-gfx/asymptote-2.68::gentoo was built with the following: USE="X boehm-gc doc examples fftw imagemagick latex offscreen opengl sigsegv svg vim-syntax -emacs -gsl -python -test" ABI_X86="(64)" PYTHON_TARGETS="python3_8 -python3_7" FEATURES="parallel-fetch userfetch userpriv ipc-sandbox news sfperms parallel-install assume-digests collision-protect pid-sandbox network-sandbox merge-sync cgroup preserve-libs distlocks multilib-strict usersandbox config-protect-if-modified strict ebuild-locks unknown-features-warn unmerge-logs protect-owned usersync binpkg-dostrip binpkg-logs binpkg-docompress sandbox xattr unmerge-orphans fixlafiles qa-unresolved-soname-deps"
Created attachment 699687 [details] Build log
All asymptote versions currently in portage (2.68, 2.69-r1 and 2.70) fail with the same error messages on my system.
Works for me. Your log file mentions /usr/include/GL/osmesa.h I don't have such file. To what package does it belong? I see GLPAI is defined in /usr/include/GL/gl.h #ifndef GLAPI #define GLAPI extern #endif Do you have this gl.h file? It seems to belong to media-libs/libglvnd
Curious. Here's what I get for osmesa.h: # equery belongs /usr/include/GL/osmesa.h * Searching for /usr/include/GL/osmesa.h ... media-libs/mesa-20.3.5 (/usr/include/GL/osmesa.h) This file appears to be there because the 'osmesa' USE flag is defined for media-libs/mesa in package.use. However, if I remove it and try to rebuild, I get this: # emerge -uDNpv --with-bdeps=y --changed-deps=y @world These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] media-gfx/asymptote-2.68::gentoo USE="X boehm-gc doc examples fftw imagemagick latex offscreen opengl sigsegv svg vim-syntax -emacs -gsl -python -test" PYTHON_TARGETS="python3_8 -python3_7" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict: media-libs/mesa:0 (media-libs/mesa-20.3.5:0/0::gentoo, ebuild scheduled for merge) USE="X classic d3d9 dri3 egl gallium gbm gles2 llvm lm-sensors opencl vaapi vdpau vulkan vulkan-overlay wayland xa zstd -debug -gles1 -osmesa (-selinux) -test -unwind -valgrind -xvmc -zink" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="radeonsi (-freedreno) -i915 -i965 -intel -iris (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon (-v3d) (-vc4) -virgl (-vivante) -vmware" conflicts with media-libs/mesa[osmesa] required by (media-gfx/asymptote-2.68:0/0::gentoo, ebuild scheduled for merge) USE="X boehm-gc doc examples fftw imagemagick latex offscreen opengl sigsegv svg vim-syntax -emacs -gsl -python -test" ABI_X86="(64)" PYTHON_TARGETS="python3_8 -python3_7" ^^^^^^ Sure enough, looking at the ebuild, it seems 'osmesa' is required for media-libs/mesa if media-gfx/asymptote enables the 'offscreen' USE flag. If I remove those USE flags from mesa and asymptote and rebuild, asymptote than compiles fine. Doing some searching, I've come across this: https://github.com/nigels-com/glew/issues/255 and this: https://discourse.panda3d.org/t/compiling-panda3d-with-cuda-development-drivers-and-ubuntu/10543/6 which both point to an #undef GLAPI line in another GL include file (in my case it's in /usr/include/GL/glew.h, which belongs to media-libs/glew-2.2.0.) However, commenting that out and rebuilding with the offscreen and osmesa USE flags still results in the original compiler error message. Searching some more, I come across reports like these: https://stackoverflow.com/questions/30268061/mesa-linux-gl-h-does-not-contain-modern-opengl https://sourceforge.net/p/asymptote/bugs/157/ The gist of it seems to be that enabling the 'offscreen' USE flag in asymptote requires media-libs/mesa to install the osmesa.h header file, which appears to cause include file issues (possibly because someone is including them out-of-order.) If that is actually what's going on--and exactly who (and where) that culprit is--I haven't been able to determine by cursory examination of the header files.
So, we have to mask offscreen until the upstream fixes this mess commit 56107f27a8ea14c1c720fa52837f83614c56b45d (HEAD -> master, origin/master, origin/HEAD) Author: Andrey Grozin <grozin@gentoo.org> Date: Thu May 6 13:51:25 2021 +0700 profiles/default/linux/package.use.mask: mask media-gfx/asymptote offscreen Signed-off-by: Andrey Grozin <grozin@gentoo.org>
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df71c189b422e852a650c55972c86b97312c78b8 commit df71c189b422e852a650c55972c86b97312c78b8 Author: Andrey Grozin <grozin@gentoo.org> AuthorDate: 2022-01-03 05:06:45 +0000 Commit: Andrey Grozin <grozin@gentoo.org> CommitDate: 2022-01-03 05:06:45 +0000 profiles/default/linux: package.use.mask Mask offscreen only for <media-gfx/asymptote-2.74 Bug: https://bugs.gentoo.org/782688 Signed-off-by: Andrey Grozin <grozin@gentoo.org> profiles/default/linux/package.use.mask | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)