INstallation with VTK Version other than 6.1

Install support for openEMS

Moderators: thorsten, sebastian

gobers
Posts: 10
Joined: Thu 10 May 2012, 10:49

INstallation with VTK Version other than 6.1

Post by gobers » Fri 09 Dec 2016, 20:11

Hello,

running the script as well as cmake (and make) separately, I get
CMake Warning at CMakeLists.txt:124 (find_package):
Could not find a configuration file for package "VTK" that is compatible
with requested version "6.1".

The following configuration files were considered but not accepted:

/usr/local/lib/cmake/vtk-7.1/VTKConfig.cmake, version: 7.1.0

-- Found package VTK. Using version 7.1.0

which is obviously telling me, I have a wrong version of VTK installed. In order not to mess up my installation (I need VTK also for other programs) I wonder, if it is possible to run version 7.1 as well. Just changing 6.1 to 7.1.0 in related CMakeFiles.txt did not really help.
Do you have any suggestions? The above is valid for 0.34 and git-version.
Thanks
Gerald

thorsten
Posts: 1430
Joined: Mon 27 Jun 2011, 12:26

Re: INstallation with VTK Version other than 6.1

Post by thorsten » Fri 09 Dec 2016, 22:02

Hi,

I first try to request vtk >6.1 and then even fallback to any available version. Thus I'm not sure what is happening. Is vtk 7.x marked as not compatible with 6.x?
Unfortunately I have no experience with vtk 7.x yet. Thus I'm not sure how I can help.
What error messages appear? Does cmake fail completely or does make fail? What are the error messages?
From what you wrote, vtk did "fallback" to 7.1. But then the question is what happened...

Unfortunately I really cannot support all Linux distros in existence.

regards
Thorsten

gobers
Posts: 10
Joined: Thu 10 May 2012, 10:49

Re: INstallation with VTK Version other than 6.1

Post by gobers » Sun 11 Dec 2016, 11:04

Hi Thorsten,
thanks for looking at this. I fully understand, that you cannot support all possible configs on earth.

However, it seems I was mistaken, it is make taht is failing with the message:

---------------------------
/usr/bin/cmake3 -E cmake_link_script CMakeFiles/cmTC_77a8d.dir/link.txt --verbose=1
/usr/bin/c++ -frounding-math -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_77a8d.dir/CheckFunctionExists.cxx.o -o cmTC_77a8d -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: Fehler: ld gab 1 als Ende-Status zurück
gmake[4]: *** [cmTC_77a8d] Fehler 1
gmake[4]: Leaving directory `/home/varmeins/fenics-project/openEMS-Project/openEMS/CSXCAD-prefix/src/CSXCAD-build/CMakeFiles/CMakeTmp'
------------------------------

"cannot find -lpthreads". To me this seems odd, because Cmake find pthread but not pthreads (see CMakeCache.txt from CSXCAD:

//Have symbol pthread_create
CMAKE_HAVE_LIBC_CREATE:INTERNAL=
//Have library pthreads
CMAKE_HAVE_PTHREADS_CREATE:INTERNAL=
//Have library pthread
CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1
//Have include pthread.h
CMAKE_HAVE_PTHREAD_H:INTERNAL=1

Do you have an idea, where to set this properly?

Thanks again

Gerald

thorsten
Posts: 1430
Joined: Mon 27 Jun 2011, 12:26

Re: INstallation with VTK Version other than 6.1

Post by thorsten » Sun 11 Dec 2016, 14:19

Hi,

are you sure this is at all relevant? It looks to me like the cmake internal test to determine if pthreads is available or not.
Which it is not, but that is fine. I can see this messages too but it has really no meaning and is totally expected...

Does cmake run trough? Is a Makefile generated and what does make do?

regards
Thorsten

gobers
Posts: 10
Joined: Thu 10 May 2012, 10:49

Re: INstallation with VTK Version other than 6.1

Post by gobers » Sun 11 Dec 2016, 21:02

Hello Thorsten,

Yes, cmake runs through fine.
Makefiles are generated
make is aborting with the error message that it cannot find "-lpthreads" (I believe the "s" at the end is relevant). And I do not have libpthreads.so, I do have libthread.so. I have little experience with cmake. Usually, cmake tests if thread or threads is available and then generates makefiles accordingly. some excerpts from error and log are in the previous post.
Best regards
Gerald

thorsten
Posts: 1430
Joined: Mon 27 Jun 2011, 12:26

Re: INstallation with VTK Version other than 6.1

Post by thorsten » Mon 12 Dec 2016, 07:54

This is all very odd. Is this a cmake bug? Why is cmake detecting that pthreads is not available and still tries to link it...

You can define cmake arguments like this:

Code: Select all

cmake -DCMAKE_HAVE_PTHREADS_CREATE:INTERNAL=  [..] 
But this is all very odd and would still need to be understand properly...

regards
Thorsten

gobers
Posts: 10
Joined: Thu 10 May 2012, 10:49

Re: INstallation with VTK Version other than 6.1

Post by gobers » Mon 12 Dec 2016, 09:00

Hello Thorsten,

this is what cake says:
CMake Warning:
Manually-specified variables were not used by the project:

CMAKE_HAVE_PTHREADS_CREATE

and the end-result is the same. I got openEMS to work on a different machine (rather clean Debian Jessie stable distro). Therefore this helps a little bit, but I still would like to get it running on the other machine (Scientific Linux (Centos-based) 7, with the VTK7.1 (if that matters)). If you have any hint, or want me to try something, I am happy to do it.

Best regards
Gerald

gobers
Posts: 10
Joined: Thu 10 May 2012, 10:49

Re: INstallation with VTK Version other than 6.1

Post by gobers » Mon 12 Dec 2016, 15:37

Hello,
I got it to work also on the other machine (SL7, VTK7.1), this is what I did (I do not know, if these are just hacks or proper solutions):
1. in all subdirectory CMakeLists.txt I added "C" in e.g. PROJECT( AppCSXCAD CXX C). cmake threw an error, that it couldn't execute a try_compile, because the language "C" was not activated. This was actually the main reason also for the -lpthreads problem: cmake did not execute the rest of the lists-file after a.m. error.
3. I modified the HDF5 section of relevant CMakeLists.txt so that
find_package(HDF5 1.8 COMPONENTS C HL REQUIRED)
INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIRS})
The "S" is actually important here, however, I believe since the includes here are in the standard path, this did not matter.
4. in TARGET_LINK_LIBRARIES(... I added ${HDF5_HL_LIBRARIES} where required (openEMS, AppCSXCAD)
5. of course I needed to compile the VTK-QT (Gui support)
So with that I was able to execute the helical_antenna tutorial just fine.

I f I can help in any way to test things or i should send the CmakeLists, just let me know.

Best regards

Gerald

thorsten
Posts: 1430
Joined: Mon 27 Jun 2011, 12:26

Re: INstallation with VTK Version other than 6.1

Post by thorsten » Mon 12 Dec 2016, 22:29

Hi,

to 1.) very odd that this is now required and was never before. According to this specifying nothing would be an alternative too...
to 2.) I agree ;)
to 3.) Well I had this fixed for openEMS, but not CSXCAD and others?
to 4.) can you check if linking HDF5_HL only for CSXCAD and openEMS would be sufficient. Because AppCSXCAD is really not doing any hdf5 on its own... Thus I suspect CSXCAD is requiring it not AppCSXCAD. But it only fails for the final binary...
to 5.) Sure
I f I can help in any way to test things or i should send the CmakeLists, just let me know.
I can make all the necessary changes, but maybe you want to create the appropriate git commits yourself and create a pull request on github? I will then review them and give my feedback. Just let me know what route you want to go...
Thanks for the patience in figuring this out.

regards
Thorsten

gobers
Posts: 10
Joined: Thu 10 May 2012, 10:49

Re: INstallation with VTK Version other than 6.1

Post by gobers » Tue 13 Dec 2016, 08:07

HI,
about (4). AppCSXCAD: Yes it is building the last binary that fails, and yes, AppCSXCAD needed the hdf5-stuff, at least the way I built it with not using the script, but the "mkdir build && cd build && cmake ../ && make AppCSXCAD" chain of commands (gives better access to logs and errors).
I will try to do it with the git/fork/commit, but it may take one or two day.

Thanks and best regards

Gerald

Post Reply