When I am trying to compile LIGGGHTS with Makefile.g++VTK (as attached) then I am getting following error:
Please note it compiles finely without -DLAMMPS_VTK switch.
make[1]: Entering directory `/lustre/scratch/rsoni/LIGGGHTS/LIGGGHTS-PUBLIC-350-VTK/src/Obj_g++VTK'
g++ -g -O -DMPI_NO_CPPBIND -DLAMMPS_GZIP -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_VTK -DMPICH_SKIP_MPICXX -DFFT_SCSL -l/usr/include/ -c ../dump_atom_vtk.cpp
../dump_atom_vtk.cpp:47:24: fatal error: vtkVersion.h: No such file or directory
#include
^
compilation terminated.
make[1]: *** [dump_atom_vtk.o] Error 1
make[1]: Leaving directory `/lustre/scratch/rsoni/LIGGGHTS/LIGGGHTS-PUBLIC-350-VTK/src/Obj_g++VTK'
make: *** [g++VTK] Error 2
I am compiling in cluster so I don't have administrative privilege. But I think I have all the pre-requisites in following locations:
vtk-devel:
/lustre/scratch/rsoni/LIGGGHTS/vtk-devel/usr/
VTK-5.8:
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-Build/
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/include/
My VTK settings in the Makefiles is as below:
VTK_INC = -I/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/include/vtk-5.8
VTK_PATH =
VTK_LIB = -lvtkCommon -lvtkFiltering -lvtkIO
Please help me resolve the issue.
Attachment | Size |
---|---|
![]() | 3.01 KB |
j-kerbl | Wed, 12/21/2016 - 16:03
Hi Rahulsoni,
Hi Rahulsoni,
I have two remarks for you:
The VTK_INC path exists (it looks a bit odd) and there is the file vtkVersion.h inside it?
Usually you have to add /include/vtk-5.8 to the installation directory, specified during the vtk compilation.
Please also set the VTK_PATH to the lib/vtk-5.8 folder of this installation. There you should find e.g. libvtkCommon.so .
Happy compiling,
Josef
Daniel Queteschiner | Wed, 12/21/2016 - 16:22
Include Path
You forgot to add VTK_INC to EXTRA_INC
rahulsoni | Thu, 12/22/2016 - 06:22
Partially solved
Hi Josef and Daniel
Thanks for valuable information, I was missing something very important as you pointed out. I made the changes as following:
VTK_INC = -I/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/include/vtk-5.8
VTK_PATH = -L/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/lib/vtk-5.8
VTK_LIB = -lvtkCommon -lvtkFiltering -lvtkIO
EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) $(VTK_INC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) $(VTK_PATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) $(VTK_LIB)
Now, first few snippet of the errors I am getting are shown below
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkObjectFactory.cxx.o): In function `vtkObjectFactory::LoadLibrariesInPath(char const*)':
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkObjectFactory.cxx:205: undefined reference to `vtksys::Directory::Directory()'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkObjectFactory.cxx:206: undefined reference to `vtksys::Directory::Load(char const*)'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkObjectFactory.cxx:214: undefined reference to `vtksys::Directory::GetFile(unsigned long) const'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkObjectFactory.cxx:212: undefined reference to `vtksys::Directory::GetNumberOfFiles() const'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkObjectFactory.cxx:277: undefined reference to `vtksys::Directory::~Directory()'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkObjectFactory.cxx:277: undefined reference to `vtksys::Directory::~Directory()'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o): In function `__static_initialization_and_destruction_0':
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-Build/Utilities/vtksys/SystemTools.hxx:73: undefined reference to `vtksys::SystemToolsManager::SystemToolsManager()'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-Build/Utilities/vtksys/SystemTools.hxx:73: undefined reference to `vtksys::SystemToolsManager::~SystemToolsManager()'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o): In function `double vtkVariantStringToNonFiniteNumeric(vtkStdString, bool*)':
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkVariant.cxx:944: undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkVariant.cxx:949: undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkVariant.cxx:949: undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkVariant.cxx:955: undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkVariant.cxx:955: undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkDynamicLoader.cxx.o): In function `vtkDynamicLoader::LastError()':
/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/VTK-5.8-SRC/Common/vtkDynamicLoader.cxx:69: undefined reference to `vtksys::DynamicLoader::LastError()'
Daniel Queteschiner | Thu, 12/22/2016 - 12:50
Linker
Have you checked that libvtkCommon.so, libvtkFiltering.so and libvtkIO.so (often just system links to the actual lib files libvtkCommon.so.5.8.0, libvtkFiltering.so.5.8.0 and libvtkIO.so.5.8.0!) are at the specified folder so the linker can find them?
rahulsoni | Thu, 12/22/2016 - 14:38
Seems right
Yes, it seems right. I don't think the cluster is having any other VTK installation.
Moreover, the contents of linked VTK library path shown below asserts proper linking:
service0 local/lib> cd vtk-5.8/
Directory: /lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/lib/vtk-5.8
service0 lib/vtk-5.8> ls
CMake libvtkGeovis.a libvtksys.a vtkFilteringKit.cmake
doc libvtkGraphics.a libvtktiff.a vtkGenericFilteringKit.cmake
doxygen libvtkhdf5.a libvtkverdict.a vtkGeovisKit.cmake
hints libvtkHybrid.a libvtkViews.a vtkGraphicsKit.cmake
libMapReduceMPI.a libvtkImaging.a libvtkVolumeRendering.a vtkHybridKit.cmake
libmpistubs.a libvtkInfovis.a libvtkWidgets.a vtkImagingKit.cmake
libvtkalglib.a libvtkIO.a libvtkzlib.a vtkInfovisKit.cmake
libvtkCharts.a libvtkjpeg.a ls vtkIOKit.cmake
libvtkCommon.a libvtklibxml2.a pwd vtkRenderingKit.cmake
libvtkDICOMParser.a libvtkmetaio.a testing VTKTargets.cmake
libvtkexoIIc.a libvtkNetCDF.a UseVTK.cmake VTKTargets-debug.cmake
libvtkexpat.a libvtkNetCDF_cxx.a VTKBuildSettings.cmake vtkViewsKit.cmake
libvtkFiltering.a libvtkpng.a vtkChartsKit.cmake vtkVolumeRenderingKit.cmake
libvtkfreetype.a libvtkproj4.a vtkCommonKit.cmake vtkWidgetsKit.cmake
libvtkftgl.a libvtkRendering.a VTKConfig.cmake
libvtkGenericFiltering.a libvtksqlite.a VTKConfigVersion.cmake
service0 lib/vtk-5.8>
rahulsoni | Thu, 12/22/2016 - 14:44
Update
Although, I have listed the contents of lib folder but I can't see and .so file as you are pointing. Does, .so files are really required. Do they come from any pre-requisite installation such as libvtk5-dev, and whether it will require administrative privilege. If so then how can I get them without administrative privilege.
rahulsoni | Thu, 12/22/2016 - 15:36
Update
Ok, got it. Your hint helped a lot. Sometimes miracle happen like this.
From my own comment I got the hint that I am linking to wrong directory (/lustre/scratch/rsoni/LIGGGHTS/VTK-5.8/install_dir/usr/local/lib/vtk-5.8). That doesn't contain .so files.
I understood that I need something like libvtk5-dev but since I don't have admin privilege I couldn't get them from global servers.
I already had vtk-devel-5.8.0-7.9.x86_64.rpm which I extracted and then linked /lustre/scratch/rsoni/LIGGGHTS/vtk-devel/usr/lib64/vtk to VTK_PATH
So, I did following thing:
VTK_PATH = -L/lustre/scratch/rsoni/LIGGGHTS/vtk-devel/usr/lib64/vtk
and, executed these commands as well:
setenv PATH $PATH\:/lustre/scratch/rsoni/LIGGGHTS/vtk-devel/usr/include/vtk-5.8/
setenv LD_LIBRARY_PATH /lustre/scratch/rsoni/LIGGGHTS/vtk-devel/usr/lib64/vtk:$LD_LIBRARY_PATH
However, I am getting follwing error that linked libraries are not found.
/lustre/scratch/rsoni/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lvtkCommon
/lustre/scratch/rsoni/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lvtkFiltering
/lustre/scratch/rsoni/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lvtkIO
collect2: error: ld returned 1 exit status
make[1]: *** [../lmp_g++VTK] Error 1
make[1]: Leaving directory `/lustre/scratch/rsoni/LIGGGHTS/LIGGGHTS-PUBLIC-350-VTK/src/Obj_g++VTK'
make: *** [g++VTK] Error 2
Why it is trying to find things in /lustre/scratch/rsoni/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/bin/ld
j-kerbl | Thu, 12/29/2016 - 10:21
Hi Rahul,
This
/lustre/scratch/rsoni/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/bin/ld
indicates only that you are using gcc from OpenFOAMs ThirdParty and not the one from your system. ld is the library linker.
/lustre/scratch/rsoni/LIGGGHTS/vtk-devel/usr/lib64/vtkHowever it complains it cannot find the necessary vtk libraries, which is weird, since the libraries should be within the LD_LIBRARY_PATH and specified within the Makefile.
A thought on the contents of:
Can you make sure all the necessary libraries are contained in here and have the exact name without e.g. the version ending 5.8.0 ?
Regards
Josef
Daniel Queteschiner | Sun, 01/01/2017 - 10:38
Static vs Dynamic Libraries
What it comes down to is that you have a vtk installation of static libraries (honestly, I haven't come across one yet), while the make file assumes linkage to the dynamic vtk libraries. For static libraries you also have to add the dependencies of vtkCommon, vtkFiltering and libvtkIO, e.g., vtksys. This implies that you will need to find out all the necessary dependencies and if you are unlucky you will also need to take care of the correct order.