How to use Sphinx to generate PDF - macos

I am trying to learn Sphinx documentation creating tool. I am able to generate html documentation. Now, in order to create an off-line version of the (html) documentation, I have been trying to generate pdf file from my project.
Towards that goal, so far I have tried the following (using resources available on the web including the Sphinx docs):
Added the following to conf.py:
# conf.py options for Latex
latex_engine = 'pdflatex'
latex_elements = {
'papersize': 'a4paper',
'pointsize': '10pt',
}
Subsequently used the command make latexpdf in the terminal, whereupon I got the following messages in the terminal:
/Users/.../.../.../.../.../urls.py:docstring of lead.urls:5: WARNING: Definition list ends without a blank line; unexpected unindent.
/Users/.../urls.py:docstring of lead.urls:7: WARNING: Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
processing lead.tex... index modules/...
resolving references...
done
writing... done
copying TeX support files... copying TeX support files...
done
build succeeded, () warnings.
The LaTeX files are in _build/latex.
Run 'make' in that directory to run these through (pdf)latex
(use `make latexpdf' here to do that automatically).
latexmk -pdf -dvi- -ps- 'lead.tex'
make[1]: latexmk: No such file or directory
make[1]: *** [lead.pdf] Error 1
make: *** [latexpdf] Error 2
A new folder latex was created with a number of files in them including one with the name <project_name>.tex (lead.tex in the error log above) and one batch file make.bat among them.
However, running the command make only produces the following error:
latexmk -pdf -dvi- -ps- 'lead.tex'
make: latexmk: No such file or directory
make: *** [lead.pdf] Error 1
Following some leads (materials available on the web) on latexmk, tried to install BasicTex package from the Tex site.
However, the package available is only for macOs 10.13 and higher. I am on 10.12.6.
So I am stuck. Can somebody please let me know if there is any solution to my predicament?

https://www.tug.org/mactex/faq/3-4.html worked for me while on macOS 10.12.6.

Related

Pachi cant find caffe/caffe.hpp: No such file or directory

I am attempting to compile Go/Baduk engine Pachi (https://github.com/pasky/pachi) with Caffe (http://caffe.berkeleyvision.org) support.
Caffe install is OK and its located in /something/PACHI_GO_ENGINE/caffe/
caffe.hpp is located in:
/something/PACHI_GO_ENGINE/caffe/distribute/include/caffe/caffe.hpp
/something/PACHI_GO_ENGINE/caffe/include/caffe/caffe.hpp
I also updated the Pachi Makefile as instructed:
- Edit Makefile, set DCNN=1, point it to where caffe is installed and build.
I even made a copy of ...include/caffe/ to /usr/local/lib because this supposed to be a default location.
Makefile changes:
DCNN=1
#CAFFE_LIB=/usr/local/lib
CAFFE_LIB=/something/PACHI_GO_ENGINE/caffe/distribute/include
#(and several variations of this)
And I still get:
[CC] fbook.c
[CC] chat.c
[CXX] dcnn.cpp
dcnn.cpp:13:27: fatal error: caffe/caffe.hpp: No such file or directory
compilation terminated.
Makefile.lib:78: recipe for target 'dcnn.o' failed
make: *** [dcnn.o] Error 1
CAFFE_LIB variable is to point to the path where caffe.so or caffe.a is present. In your case, the dcnn.cpp cannot find the header files.
Though the header files are present in /something/PACHI_GO_ENGINE/caffe/distribute/include they won't be detected by pachi because, header file paths are mentioned using the variable INCLUDES. You will have to append this path to the INCLUDES variable and not the CAFFE_LIB.

Cutecom installation fails on OSX Mavericks

I'm trying to install cutecom on OSX Mavericks but I'm getting some erros.
Here are the steps that I followed.
install qt through brew
brew install qt
update path on .bashprofile
export PATH=/usr/local/Cellar/qt/4.8.6/bin:$PATH
extract files of cutecom
compile source code of cutecom
$ mkdir build
$ cd build
$ cmake ..
$ make
And the output of make is:
[ 20%] Generating ui_cutecommdlg.h
/Users/kc/Downloads/cutecom-0.22.0/cutecommdlg.ui: Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. This requires Qt 3 support, which is disabled. The resulting code will not compile.
[ 40%] Generating moc_qcppdialogimpl.cxx Scanning dependencies of target cutecom
[ 60%] Building CXX object CMakeFiles/cutecom.dir/main.cpp.o
In file included from /Users/kc/Downloads/cutecom-0.22.0/main.cpp:21:
In file included from /Users/kc/Downloads/cutecom-0.22.0/qcppdialogimpl.h:22:
/Users/kc/Downloads/cutecom-0.22.0/build/ui_cutecommdlg.h:12:10: fatal error:
'Qt3Support/Q3MimeSourceFactory' file not found
#include <Qt3Support/Q3MimeSourceFactory>
^
1 error generated.
make[2]: *** [CMakeFiles/cutecom.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/cutecom.dir/all] Error 2
make: *** [all] Error 2
Any suggestions ?
Thank you very much for your time.
Kostas.
The Qt package you have is missing Qt3Support (on purpose). This component is necessarily for some Qt4 software that still uses deprecated features dating back to Qt3.
Based on the documentation I've been able to find online, you should be able to reinstall Qt4 with the extras you need using a command like this:
brew install --with-qt3support qt

Unable to get automake to build .proto files into .pb.cc files with google protocol buffers

I've been trying to get automake to automagically determine how to build .pb.cc and .pb.hh files from a google protocol buffers .proto description, but have had no luck.
I've tried using this post on SO, but it still doesn't work.
Here's an excerpt from my Makefile.am:
PROTOC=#ac_protoc_cmd#
%.pb.h %.pb.cc: %.proto
$(PROTOC) --proto_dir=$(srcdir)/proto --cpp_out=$(srcdir) $(srcdir)/proto/$<
libtass_a_SOURCES = \
$(srcdir)/tass.pb.cc
nobase_include_HEADERS = \
$(srcdir)/tass.pb.h
Upon attempting to run make, I get:
> Making all in src
> make[1]: Entering directory `/project/tass/src'
> make[1]: *** No rule to make target `tass.pb.cc', needed by `tass.pb.o'. Stop.
> make[1]: Leaving directory `/project/tass/src'
> make: *** [all-recursive] Error 1
ac_proto_cmd is filled in with the path to the protoc binary by configure.ac when it does a check for the GPB dependency. I've verified it's of the form "/opt/common/protobuf/-VERSION-/bin/protoc" which is where I keep the GPB library.
I'm trying to keep my .proto files in src/proto, and to have protoc spit out the compiled cc and h files into src. However, even moving my .proto files into src/ doesn't work, so I don't think that's the problem. As far as I can tell, make isn't even attempting to invoke protoc, so I'm not sure that the rule is being interpreted correctly at all by make.
Thanks in advance for any help on this.
There's no protoc argument named --proto_dir. I expect you meant --proto_path.
The problem here is the build dependencies, because automake finds dependencies as a side effect of compilation (see http://www.gnu.org/software/automake/manual/html_node/Sources.html for the explaination of the workaround) so you have to add this line:
BUILT_SOURCES = $(srcdir)/tass.pb.cc

Cygwin make error

I was compiling a source code, and it always fails at make command, below is the error message.
gcc: unrecognized option '-rdynamic'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: \
warning: --export-dynamic is not supported for PE targets, \
did you mean --export-all-symbols?
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: \
warning: --export-dynamic is not supported for PE targets, \
did you mean --export-all-symbols?
make[3]: Leaving directory `/home/alimjan/slim502/src'
make[2]: Leaving directory `/home/alimjan/slim502/src'
make[1]: Leaving directory `/home/alimjan/slim502/src'
Making all in lib
make[1]: Entering directory `/home/alimjan/slim502/lib'
Cannot execute /bin/lmntal
Makefile:422: recipe for target `config.il' failed
make[1]: *** [config.il] Error 1
make[1]: Leaving directory `/home/alimjan/slim502/lib'
Makefile:293: recipe for target `all-recursive' failed
make: *** [all-recursive] Error 1
(Above lines broken to display)
I could not solve this. I am new to make and don't know what to do?
Usually when a makefile output looks as severe as your output, then it is because of the environment of which it is being used on has changed -- it could perhaps be that some external files have been moved or deleted or it could be that the make is too big, especially if the make is recursive in nature ( stay away from recursive makefiles; go NR)
Anyway if I where you I would look into where the environment had changed -- perhaps if your project is in a version system - try a different branch
Trying to solve the problems in the makefile could be very difficult and so it is better to go back to a version that worked and then move on from there
I'm not really sure this is a problem with the makefile. The error is:
Cannot execute /bin/lmntal
I'm fairly sure if you tried to run "/bin/lmntal" yourself from the command line you'd get a similar error. It seems that your build requires some extra utility in order to run, that you don't have or which isn't working on your system. Does that file (/bin/lmntal) exist? Is it executable? Is it a script and if so, does the first line refer to an interpreter that exists and is executable? Is it a 32bit program (use file /bin/lmntal) while you're using a 64bit operating system and if so, do you have the 32bit versions of libc, etc. installed on your Ubuntu system? Or vice versa (if you have a 32bit Ubuntu and the utility is a 64bit program you won't be able to run it at all)?
Alternatively it could be that this program is supposed to be found somewhere else or named something else, and your makefile is at fault because some variables are not set; for example the makefile could say something like $(FOODIR)/bin/lmntal and for some reason the variable $(FOODIR) is not set.
If you provide the details above (file exists? Permissions? file output? Complete rule at line 422 of the makefile?) we can provide more help.

installing isolated gcc on server without sudo

I have access to a server (but don't have root permissions on there). To cut a long story short the admin won't upgrade to the newer version of gcc that I need, but has suggested that I can just install it locally.
I'm having some issues doing this, despite trying to follow the guide at http://gcc.gnu.org/install/index.html. I want to use the new versions of GMP, MPFR, and MPC that are installed now on the server.
I first go into my home dir on the server then mkdir mygcc which I then cd into (this is to be the build dir and is not a sub-dir of src dir), from there I do
/home/username/gcc-4.6.3/configure --with-gmp="/software/gmp-5.0.5" --with-
gmp-include="/software/gmp-5.0.5/include" --with-gmp-lib="/software/gmp-5.0.5/lib"
--with-mpfr="/software/mpfr-3.1.1" --with-mpfr-include="/software/mpfr-3.1.1/include"
--with-mpfr-lib="/software/mpfr-3.1.1/lib" --with-mpc-include="/home/username/usr/local
/include" --with-mpc-lib="/home/username/usr/local/lib" --prefix="/home/username/mygcc"
--with-local-prefix="/home/username/usr/local"
the src files that I unzipped are at /home/pmxlh1/gcc-4.6.3.
I also made the directories /home/username/usr/include, /home/username/usr/local etc and set the prefix flags to try and install various things there, but it also fails if I just leave those flags out for the same reasons.
When I get to make however it ends with
checking for suffix of object files... configure: error: in `/home/pmxlh1/mygcc/x86_64-
unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/pmxlh1/mygcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/pmxlh1/mygcc'
make: *** [all] Error 2
Not sure if I'm going about this the correct way? But basically I want to install it in my home/dir and so that it uses the correct GMP/MPFR/MPC not the old versions that maybe lurking elsewhere on the server.
thanks for any help

Resources