/media/bill/HOWELL_BASE/System_maintenance/cmake/0_cmake notes.txt cmake REQUIRES JSON https://www.cs.swarthmore.edu/~adanner/tips/cmake.php Andrew Danner, Associate Professor, Computer Science, Swarthmore College, Swarthmore, PA This document provides a quick overview to CMake — a cross-platform alternative to linux Makefiles and make. For help on using make and Makefiles without CMake, please see Prof. Newhall's documentation. This document was written for cmake version 2.6, which is installed on the lab machines via stow (as of Jan 2009). https://cmake.org/documentation/ https://cmake.org/cmake/help/v3.8/ - links to specific docs https://cmake.org/cmake/help/v3.8/manual/cmake.1.html - looks like "man cmake" ~/OPM $ echo $JSON >> nothing ~/OPM $ echo $CJSON >> nothing see "https://cmake.org/cmake/help/v3.8/manual/cmake.1.html" reference doc https://cmake.org/cmake/help/v3.8/manual/cmake-commands.7.html good list of commands for cmake script files https://cmake.org/cmake/help/v3.8/command/variable_watch.html variable_watch Watch the CMake variable for change. variable_watch( []) If the specified variable changes, the message will be printed about the variable being changed. If the command is specified, the command will be executed. The command will receive the following arguments: COMMAND( ) comment command - to output variables!!! (better than variable watch!?!?!) ************************ messages in "/home/bill/OPM/opm-common/cmake/Modules/FindSuiteSparse.cmake" : I inserted "messages" to show ENV values, and need to test them to see if syntax is correct. # 13Feb2017 Howell : Comments to see what the environment is message("Howell : environmental variables listing : ") message("ENV{SuiteSparse_DIR} : " "$ENV{SuiteSparse_DIR}") message("ENV{SuiteSparse_EXTRA_LIBS} : "$ENV{SuiteSparse_EXTRA_LIBS}") message("ENV{UMFPACK_INCLUDE_DIRS} : " "$ENV{UMFPACK_INCLUDE_DIRS}") message("ENV{UMFPACK_LIBRARY} : " "$ENV{UMFPACK_LIBRARY}") message("ENV{LAPACK_LIBRARIES} : " "$ENV{LAPACK_LIBRARIES}") message("ENV{BLAS_LIBRARIES} : " "$ENV{BLAS_LIBRARIES}") message("ENV{MATH_LIBRARY} : " "$ENV{MATH_LIBRARY}") Oh-Oh , jillions of errors like : Call Stack (most recent call first): /home/bill/OPM/opm-common/cmake/Modules/OpmFind.cmake:147 (find_package) /home/bill/OPM/opm-common/cmake/Modules/OpmPackage.cmake:279 (find_and_append_package_to) /home/bill/OPM/opm-common/cmake/Modules/Finddune-istl.cmake:14 (find_opm_package) /home/bill/OPM/opm-common/cmake/Modules/OpmFind.cmake:147 (find_package) /home/bill/OPM/opm-common/cmake/Modules/OpmFind.cmake:211 (find_and_append_package_to) /home/bill/OPM/opm-common/cmake/Modules/OpmLibMain.cmake:112 (find_and_append_package_list_to) CMakeLists.txt:109 (include) ... and CMake Warning (dev) at /home/bill/OPM/opm-common/cmake/Modules/OpmFind.cmake:147 (find_package): Syntax Warning in cmake code at /home/bill/OPM/opm-common/cmake/Modules/FindSuiteSparse.cmake:39:41 ... ~/OPM/opm-common/cmake/Modules $ grep message * AddOptions.cmake: #message (STATUS "Adding \"${_opt}\" to \${${_var}}") grep: compat-2.8.3: Is a directory grep: compat-2.8.5: Is a directory grep: compat-2.8.7: Is a directory ConfigVars.cmake: message (FATAL_ERROR "Syntax error in argument list") ConfigVars.cmake: message (FATAL_ERROR "Invalid target syntax \"${syntax}\"") ConfigVars.cmake: file (APPEND "${filename}" "\tmessage (WARNING \"Incompatible value \\\"${_db}${_var}}\\\" of variable \\\"${_var}\\\"\")\n") FindCxaDemangle.cmake:# prevent useless message from being displayed FindCXX11Features.cmake:#define DEP __attribute__((deprecated(\"message\"))) FindCXX11Features.cmake: message(FATAL_ERROR FindEigen3.cmake: message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " FindMETIS.cmake:# print a message to indicate status of this package Findopm-data.cmake: message(STATUS "Setting OPM_DATA_ROOT: ${OPM_DATA_ROOT}") Findopm-data.cmake: message(WARNING "opm-data not found - integration tests using opm-data will be skipped.") FindParMETIS.cmake: message(WARNING "MPI not found ==> ParMETIS disabled! Plase make sure -DUSE_MPI=ON was set if you need ParMETIS.") FindPETSc.cmake:# print message if there was still no blas found! FindPETSc.cmake: message(STATUS "BLAS not found but required for PETSc") FindPETSc.cmake:# print message if there was still no blas found! FindPETSc.cmake: message(STATUS "LAPACK not found but required for PETSc") FindPETSc.cmake: message(STATUS "Could not find a system provided MPI. Searching for PETSc provided mpiuni fallback implementation.") FindPETSc.cmake: message(WARNING "Could not find any MPI implementation. If PETSc is compiled with --with-mpi=0 this is ok. Otherwise you will get linker errors or (possibly subtle) runtime errors. Continuing.") FindPETSc.cmake: message("To build with MPI support, pass -DUSE_MPI=ON to CMake.") FindPETSc.cmake: message(STATUS "Could not find the PETSc library") FindQuadmath.cmake: message(FATAL_ERROR "Quadruple precision math support was explicitly requested but is unavailable!") FindSuiteSparse.cmake:message("Howell : environmental variables listing : ") FindSuiteSparse.cmake:message("ENV{SuiteSparse_DIR} : " "$ENV{SuiteSparse_DIR}") FindSuiteSparse.cmake:message("ENV{SuiteSparse_EXTRA_LIBS} : "$ENV{SuiteSparse_EXTRA_LIBS}") FindSuiteSparse.cmake:message("ENV{UMFPACK_INCLUDE_DIRS} : " "$ENV{UMFPACK_INCLUDE_DIRS}") FindSuiteSparse.cmake:message("ENV{UMFPACK_LIBRARY} : " "$ENV{UMFPACK_LIBRARY}") FindSuiteSparse.cmake:message("ENV{LAPACK_LIBRARIES} : " "$ENV{LAPACK_LIBRARIES}") FindSuiteSparse.cmake:message("ENV{BLAS_LIBRARIES} : " "$ENV{BLAS_LIBRARIES}") FindSuiteSparse.cmake:message("ENV{MATH_LIBRARY} : " "$ENV{MATH_LIBRARY}") FindSuiteSparse.cmake:# print a message to indicate status of this package FindSuiteSparse.cmake:# add these after checking to not pollute the message output (checking for FindSuiteSparse original.cmake:# print a message to indicate status of this package FindSuiteSparse original.cmake:# add these after checking to not pollute the message output (checking for FindSuperLU.cmake:# print message if there was still no blas found! FindSuperLU.cmake: message(STATUS "BLAS not found but required for SuperLU") FindSuperLU.cmake: message(STATUS "Directory with the SuperLU include files not found") FindSuperLU.cmake: message(STATUS "Directory with the SuperLU library not found") FindUG.cmake: message(STATUS "Could not find UG. It seems to be not installed.") FindUG.cmake: message(WARNING "Could not find file ug-config.cmake relative to given UG_ROOT") FindUG.cmake: message(WARNING "UG was not configured for DUNE. Did pass --enable-dune to its configure?") FindZOLTAN.cmake:# print a message to indicate status of this package LibtoolArchives.cmake: # (you get an error message about argument not parsed). translate each LibtoolArchives.cmake: message (STATUS "Libtool not found!") LibtoolArchives.cmake: message (STATUS "Writing libtool archive for ${target}") OpmCompile.cmake: message (STATUS "Precompiled headers: ${${opm}_CXX_pch}") OpmDefaults.cmake: message (STATUS "Precompiled headers: disabled") OpmDefaults.cmake: #message ("Setting ${name} to \"${${name}}\" in cache.") OpmFind.cmake: message (STATUS "Finding package ${name} using config mode") OpmFind.cmake: message (STATUS "Finding package ${name} using module mode") OpmLibMain.cmake: message (STATUS "Enabling compatibility modules for CMake 2.8.3") OpmLibMain.cmake: message (STATUS "Enabling compatibility modules for CMake 2.8.5") OpmLibMain.cmake: message (STATUS "Enabling compatibility modules for CMake 2.8.7") OpmLibMain.cmake:message (STATUS "Build type: ${CMAKE_BUILD_TYPE}") OpmLibMain.cmake:message (STATUS "Writing config file \"${PROJECT_BINARY_DIR}/config.h\"...") OpmLibMain.cmake:message (STATUS "This build defaults to installing in ${CMAKE_INSTALL_PREFIX}") OpmLibMain.cmake: message (STATUS "${name} test disabled, since ${name} is not found.") OpmPackage.cmake: message (STATUS "Failed to find library \"${_lib}\" for module ${module}") OpmPackage.cmake: message (WARNING "Empty dependency in find module for ${module} (check for trailing semi-colon)") OpmPackage.cmake: # write status message in the same manner as everyone else OpmPackage.cmake: message (STATUS "${module}_DIR = ${${module}_DIR}") OpmPackage.cmake: message (STATUS "${module}_ROOT = ${${module}_ROOT}") OpmPackage.cmake: message (STATUS "${MODULE}_ROOT = ${${MODULE}_ROOT}") OpmPackage.cmake: message (STATUS "${module} prereqs: ${${module}_ALL_PREREQS}") OpmPackage.cmake: message (STATUS "${module}_FOUND = ${${module}_FOUND}") OpmPackage.cmake: message (STATUS "${module}_INCLUDE_DIRS = ${${module}_INCLUDE_DIRS}") OpmPackage.cmake: message (STATUS "${module}_LIBRARIES = ${${module}_LIBRARIES}") OpmPackage.cmake: message (STATUS "${module}_DEFINITIONS = ${${module}_DEFINITIONS}") OpmPackage.cmake: message (STATUS "${module}_CONFIG_VARS = ${${module}_CONFIG_VARS}") OpmPackage.cmake: message (STATUS "${module}_LINKER_FLAGS = ${${module}_LINKER_FLAGS}") OpmPackage.cmake: message (STATUS "HAVE_${MODULE} = ${HAVE_${MODULE}}") UseCompVer.cmake: message (STATUS "GNU C++ compiler version: ${version}") UseCompVer.cmake: message (STATUS "Linker: ${version}") UseDebugSymbols.cmake: message (STATUS "Generating debug symbols: ${_dbg_flag}") UseDebugSymbols.cmake: message (STATUS "Looking for strip utility") UseDebugSymbols.cmake: message (STATUS "Looking for strip utility - found") UseDebugSymbols.cmake: message (WARNING "Looking for strip utility - not found") UseDuneVer.cmake: message (FATAL_ERROR "Failed to locate dune.module for ${suite}-${module} (looking for ${_searched_paths})") UseDuneVer.cmake: message (STATUS "Version ${_major}.${_minor}.${_revision} of ${suite}-${module} from ${_dune_mod}") UseFortranWrappers.cmake: message (FATAL_ERROR UseFortranWrappers.cmake: message (FATAL_ERROR UseFortranWrappers.cmake: message (STATUS "Assuming Fortran externals have underscore suffix") UseFortranWrappers.cmake: message (STATUS "Fortran/C interface not activated") UseOpenMP.cmake: message (STATUS "OpenMP: disabled") UsePrecompHeaders.cmake: message (FATAL "Third token to precompile_header shoulde be \"HEADER\"") UsePrecompHeaders.cmake: message (FATAL "Fifth token to precompile_header should be \"TARGET\"") UsePrecompHeaders.cmake: message (FATAL "Seventh token to precompile_header should be \"FLAGS\"") UsePrecompHeaders.cmake: message (FATAL "Only C or C++ can have precompiled headers") UseSystemInfo.cmake: message (STATUS "CMake version: ${CMAKE_VERSION}") UseSystemInfo.cmake: message (STATUS "Linux distribution: ${DISTRO_NAME}") UseSystemInfo.cmake: message (STATUS "${OS_VERSION}") UseSystemInfo.cmake: message (STATUS "Operating system: ${CMAKE_SYSTEM}") UseSystemInfo.cmake: message (STATUS "Target architecture: ${TARGET_CPU}") UseSystemInfo.cmake:# preprocessor symbols and communicate this back to us through an error message(!) UseVCSInfo.cmake: message (STATUS "Source code repository: ${VCS_SYSTEM} ${VCS_SHA1}${VCS_DECOR}") UseVCSInfo.cmake: message (STATUS "Source code repository: not found!") UseVersion.cmake:message("-- Writing version information to local header project-version.h") UseVersion.cmake: message (AUTHOR_WARNING UseWarnings.cmake: message (STATUS "All warnings enabled: ${_warn_flag}") Maybe use simple form like : UseSystemInfo.cmake: message (STATUS "Operating system: ${CMAKE_SYSTEM}") >> So I convereted mesages to : # 13Feb2017 Howell : Comments to see what the environment is message(STATUS "Howell : environmental variables listing : ") message(STATUS "ENV{SuiteSparse_DIR} : ${SuiteSparse_DIR}") message(STATUS "ENV{SuiteSparse_EXTRA_LIBS} : ${SuiteSparse_EXTRA_LIBS}") message(STATUS "ENV{UMFPACK_INCLUDE_DIRS} : ${UMFPACK_INCLUDE_DIRS}") message(STATUS "ENV{UMFPACK_LIBRARY} : ${UMFPACK_LIBRARY}") message(STATUS "ENV{LAPACK_LIBRARIES} : ${LAPACK_LIBRARIES}") message(STATUS "ENV{BLAS_LIBRARIES} : ${BLAS_LIBRARIES}") message(STATUS "ENV{MATH_LIBRARY} : ${MATH_LIBRARY}") # enddoc