GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
main-cli.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2012-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <cstdlib>
31 
32 #include <iostream>
33 #include <string>
34 
35 #include "liboctave-build-info.h"
36 
38 
39 #include "oct-env.h"
40 #include "signal-wrappers.h"
41 
42 #include "octave.h"
43 #include "octave-build-info.h"
44 #include "sysdep.h"
45 
46 static void
48 {
49  bool ok = true;
50 
51  // Each library and executable has its own definition of the hg
52  // id. They should always match but may be different because of a
53  // botched installation or incorrect LD_LIBRARY_PATH or some other
54  // unusual problem.
55 
56  std::string octave_id = octave_hg_id ();
57  std::string liboctave_id = liboctave_hg_id ();
58  std::string liboctinterp_id = liboctinterp_hg_id ();
59 
60  if (octave_id != liboctave_id)
61  {
62  std::cerr << "octave hg id ("
63  << octave_id
64  << ") does not match liboctave hg id ("
65  << liboctave_id
66  << ')' << std::endl;
67  ok = false;
68  }
69 
70  if (octave_id != liboctinterp_id)
71  {
72  std::cerr << "octave hg id ("
73  << octave_id
74  << ") does not match liboctinterp hg id ("
75  << liboctinterp_id
76  << ')' << std::endl;
77  ok = false;
78  }
79 
80  if (! ok)
81  exit (1);
82 }
83 
84 int
85 main (int argc, char **argv)
86 {
88 
90 
92 
93  octave::cli_application app (argc, argv);
94 
95  return app.execute ();
96 }
static void set_program_name(const std::string &s)
Definition: oct-env.cc:182
OCTAVE_API std::string liboctave_hg_id(void)
OCTAVE_API std::string liboctinterp_hg_id(void)
int main(int argc, char **argv)
Definition: main-cli.cc:85
static void check_hg_versions(void)
Definition: main-cli.cc:47
std::string octave_hg_id(void)
void octave_block_async_signals(void)