ADMB Documentation  11.1x.2730
 All Classes Files Functions Variables Typedefs Friends Defines
banner.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: banner.cpp 1702 2014-02-28 18:37:48Z johnoel $
00003  *
00004  * Copyright (c) 2008-2013 ADMB Foundation
00005  */
00006 
00007 #include <fvar.hpp>
00008 #include <adstring.hpp>
00009 #if defined(__BORLANDC__)
00010   #include <strstrea.h>
00011   #include <iomanip.h>
00012 #else
00013   #include <sstream>
00014   using namespace std;
00015 #endif
00016 
00017 #include <sstream>
00018 using std::ostringstream;
00019 
00020 #define STR(x) #x
00021 #define STR2(x) STR(x)
00022 
00030 void banner(const adstring& program_name)
00031 {
00032   ostringstream ss;
00033 
00034   ss << "ADMB Program: " << program_name << "\n\n";
00035 
00036   ss << "ADMB";
00037 
00038 #if defined(ADMB_VERSION)
00039   ss << "-" << STR2(ADMB_VERSION);
00040 #endif
00041 
00042   if (which_library() == 'o')
00043      ss << " optimized libraries";
00044   else
00045      ss << " safe libraries";
00046 
00047   ss << " compiled with ";
00048 
00049 #if defined(__GNUC__)
00050   ss <<  "GNU C++ " << __GNUC__ << '.' << __GNUC_MINOR__ << '.'
00051     << __GNUC_PATCHLEVEL__;
00052   #if defined(__x86_64)
00053   ss <<  " (64bit)";
00054   #else
00055   ss <<  " (32bit)";
00056   #endif
00057 #elif defined(_MSC_VER)
00058   ss << "Microsoft Visual C++ ";
00059   #if (_MSC_VER==1300)
00060   ss << "7.0";
00061   #elif (_MSC_VER==1310)
00062   ss << "2003 7.1";
00063   #elif (_MSC_VER==1400)
00064   ss << "2005 8.0";
00065   #elif (_MSC_VER==1500)
00066   ss << "2008 9.0";
00067   #elif (_MSC_VER==1600)
00068   ss << "2010 10.0";
00069   #endif
00070   #if defined(_M_X64)
00071   ss <<  "(64bit)";
00072   #else
00073   ss <<  "(32bit)";
00074   #endif
00075 #elif defined(__BORLANDC__)
00076   ss << "Borland C++";
00077   #if (__BORLANDC__==0x550)
00078   ss << " 5.5";
00079   #elif (__BORLANDC__==0x551)
00080   ss << " 5.51";
00081   #endif
00082   ss <<  "(32bit)";
00083 #elif defined(__SUNPRO_CC)
00084   ss << "Solaris Studio";
00085   #if (__SUNPRO_CC==0x420)
00086   ss << "4.2";
00087   #elif (__SUNPRO_CC==0x500)
00088   ss << "5.0";
00089   #endif
00090   #if defined(__x86_64)
00091   ss <<  "(64bit)";
00092   #else
00093   ss <<  "(32bit)";
00094   #endif
00095 #elif defined(__INTEL_COMPILER)
00096   ss << "Intel C/C++";
00097   #if (__INTEL_COMPILER==500)
00098   ss << " 5.0"
00099   #elif (__INTEL_COMPILER==600)
00100   ss << " 6.0"
00101   #elif (__INTEL_COMPILER==800)
00102   ss << " 8.0"
00103   #elif (__INTEL_COMPILER==900)
00104   ss << " 9.0"
00105   #endif
00106   #if defined(__x86_64)
00107   ss <<  "(64bit)";
00108   #else
00109   ss <<  "(32bit)";
00110   #endif
00111 #else
00112   ss << "unknown compiler";
00113 #endif
00114   ss << "\n";
00115   ss << "Copyright (c) 2008-2013 ADMB Foundation"
00116      << " and Regents of the University of California\n";
00117   ss << "Build date: " << __DATE__ << "\n";
00118 #if defined(ADMB_REVISION)
00119   ss << "Revision: " << STR2(ADMB_REVISION) << "\n";
00120 #endif
00121 
00122   cout << ss.str() << endl;
00123 }