Compilation of flann with use-enabled cuda flag fails, at least with nvidia-cuda-sdk 8.0 installed. The relevant bit appears on the following nvcc invocation: /opt/cuda/bin/nvcc -M -D__CUDACC__ /var/tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu -o /var/tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o.NVCC-depend -m64 -DFLANN_STATIC -D_FLANN_VERSION=1.9.1 -Xcompiler ,\"-O2\",\"-march=native\",\"-mtune=native\",\"-pipe\",\"-fopenmp\" -O2 -v --compiler-bindir /usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0 --compiler-options "-O2 -march=native -mtune=native -pipe" --linker-options -O1,--as-needed ,-arsch -DFLANN_USE_CUDA -Xcompiler -fPIC -DNVCC -I/opt/cuda/include -I/var/tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified Notice the space between the linker-options and ",-arsch" that was appended in the ebuild? This is the culprit, which can be solved with this patch. diff --git a/sci-libs/flann/flann-1.9.1.ebuild b/sci-libs/flann/flann-1.9.1.ebuild index b4f868b50..552e83830 100644 --- a/sci-libs/flann/flann-1.9.1.ebuild +++ b/sci-libs/flann/flann-1.9.1.ebuild @@ -73,7 +73,7 @@ src_configure() { -DUSE_OPENMP=$(usex openmp) ) use cuda && mycmakeargs+=( - -DCUDA_NVCC_FLAGS="${NVCCFLAGS},-arsch" + -DCUDA_NVCC_FLAGS="${NVCCFLAGS} --linker-options \"-arsch\"" ) cmake-utils_src_configure }
emerge --info Portage 2.3.3 (python 2.7.12-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r3, 4.8.3-gentoo x86_64) ================================================================= System uname: Linux-4.8.3-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_@_9200_@_2.67GHz-with-gentoo-2.3 KiB Mem: 16408264 total, 13143408 free KiB Swap: 4194300 total, 3970840 free sh bash 4.4_p5-r1 ld GNU ld (Gentoo 2.27 p1.0) 2.27 distcc 3.2rc1 x86_64-pc-linux-gnu [disabled] ccache version 3.3.3 [disabled] app-shells/bash: 4.4_p5-r1::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.24.1_rc4::gentoo dev-lang/python: 2.7.12::gentoo, 3.5.2::gentoo dev-util/ccache: 3.3.3::gentoo dev-util/cmake: 3.7.1::gentoo dev-util/pkgconfig: 0.29.1::gentoo sys-apps/baselayout: 2.3::gentoo sys-apps/openrc: 0.23.1::gentoo sys-apps/sandbox: 2.10-r3::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r2::gentoo sys-devel/automake: 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.27::gentoo sys-devel/gcc: 4.9.3::gentoo, 5.4.0-r2::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r2::gentoo sys-devel/make: 4.2.1::gentoo sys-kernel/linux-headers: 4.9::gentoo (virtual/os-headers) sys-libs/glibc: 2.23-r3::gentoo Repositories: gentoo location: /usr/portage sync-type: git sync-uri: https://anongit.gentoo.org/git/repo/gentoo.git priority: -1000 local location: /usr/local/portage/local masters: gentoo ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -mtune=native -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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="-O2 -march=native -mtune=native -pipe" DISTDIR="/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps=y" FCFLAGS="-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 webrsync-gpg xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.modulix.net/gentoo/ http://gentoo.mirrors.ovh.net/gentoo-distfiles/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://mirror.netcologne.de/gentoo/" LANG="fr_FR.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j10" 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="256-color 3dnow 3dnowext 7zip X a52 aac adobe-cff aio alsa amd64 apng archive aspell ass async automount bash-completion berkdb bluray branding bzip2 c++0x c++11 cairo cblas-external cdda cdparanoia cdr cdrtools cjk clang cli color-console consolekit cracklib crossdev crypt css cups cxx dbus device-mapper dga divx divx4linux djvu dlz dri dts dv dvd dvdnav dvdr dvdread dvi eac3 edd enca encode exif faac faad fam fat ffmpeg fftw firefox flac fontconfig fortran frei0r fts3 fuse g3dvl gdbm gdu gflags ghcquickbuild gimp git glib gnome-keyring gnuplot gnutls gphoto2 graphite gs gsl gstreamer gtkstyle gudev hal hashstyle highlight hscolour hwdb ice1712 iconv idn imagemagick infinality introspection java6 jpeg jpeg2k keymap lapack lcdfilter lcms libass libcanberra libffi libsamplerate live logrotate lto luajit lzma lzo mad matroska md5sum mdadm minizip mmx mmxext mng modules mozbranding mozdevelop mozdom mozpango mp2 mp3 mp4 mpeg mpi mplayer multilib natspec ncurses nemesi nls nptl nptlonly nsplugin nspluginwrapper nvidia ogg oggvorbis ogm opengl openmp openssl pam pcf pch pcre pdf perl phonon png pulseaudio python qt5 quicktime rar readline real regex replytolist romio rtmp rtsp samba seccomp session smbclient smp sortsub sqlite srt sse sse2 sse3 sse4 sse4_2 ssl ssse3 startup-notification subtitles subversion svg syslog theora threads threadsafe thunar thunderbird tiff toolkit-scroll-bars tremor truehd truetype udev unicode unit-mm usb vapigen video vim vim-pager vim-syntax visibility vorbis vpx webdav-neon win32codecs wmf wmp x264 xattr xcomposite xforms xft xklavier xml2 xmp xorg xscreensaver xulrunner xv xvid xvmc zero-penalty-hit zip zlib zsh-completion zvbi" ABI_X86="64" ALSA_CARDS="ice1712 hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="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" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" L10N="fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr fr_FR" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" QEMU_SOFTMMU_TARGETS="arm x86_64 i386" QEMU_USER_TARGETS="arm" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="nvidia" XFCE_PLUGINS="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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Created attachment 461188 [details] flann-1.9.1 build log
Created attachment 461190 [details, diff] flann-1.9.1 patch solving the issue
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a27be96554ff89124e27de08d56d34215428dd1d commit a27be96554ff89124e27de08d56d34215428dd1d Author: Amy Liffey <amynka@gentoo.org> AuthorDate: 2018-02-06 17:56:07 +0000 Commit: Amy Liffey <amynka@gentoo.org> CommitDate: 2018-02-06 18:04:45 +0000 sci-libs/flann: fix cuda linking error Submitted-by: pa.lacaze@gmail.com Closes: https://bugs.gentoo.org/607062 Package-Manager: Portage-2.3.13, Repoman-2.3.3 sci-libs/flann/flann-1.9.1.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)