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

Bug 557974

Summary: sci-libs/vtk-6.1.0-r1 fails to find system netcdf-c++
Product: Gentoo Linux Reporter: Marius N Sletten <mariusns>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: UNCONFIRMED ---    
Severity: normal CC: nheghathivhistha, sci
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Attachments: VTK-6.1.0/CMake/FindNetCDF.cmake patch
Updated ebuild
emerge --info
Build log

Description Marius N Sletten 2015-08-17 01:03:22 UTC
Created attachment 409210 [details, diff]
VTK-6.1.0/CMake/FindNetCDF.cmake patch

Due to wrong path hits in VTK-6.1.0/CMake/FindNetCDF.cmake, NO_DEFAULT_PATH. configure fails finding the system netcdf-c++ libs and includs.

Quick fix is this attached patch and ebuild :-)
Comment 1 Marius N Sletten 2015-08-17 01:04:50 UTC
Created attachment 409212 [details]
Updated ebuild
Comment 2 Marius N Sletten 2015-08-17 01:23:36 UTC
Created attachment 409214 [details]
emerge --info
Comment 3 Michael Palimaka (kensington) gentoo-dev 2015-08-22 19:01:46 UTC
Please attach the failing build log.
Comment 4 Marius N Sletten 2015-08-22 21:24:47 UTC
Created attachment 409894 [details]
Build log

Build log of failed vtk build
Comment 5 Justin Lecher gentoo-dev 2015-08-23 13:40:10 UTC
which version of sci-libs/netcdf-cxx do you have installed?
Comment 6 Marius N Sletten 2015-08-23 14:14:19 UTC
sci-libs/netcdf: 4.3.2-r1

sci-libs/netcdf-cxx:  4.2-r300 at slot 3 and 4.2.1 at slot 0

vtk builds against from the 4.2-r300 version and both builds fine.

So 4.2.1 in slot 0 is not relevant with

The only problem here was the macro, NetCDF_check_interface, inside FindNetCDF.cmake. Where find_path and find_library has  NO_DEFAULT_PATH as last parameter. 

I didnt check how NO_DEFAULT_PATH is set.
Comment 7 Marius N Sletten 2015-08-23 14:18:25 UTC
Comment 8 Justin Lecher gentoo-dev 2015-08-23 14:46:24 UTC
It works here, so I need to figure out what is different on your system.
Comment 9 Marius N Sletten 2015-08-23 16:35:44 UTC
On the top of  the FindNetCDF.cmake I addad a few lines:

  # Already in cache, be silent
endif ()


$ ebuild vtk-6.1.0-r1.ebuild configure


NETCDF_CXX NETCDF_INCLUDE_DIR:  /usr/local/include
NETCDF_CXX NETCDF_LIBRARY:  /usr/local/lib64/
-- Failed to find NetCDF interface for CXX
CMake Error at CMake/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
  Could NOT find NetCDF (missing: NETCDF_HAS_INTERFACES)


NetCDF_lib_dirs = /usr/local/lib64 using NO_DEFAULT_PATH)
NetCDF_lib_dirs = /usr/lib64 using DEFAULT_PATH

Same result with the find_path for NETCDF_INCLUDE_DIR inside the macro NetCDF_check_interface

And YES, I had a copy similar to  sci-libs/netcdf-4.3.2-r1 on /usr/local from a local git install of moose,

Sorry, I didnt know!

These files are removed and the vtk ebuild in portage works fine now.

So the real problem here:

When a copy of  sci-libs/netcdf is placed in /usr/local then sci-libs/vtk requires sci-libs/netcdf-cxx to be installed at the same path. Not very PIC compatible.

Also, primary search paths, INCLUDES/LIBS, should come first if there's parallel installs of anything. Is there a USE-flag switch for this?

A little strange if you have your own modified copy of netcdf. I would still like to have a patch for the FindNetCDF.cmake in vtk to correct this.
Comment 10 Marius N Sletten 2015-08-23 21:09:44 UTC
Reproduce error by:

$ ln -s /usr/include/netcdf.h /usr/local/include/netcdf.h
$ cd /usr/portage/sci-libs/vtk
$ ebuild vtk-6.1.0-r1.ebuild configure

My use-flags:

USE="X boost doc ffmpeg imaging python qt4 rendering smp tbb theora views"
Comment 11 James Le Cuirot gentoo-dev 2015-08-23 21:19:34 UTC
Un-CCing Java since this doesn't look like our battle.