moose tests won't build with vtk enabled

191 views
Skip to first unread message

Victor Koppejan

unread,
May 5, 2018, 3:46:30 AM5/5/18
to moose-users
I'm having some issues build moose with vtk support.

I'm getting the following error:

Compiling C++ (in dbg mode) /data/localhome/vwkoppejan/software/moose/vtk/test/build/unity_src/meshes_Unity.C...
Linking Library /data/localhome/vwkoppejan/software/moose/vtk/framework/libmoose-dbg.la...
Linking Executable /data/localhome/vwkoppejan/software/moose/vtk/framework/contrib/exodiff/exodiff...
Linking Library /data/localhome/vwkoppejan/software/moose/vtk/test/lib/libmoose_test-dbg.la...
Linking Executable /data/localhome/vwkoppejan/software/moose/vtk/test/moose_test-dbg...
/data/localhome/vwkoppejan/software/moose/vtk/framework/libmoose-dbg.so: error: undefined reference to 'vtkAlgorithm::GetOutputPort(int)'
/data/localhome/vwkoppejan/software/moose/vtk/framework/libmoose-dbg.so: error: undefined reference to 'vtkImageAlgorithm::GetOutput()'
collect2
: error: ld returned 1 exit status
make
: *** [/data/localhome/vwkoppejan/software/moose/vtk/test/moose_test-dbg] Error 1

Can anyone help me solve this?

Thanks in advance,

Victor
libmesh_diagnostic.log

Derek Gaston

unread,
May 5, 2018, 9:56:34 AM5/5/18
to moose...@googlegroups.com
Do you need VTK support?  If not, try passing --disable-vtk to the update_and_rebuild_libmesh.sh script.  VTK is not critical for "normal" MOOSE usage.

Derek

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/6d0968f5-5b06-40ce-aeea-947ee30e2389%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Victor Koppejan

unread,
May 5, 2018, 3:19:12 PM5/5/18
to moose-users
Well need, need, no. It's just that many of my post processing scripts are based on vtk files. It's not so hard to change the input reader to exodus/nemesis.

I still find it a bit weird I can't get it to work. Can you guys share the cmake command you use for vtk with the moose rpms?

Peterson, JW

unread,
May 7, 2018, 10:25:12 AM5/7/18
to moose-users
On Sat, May 5, 2018 at 1:19 PM, Victor Koppejan <victork...@gmail.com> wrote:
Well need, need, no. It's just that many of my post processing scripts are based on vtk files. It's not so hard to change the input reader to exodus/nemesis.

I still find it a bit weird I can't get it to work. Can you guys share the cmake command you use for vtk with the moose rpms?

Hmm... I see from your diagnostic log that you are using CentOS Linux and a VTK/7.1.1-gompi-2017b-Python-2.7.14 module. Is that VTK something you built yourself? 

It's possible that your VTK installation is slightly different from what we typically build, and requires different libraries to be linked against. We have seen this in the past, for example with the ArchLinux VTK binary distributions.

--
John

Victor Koppejan

unread,
May 9, 2018, 12:49:21 AM5/9/18
to moose-users
Hi John,

I've used a vtk module I built using easybuild. How do you typically build vtk (I mean which cmake options do you use)?

Miller, Jason M

unread,
May 9, 2018, 8:41:11 AM5/9/18
to moose...@googlegroups.com
Victor,

Folks can view how we build all the software that goes into the moose-environment package from our package_builder repository: https://github.com/idaholab/package_builder/tree/master/build_from_source
To answer your question, we build VTK using the following configure:


# Assuming you can load a GNU MPI Wrapper of some sort

  module load cmake mpich-3.2-gcc


# Create an out-of-tree build location

  mkdir vtk-build; cd vtk-build


# Declare a installation base directory

  export PACKAGES_DIR=/opt/moose


# Assuming VTK-7.1.0 is up one directory where you extracted the tarball.
# Obviously you may want to change the directories a bit. For this example we are using gcc-7.3.0 as our compiler

cmake ../VTK-7.1.0 -DCMAKE_INSTALL_PREFIX=$PACKAGES_DIR/VTK-7.1.0/gcc-7.3.0 \
 -DCMAKE_INSTALL_RPATH:STRING=$PACKAGES_DIR/VTK-7.1.0/gcc-7.3.0/lib \
 -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
 -DCMAKE_INSTALL_NAME_DIR:STRING=$PACKAGES_DIR/VTK-7.1.0/gcc-7.3.0/lib \
 -DCMAKE_MACOSX_RPATH:BOOL=ON \
 -DVTK_WRAP_PYTHON=ON \
 -DVTK_Group_MPI:BOOL=ON -Wno-dev


The resulting module we create so VTK can be 'accessed' when needed:


#%Module1.0#####################################################################
##
## VTK-7.1.0 gcc-7.3.0 Module
##
##
##
set             BASE_PATH          "$PACKAGES_DIR"
if { [uname sysname] != "Darwin" } {
  prepend-path    LD_LIBRARY_PATH    "$BASE_PATH/VTK-7.1.0/gcc-7.3.0/lib"
}
setenv          VTKINCLUDE_DIR                "$BASE_PATH/VTK-7.1.0/gcc-7.3.0/include/vtk-7.1"
prepend-path    INCLUDE_PATH                  "$BASE_PATH/VTK-7.1.0/gcc-7.3.0/include/vtk-7.1"
setenv          VTKLIB_DIR                    "$BASE_PATH/VTK-7.1.0/gcc-7.3.0/lib"
setenv          VTK6_PYTHON_DIR               "$BASE_PATH/VTK-7.1.0/gcc-7.3.0/lib/python2.7/site-packages"




Cheers!
Jason




On Tue, May 8, 2018 at 10:49 PM, Victor Koppejan <victork...@gmail.com> wrote:
Hi John,

I've used a vtk module I built using easybuild. How do you typically build vtk (I mean which cmake options do you use)?
--
You received this message because you are subscribed to the Google Groups "moose-users" group.

Peterson, JW

unread,
May 9, 2018, 10:36:50 AM5/9/18
to moose-users
On Wed, May 9, 2018 at 6:40 AM, Miller, Jason M <jason....@inl.gov> wrote:
Victor,

Folks can view how we build all the software that goes into the moose-environment package from our package_builder repository: https://github.com/idaholab/package_builder/tree/master/build_from_source
To answer your question, we build VTK using the following configure:


# Assuming you can load a GNU MPI Wrapper of some sort

  module load cmake mpich-3.2-gcc


# Create an out-of-tree build location

  mkdir vtk-build; cd vtk-build


# Declare a installation base directory

  export PACKAGES_DIR=/opt/moose


# Assuming VTK-7.1.0 is up one directory where you extracted the tarball.
# Obviously you may want to change the directories a bit. For this example we are using gcc-7.3.0 as our compiler

cmake ../VTK-7.1.0 -DCMAKE_INSTALL_PREFIX=$PACKAGES_DIR/VTK-7.1.0/gcc-7.3.0 \
 -DCMAKE_INSTALL_RPATH:STRING=$PACKAGES_DIR/VTK-7.1.0/gcc-7.3.0/lib \
 -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
 -DCMAKE_INSTALL_NAME_DIR:STRING=$PACKAGES_DIR/VTK-7.1.0/gcc-7.3.0/lib \
 -DCMAKE_MACOSX_RPATH:BOOL=ON \
 -DVTK_WRAP_PYTHON=ON \
 -DVTK_Group_MPI:BOOL=ON -Wno-dev


An important option that we are using is the -DVTK_Group_MPI:BOOL=ON option. That option seems to be missing from the easybuild config I randomly found at:


This could be related to the linking error you are getting, not 100% sure though.


In our VTK builds, the symbol in question is found (using the nm utility) in the following dylib on MacOS:

./libvtkCommonExecutionModel-7.1.1.dylib
000000000000b700 T __ZN12vtkAlgorithm13GetOutputPortEi

Could you check if there is something similar on your system (the exact name mangling may be slightly different)?

--
John

Victor Koppejan

unread,
May 9, 2018, 10:48:37 AM5/9/18
to moose-users
Hi Jason and John,

Thanks for looking into this. I have the -DVTK_Group_MPI:BOOL=ON option in my easyconfig file, the problem could be the -DVTK_WRAP_PYTHON=ON.

I have the libvtkCommonExecutionModel-7.1.so present in my VTK lib dir.

I'll recompile tomorrow and see if it I can get it to work.



Op woensdag 9 mei 2018 16:36:50 UTC+2 schreef jw.peterson:
VTK-7.1.1-gompi-2017b-Python-2.7.14.eb

Victor Koppejan

unread,
May 9, 2018, 10:51:35 AM5/9/18
to moose-users
sorry, forgot the nm output, the symbol is found.

Op woensdag 9 mei 2018 16:48:37 UTC+2 schreef Victor Koppejan:
nm.log

Peterson, JW

unread,
May 9, 2018, 11:09:26 AM5/9/18
to moose-users
On Wed, May 9, 2018 at 8:51 AM, Victor Koppejan <victork...@gmail.com> wrote:
sorry, forgot the nm output, the symbol is found.

I agree, as I see 

0000000000059160 T _ZN12vtkAlgorithm13GetOutputPortEi

in your output. Now, MOOSE does not link against libvtkCommonExecutionModel-7.1.so directly, it links against the following libs


one or more of which links against libvtkCommonExecutionModel-7.1.so, so we end up pulling in the required symbols indirectly.

On my system, I can run "otool -L" on dynamic libraries to see what they are linked against. I'm not sure what the corresponding command is on Linux, but it would be good to verify that one of the libraries in the list above links to libvtkCommonExecutionModel-7.1.so on your system... 

Another potential issue that could arise is if a different compiler was used to compile VTK than you are now using to compile MOOSE as they could have different name manglings...

--
John

Alexander Lindsay

unread,
May 9, 2018, 2:18:20 PM5/9/18
to moose...@googlegroups.com
ldd

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users+unsubscribe@googlegroups.com.

Victor Koppejan

unread,
May 10, 2018, 8:25:27 AM5/10/18
to moose-users
I compiled vtk-7.1.1 myself using

cmake .. -DCMAKE_INSTALL_PREFIX=/data/localhome/vwkoppejan/software/VTK/7.1.1/deb -DCMAKE_INSTALL_RPATH:STRING=/data/software/VTK/7.1.1/deb/lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON -DCMAKE_INSTALL_NAME_DIR:STRING=/data/software/VTK/7.1.1/deb/lib -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MACOSX_RPATH:BOOL=ON -DVTK_WRAP_PYTHON=ON -DVTK_Group_MPI:BOOL=ON -Wno-dev

Using the same toolchain I compiled moose using the update/rebuild script. The configure command finds vtk versions,  just as I showed earlier. Tests give t he same problem. Using ldd I can see the the vtk shared libs arer properly linked against  libvtkCommonExecutionModel-7.1.so.

not sure where to look next



Op woensdag 9 mei 2018 20:18:20 UTC+2 schreef Alexander Lindsay:
ldd

To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
ldd

Miller, Jason M

unread,
May 10, 2018, 8:58:34 AM5/10/18
to moose...@googlegroups.com
Did you set your environment up to include the following after installing VTK? For us, we need to export the following in order for libMesh to detect and link to it:

setenv          VTKINCLUDE_DIR                "/opt/moose/VTK-7.1.0/gcc-7.3.0/include/vtk-7.1"
prepend-path    INCLUDE_PATH                  "/opt/moose/VTK-7.1.0/gcc-7.3.0/include/vtk-7.1"
setenv          VTKLIB_DIR                    "/opt/moose/VTK-7.1.0/gcc-7.3.0/lib"
setenv          VTK6_PYTHON_DIR               "/opt/moose/VTK-7.1.0/gcc-7.3.0/lib/python2.7/site-packages"


Of course, your paths will be different than ours. According to your cmake configure line, I think it should look like:

export VTKINCLUDE_DIR="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/include/vtk-7.1"
export INCLUDE_PATH="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/include/vtk-7.1:$INCLUDE_PATH"
export VTKLIB_DIR="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/lib"
export VTK6_PYTHON_DIR="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/lib/python2.7/site-packages"

Once the above is set, you will want to rebuild libMesh within the same terminal... After you do, can you submit the new libmesh_diagnostic.log generated?

Thanks!
Jason


To unsubscribe from this group and stop receiving emails from it, send an email to moose-users+unsubscribe@googlegroups.com.

Peterson, JW

unread,
May 10, 2018, 10:26:58 AM5/10/18
to moose-users
The configure command finds vtk versions,  just as I showed earlier.

But not _exactly_ as you showed earlier, since your hand-built VTK is now in a different location, right?

Other than that, it sounds like you are doing everything correctly/consistently so I don't understand how you would still get undefined symbols while linking.

--
John

Victor Koppejan

unread,
May 10, 2018, 10:55:11 AM5/10/18
to moose-users
Apologies, I ment that the configure command in the update/build script recognizes and approves the vtk installation.

I went through Jason´s steps, but the problem´s still there. I´ve added the log file and the module file for moose (vtk.lua)

bash history

module load moose/vtk 
export VTKINCLUDE_DIR="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/include/vtk-7.1"
export INCLUDE_PATH="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/include/vtk-7.1:$INCLUDE_PATH"
export VTKLIB_DIR="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/lib"
export VTK6_PYTHON_DIR="/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/lib/python2.7/site-packages"
cd software/moose/vtk/
cd scripts/
./update_and_rebuild_libmesh.sh 
cd ../test/
make -j8



Op donderdag 10 mei 2018 16:26:58 UTC+2 schreef jw.peterson:
libmesh_diagnostic.log
vtk.lua

Peterson, JW

unread,
May 10, 2018, 11:10:39 AM5/10/18
to moose-users
On Thu, May 10, 2018 at 8:55 AM, Victor Koppejan <victork...@gmail.com> wrote:
Apologies, I ment that the configure command in the update/build script recognizes and approves the vtk installation.

Could you write a simple main program program that makes a dummy call to one or both of the offending functions

vtkAlgorithm::GetOutputPort(int)
vtkImageAlgorithm::GetOutput()

and then attempt to compile/link it with the command:

mpicxx -o foo -I/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/include/vtk-7.1 foo.cpp -ldl -Wl,-rpath,/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/lib \
-L/data/localhome/vwkoppejan/software/VTK/7.1.1/deb/lib -lvtkIOCore-7.1 -lvtkCommonCore-7.1 -lvtkCommonDataModel-7.1 -lvtkFiltersCore-7.1 -lvtkIOXML-7.1 -lvtkImagingCore-7.1 -lvtkIOImage-7.1 -lvtkImagingMath-7.1 -lvtkIOParallelXML-7.1 -lvtkParallelMPI-7.1 -lvtkParallelCore-7.1

(assuming your source file is called foo.cpp). If that works, then I'm still stumped, but it if fails, we may be able to play with different linker libraries etc. until we get it working.

--
John
Reply all
Reply to author
Forward
0 new messages