Sorry, this content is no longer available

Ask Your Question
3

Unable to build documentation [closed]

asked Feb 21 '13

kebs gravatar image

updated Feb 21 '13

I have successfully build Opencv2.4.4, with:

cmake -D CMAKE_BUILD_TYPE=RELEASE ..

Now, a couple of days later, I want to build documentation for offline reading. After rerunning cmake, I notice the following output:

-- 
--   Documentation:
--     Build Documentation:         NO
--     Sphinx:                      NO
--     PdfLaTeX compiler:           /usr/bin/pdflatex
--

I couldn't find anywhere a list of valid options for cmake, so I had a look inside the file CMakeLists.txt, where I notice that the corresponding option seems to be called BUILD_DOCS.

So I try again cmake:

cmake -D BUILD_DOCS=YES -D CMAKE_BUILD_TYPE=RELEASE ..

or even:

cmake -D BUILD_DOCS=ON -D CMAKE_BUILD_TYPE=RELEASE ..

But, no, the cmake output keeps saying it won't build doc. And funnily , it seems that this option should be enabled by default (line 154) :

OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON )

However, after checking indepth the Cmakelists.txt file (line 807), it seems that is is indeed possible to build html and pdf versions of doc ?

So my questions are:

  • Is is possible to build doc without Sphinx ?
  • If yes, how can I force cmake to generate the "doc" target ?

(And, yes, in the meanwhile I got the online pdf files, but the question remains.)

Preview: (hide)

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-09-26 07:36:22.673630

2 answers

Sort by » oldest newest most voted
7

answered Feb 21 '13

updated May 27 '13

Abid Rahman K gravatar image

You need to install Sphinx. It is main tool for building docs. Also, documentation is not included to all target of make. You need make docs to build documentation in pdf format and make html_docs to build html documentation same as on docs.opencv.org. If you want to build pdf some additional font packages are needed also.

Preview: (hide)

Comments

Thanks, that's a clear answer, although it is to me contradictory with CMakeLists.txt:835, that states: "status("Build Documentation:" PDFLATEX_COMPILER THEN YES ELSE "YES (only HTML and without math expressions)")". As I have the latex compiler, I expected it to say "YES", thus my incomprehension. But maybe that was just something that was planned and that eventually didn't work. (I'm not very good with cmake)

kebs gravatar imagekebs (Feb 22 '13)edit

+1 - make docs is mentioned no where, I think. Thank you.

Abid Rahman K gravatar imageAbid Rahman K (May 27 '13)edit

Even after installing sphinx, the doc build will not work after a new cmake. There is a problem in cmake/OpenCVDetectPython.cmake. The line

if(SPHINX_OUTPUT MATCHES "^Sphinx v([0-9][^ \n]*)")

does not work correctly. Only if I force SPHINX_VERSION to 1.2 (my version) the documentation will built (both HTML and PDF).

The problem is related to executing sphinx-build, which returns a multi-line response, which includes the Sphinx version as the second line. I guess the MATCHES statement does not handle that correctly (I am not a cmake expert, though).

I am using the git procedure to build from source (2.4).

ggl gravatar imageggl (Jul 2 '13)edit

I recommend you to create a ticket on OpenCV issue tracker (http://code.opencv.org). Also, if you know appropriate solution, you can contribute it via pull request on Github. Contributor instruction are published in wiki on issue tracker.

if you are on MAC OS X using BREW consider this for sphinx: https://gist.github.com/terenceponce/3786784

nkint gravatar imagenkint (Jan 29 '14)edit

make html_docs make many html documents but make install don't install it . what html docs are important to belongs to an rpm package ?

sergiomb gravatar imagesergiomb (Jul 14 '15)edit
0

answered Aug 21 '13

Damilola gravatar image

updated Aug 21 '13

After installing sphinx, open cmake/OpenCVDetectPython.cmake and replace line if(SPHINX_OUTPUT MATCHES "^Sphinx v([0-9][^ \n])") With if(SPHINX_OUTPUT MATCHES "Sphinx v([0-9][^ \n])") and it would work perfectly

Preview: (hide)

Comments

Hi I'm using opencv 2.4.9 with VS 2012.I just installed Sphinx-1.2.3.win-amd64-py2.7.exe to my computer but when making an installation,it said that i don't have python version 2.7! I need to download python version 2.7 and this problem will be solved?? I am very new to opencv and i need a lot of help!!

littleduck gravatar imagelittleduck (Dec 24 '14)edit

Question Tools

1 follower

Stats

Asked: Feb 21 '13

Seen: 4,985 times

Last updated: Aug 21 '13