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