958e88b05a5d88368c23ea460aa8a3627e2217ef
[goodguy/cin-manual-latex.git] / parts / Installation.tex
1 \chapter{Installation}
2 \label{cha:Installation}
3 \section{How to Build \CGG{} from Developer's Git Repository}%
4 \label{sec:How_to_build}
5
6 These are generic build instructions for building \CGG{} Infinity.
7 Known to work on Ubuntu, Mint, OpenSuse, Fedora, Debian, Centos,
8 Arch, Slackware, and Gentoo.  It has not been tested on every
9 single possible distro yet so you might expect to have to make
10 some minor changes.  Also works on a somewhat limited basis on
11 FreeBSD and Windows 10 with the bsd.patch for FreeBSD and the
12 cygwin.patch for Windows 10.
13
14 Alternatively, there are some pre-built dynamic or static binaries
15 which are updated on a fairly regular basis (as long as code changes
16 have been made) available at the link below.
17 \begin{center}
18   \href{https://cinelerra-gg.org/download/}{https://cinelerra-gg.org/download/}
19 \end{center}
20
21 Because there are many references to "git" in this section, it is
22 assumed that the user is somewhat familiar with its use.  Because
23 "git" has more than 130 commands and is Open Source, it is well
24 documented so for problems in usage, please refer to those.
25
26 There are 2 kinds of builds, the default system-build and a
27 single-user build.  A system build has results which are installed
28 to the system.  The majority of the files are installed in the
29 standard system paths, but some customization is possible.  The
30 single user build allows for running completely out of a local
31 user directory so it doesn't affect the system.
32
33 We recommend the single-user version when possible.  It makes it
34 very easy to install a new version without having to delete the
35 older version in case you want it for backup -- once you are happy
36 with the new version, all you have to do is delete the entire old
37 directory path.  Another reason for using single-user is that if
38 you install a new Operating System version and if you have \CGG{}
39 on separate disk space that is preserved, you won't have to
40 reinstall \CGG{}.  It is also convenient for the purpose of having
41 the ability to interrupt or to see any possible error messages, if
42 you start the application from a terminal window command line
43 where you will have more control to catch problems.  All that
44 said, the system builds can be useful in a university lab setting
45 where there are possibly multiple users, or multiple versions.
46
47 There are two notable differences between \textit{standard} views
48 of \CGG{} and this implementation for the system builds.  Both of
49 these can be configured during installation.  The differences make
50 it possible to have several different versions installed without
51 having them \textit{walk} on each other.
52
53 \begin{enumerate}
54 \item application name can be set during installation and defaults
55   to: \texttt{cin}
56 \item the home configuration directory can also be set and
57   traditionally defaults to: \texttt{\$HOME/.bcast5}
58 \end{enumerate}
59
60
61 \subsection{The system build}
62 \label{sec:system-build}
63
64 To do a system build, you should read the file
65 \texttt{README} that is at the top level after you get the source.
66
67 \begin{itemize}
68 \item You need about 6.0 \,GB of disk storage to operate a build and
69   you need to have \textit{git} installed.
70
71 \item Obviously in order to install into the system, you must run as
72   \textbf{root}.
73
74 \item The \textit{git:} step has to download many files (approx
75   130\,MB) so allow time. When decompressed this will expand to
76   about 530 MB.
77
78 \item Run the following commands (this takes awhile):
79
80 \begin{lstlisting}[style=sh]
81 # This is where you need the 6.0GB of disk space:
82 cd /<build_path>/
83 git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
84 # Change to the cloned directory:
85 cd cinelerra5/cinelerra-5.1
86 \end{lstlisting}
87   NOTE: if your system has never had \CGG{} Infinity installed, you
88   will have to make sure you have all of the compilers and libraries
89   necessary.  So on the very first build you should run:
90
91 \begin{lstlisting}[style=sh]
92 ./blds/bld_prepare.sh <os> # where <os> represents the
93                            # Operating System of centos,
94                            # fedora, suse, ubuntu, mint, debian.
95 ./autogen.sh
96 ./configure --prefix=/usr  # optional parameters can be added here
97 make 2>&1 | tee log        # make and log the build
98 \end{lstlisting}
99
100   \texttt{bld\_prepare.sh} does not work for Arch Linux or Gentoo,
101   so we have to install the dependencies
102   manually. \texttt{README.arch} or \texttt{README.gentoo}, which
103   contain the list of dependencies, can be found at:
104   \begin{list}{}{}
105   \item \href{https://cinelerra-gg.org/download/README.arch}{https://cinelerra-gg.org/download/README.arch}
106   \item \href{https://cinelerra-gg.org/download/README.gentoo}{https://cinelerra-gg.org/download/README.gentoo}
107   \end{list}
108
109 \item Check for obvious build errors:
110 \begin{lstlisting}[style=sh]
111 grep "\*\*\*.*error" -ai log
112 \end{lstlisting}
113   If this reports errors and you need assistance or you think
114   improvements can be made to the builds, email the log which is
115   listed below to:
116   \href{mailto:cin@lists.cinelerra-gg.org}{cin@lists.cinelerra-gg.org}
117 \begin{lstlisting}[style=sh]
118 /<build_path>/cinelerra5/cinelerra-5.1/log
119 \end{lstlisting}
120
121 \item If there are no build errors, finally just run:
122 \begin{lstlisting}[style=sh]
123 make install
124 \end{lstlisting}
125
126 \item If it all worked, you are all setup. Just click on the \CGG{}
127   desktop icon.
128 \end{itemize}
129
130
131 \subsection{The single-user build}
132 \label{sec:single-user-build}
133
134 To do a single-user build, read the file \texttt{README} that is at
135 the top level after you get the source.
136
137 \begin{enumerate}
138 \item You need at least 6\,GB of disk storage to operate a build +
139   you need to have β€œ\texttt{git}” installed.
140
141 \item Recommend you build and run as \textbf{root}, just to avoid
142   permission issues initially.
143 \item The \textit{git} step has to download many files (approx
144   130\,MB) so allow time.
145
146 \item Run the following commands (this takes awhile):
147 \begin{lstlisting}[style=sh]
148 # This is where you need the 6GB of disk space
149 cd /<build_path>/
150 git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
151 # Toplevel directory:
152 cd cinelerra5/cinelerra-5.1
153 \end{lstlisting}
154 \end{enumerate}
155
156 NOTE: if your system has never had \CGG{} Infinity installed, you
157 will have to make sure all the compilers and libraries necessary are
158 installed. So on the very first build you should run as
159 \textbf{root}:
160
161 % FIXME No novels in the listings.
162 \begin{lstlisting}[style=sh]
163 ./blds/bld_prepare.sh <os>
164 ./autogen.sh
165 ./configure --with-single-user
166 make 2>&1 | tee log
167 make install
168 \end{lstlisting}
169 Where <os> represents the Operating System supported by \CGG{}, such
170 as centos, fedora, suse, ubuntu, mint, debian.
171 The ``with-single-user'' parameter makes it so.
172 % Make and log build (
173 Check for errors before proceeding.
174
175
176 Then just start the application by keying in: \texttt{./cin} in the
177 bin subdirectory OR add a desktop icon by using the appropriate
178 directory to copy the files to, run as \textbf{root}, and edit to
179 correct the directory path.  Below are generic directions of how to
180 do this.
181
182 \begin{lstlisting}[style=sh]
183 cd /cinelerra_directory_path
184 cp -a image/cin.{svg,xpm} /usr/share/pixmaps/
185 cp -a image/cin.desktop /usr/share/applications/cin.desktop
186 \end{lstlisting}
187
188 After you have followed the above, in the cin.desktop file, change
189 the \texttt{Exec=cin} line to be
190 \texttt{Exec=<your\_directory\_path>/bin/cin}.
191
192 The preceding directions for doing a single-user build have been
193 meticulously followed to build and run on a newly installed ubuntu
194 15 system WITHOUT BEING ROOT except for the \texttt{bld\_prepare.sh}
195 and creating the desktop icon.
196
197
198 \subsection{Notable Options and Caveats}%
199 \label{sub:notable_options_and_caveats}
200
201 These procedures and the \CGG{} Infinity software have all been run
202 as \textbf{root} on various home laptops and desktops. This provides
203 the best chance to ensure all works correctly and also allows for
204 handling errors, other problems and potential crashes with the most
205 success.  Included in this section are some of the build variations
206 easily available for normal builds.
207
208 To see the full list of features use:
209
210 \begin{lstlisting}[style=sh]
211 ./configure --help
212 \end{lstlisting}
213 The default build is a system build which uses:
214
215 \begin{lstlisting}[style=sh]
216 ./configure --without-single-user
217 \end{lstlisting}
218
219 In the single-user build, the target directory is always
220 \texttt{cin}.  Because this is also the developer build, constant
221 names are used throughout.  However, you can rename files after the
222 install is complete.
223
224 If your operating system has issues with the default install to
225 \texttt{/usr/local}, you might have to change the location to
226 \texttt{/usr} for a system build.  Then you will have to use:
227 \begin{lstlisting}[style=sh]
228 ./configure --prefix=/usr
229 \end{lstlisting}
230
231 If you wish to change the default directory for a system build you
232 will have to add the destination directory path on the \texttt{make
233   install} line.  For example:
234 \begin{lstlisting}[style=sh]
235 make install DESTDIR=<your selected target directory path>
236 \end{lstlisting}
237
238 The application name can be set during installation, but defaults to
239 \texttt{cin} so that the GG/Infinity build can coexist with other
240 \CGG{} builds if necessary.  To override the default \texttt{cin}
241 name, use:
242 \begin{lstlisting}[style=sh]
243 ./configure --with-exec-name=cinelerra
244 \end{lstlisting}
245
246 The home configuration directory can also be set, but default
247 location is traditionally \texttt{\$HOME/.bcast5}.  For example:
248
249 \begin{lstlisting}[style=sh]
250 ./configure -with-config-dir=/myusername/.bcast5
251 \end{lstlisting}
252
253 NOTE: when you specify parameters to the configure program, it will
254 create a \texttt{make} file as a consequence.  Since in a
255 \texttt{make} file, the \$ is a special character, it must be
256 escaped so in order to represent a \$ as part of an input parameter,
257 it has to be stuttered.  That is, you will need \$\$ (2 dollar
258 signs) to represent a single dollar sign.
259
260 It may be necessary on some distros which have missing or incomplete
261 up-to-date libraries, to build \CGG{} without Ladspa.  To do so,
262 use:
263
264 \begin{lstlisting}[style=sh]
265 ./configure --prefix=/usr --without-ladspa-build
266 \end{lstlisting}
267
268 Note that the with-ladspa-dir is the ladspa search path, and
269 exists even if the ladspa build is not selected.  This gives you
270 the ability to specify an alternate ladspa system path by
271 utilizing the \texttt{LADSPA\_PATH} environment variable (that is,
272 the default ladspa build is deselected).
273
274 Note for 32-bit 14.2 Slackware, Debian, Gentoo, Arch, FreeBSD,
275 before running the configure, you will need to set up the following:
276
277 \begin{lstlisting}[style=sh]
278 export ac_cv_header_xmmintrin_h=no
279 export FFMPEG_EXTRA_CFG=" --disable-vdpau"
280 \end{lstlisting}
281
282
283 \subsection{Notes about Building from Git in your Customized Environment}%
284 \label{sub:notes_about_building_from_git_in_your_customized_environment}
285
286 Getting a build to work in a custom environment is not easy.  If you
287 have already installed libraries which are normally in the
288 thirdparty build, getting them to be recognized means you have to
289 install the \textit{devel} version so the header files which match
290 the library interfaces exist.  Below is the list of thirdparty
291 builds, but this list may have changed over time.
292 % It's list of Table?
293
294 \begin{table}[htpb]
295   \centering
296   \caption{List of thirdparty builds}
297   \label{tab:List_of_thirdparty_builds}
298   \small
299   \begin{tabular}{m{8em}c}
300     \toprule
301         a52dec   & yes\\
302         djbfft   & yes\\
303         ffmpeg   & yes\\
304         fftw     & auto\\
305         flac     & auto\\
306         giflib   & yes\\
307         ilmbase  & auto\\
308         lame     & auto\\
309         libavc1394&auto\\
310         libraw1394&auto\\
311         libiec61883&auto\\
312     libdv     &auto\\
313         libjpeg   &auto\\
314         opus      &auto\\
315         openjpeg  &auto\\
316         libogg    &auto\\
317         libsndfile&auto\\
318         libtheora&auto\\
319         libuuid  & yes\\
320         libvorbis&auto\\
321         mjpegtools&yes\\
322         openexr   &auto\\
323     tiff      &auto\\
324         twolame   &auto\\
325         x264      &auto\\
326         x265      &auto\\
327         libvpx    &auto\\
328         lv2       &auto\\
329         sratom    &auto\\
330         serd      &auto\\
331         sord      &auto\\
332         lilv      &auto\\
333         suil      &auto\\
334         libaom    &auto\\
335         dav1d     &auto\\
336     libwebp   &auto\\
337         ffnvcodec &auto\\
338     \bottomrule
339   \end{tabular}
340 \end{table}
341
342
343 The \textit{yes} means force build and \textit{auto} means probe and
344 use the system version if the build operation is not static.  To get
345 your customized build to work, you need to change the probe options
346 for the conflicting libraries from \textit{yes} to \textit{auto}, or
347 even rework the \texttt{configure.ac} script.  There may be several
348 libraries which need special treatment.
349
350 An example of a problem you might encounter with your customized
351 installation is with \texttt{a52dec} which has probes line
352 \texttt{(CHECK\_LIB/CHECK\_HEADERS)} in \texttt{configure.ac}, but
353 \texttt{djbfft} does not.  In this case, \texttt{djbfft} is only
354 built because \texttt{a52dec} is built, so if your system has
355 \texttt{a52dec}, set \texttt{a52dec} to auto and see if that
356 problem is solved by retrying the build with:
357 \begin{lstlisting}[style=sh]
358 ./confgure --with-single-user -enable-a52dec=auto .
359 \end{lstlisting}
360
361 With persistence, you can get results, but it may take several tries
362 to stabilize the build.  If you need help, email the \texttt{log}
363 and \texttt{config.log}, which is usually sufficient to determine
364 why a build failed.
365
366 If you have already installed the \texttt{libfdk\_aac} development
367 package on your computer because you prefer this version over the
368 default aac, you will have to do the following to get this
369 alternative operational. The libfdk\_aac library is not a part of
370 \CGG{} by default because it is not license free.
371
372 \begin{lstlisting}[style=sh]
373 export FFMPEG_EXTRA_CFG=" --enable-libfdk-aac --enable-nonfree"
374 export EXTRA_LIBS=" -lfdk-aac"
375 for f in `grep -lw aac cinelerra-5.1/ffmpeg/audio/*`; do
376   sed -e 's/\<aac\>/libfdk_aac/' -i $f
377 done
378 \end{lstlisting}
379
380
381 \subsection{Cloning the Repository for Faster Updates}%
382 \label{sub:cloning_the_repository_for_faster_updates}
383
384 If you want to avoid downloading the software every time an update
385 is available you need to create a local "repository" or repo.  The
386 repo is a directory where you first do a \texttt{git clone}.  For
387 the initial git clone, set up a local area for the repository
388 storage, referred to as \texttt{<repo\_path>}.  The \texttt{git
389   clone} creates a repo named \texttt{cin5} in the
390 \texttt{/<repo\_path>/} directory.  This accesses about 530\,MB of
391 repo data, so the device has to have at least that available.  The
392 repo path is always a perfect clone of the main repo.
393
394
395 \paragraph{Setting up the initial clone}%
396 \label{par:setting_up_the_initial_clone}
397
398 You may want to add "\texttt{ -{}-depth 1}" before \texttt{cin5}
399 because this will clone faster and is smaller, but has no history.
400
401 \begin{lstlisting}[style=sh]
402 cd /<repo\_path>/
403 git clone "git://git.cinelerra-gg.org/goodguy/cinelerra" cin5
404
405 Cloning into "cin5"...
406 remote: Counting objects: 20032, done.
407 remote: Compressing objects: 100% (11647/11647), done.
408 remote: Total 20032 (delta 11333), reused 16632 (delta 8189)
409 Receiving objects: 100% (20032/20032), 395.29 MiB | 3.26 MiB/s, done.
410 Resolving deltas: 100% (11333/11333), done.
411 Checking connectivity... done.
412 \end{lstlisting}
413
414
415 \paragraph{Update an existing repo}%
416 \label{par:update_an_existing_repo}
417 The below shows how you can get updates.
418
419 \begin{lstlisting}[style=sh]
420 cd /<repo home>/cin5
421 git pull
422 \end{lstlisting}
423
424
425 \paragraph{Useful git commands}%
426 \label{par:useful_git_commands}
427 Some other commands that are useful.
428
429 \begin{lstlisting}[style=sh]
430 git clone "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cin5
431 git pull         # pull remote changes to the local version
432 git status       # shows changed files
433 git clean -i     # interactive clean, use answer 1 to "clean"
434 \end{lstlisting}
435
436
437 \subsection{How to Build from a Previous GIT Version}%
438 \label{sub:how_to_build_from_a_previous_git_version}
439
440 % FIXME The listing is here because...
441 \strut
442 %
443 \begin{lstlisting}[style=sh]
444 cd /<path>/cin5_repo
445 git log
446 git checkout <version>
447 \end{lstlisting}
448
449 The \texttt{git log} command produces a log file with hash values
450 for commit keys. The hash ids are the commit names to use when you
451 use git checkout. Next is displayed sample output:
452
453 \begin{lstlisting}[style=nil]
454 delete stray line in last checkin
455
456 commit 4a90ef3ae46465c0634f81916b79e279e4bd9961
457 Author: Good Guy <good1.2guy@gmail.com>
458 Date: Thu Feb 22 14:56:45 2018 -0700
459
460 nested clips, big rework and cleanup, sams new icons,
461 leaks and tweaks
462
463 commit f87479bd556ea7db4afdd02297fc00977412b873
464 Author: Good Guy <good1.2guy@gmail.com>
465 Date: Sat Feb 17 18:09:22 2018 -0700
466 \end{lstlisting}
467
468 For the \texttt{git checkout <version>}, you would then keyin the
469 line below for the following results:
470
471 \begin{lstlisting}[style=nil]
472 git checkout f87479bd556ea7db4afdd02297fc00977412b873
473
474 Note: checking out 'f87479bd556ea7db4afdd02297fc00977412b873'.
475
476 You are in 'detached HEAD' state. You can look around, make
477 experimental changes and commit them, and you can discard any
478 commits you make in this state without impacting any branches by
479 performing another checkout.
480
481 If you want to create a new branch to retain commits you create,
482 you may do so (now or later) by using -b with the checkout command
483 again. Example:
484
485 git checkout -b <new-branch-name>
486
487 HEAD is now at f87479bd... more file size icon updates,
488 and more to followend
489 \end{lstlisting}
490
491 Later to get the repo back to current, use:
492 \begin{lstlisting}[style=sh]
493 git checkout master
494 \end{lstlisting}
495
496
497 \subsection{Debuggable Single User Build}%
498 \label{sub:debuggable_single_user_build}
499
500 To build from source with full debugging symbols, first build a full
501 static (non\_debug) build as follows but instead of using
502 \texttt{/tmp} substitute your permanent disk path if you want to
503 keep it.
504
505 % FIXME cd /tmp/ && git clone ?
506 \begin{lstlisting}[style=sh]
507 git clone ...
508 cp -a /path/cinelerra-5.1 /tmp/
509 cd /tmp/cinelerra-5.1
510 ./bld.sh
511 \end{lstlisting}
512
513 Then, to run as a developer in the debugger:
514
515 \begin{lstlisting}[style=sh]
516 CFLAGS="-O2 -ggdb" make -j8 rebuild_all
517 cd cinelerra
518 gdb ./ci
519 \end{lstlisting}
520
521
522 \subsection{Unbundled Builds}%
523 \label{sub:unbundled_builds}
524
525 There are some generic build scripts included in the \CGG{} GIT
526 repository for users who want to do unbundled builds with ffmpeg
527 already available on their system.  This has been tested on Arch,
528 Ubuntu 18, FreeBSD, Windows10 and Leap 15 (rpm) at the time this
529 was documented.
530 %
531 The names of the build scripts are: \texttt{arch.bld},
532 \texttt{bsd.bld}, \texttt{deb.bld}, \texttt{rpm.bld}, and
533 \texttt{cygwin.bld}.  These scripts are in the \texttt{blds}
534 subdirectory.  The \texttt{bsd.bld} should be used with the
535 \texttt{bsd.patch} file in that same directory.  The
536 \texttt{cygwin.bld} should be used with the \texttt{cygwin.patch}
537 file in that same directory.
538
539 The reason that Cin Infinity traditionally uses thirdparty builds
540 (bundled builds) is because there are a lot of different distros
541 with varying levels of ffmpeg and other needed thirdparty
542 libraries.  However, some users prefer using their current system
543 baseline without another/different copy of ffmpeg.
544 %
545 With different levels of the user’s libraries, uncertainty,
546 potential instability, and unknown issues may come up while
547 running \CGG{} and this will make it, for all practical purposes,
548 impossible to diagnose and debug problems or crashes.
549 %
550 There may be no help in these cases.  You are encouraged to report
551 any errors which potentially originate from Cin Infinity, but if
552 the data indicates alternate library sources, please report the
553 problems to the appropriate maintainers.
554
555 With the unbundled builds, some features may not be available and
556 no attempt to comment them out has been made.  So if you use a
557 pulldown, or pick a render option, or choose something that is not
558 available, it just will not work.  For example, unless special
559 options were set up by you, the LV2 audio plugins will not be
560 available.  Nor will the codec libzmpeg, the file codec ac3, or
561 DVD creation.  The old school file classes will all work, but some
562 of the formats that come with ffmpeg may not because of the way
563 that ffmpeg was installed on your operating system.  That is
564 because the \CGG{} included ffmpeg is a known static build and is
565 usually the latest stable/released version.  For example, in the
566 current case of Leap 15, libx264 and libx265 are not built in and
567 this can be debilitating; you can always run \texttt{ffmpeg
568   -formats} and \texttt{ffmpeg -codecs} to see what is available
569 on your system.
570
571
572 \section{Download Already Built \CGG{}}%
573 \label{sec:download_already_built_cinelerra_gg}
574
575 \begin{figure}[htpb]
576   \centering
577   \includegraphics[width=1.0\linewidth]{download-distros.png}
578   \caption{Screencast of the website Download page for installing \CGG{} for various O/S.}
579   \label{fig:download-distros}
580 \end{figure}
581
582 If you prefer to not have to take the time to build \CGG{} Infinity
583 yourself, there are pre-built dynamic or static binaries for various
584 versions of Ubuntu, Mint, Suse, Fedora, Debian, Centos, Arch, and
585 Slackware linux as well as Gentoo and FreeBSD.
586 %
587 A Windows 10 version installation is described in
588 \ref{sec:ms_windows10}.  There are also 32-bit i686 Ubuntu, Debian,
589 and Slackware versions available.  These are updated on a fairly
590 regular basis as long as significant code changes have been made.
591 They are in subdirectories of:
592
593 \begin{list}{}{}
594 \item \href{https://cinelerra-gg.org/download/tars}{https://cinelerra-gg.org/download/tars}
595 \item \href{https://cinelerra-gg.org/download/pkgs}{https://cinelerra-gg.org/download/pkgs}
596 \end{list}
597
598 The \textbf{tars} directory contains single-user static builds for
599 different distros.
600 %
601 This is the recommended usage of \CGG{} because all of the files
602 will exist in a single directory.  Generally all of the necessary
603 libraries are built into the static build, but in some cases you may
604 have to install another library that is being called for.
605 %
606 To install the single user builds, download the designated tarball
607 from the \texttt{./tars} subdirectory and unpack as indicated below:
608
609 \begin{lstlisting}[style=sh]
610 cd /path
611 mkdir cin
612 cd cin
613 tar -xJf /src/path/cinelerra-5.1-*.txz  # for the *,
614                                         # substitute your
615                                         # distro tarball name
616 \end{lstlisting}
617
618 \emph{Do not download the LEAP 10-bit version unless you use h265 (it
619 can't render 8-bit h265).}
620
621 The \textbf{pkgs} directory contains the standard packaged
622 application for various distros.  This will install a dynamic
623 system version for users who prefer to have the binaries in the
624 system area and for multi-user systems.
625 %
626 In addition, performing the package install checks the md5sum in
627 the file \texttt{md5sum.txt} to ensure the channel correctly
628 transmits the package.  There is a
629 \href{https://cinelerra-gg.org/download/README.pkgs}{README.pkgs}
630 file in the \texttt{download} directory with instructions so you
631 can \textit{ cut and paste} and avoid typos; it is also shown
632 next.
633
634 % FIXME (!) It doesn't work that way. The text is set as it is
635 % written.
636 % \begin{lstlisting}[style=sh]
637 {\tiny
638 \begin{verbatim}
639 Depending on the distro, use the instructions below and select the appropriate
640 setup operations to install, update or remove cinelerr-gg infinity.  (02/05/2020)
641 To upgrade, refresh repo, then replace "install" with "update", or whatever.
642
643 Email problems to cin@lists.cinelerra-gg.org
644 If repository problems, usually you can manually do an install by using:
645  UBUNTU, MINT, DEBIAN
646   wget https://cinelerra-gg.org/download/pkgs/{substitute_name}/cin_5.1.<sub_name>.deb
647   and install it manually: dpkg -i cin_5.1.{substitute_filename}.deb
648  ARCH
649   wget https://cinelerra-gg.org/download/pkgs/{substitute_name}/cin_5.1.<sub_name>.pkg.tar.xz
650   and install it manually: pacman -U cin_5.1.{substitute_filename}.pkg.tar.xz
651  FEDORA
652   wget https://cinelerra-gg.org/download/pkgs/{substitute_name}/cin_5.1.<sub_name>.rpm
653   and install it manually: dnf install cin_5.1.{substitute_filename}.rpm
654  LEAP, SUSE
655   wget https://cinelerra-gg.org/download/pkgs/{substitute_name}/cin_5.1.<sub_name>.rpm
656   and install it manually: zypper install cin_5.1.{substitute_filename}.rpm
657  CENTOS
658   wget https://cinelerra-gg.org/download/pkgs/{substitute_name}/cin_5.1.<sub_name>.rpm
659   and install it manually: yum localinstall cin_5.1.{substitute_filename}.rpm
660
661 # GENTOO - there are static and dynamic tarballs for Base Release 2.6
662   https://cinelerra-gg.org/download/tars/cinelerra-5.1-gentoo-20200202.x86_64-static.txz
663   https://cinelerra-gg.org/download/tars/cinelerra-5.1-gentoo-20200202.x86_64.txz
664   download one of the above and then refer to README.txt
665
666 # FREEBSD - there is a tarball based on FreeBSD version 12.1 at
667   https://cinelerra-gg.org/download/testing/bsdcin.tar.xz
668   download the above and then refer to README.txt
669
670 # FEDORA
671 # Replace the XX in fedoraXX in the next line with your current O/S version number
672 dnf install cinelerra --nogpgcheck --repofrompath cingg,https://cinelerra-gg.org/download/pkgs/fedoraXX/
673 # dnf erase cinelerra
674
675 # CENTOS
676 # Python 2 has been updated for other distros to Python 3 so you might have to create a soft link
677 #   to get the correct version.  For help, send email to cin@lists.cinelerra-gg.org
678 # first create the file /etc/yum.repos.d/cin_gg, with the following contents:
679 [cin_gg]
680 name=cingg
681 baseurl=https://cinelerra-gg.org/download/pkgs/centos7
682 gpgcheck=0
683 # end of cin_gg
684 yum install cinelerra
685 # yum erase cinelerra
686
687 # UBUNTU, replace ub14 with your distro id: ub16,ub18
688 #  Some ubuntu apt downloads register status as working 0% constantly while running the package
689 #   download, like ubuntu 14.  It may take a few minutes for this step so be patient.
690 apt install software-properties-common apt-transport-https
691 apt-add-repository https://cinelerra-gg.org/download/pkgs/ub14
692 # UBUNTU 16/18 note - This has been known to work, but things change quickly:
693 # VIP - for the first install, the above line adds \CGG{} to /etc/apt/sources.list but...
694 # Version 16/18 of Ubuntu are more strict for licensing so you will have to edit
695 #  the file /etc/apt/sources.list to add [trusted=yes] after deb and before https...cin...
696 # For example the line should be: deb [trusted=yes] https://cinelerra-gg.org/download/pkgs/ub16 xenial main
697 #   Or for ub18: deb [trusted=yes] https://cinelerra-gg.org/download/pkgs/ub18 bionic main
698 # Also, on the install you will get an error message that you can either ignore as \CGG{}
699 #  will run anyway, or else (the first time only) on the commnand line keyin:
700 #  echo > /etc/sysctl.d/50-cin.conf "kernel.shmmax=0x7fffffff"
701 apt update
702 apt install cin
703 #to update a previous install (ignore any i386 errors as only 64 bit version available):
704 apt update
705 apt upgrade cin
706 ##apt remove cin
707
708 # MINT should use the same procedure as Ubuntu, but apt-add-repository does not seem to work,
709 #  so use the GUI UpdateManager as follows:
710 #  Administration->Software Sources->Additional Repositories->Add a new repository
711 #    (Note instead of Administration, some versions of Mint GUI UpdateManager might be System)
712 #  For Mint18,add: deb [trusted=yes] https://cinelerra-gg.org/download/pkgs/mint18 xenial main
713 #  For Mint19,add: deb [trusted=yes] https://cinelerra-gg.org/download/pkgs/mint19 bionic main
714 # IMPORTANT NOTE: if you get "malformed input" error, you will have to create a file
715 #    by typing the command: sudo touch /etc/apt/sources.list.d/additional-repositories.list
716 #    then wait 10 minutes or so and try using the Gui Update Manager again.
717 apt update
718 apt install cin
719 #to update a previous install
720 apt update
721 apt upgrade cin
722 ##apt remove cin
723
724 # DEBIAN uses the same basic procedure as Ubuntu.
725 #  The apt-add-repository varies per system so you will have to use your best judgement
726 apt install software-properties-common apt-transport-https
727 apt-add-repository https://cinelerra-gg.org/download/pkgs/debian8
728 OR apt-add-repository https://cinelerra-gg.org/download/pkgs/debian9
729 OR apt-add-repository https://cinelerra-gg.org/download/pkgs/debian10
730 # VIP - for the first install, the above line adds cinelerra to /etc/apt/sources.list but...
731 # Debian stretch/jessie/buster are more strict for licensing so you will have to edit
732 #  the file /etc/apt/sources.list to add [trusted=yes] after deb and before https...cin...
733 # For example for debian8: deb [trusted=yes] https://cinelerra-gg.org/download/pkgs/debian8 jessie main
734 # For example for debian9: deb [trusted=yes] https://cinelerra-gg.org/download/pkgs/debian9 stretch main
735 # For example for debian10: deb [trusted=yes] https://cinelerra-gg.org/download/pkgs/debian10 buster main
736 apt update
737 apt install cin
738 #to update a previous install
739 apt update
740 apt upgrade cin
741 ##apt remove cin
742
743 # SUSE/LEAP/TUMBLEWEED
744 # (Note: you may have to zypper libavc and libiec versions if not already installed)
745 # cinelerra packages are unsigned so you will have to ignore: Package is not signed!
746 # openSUSE LEAP 15
747 zypper ar -f https://cinelerra-gg.org/download/pkgs/leap15/ cingg
748 zypper install -r cingg cinelerra   # or cinelerra10bit for 10 bit
749 # openSUSE LEAP 42
750 zypper ar -f https://cinelerra-gg.org/download/pkgs/leap42/ cingg
751 # as of 42.3 SUSE there is a new requirement, so you will need to add:
752 zypper mr -G cingg
753 zypper install -r cingg cinelerra   # or cinelerra10bit for 10 bit
754 # openSUSE TUMBLEWEED
755 zypper ar -f https://cinelerra-gg.org/download/pkgs/tweed/ cingg
756 # as of 42.3 SUSE there is a new requirement, so you will need to add:
757 zypper mr -G cingg
758 zypper install -r cingg cinelerra
759 ##zypper remove cinelerra           # or cinelerra10bit for 10 bit
760 #to update a previous install (assuming you enabled autorefresh as above)
761 zypper refresh cingg
762 zypper up cinelerra  # or cinelerra10bit for 10 bit
763
764 # SLACKWARE, substitute slk32 for slk64 and i486-1 for x86_64-1
765 wget -P /tmp https://cinelerra-gg.org/download/pkgs/slk64/cin-{date}-slk64-x86_64.txz
766 installpkg /tmp/cin...    # name you used in the above line
767 #to update a previous install
768 upgradepkg /tmp/cin...    # name you used in the above line
769 ##removepkg cin
770
771 # ARCH linux
772 #  (A loosely defined list of packages that you should install first is listed in this file:
773 #   https://www.cinelerra-gg.org/download/pkgs/README.arch   )
774 # first edit the file /etc/pacman.conf, to include the following:
775 [cingg]
776 SigLevel = Optional TrustAll
777 Server = https://cinelerra-gg.org/download/pkgs/arch
778 # end of cingg
779 #
780 # next run from a window the following 2 commands;
781 pacman -Syu
782 pacman -S cin
783 # NOTE: the first line above updates your Arch system to the current rolling release and the second
784 #  line updates \CGG{} based on the rolling release that was in effect on the last day of the month.
785 #  Please complete the 2 steps above in order, one right after the other to avoid risk of a partial upgrade.
786 #  Due to the unpredictability of when Arch libraries are updated, performing an install of \CGG{} at
787 #  any time other than shortly after the last day of the month when the new build package is created,
788 #  could lead to library incompatibilities.  In that case, please consider using the Arch static tar file
789 #  for installation instead.
790 #to remove a previous install
791 ##pacman -R cin
792 \end{verbatim}
793 }
794 % \end{lstlisting}
795
796 \section{Windows 10 with Cygwin for \CGG{} Limited}%
797 \label{sec:ms_windows10}
798
799 To run \CGG{} on a Windows 10 computer, you will need to have Cygwin installed on your system, 
800 along with the  \CGG{} static tar and a patched library: libxbc.  This setup has been tested 
801 with Windows 10, version 1909, on an HP EliteBook 820 at 2.3 GHz.
802
803 This limited version provides \textit{core} functionality at this time with the standard Windows FFmpeg
804 executable, meaning that specific modifications in FFmpeg needed for \CGG{} are not available. 
805 Limited capabilities include only a few render output formats available - for example \textit{mov}, \textit{qt} 
806 as \textit{mjpeg}, and \textit{mpeg} for videos and \textit{avi} and \textit{qt} as \textit{s16le} 
807 for audio, but not \textit{mkv} or \textit{mp4}.  
808 This is due to the fact that several codec and utility libraries are not currently compiled to 
809 work with Windows.
810
811 \subsection*{Installing Cygwin}
812 \label{sec:installing_cygwin}
813
814 Cygwin is an environment that runs natively on Windows which allows Unix programs to be compiled 
815 and run on Windows.  With cygwin installed on your Windows 10 computer, you will be able to run 
816 \CGG{}.  Before installing cygwin, you need to be warned that the Avast anti-virus software 
817 kills files necessary for cygwin installation and execution, so you will have to remove it and 
818 use alternative anti-virus software (the standard default already included with Windows 10 
819 is Defender). Below are the steps for installation:
820
821 \begin{enumerate}
822         \item Download cygwin for your 64-bit computer at: {\small \url{https://www.cygwin.com/}}
823         \item Generally just take the defaults as they show up, but the next steps show what comes up.
824         \item When a warning window pops up, click \textit{Yes}.
825         \item Click \textit{Next}.
826         \item Choose \textit{Install from Internet} option and then click \textit{Next}.
827         \item Choose your desired directory by clicking on Browse button. Choose \textit{All Users (Recommended)} and then click \textit{Next}.
828         \item Choose the local package directory where you would like your installation files to be placed. Click \textit{Next}.
829         \item Choose \textit{Direct Connection} if you are using Internet with plug and play device. Click \textit{Next}.
830         \item Choose any download site preferably "cygwin.mirror.constant.com" and then click \textit{Next}.
831         \item For list of things to install, leave all set to \textit{Default} except these to \textit{Install} instead:
832
833 \begin{tabular}{ll}
834         base& devel\\
835         gnome& graphics\\
836         system& video\\
837         X11 \\
838 \end{tabular}
839
840      This install takes a long time; approximately 2 hours on an EliteBook and requires approximately 20GB storage.
841         \item Finally you will want to have the icons on your desktop (already default) and then click \textit{Finish}.
842 \end{enumerate}
843
844 Then to install the \CGG{} tar files, you will need to start a cygwin console terminal from the startup menu as shown here:
845         \texttt{Start $\rightarrow$ Cygwin $\rightarrow$ Cygwin64} Terminal
846
847 \subsection*{Installing \CGG{}}
848 \label{sec:installing_cinelerra}
849
850 \begin{enumerate}
851         \item Download the tar file at:\\
852          {\small \url{https://cinelerra-gg.org/download/testing/libxcb-bld.tar.bz2}}
853         \item Install libxbc from the tar file -- installs into \texttt{/usr/local} and requires approximately 21MB storage.
854 \begin{lstlisting}[style=sh]
855         $ tar -C /usr/local -xJf /path/libxcb-bld.tar.bz2
856 \end{lstlisting}
857 The libxcb path repairs an error (XIOError), which stops Cinelerra.
858         \item Download the tar file at:\\
859         {\small \url{https://cinelerra-gg.org/download/testing/cygcin-bld.tar.bz2}}     
860         \item Install cygcin from the tar file - this installs into home directory.  Note this is cygcin NOT cygwin. You must change the \texttt{path} below to the name of the path where you downloaded the tar file.
861 \begin{lstlisting}[style=sh]
862         $ cd
863         $ tar -xJf /path/cygcin-bld.tar.bz2
864 \end{lstlisting}
865 \end{enumerate}
866 This creates \texttt{\~{}/cygcin} , a user build installation of \CGG{} and requires approximately 400MB storage.
867
868 \underline{Running \CGG{}:}
869
870 You will need to start a cygwin desktop from the startup menu:
871 \begin{enumerate}
872         \item \texttt{Start$\rightarrow$ Cygwin-X $\rightarrow$ Openbox}
873
874 You should start a console controlling terminal so that you can see program logging.
875         \item \texttt{Start$\rightarrow$ Cygwin $\rightarrow$ Cygwin64} Terminal
876
877 This opens a separate window that can survive a cygwin hang and bugs. Without these logs, it is much more difficult to use.
878
879         \item Type into that console controlling window, the following:
880 \begin{lstlisting}[style=sh]
881         $ export DISPLAY=:0.0
882 \end{lstlisting}
883         \item Change directories to where \CGG{} is installed:
884 \begin{lstlisting}[style=sh]
885         $ cd /path/cygcin    (NOT cygwin)
886 \end{lstlisting}
887         \item Finally keyin:
888 \begin{lstlisting}[style=sh]
889         $ ./cin
890 \end{lstlisting}
891 which starts up your 4 \CGG{} windows.
892 \end{enumerate}
893
894 The most noticeable difference from the Linux versions is that \CGG{} seems to run 
895 very slowly on Windows 10. You must be very tolerant and patient to see this work.  
896 It can however exhibit astonishing speed when encoding.  \CGG{} has to be downgraded significantly due to lack of supported interfaces, codecs (for example h264/h265), and utilities.  
897 The only graphics driver is X11 and the only sound driver is pulseaudio.  Almost all configurable
898 omissions are applied to this build.  
899
900 \underline{\CGG{} build on cygwin from source code:}
901
902 \begin{enumerate}
903         \item Download and install ffmpeg into /usr/local :
904
905         download ffmpeg (currently 4.2.2)
906 \begin{lstlisting}[style=sh]
907         $ cd /tmp
908         $ tar -xJf /path/ffmpeg-4.2.2.tar.bz2
909         $ cd ffmpeg-4.2.2
910         $ ./configure
911         $ make -j
912         $ make install
913 \end{lstlisting}
914         \item Download and install a patched libxcb:
915 \begin{lstlisting}[style=sh]
916         $ cd /tmp
917         $ rm -rf libxcb-1.13/
918         $ tar -xf /path/libxcb-1.13.tar.bz2
919         $ cd libxcb-1.13/
920         $ patch -p1 < /path/cinelerra-5.1/thirdparty/src/libxcb.patch1
921            patching file configure.ac
922            patching file src/xcb_in.c
923         $ ./autogen.sh
924         $ ./configure
925         $ make -j
926         $ make install
927 \end{lstlisting}
928         \item Download cinelerra-gg:
929 \begin{lstlisting}[style=sh]
930         $ cd /build_path/
931         $ git clone "git://git.cinelerra-gg.org/goodguy/cinelerra.git"
932         $ cd cinelerra-gg/cinelerra-5.1
933 \end{lstlisting}
934         \item Apply cygwin patch:
935 \begin{lstlisting}[style=sh]
936         $ patch -p2 < blds/cygwin.patch
937 \end{lstlisting}
938         \item Run the build with:
939 \begin{lstlisting}[style=sh]
940         $ ./blds/cygwin.bld
941 \end{lstlisting}
942 \end{enumerate}
943
944 This produces a directory: $/build\_path$/cinelerra-gg$/cinelerra$-5.1/bin
945 which is used to create the cygcin archive.
946
947 Currently, the targets are not stripped and can be run from gdb.
948 There is only very limited signal handler dmp file support.
949 Running gdb from inside a desktop resident console (not a cygwin64 window) will hang cygwin (and cin) when it hits a breakpoint.  You must run from an external console window to avoid this issue.
950
951
952 \section{Distribution Systems with \CGG{} Included}%
953 \label{sec:distribution_systems_with_cinelerra_included}
954
955 There are also some special complete distribution systems available that include \CGG{} for audio and video production capabilities.
956
957 \subsection{AV Linux}
958 \label{sec:AV Linux}
959
960 \textbf{AV Linux} is a downloadable/installable shared snapshot
961 ISO image based on Debian.  It provides the user an easy method to
962 get an Audio and Video production workstation without the hassle
963 of trying to find and install all of the usual components
964 themselves.  Of course, it includes \CGG{}!
965 %
966 Click here for the
967 \href{http://www.bandshed.net/avlinux/}{homepage of AV Linux}.
968
969 \subsection{Bodhi Linux}
970 \label{sec:Bodhi Linux}
971
972 \textbf{Bodhi Linux Media} is a free and open source distribution that
973 comes with a curated list of open source software for digital
974 artists who work with audio, video, includes \CGG{}, games,
975 graphics, animations, physical computing, etc.
976 %
977 Click here for the
978 \href{https://gitlab.com/giuseppetorre/bodhilinuxmedia}{homepage of Bodhi Linux}.
979
980 -\begin{center}
981 -       {\small \url{https://gitlab.com/giuseppetorre/bodhilinuxmedia}}
982 -\end{center}   
983
984 \section{Cinx and a β€œBit” of Confusion}%
985 \label{sec:cinx_and_a_bit_of_confusion}
986
987 Cinx is the exact same program as Cin.  
988 The X (x) represents the roman numeral 10 for 10-bit as opposed to 8-bit standard.  
989 The third-party library used for x265 must be specially compiled with \texttt{--bit-depth=10} in order to produce 10-bit rendered output.  
990 This build will not be able to output 8-bit depth which means you have to retain the Cin version also.  
991 Whatever build ffmpeg is linked to will determine what bit depth it can output.  
992 This is why there have to be separate builds.  
993 If you install both packages, Cin and CinX, you may get \textit{file conflicts of same file name} --- just continue.
994
995 Keep in mind that the regular 8-bit version works on 8-bit bytes --- the standard word size for computers, but the 10-bit version has to use 2 words to contain all 10 bits so you can expect rendering to be as much as twice as slow.  
996 There is also a 12-bit version for consideration but currently the results are simply the same as 10-bit with padding to make 12-bit so it is of no value.
997
998
999 %%% Local Variables:
1000 %%% mode: latex
1001 %%% TeX-master: "../CinelerraGG_Manual"
1002 %%% End: