Bug #1027

building GMT documentation from scratch (gmt/trunk)

Added by Peter 2 months ago. Updated 19 days ago.

Status:NewStart date:2017-01-15
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Affected version:5.x-svn Platform:

Description

Hi

Over the end of last week I've downloaded the development version of GMT5 via svn to build the latest version and its documentation (script used for downloading and installation is attached as well as fetch log).

Installation of the executables went smoothly but I fail to build the documentation. I've discussed this with Joaquim in the forum (thread: Building GMT documentation) who eventually told me that this could be moved to an issue so here it is:

Running cmake i get the errors (see attached install log):

make: * No rule to make target `manpages_all'. Stop.
make: No rule to make target `gmt_pdf_manpages'. Stop.
make: No rule to make target `gmt_doc'. Stop.
make: * No rule to make target `gmt_doc_shrink'. Stop.

which explains why documentation and man pages are not built. Diving into the cmake file in <GMT_ROOT>/cmake/modules/GmtManpages.cmake where these rules are configured I find the the requirements for the rules to be set is the test HAVE_TRADITIONAL_CPP is successful.

Re-inspecting the install log I find that this test fails (note that it passes in the attached install log as explained below). The test HAVE_TRADITIONAL_CPP is defined in <GMT_ROOT>/cmake/modules/ConfigureChecks.cmake where it is defined as

if (NOT HAVE_TRADITIONAL_CPP)
    if (MSVC)
        # Visual C++
        set (_cpp_cmdline /EP)
    elseif (CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang|Intel)")
        # GCC, Clang, or ICC
        set (_cpp_cmdline -E -w -P -nostdinc -traditional-cpp)
    endif (MSVC)
    message (STATUS "Performing Test HAVE_TRADITIONAL_CPP")
    execute_process (COMMAND ${CMAKE_C_COMPILER} ${_cpp_cmdline}
        ${GMT_SOURCE_DIR}/config.h.in # can be any header file
        RESULT_VARIABLE _cpp_traditional_result
        OUTPUT_QUIET ERROR_QUIET)
    if (_cpp_traditional_result EQUAL 0)
        set (HAVE_TRADITIONAL_CPP TRUE CACHE INTERNAL "Test HAVE_TRADITIONAL_CPP")
        message (STATUS "Performing Test HAVE_TRADITIONAL_CPP - Success")
    else (_cpp_traditional_result EQUAL 0)
        set (HAVE_TRADITIONAL_CPP "" CACHE INTERNAL "Test HAVE_TRADITIONAL_CPP")
        message (STATUS "Performing Test HAVE_TRADITIONAL_CPP - Failed")
    endif (_cpp_traditional_result EQUAL 0)
endif (NOT HAVE_TRADITIONAL_CPP)

modyfing the above test to output the value of ${GMT_SOURCE_DIR}/config.h.in it turns out that this evaluates to <GMT_ROOT>config.h.in. However this file does not exists which explains the failing test. Instead the file <GMT_ROOT>/src/config.h.in exists so by modifying ${GMT_SOURCE_DIR}/config.h.in to ${GMT_SOURCE_DIR}/src/config.h.in the test HAVE_TRADITIONAL_CPP passes (install log attached for this case), but still no make rules to generate the documentation/manfiles

Digging deeper i venture again into <GMT_ROOT>/cmake/modules/GmtManpages.cmake and note that the condition to set up the missing make rules is if (HAVE_TRADITIONAL_CPP AND NOT _HAVE_EXTERNAL_MAN). Now, from the lines just above this line I note that the condition the second variable, _HAVE_EXTERNAL_MAN is set to TRUE is if (EXISTS ${GMT_INSTALL_EXTERNAL_MAN}) else it will be set to FALSE. The variable GMT_INSTALL_EXTERNAL_MAN can be set in <GMT_ROOT>/cmake/ConfigUser.cmake by un-commenting the preset command in there (ConfigUser.cmake that I use is attached). Still no rules to make manpages.

I've also tried dumping the values of the relevant variables from within <GMT_ROOT>/cmake/modules/GmtManpages.cmake, but with no luck indicating that either this file is never invoked or I fail to use the cmake function message() properly (worked nicely in other files though which leads me to suspect the first alternative). I may be noted here that greping for GmtManpages.cmake in all the files downloaded I found no instance where this is included, perhaps this is the source of my problems.

In any case, any help or further insight would be appreciated, perhaps I just doing something stupid as usual

regards Peter

UpdGMT5.sh Magnifier (2.55 KB) Peter, 2017-01-15 22:09

GMT5.install.log (65.4 KB) Peter, 2017-01-15 22:09

GMT5.fetch.log (99.8 KB) Peter, 2017-01-15 22:09

ConfigUser.cmake (10.6 KB) Peter, 2017-01-15 22:24

History

#1 Updated by Florian 2 months ago

I moved config.h.in to src in r13957 and did not modify cmake/modules/GmtManpages.cmake. The corresponding line in GmtManpages.cmake should read

${GMT_SOURCE_DIR}/src/config.h.in

as you already noted. But you are on a wrong trail because the macro gmt_create_manpages that used to process the manfiles is defunct and superseded by sphinx. We should remove the unused CMake macros to avoid confusion.

#2 Updated by Paul 19 days ago

Florian, I can certainly remove GmtManpages.cmake. is there anything else that needs to be modified once we remove it or is it completely unreferenced.

Also available in: Atom PDF