diff --git a/README.md b/README.md index 5bd90e040e63819743367dcefdab6b42566929a4..d6d57a3dbce9fad9ae4945aac066cfc1b61e9e1f 100644 --- a/README.md +++ b/README.md @@ -47,39 +47,60 @@ Ensure that the OpenFOAM environment is active and that ParaView or Catalyst can be found (Eg, the `ParaView_DIR` environment is properly set). -### With the OpenFOAM `wmake` +### To install in the normal OpenFOAM directories (using `wmake`) Simply use the supplied `Allwmake` script: ```` ./Allwmake ```` -This will install into `$FOAM_LIBBIN` +This will install the library under +`$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib`, +which corresponds to the `$FOAM_LIBBIN` location. -### With `cmake` directly +### To install in arbitrary locations (using `cmake`) -Without parameters, it installs to `$FOAM_LIBBIN` as the default output -location for the library. +Without parameters, it installs to `/usr/local` as the default location. +This can be changed as required with the cmake `CMAKE_INSTALL_PREFIX` +parameter. ```` mkdir build; cd build -cmake ../src/catalyst +cmake -DCMAKE_INSTALL_PREFIX=/install/path ../src/catalyst ```` -which is identical to + +The installation using the `./Allwmake` script can be replicated with +either of these commands: + ```` mkdir build; cd build -cmake -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=default ../src/catalyst +cmake -DCMAKE_INSTALL_PREFIX=$WM_PROJECT_DIR/platforms/$WM_OPTIONS ../src/catalyst +make install ```` - -To specifying an alternative library location, change the cmake parameter: - +or ```` mkdir build; cd build -cmake -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/output/path/lib ../src/catalyst +cmake -DCMAKE_INSTALL_PREFIX=${FOAM_LIBBIN%/*} ../src/catalyst +make install ```` -The cmake configuration possibilities are functional, but still very -**rudimentary** at the moment. + +### Where to start + +Look at the tutorials cases to get an idea of how different things +might be done. Know what types of inputs your particular Catalyst +function object is producing. The `writeAll.py` script included as +part of the normal OpenFOAM distribution provides a good starting point +for examing your output, but also for generating initial data sets for +your pipelines. Use the script generation capabilities within ParaView +to generate your pipelines. Save a backup of your pipelines as `pvsm` +state files so that you can go back and tweak your pipelines without +manually editing the python scripts and introducing possible errors. + +Be aware that there may be some combinations of pipelines or +annotations that misbehave. If you encounter such a problem, try +backing out various pieces to isolate the cause. If it does appear to be +a reproducible error, test it on a tutorial example too. ## Authors diff --git a/src/catalyst/Allwmake b/src/catalyst/Allwmake index 3ee577adf65564ab81a7534644b27e154ed4b457..0dcd54ad4b167b0b00528de8fbcdc5b01939be51 100755 --- a/src/catalyst/Allwmake +++ b/src/catalyst/Allwmake @@ -3,12 +3,14 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The cmake functions # CMake into objectsDir with external dependency -# - This function override can be removed with OpenFOAM-1806 -cmakeVersioned() +# - Can this function can be removed with OpenFOAM-1812 ? +unset -f cmakeVersionedInstall 2>/dev/null +cmakeVersionedInstall() { local depend="$1" local sourceDir="$2" local objectsDir + shift 2 # Where generated files are stored objectsDir=$(findObjectDir "$sourceDir") || exit 1 # Fatal @@ -18,7 +20,7 @@ cmakeVersioned() rm -rf "$objectsDir" > /dev/null 2>&1 mkdir -p $objectsDir \ - && (cd $objectsDir && _cmake $sourceDir && make) \ + && (cd $objectsDir && _cmake "$@" $sourceDir && make install) \ && echo "$depend" >| "${sentinel:-/dev/null}" } @@ -28,6 +30,16 @@ echo "======================================================================" echo "${PWD##*/} : $PWD" echo +# For FOAM_LIBBIN +cmakeOpts="-DCMAKE_INSTALL_PREFIX=$WM_PROJECT_DIR/platforms/$WM_OPTIONS" + +# or +# cmakeOpts="-DCMAKE_INSTALL_PREFIX=${FOAM_LIBBIN%/*}" + +# For FOAM_USER_LIBBIN +# cmakeOpts="-DCMAKE_INSTALL_PREFIX=${FOAM_USER_LIBBIN%/*}" + + unset depend if [ -d "$ParaView_DIR" ] then @@ -40,7 +52,7 @@ then then if command -v cmake > /dev/null 2>&1 then - cmakeVersioned "$depend" $PWD || { + cmakeVersionedInstall "$depend" $PWD "$cmakeOpts" || { echo echo " WARNING: incomplete build of ParaView Catalyst" echo diff --git a/src/catalyst/CMakeLists-Catalyst.txt b/src/catalyst/CMakeLists-Catalyst.txt index d0068c997a61d5e458c7214c347ececf3055a585..00cf60e471928927312bdad0a22ac96df9207608 100644 --- a/src/catalyst/CMakeLists-Catalyst.txt +++ b/src/catalyst/CMakeLists-Catalyst.txt @@ -49,12 +49,6 @@ link_directories( set(CMAKE_BUILD_TYPE Release) -set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - CACHE INTERNAL - "" -) - - file(GLOB SOURCE_FILES catalystCoprocess.C catalystTools.C @@ -107,4 +101,6 @@ target_link_libraries( ${OPENFOAM_LIBRARIES} ) +install(TARGETS catalystFoam DESTINATION lib) + #----------------------------------------------------------------------------- diff --git a/src/catalyst/CMakeLists.txt b/src/catalyst/CMakeLists.txt index edfa5adbea9d4f19a4e15429b1b47c5fd3690bb4..cb734ec15345a82127ac5651da90b01e7d3ba88c 100644 --- a/src/catalyst/CMakeLists.txt +++ b/src/catalyst/CMakeLists.txt @@ -26,16 +26,6 @@ else() endif() -#------------------------------------------------------------------------------ -# Installation locations (not much) -# - default install into FOAM_LIBBIN - -if ((NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) OR - ("${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "default")) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $ENV{FOAM_LIBBIN}) -endif() - - #----------------------------------------------------------------------------- # All messages @@ -45,7 +35,7 @@ message("Using ParaView = $ENV{ParaView_DIR}") if (NOT PARAVIEW_USE_MPI) message(WARNING "==== Recommended to build using ParaView Catalyst with MPI ====") endif() -message("install libdir = ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") +message("install prefix = ${CMAKE_INSTALL_PREFIX}") message("================")