Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 557974 - sci-libs/vtk-6.1.0-r1 fails to find system netcdf-c++
Summary: sci-libs/vtk-6.1.0-r1 fails to find system netcdf-c++
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2015-08-17 01:03 UTC by Marius N Sletten
Modified: 2018-01-05 16:57 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
VTK-6.1.0/CMake/FindNetCDF.cmake patch (vtk-6.1.0-netcdf2.patch,748 bytes, patch)
2015-08-17 01:03 UTC, Marius N Sletten
Details | Diff
Updated ebuild (vtk-6.1.0-r1.ebuild,10.20 KB, text/plain)
2015-08-17 01:04 UTC, Marius N Sletten
Details
emerge --info (emerge.info,6.54 KB, application/x-info)
2015-08-17 01:23 UTC, Marius N Sletten
Details
Build log (build.log,37.41 KB, text/x-log)
2015-08-22 21:24 UTC, Marius N Sletten
Details

Note You need to log in before you can comment on or make changes to this bug.
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 libnetcdf_c++.so.4 from the 4.2-r300 version and both builds fine.

So 4.2.1 in slot 0 is not relevant with libnetcdf_c++4.so.

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
NO_DEFAULT_PATH=/usr/local
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:

if (NETCDF_INCLUDE_DIR AND NETCDF_LIBRARY)
  # Already in cache, be silent
  set (NETCDF_FIND_QUIETLY TRUE)
endif ()

message("NETCDF_CXX NETCDF_INCLUDE_DIR:  ${NETCDF_INCLUDE_DIR}")
message("NETCDF_CXX NETCDF_LIBRARY:  ${NETCDF_LIBRARY}")

where,
$ ebuild vtk-6.1.0-r1.ebuild configure

gives:

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

implying:

NetCDF_lib_dirs = /usr/local/lib64 using NO_DEFAULT_PATH)
and
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, http://mooseframework.org/.

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"
PYTHON_TARGETS="python2_7"
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.