Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 552796

Summary: sci-libs/vtk-6.1.0-r1 can't find libmawt.so
Product: Gentoo Linux Reporter: Peter Bleszynski <bleszynski>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: RESOLVED FIXED    
Severity: normal CC: elliot, java, rich, rose, rossi.f, sci, tb
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info =vtk-6.1.0
Updated ebuild vtk-6.1.0-r2.ebuild

Description Peter Bleszynski 2015-06-21 22:56:48 UTC
Created attachment 405518 [details]
emerge --info =vtk-6.1.0

emerge sci-libs/vtk-6.1.0-r1 fails to find libmawt.so under dev-java/oracle-jdk-bin-1.8.0.45.  

GENTOO_VM=oracle-jdk-bin-1.8  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER=""

Output of emerge --info =vtk-6.1.0 is attached.



-- Found Java: /etc/java-config-2/current-system-vm/bin/java (found version "1.8.0.45") 
-- Found JNI: /etc/java-config-2/current-system-vm/jre/lib/amd64/libjawt.so;/etc/java-config-2/current-system-vm/jre/lib/amd64/xawt/libmawt.so  
..
ninja -j4 -v
ninja: error: '/etc/java-config-2/current-system-vm/jre/lib/amd64/xawt/vtk', needed by 'lib/libvtkRenderingCoreJava.so', missing and no known rule to make it
Comment 1 justin.brody 2015-07-09 14:03:31 UTC
Definitely not an ideal solution, but it looks like you can work around this by changing the system-vm to icedtea.
Comment 2 Peter Bleszynski 2015-09-13 05:36:24 UTC
Setting the system java-vm to icedtea-bin-7 with eselect solves the problem and allows vtk to build.
# eselect java-vm set system icedtea-bin-7

By the way, you have to set icedtea as the system vm not just the build vm. This may be a separate bug or a misunderstanding of the build vm concept.

I found that just setting *=icedtea-bin-7 in /etc/java-config-2/build/jdk.conf causes emerge vtk to fail with the same errors. The only difference in emerge messages was GENTOO_VM=icedtea-bin-7 while JAVA_HOME remained unchanged and still pointed to an Oracle JDK, which was the system vm at that time. 

The "Preferred Build VM" method is described in the wiki at https://wiki.gentoo.org/wiki/Java#Preferred_Build_VM.
Comment 3 James Le Cuirot gentoo-dev 2015-09-13 08:57:22 UTC
I don't know why it's looking for mawt. There aren't any references to it in VTK at all.

(In reply to Peter Bleszynski from comment #2)
> I found that just setting *=icedtea-bin-7 in
> /etc/java-config-2/build/jdk.conf causes emerge vtk to fail with the same
> errors. The only difference in emerge messages was GENTOO_VM=icedtea-bin-7
> while JAVA_HOME remained unchanged and still pointed to an Oracle JDK, which
> was the system vm at that time. 

This code is older than the hills and given that no one usually touches that stuff, I wouldn't be surprised if it doesn't actually work. We may end up killing it off eventually because if just complicates the eclasses. There is a much greater tendency to use the latest Java version these days because of security issues and we're trying to reduce the number of Java versions we have in the tree at any one time down to 2. We would even try for 1 if it were feasible but sometimes upstream lags behind.
Comment 4 Bernd Feige 2016-03-30 09:18:54 UTC
It still fails with USE=java and current oracle-jdk-bin (1.8.0.77) for the new sci-libs/vtk-6.1.0-r2 .

(In reply to James Le Cuirot from comment #3)
> I don't know why it's looking for mawt. There aren't any references to it in
> VTK at all.

It's actually the ebuild:
mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so;${JAVA_HOME}/jre/lib/${ARCH}/xawt/libmawt.so" )

I don't know why this is in the ebuild - FindJNI.cmake takes care of setting JAVA_AWT_LIBRARY correctly. Everything works if the whole "if use java; then" block, of which this is the last statement not yet commented out, is removed.
Comment 5 Bernd Feige 2016-03-30 09:20:32 UTC
Created attachment 429282 [details]
Updated ebuild vtk-6.1.0-r2.ebuild
Comment 6 Bob Johnson 2016-09-26 18:37:15 UTC
Also fails with icedtea-8:

-- Build files have been written to: /var/tmp/portage/sci-libs/vtk-6.1.0-r1/work/vtk-6.1.0_build
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sci-libs/vtk-6.1.0-r1/work/VTK-6.1.0 ...
>>> Working in BUILD_DIR: "/var/tmp/portage/sci-libs/vtk-6.1.0-r1/work/vtk-6.1.0_build"
ninja -j5 -v
ninja: error: '/etc/java-config-2/current-system-vm/jre/lib/amd64/xawt/libmawt.so', needed by 'lib/libvtkRenderingCoreJava.so', missing and no known rule to make it
 * ERROR: sci-libs/vtk-6.1.0-r1::gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  115:  Called src_compile
 *   environment, line 5912:  Called cmake-utils_src_compile
 *   environment, line 1200:  Called _cmake_execute_optionally 'src_compile'
 *   environment, line  557:  Called enable_cmake-utils_src_compile
 *   environment, line 1573:  Called cmake-utils_src_make
 *   environment, line 1215:  Called _cmake_ninja_src_make
 *   environment, line  613:  Called die
 * The specific snippet of code:
 *       "$@" || die
 * 
 * If you need support, post the output of `emerge --info '=sci-libs/vtk-6.1.0-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sci-libs/vtk-6.1.0-r1::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=icedtea-bin-8  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER=""
and of course, the output of emerge --info =vtk-6.1.0
# emerge --info =vtk-6.1.0
Portage 2.3.0 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-4.9.3, glibc-2.22-r4, 4.4.6-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.4.6-gentoo-x86_64-Intel-R-_Core-TM-_i5-3570_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    32936524 total,  17392216 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Mon, 26 Sep 2016 14:15:02 +0000
sh bash 4.3_p46-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p46-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21.7::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.namerica.gentoo.org/gentoo-portage
    priority: -1000

printer-drivers
    location: /var/lib/layman/printer-drivers
    masters: gentoo
    priority: 0

vmware
    location: /var/lib/layman/vmware
    masters: gentoo
    priority: 1

local
    location: /usr/local/portage
    masters: gentoo
    priority: 2

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA 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-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/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="/usr/portage/distfiles"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned 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"
MAKEOPTS="-j5"
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="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 apache2 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord consolekit cracklib crypt cups curl cxx dbus declarative doc dri dts dvd dvdr emboss encode examples exif fam firefox flac fontconfig fortran gcj gd gdbm gif glamor gtk handbook iconv icu ipv6 jack java jbig jpeg jpeg2k kde kipi kpathsea lcms ldap libnotify lzma mad mbox mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl odbc ogg openexr opengl openmp pam pango pcre pdf phonon plasma png policykit postgres ppds qml qt3support qt4 qt5 readline sdl seccomp semantic-desktop session source spell sse sse2 ssl startup-notification svg t1lib tcpd threads tiff truetype udev udisks unicode upower usb vim-syntax vorbis webp widgets wxwidgets x264 xattr xcb xcomposite xinerama xml xpm xscreensaver xv xvid 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="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 rewrite setenvif slotmem_shm socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="canon" 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="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse evdev vmmouse wacom joystick" KERNEL="linux" L10N="en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver presenter-minimizer wiki-publisher" LINGUAS="en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" SANE_BACKENDS="epson2" USERLAND="GNU" VIDEO_CARDS="fbdev intel radeon vesa vmware" XFCE_PLUGINS="clock trash" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


If I re-install icedtea-8 with the 'multilib' use flag and change the system java-vm to icedtea-bin-8-x86, the libmawt.so error goes away and in it's place:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2
  JAVA_AWT_INCLUDE_PATH)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindJNI.cmake:301 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  Wrapping/Java/CMakeLists.txt:2 (find_package)


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
JAVA_INCLUDE_PATH (ADVANCED)
   used as include directory in directory /var/tmp/portage/sci-libs/vtk-6.1.0-r1/work/VTK-6.1.0/Common/Core
   used as include directory in directory /var/tmp/portage/sci-libs/vtk-6.1.0-r1
...
...
   used as include directory in directory /var/tmp/portage/sci-libs/vtk-6.1.0-r1/work/VTK-6.1.0/Views/Geovis

-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/sci-libs/vtk-6.1.0-r1/work/vtk-6.1.0_build/CMakeFiles/CMakeOutput.log".
See also "/var/tmp/portage/sci-libs/vtk-6.1.0-r1/work/vtk-6.1.0_build/CMakeFiles/CMakeError.log".
 * ERROR: sci-libs/vtk-6.1.0-r1::gentoo failed (configure phase):
 *   cmake failed
 * 
 * Call stack:
 *     ebuild.sh, line  115:  Called src_configure
 *   environment, line 5947:  Called cmake-utils_src_configure
 *   environment, line 1201:  Called _cmake_execute_optionally 'src_configure'
 *   environment, line  554:  Called enable_cmake-utils_src_configure
 *   environment, line 1706:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";
 * 
 * If you need support, post the output of `emerge --info '=sci-libs/vtk-6.1.0-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sci-libs/vtk-6.1.0-r1::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=icedtea-bin-8-x86  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER=""
and of course, the output of emerge --info =vtk-6.1.0

The same errors occur for -r2 and -r3.
Comment 7 James Le Cuirot gentoo-dev 2016-09-26 19:45:34 UTC
(In reply to Bob Johnson from comment #6)
> If I re-install icedtea-8 with the 'multilib' use flag and change the system
> java-vm to icedtea-bin-8-x86, the libmawt.so error goes away and in it's
> place:

The multilib variants are not supposed to be used for building.
Comment 8 Richard Ostrow 2016-10-29 15:45:15 UTC
The patch from comment 5 gets it to compile for me under icedtea-bin:8. I haven't yet bothered to run a diff between it and what's in the tree under 6.1.0-r2...
Comment 9 James Le Cuirot gentoo-dev 2016-12-04 00:25:08 UTC
Sorry for my inaction here, I never looked at this long enough to figure out what was really going on. You're right, the "if use java" block should just go away. I'm not sure why it was even added in the first place, I can see VTK using FindJNI as far back as 9 years ago.

I was worried that VTK would hardcode the JVM location somewhere so I built it just to check. With the "if use java" block gone, it does record /etc/java-config-2/current-system-vm in a couple of places, which isn't great but not the end of the world and certainly not as bad as the real JVM location. One of these is libQVTKWidgetPlugin.so and the other is a .cmake file, both of which seem relatively unimportant.

An attempt to bump to 7.0.0 (maybe 7.1.0) is happening on GitHub so I've told the author to make the necessary adjustment.
Comment 10 tman 2017-01-10 03:44:14 UTC
we have 2017 and this is still bugging in portage


 type      Gentoo
Install path    /usr
Compiler flags:
C               -march=core-avx-i -O2 -pipe 
C++             -march=core-avx-i -O2 -pipe  -Wno-deprecated
Linker flags:
Executable      -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,-O1 -Wl,--as-needed 
Module          -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,-O1 -Wl,--as-needed 
Shared          -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,-O1 -Wl,--as-needed 

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/sci-libs/vtk-6.1.0-r4/work/vtk-6.1.0_build
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sci-libs/vtk-6.1.0-r4/work/VTK-6.1.0 ...
>>> Working in BUILD_DIR: "/var/tmp/portage/sci-libs/vtk-6.1.0-r4/work/vtk-6.1.0_build"
ninja -j9
ninja: error: '/etc/java-config-2/current-system-vm/jre/lib/amd64/xawt/libmawt.so', needed by 'lib/libvtkRenderingCoreJava.so', missing and no known rule to make it
 * ERROR: sci-libs/vtk-6.1.0-r4::gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  115:  Called src_compile
 *   environment, line 6051:  Called cmake-utils_src_compile
 *   environment, line 1187:  Called _cmake_execute_optionally 'src_compile'
 *   environment, line  534:  Called enable_cmake-utils_src_compile
 *   environment, line 1560:  Called cmake-utils_src_make
 *   environment, line 1202:  Called _cmake_ninja_src_make
 *   environment, line  590:  Called die
 * The specific snippet of code:
 *       "$@" || die
 * 
 * If you need support, post the output of `emerge --info '=sci-libs/vtk-6.1.0-r4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sci-libs/vtk-6.1.0-r4::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=icedtea-bin-8  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER=""
and of course, the output of emerge --info =vtk-6.1.0
 * The complete build log is located at '/mnt/portage/logs/sci-libs:vtk-6.1.0-r4:20170110-033745.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sci-libs/vtk-6.1.0-r4/temp/environment'.
 * Working directory: '/var/tmp/portage/sci-libs/vtk-6.1.0-r4/work/vtk-6.1.0_
Comment 11 James Le Cuirot gentoo-dev 2017-01-10 07:53:30 UTC
The GitHub pull request is still in progress on non-Java issues but nearly done.
Comment 12 Fabio Rossi 2017-05-23 15:32:33 UTC
any news on this? which is the reference to github pull request?
Comment 13 James Le Cuirot gentoo-dev 2017-05-23 15:44:21 UTC
This pull request.

https://github.com/gentoo/gentoo/pull/2936

It was merged some time ago. It just needs to be stabilised.
Comment 14 Fabio Rossi 2017-06-12 14:00:13 UTC
*** Bug 599366 has been marked as a duplicate of this bug. ***
Comment 15 Benda Xu gentoo-dev 2017-07-03 10:05:15 UTC
It is fixed in vtk-7.1.0.  Thanks for all your work.