How to build VTK with CMake for parallel computing? - parallel-processing

I would like to build VTK with CMake for parallel computing, the environment is Win10 (x64), Codeblocks-12.11, VTK-7.0.0 and CMake-3.5.0. When I selected VTK_Group_MPI and Module_vtkParallelMPI, CMake errors are as follows. So how to build VTK with CMake for parallel computing? Thank you in advance!
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MPI_C_LIBRARIES (ADVANCED)
linked by target "vtkParallelMPI" in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
linked by target "vtkIOMPIImage" in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
linked by target "vtkIOMPIParallel" in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
linked by target "vtkIOParallelNetCDF" in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
MPI_HEADER_PATH
used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF

I have to admit that I haven't tried to build VTK myself, but I know enough CMake to see that it failed to find the MPI library, because the variables MPI_C_LIBRARIES and MPI_HEADER_PATH is not set.
How are you configuring CMake?
If you are using the CMake GUI - which I would recommend that you do - you ought to switch on grouped and advanced options.
Now, the Find_MPI CMake script uses the registry to find MPI libraries - so you can help it by setting the MSMPI_BINenvironment variable.
See Find_MPI Source code
However, if all of that is too much black magic, then you can simply enter the correct values into CMake for the missing variables, provided that you have turned on advanced and grouped mode.

Add your MPI binaries directory to your path.
PATH=$PATH:${YOU_MPI_DIRECTORY}/bin
MPI compilers, mpicc, mpicxx, mpif90, etc, are wrappers that should solve these dependencies.

Related

How to specify the output directory of a given DLL?

I'm using the following src/CMakeLists.txt:
cmake_minimum_required(VERSION 3.1.0)
project(foo)
add_library(foo SHARED foo.cpp)
set_target_properties(foo
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIG>/subdir
)
And on Windows, I'm building the library using:
mkdir build
cd build
cmake ../src
cmake --build .
Output File: ~/build/Debug/foo.dll
Expected Output File: ~/build/Debug/subdir/foo.dll
What am I doing wrong?
It works fine on platforms other than Windows, and it seems like it should work according to the following documentation:
add_library
set_target_properties
LIBRARY_OUTPUT_DIRECTORY
cmake-generator-expressions.
Short answer
On Windows, unlike other platforms, you should use RUNTIME_OUTPUT_DIRECTORY instead of LIBRARY_OUTPUT_DIRECTORY to specify the output directory of a shared library.
Long answer
This is documented on the CMake documentation about Output Artifacts:
Runtime Output Artifacts
A runtime output artifact of a buildsystem
target may be:
The executable file (e.g. .exe) of an executable target created by the
add_executable() command.
On DLL platforms: the executable file (e.g.
.dll) of a shared library target created by the add_library() command
with the SHARED option. The RUNTIME_OUTPUT_DIRECTORY and
RUNTIME_OUTPUT_NAME target properties may be used to control runtime
output artifact locations and names in the build tree.
Library Output Artifacts
A library output artifact of a buildsystem
target may be:
The loadable module file (e.g. .dll or .so) of a module library target
created by the add_library() command with the MODULE option.
On
non-DLL platforms: the shared library file (e.g. .so or .dylib) of a
shared library target created by the add_library() command with
the SHARED option. The LIBRARY_OUTPUT_DIRECTORY and
LIBRARY_OUTPUT_NAME target properties may be used to control library
output artifact locations and names in the build tree.
But why would CMake make such a difference between DLL platforms (Windows) and non-DLL platforms (macOS, Linux, etc.)?
I couldn't find a source documenting this design decision, but I believe the rationale is that Windows does not support the concept of rpath, that is, .exe files can't store internally the location of their dependent .dll files. Therefore, on Windows, .dll files are often stored in the same folder as .exe files to make sure that the DLLs are found at runtime. Instead, on Unix systems, shared library files are often stored in a separate lib folder, while application binaries are stored in a bin folder, which is not a problem because binaries can store the location of their dependencies using rpath.
In conclusion, it makes sense for cross-platform development to define both LIBRARY_OUTPUT_DIRECTORY and RUNTIME_OUTPUT_DIRECTORY, like so:
cmake_minimum_required(VERSION 3.1.0)
project(foo)
add_library(foo SHARED foo.cpp)
set_target_properties(foo
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIG>/lib
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIG>/bin
)

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

I try to generated makefile file.
I use
cmake -G " Unix Makefiles" ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cp
It gives me the following result:
Using libclang to provide semantic completion for C/C++/ObjC
CMake Warning at /usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindBoost.cmake:765 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
/usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
ycm/CMakeLists.txt:217 (find_package)
CMake Error at /usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindBoost.cmake:1842 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
ycm/CMakeLists.txt:217 (find_package)
Using external libclang: /Library/Developer/CommandLineTools/usr/lib/libclang.dylib
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock/gtest
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock/gtest
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock/gtest
used as include directory in directory /Users/shitfly/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock/gtest
-- Configuring incomplete, errors occurred!
See also "/Users/shitfly/ycm_build/CMakeFiles/CMakeOutput.log".
I think I already has installed YCM in Vendle in ~ / .vim / bundle / YouCompleteMe,but maybe not,How do i check it?
I checked my directory and I already have these directory in Boost_INCLUDE_DIR (ADVANCED)
How do I proceed?

Installing channelflow on my Mac OsX

I am trying to install the software channelflow on my Mac OsX from the instructions on this site http://channelflow.org/dokuwiki/doku.php?id=docs:install. The site specifies that one has to first install fftw3, eigen and hdf5 usong fink on one's system. I have successfully installed fftw3 and eigen on my system but am not able to install hdf5 using fink ('fink install hdf5' mentions that there is no package called hdf5). I installed hdf5 using the mirror on https://www.hdfgroup.org/downloads/index.html. But this installed hdf5 in usr/local whereas 'fink install' installs in /sw (I think).
Now, installing channelflow gives me the following error.
MDOM18208-1:build kumarsambhava$ cmake -DCMAKE_INSTALL_PREFIX=~/channelflow ~/channelflow/trunk
-- configuring channelflow version 1.5.1
-- Build type: release
-- Basic system introspection...
-- Finding packages...
-- Found FFTW
-- FFTW_INCLUDE_DIR=/sw/include
-- FFTW_LIBRARY=/sw/lib/libfftw3.dylib
-- Adding /sw/include to include path...
-- Adding /sw/lib/libfftw3.dylib to libraries...
-- Found Eigen3
-- EIGEN3_INCLUDE_DIR=/sw/include/eigen3
-- Adding /sw/include/eigen3 to include path...
-- Found HDF5
-- HDF5 was not found.
-- Adding HDF5_LIBRARY-NOTFOUND to libraries...
-- Adding /libhdf5_cpp.so to libraries...
CMake Error at CMakeLists.txt:129 (CHECK_LIBRARY_EXISTS):
CHECK_LIBRARY_EXISTS Macro invoked with incorrect arguments for macro
named: CHECK_LIBRARY_EXISTS
CMake Error at CMakeLists.txt:135 (CHECK_LIBRARY_EXISTS):
CHECK_LIBRARY_EXISTS Macro invoked with incorrect arguments for macro
named: CHECK_LIBRARY_EXISTS
-- LIBS=/sw/lib/libfftw3.dylib;HDF5_LIBRARY-NOTFOUND;/libhdf5_cpp.so
-- INCLUDE_DIRS=
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
HDF5_INCLUDE_DIR (ADVANCED)
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/channelflow
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/programs
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/examples
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/tests
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
used as include directory in directory /Users/kumarsambhava/channelflow/trunk/data
HDF5_LIBRARY (ADVANCED)
linked by target "chflow_static" in directory /Users/kumarsambhava/channelflow/trunk/channelflow
linked by target "chflow" in directory /Users/kumarsambhava/channelflow/trunk/channelflow
linked by target "symmetryop" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "seriesdist" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "pressure" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "poincare" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "seriesdist2" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "perturbfield" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "findsoln" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "makestokesmode" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "makebasis" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "seriesprops" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "L2Dist" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "projectseries" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "continuesoln" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "findsymmetries" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "couettePoincare" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "movieframes" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "arnoldi" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "L2IP" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "continuefields" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "fieldprops" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "fieldplots" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "field2ascii" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "projectfields" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "couette" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "randomfield" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "makeheatmode" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "symmetrize" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "diffop" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "interpsoln" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "fieldconvert" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "changegrid" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "ascii2field" in directory /Users/kumarsambhava/channelflow/trunk/programs
linked by target "addfields" in directory /Users/kumarsambhava/channelflow/trunk/programs
-- Configuring incomplete, errors occurred!
See also "/Users/kumarsambhava/channelflow/build/CMakeFiles/CMakeOutput.log".
Cmake cannot find the hdf5 libraries. To fix this have a short look at <your channelflow path>/trunk/CMakeList.txt:
In line 116, 131, and 136 you find hard coded *.so libraries.
You can either change the suffix to *.dylib or create symlinks in the corresponding library paths.

Add directory containing pre compiled module in CMakeLists

I am modifying a CMakeLists.txt file for a fortran code. I need to add a directory that contains a precompiled module.
How can I do that in CMakeLists.txt ?
There is a target property called Fortran_MODULE_DIRECTORY
For good measure, I also add the module directory as an include directory. gfortran looks for .mod files in the include directories.
set_target_properties( Target PROPERTIES Fortran_MODULE_DIRECTORY "dir" )
target_include_directories(Target PUBLIC "dir" )
Edit
Reading through your question again, I see that the module you are interested in is already compiled. Fortran_MODULE_DIRECTORY specifies where to PUT .mod files, and adds that directory as a place to look for them. target_include_directories statement just specifies where to look for them. I am most familiar with using gfortran, which has this in it's man page:
-Idir
These affect interpretation of the "INCLUDE" directive (as well as of the "#include" directive of the
cpp preprocessor).
Also note that the general behavior of -I and "INCLUDE" is pretty much the same as of -I with
"#include" in the cpp preprocessor, with regard to looking for header.gcc files and other such things.
This path is also used to search for .mod files when previously compiled modules are required by a
"USE" statement.
-Jdir
This option specifies where to put .mod files for compiled modules. It is also added to the list of
directories to searched by an "USE" statement.
The default is the current directory.
This is what CMake will do for you and your compiler; you shouldn't need to specify these flags explicitly. In your case, just the includes should be sufficient, since the module has already been compiled.
However, if you find it's not working with your compiler, you may have to specify them manually by setting the variable CMAKE_Fortran_FLAGS.
Hope this helps.

I'm installing paraview from source. I don't have a previous installation but I get a CMake error

CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake
files:
/home/uma/projects/ParaView/VTK/IO/FFMPEG/FFMPEG_INCLUDE_DIR
used as include directory in directory
/home/uma/projects/ParaView/VTK/IO/FFMPEG
FFMPEG_avcodec_LIBRARY (ADVANCED)
linked by target "vtkIOFFMPEG" in directory
/home/uma/projects/ParaView/VTK/IO/FFMPEG
FFMPEG_avformat_LIBRARY (ADVANCED)
linked by target "vtkIOFFMPEG" in directory
/home/uma/projects/ParaView/VTK/IO/FFMPEG
FFMPEG_avutil_LIBRARY (ADVANCED)
linked by target "vtkIOFFMPEG" in directory
/home/uma/projects/ParaView/VTK/IO/FFMPEG
FFMPEG_swscale_LIBRARY (ADVANCED)
linked by target "vtkIOFFMPEG" in directory
/home/uma/projects/ParaView/VTK/IO/FFMPEG
I have all the required libraries installed. I followed http://www.paraview.org/Wiki/ParaView:Build_And_Install instructions for installing paraview. ccmake $HOME/projects/ParaView4 from ParaView-bin gave me the error. Any help is appreciated!
You've turned on PARAVIEW_ENABLE_FFMPEG but you don't have FFMPEG development modules installed or locatable by CMake. Either installed FFMPEG or turn off PARAVIEW_ENABLE_FFMPEG using ccmake or cmake-gui.

Resources