ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
banner.cpp
Go to the documentation of this file.
1 
9 #include <fvar.hpp>
10 #include <adstring.hpp>
11 #if defined(__BORLANDC__)
12  #include <strstrea.h>
13  #include <iomanip.h>
14 #else
15  #include <sstream>
16 #endif
17 
18 #include <sstream>
19 using std::ostringstream;
20 
21 #define STR(x) #x
22 #define STR2(x) STR(x)
23 
31 void banner(const adstring& program_name)
32 {
33  ostringstream ss;
34 
35  ss << "ADMB Program: " << program_name << "\n\n";
36 
37  ss << "ADMB";
38 
39 #if defined(ADMB_VERSION)
40  ss << "-" << STR2(ADMB_VERSION);
41 #endif
42 
43  if (which_library() == 'o')
44  ss << " optimized libraries";
45  else
46  ss << " safe libraries";
47 
48  ss << " was compiled using ";
49 
50 #if defined(__clang__)
51  #if defined(__apple_build_version__)
52  ss << "Apple ";
53  #endif
54  ss << "Clang C++ "<< __clang_major__ << '.' << __clang_minor__ << '.'
55  << __clang_patchlevel__;
56  #if defined(__arm64__)
57  ss << " arm64bit";
58  #elif defined(__x86_64)
59  ss << " 64bit";
60  #else
61  ss << " 32bit";
62  #endif
63 #elif defined(__GNUC__)
64  ss << "GNU C++ " << __GNUC__ << '.' << __GNUC_MINOR__ << '.'
65  << __GNUC_PATCHLEVEL__;
66  #if defined(__x86_64)
67  ss << " 64bit";
68  #else
69  ss << " 32bit";
70  #endif
71 #elif defined(_MSC_VER)
72  ss << "Microsoft Visual C++ ";
73  #if (_MSC_VER==1300)
74  ss << "7.0";
75  #elif (_MSC_VER==1310)
76  ss << "2003 7.1";
77  #elif (_MSC_VER==1400)
78  ss << "2005 8.0";
79  #elif (_MSC_VER==1500)
80  ss << "2008 9.0";
81  #elif (_MSC_VER==1600)
82  ss << "2010 10.0";
83  #elif (_MSC_VER==1700)
84  ss << "2012 11.0";
85  #elif (_MSC_VER==1800)
86  ss << "2013 12.0";
87  #elif (_MSC_VER==1900)
88  ss << "2015 14.0";
89  #elif (_MSC_VER<1920)
90  ss << "2017 Version 15";
91  #elif (_MSC_VER<1930)
92  ss << "2019 Version 16";
93  #elif (_MSC_VER>=1930)
94  ss << "2022 Version 17.0";
95  #else
96  #if DEBUG
97  #warning "Unknown MSVC version."
98  #endif
99  #endif
100  #if defined(_M_X64)
101  ss << "(64bit)";
102  #else
103  ss << "(32bit)";
104  #endif
105 #elif defined(__BORLANDC__)
106  ss << "Borland C++";
107  #if (__BORLANDC__==0x550)
108  ss << " 5.5";
109  #elif (__BORLANDC__==0x551)
110  ss << " 5.51";
111  #endif
112  ss << "(32bit)";
113 #elif defined(__SUNPRO_CC)
114  ss << "Solaris Studio";
115  #if (__SUNPRO_CC==0x420)
116  ss << "4.2";
117  #elif (__SUNPRO_CC==0x500)
118  ss << "5.0";
119  #endif
120  #if defined(__x86_64)
121  ss << "(64bit)";
122  #else
123  ss << "(32bit)";
124  #endif
125 #elif defined(__INTEL_COMPILER)
126  ss << "Intel C/C++";
127  #if (__INTEL_COMPILER==500)
128  ss << " 5.0"
129  #elif (__INTEL_COMPILER==600)
130  ss << " 6.0"
131  #elif (__INTEL_COMPILER==800)
132  ss << " 8.0"
133  #elif (__INTEL_COMPILER==900)
134  ss << " 9.0"
135  #endif
136  #if defined(__x86_64)
137  ss << "(64bit)";
138  #else
139  ss << "(32bit)";
140  #endif
141 #else
142  ss << "unknown compiler";
143 #endif
144  ss << " on " << __DATE__ << ".\n";
145 #if defined(ADMB_REVISION)
146  ss << "Revision: " << STR2(ADMB_REVISION) << "\n";
147 #endif
148  ss << "Copyright (c) 2008-2021 ADMB Foundation"
149  << " and Regents of the University of California\n";
150 
151  cout << ss.str() << endl;
152 }
char which_library()
Get ADMB library mode.
Definition: libtype.cpp:15
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.