Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VTK library name changes #113

Closed
jrper opened this issue Apr 27, 2016 · 12 comments · May be fixed by #356
Closed

VTK library name changes #113

jrper opened this issue Apr 27, 2016 · 12 comments · May be fixed by #356

Comments

@jrper
Copy link
Contributor

jrper commented Apr 27, 2016

As was raised in the AMCG Fluidity developers meeting, the current configure script doesn't support the default namescheme chosen for VTK libraries in (at least) version 6.2 and 6.3, as used in unstable versions of debian. An example of a workaround method is available here: 32eb490 however this is itself incompatible with the centos packages for VTK 6.1. The intention is to extend the existing autoconf scripts to include all reasonable namings.

@ggorman
Copy link
Contributor

ggorman commented Apr 27, 2016

May well be easier to switch from autoconf to cmake. The learning curve is far easier than autoconf.

@stephankramer
Copy link
Contributor

So digging into this some more, this seems to be entirely vtk's fault. vtk indeed now inserts a version number at the end of the lib name /before/ the .so. To suppress this you can add -DVTK_CUSTOM_LIBRARY_SUFFIX='' in vtk's configure, but that of course leaves the package maintainers in the dilemma: if you suppress the ugly non-standard naming scheme, you break third-party software (like us) that expect vtk to be built in the default way. See a.o. this discussion https://bugs.archlinux.org/task/43378. So we should expect different distro's to have different solutions.

As far as I can see there's no way to find out how it's been build, even if we were using cmake. The value of VTK_CUSTOM_LIBRARY_SUFFIX that's been used isn't set in any of the cmake files that come with Debian's build for instance and neither is it in centos' rpm (which does set -DVTK_CUSOM_LIBRARY_SUFFIX=''" in the .spec of the source rpm).

@jrper
Copy link
Contributor Author

jrper commented Apr 27, 2016

That's a nice piece of blackmail then: use cmake as your build system and have code that will work with a script like

cmake_minimum_required(VERSION 2.6)
enable_language (Fortran CXX)
project(bob)
find_package(VTK REQUIRED)
include_directories(./include)
include(${VTK_USE_FILE})
add_executable(bob bob.cpp bob.F90)
target_link_libraries(bob ${VTK_LIBRARIES})

Otherwise, write an autoconf script to try every possibility of custom suffices.

@ggorman
Copy link
Contributor

ggorman commented Apr 27, 2016

And this is why I eventually gave up and started just using cmake for everything.

@stephankramer
Copy link
Contributor

See the thing is - I don't see how it would work with cmake: as far as I can see you would have to know the setting for VTK_CUSTOM_LIBRARY_SUFFIX that was used. The accompanying cmake files just repeat the logic that if VTK_CUSTOM_LIBRARY_SUFFIX is not set, it defaults to $(VTK_MAJOR_VERSION)-$(VTK_MINOR_VERSION).

@ggorman
Copy link
Contributor

ggorman commented Apr 27, 2016

Kiteware maintain both vtk and cmake - and therefore insure that the "current" cmake supports the current VTK. If cmake is not detecting vtk it's typically because you have a older version of cmake relative to vtk.

@stephankramer
Copy link
Contributor

stephankramer commented Apr 27, 2016

Ah sorry I see now: I was looking in the wrong place. Yes, looks like that should just work indeed.

@stephankramer
Copy link
Contributor

Ok, so what about this:

For include flags we run (from configure):

cmake --find-package -DNAME=VTK -DCOMPILER_ID=gcc -DLANGUAGE=Fortran -DMODE=COMPILE

and for lib flags:

cmake --find-package -DNAME=VTK -DCOMPILER_ID=gcc -DLANGUAGE=Fortran -DMODE=LINK

(substituting Fortran with CXX where appropriate).

@jrper
Copy link
Contributor Author

jrper commented Apr 28, 2016

After a little experimenting, @stephankramer's solution can be made robust for those with multiple installations by ensuring that VTK_DIR is set, either as an environment variable, or as a cmake macro

cmake --find-package -DVTK_DIR=/strange/path/to/library/cmake/files -DNAME=VTK -DCOMPILER_ID=gcc -DLANGUAGE=Fortran -DMODE=LINK

so I think it's a useful way to proceed, assuming that the extra graphical libraries it might pull in to link don't give people problems.

@jrper
Copy link
Contributor Author

jrper commented Nov 7, 2016

This is closed by #125, except in the various ways distributions have managed to break their own packages, which @tmbgreaves has discovered.

@jrper jrper closed this as completed Nov 7, 2016
@ghost
Copy link

ghost commented Jan 23, 2017

Is this issue fixed? I tried to build from the master branch and I'm getting stuck at this issue.
cmake-vtk-err

@jrper
Copy link
Contributor Author

jrper commented Jan 23, 2017

It's unfortunately somewhat distribution dependent, but in general you shouldn't be seeing that if you have cmake installed and it can find your VTK installation. (i.e. if
cmake --find-package -DNAME=VTK -DCOMPILER_ID=gcc -DLANGUAGE=Fortran -DMODE=LINK
returns something useful).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants