Generating AUNIT documentation fails: pdflatex: no such file or directory

To be honest, I don’t know if this is the right place for my question, but anyway.

Environment: MSYS2/MINGW64 on Windows10
MSYS2 packages updated to latest version
Downloaded and unzipped aunit-25.0.0.zip from the AdaCore Github repo
Did a successful ‘make’ and ‘make install’

Then for documentation, I did a ‘make doc’
First pass:

  • no sphinx-builder; apparently there is a Python package for that, so needed python-pip for min64; - installed pip; using ‘pip install sphinx’ learned that I need a Python venv;
  • modified PATH so that the python and pip of the venv were first in the search order
  • created that venv and installed sphinx into that venv

Second pass of ‘make doc’:

  • pdflatex is missing; back to pip and did ‘pip install pdflatex’. (Note: I focused on the PDF output.)

Third pass of ‘make doc’:

  • result of make is ‘pdflatex: no such file or directory’; indeed there is no executable pdflatex on PATH

Fourth pass:

  • From the pdflatex · PyPI website I copied the Python statements to generate a PDF filke and fed then to Python;
  • final result: FileNotFoundError: [WinError 2] The system cannot find the file specified (when trying to call ‘_winapi.CreateProcess(executable, args,’
  • and yes, in the example on the mentioned website I changed ‘my_file.tex’ to ‘aunit_cb.tex’ AND I was in the right directory before feeding it into Python.

Remark:
This is all a very very unsatisfying process. Nowhere did I found any information on the prerequisites to create the documentation using the make/Makefile. This is all a big hindrance for people like me who are not intimate familiar with the GNAT ecosystem and very off putting.

That said, my question is: How to proceed to generate the PDF documentation using the Makefile. (Sure, online there is the HTML version, but I want a local PDF version.)

Regards, Rob

Pdflatex has nothing to do with python or Ada. For windows, look at miktex.org. But not sure you’ll want to install a whole latex distribution just to generate some PDF documentation.

2 Likes

I don’t know about generating the PDF docs, but you can get a PDF of the live documentation from: https://docs.adacore.com/live/wave/aunit/pdf/aunit_cb/aunit_cb.pdf

Thanks Damaki, for the time being that will do. But it leaves with a gnawing feeling in my head that wants to solve this “problem” / challenge.

So I hope that someone can help me get rid of that gnawing feeling

Hi @RobG9876,

since you are using MSYS2, then you want to install texlive, which is the “Linux” distribution of LaTeX. The package that will solve most/all dependencies is https://packages.msys2.org/packages/mingw-w64-x86_64-texlive-latex-recommended. Thix points to the mingw variant, install the MSYS2 variant that you use.

Best regards,
Fer

Hi Fer,

Thanks for the link and pointing me in that direction. However, I’m sorry, but I don’t think that is the right package. On the MSYS2 packages site you can find that package and it contents. It doesn’t have a pdflatex.exe. Then I stumbled on the package https://packages.msys2.org/packages/mingw-w64-x86_64-texlive-bin and that does contain a pdflatex.exe (and a whole lot of other stuff). Right now I don’t have the time to install that package and try it, I will do that asap and give feedback on the results.

Best regards,
Rob

Just as explanation, the package I recommended is a “metapackage”. It is there to pull in the most commonly used LaTeX packages, among them, there is the texlive-bin, which is the base one required to have a minimum LaTeX setup. So your package would have also been pulled :wink:

Best,
Fer

You won’t be able to use pdflatex without latex, so you’ll still need texlive or miktex. I glanced at AUnit and it seems they export to multiple formats, so you may want to consider exporting documentation to a different format, then converting that to PDF.

1 Like

Hi John, Fer,

Thanks for your help. I was able to successfully generate the HTML documentation. BUT I DO need an Python (virtual) environment with Sphinx-Build to do that.

For now I postpone my PDF-generating efforts. Pulling in the complete LaTex into MSYS2 just doesn’t seem worth the effort and disk space. And then I guess I still need Python/Sphinx-Build.

Still, I think that when there is no additional information on the prerequisites (like needed packages, or a Python environment) a Makefile like this should run put of the box.

Best regards,
Rob

I agree. You should consider submitting an issue that they update the README, or even a PR.