5 * Created by Pat Schloss on 8/14/08.
6 * Copyright 2008 Patrick D. Schloss. All rights reserved.
12 #include "globaldata.hpp"
14 /**************************************************************************************************/
16 GlobalData* GlobalData::_uniqueInstance = 0;
17 CommandFactory* CommandFactory::_uniqueInstance = 0;
19 int main(int argc, char *argv[]){
23 string logFileName = "mothur.logFile";
24 remove(logFileName.c_str());
27 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
29 #if defined (__APPLE__) || (__MACH__)
30 mothurOutJustToLog("Mac version");
31 mothurOutEndLine(); mothurOutEndLine();
33 mothurOutJustToLog("Linux version");
34 mothurOutEndLine(); mothurOutEndLine();
39 mothurOutJustToLog("Windows version");
40 mothurOutEndLine(); mothurOutEndLine();
45 mothurOut("mothur v.1.7.2");
47 mothurOut("Last updated: 12/04/2009");
52 mothurOut("Patrick D. Schloss");
55 mothurOut("Department of Microbiology & Immunology");
57 mothurOut("University of Michigan");
59 mothurOut("pschloss@umich.edu");
61 mothurOut("http://www.mothur.org");
64 mothurOut("When using, please cite:");
66 mothurOut("Schloss, P.D., et al., Introducing mothur: Open-source, platform-independent, community-supported software for describing and comparing microbial communities. Appl Environ Microbiol, 2009. 75(23):7537-41.");
69 mothurOut("Distributed under the GNU General Public License");
72 mothurOut("Type 'help()' for information on the commands that are available");
75 mothurOut("Type 'quit()' to exit program");
80 srand( (unsigned)time( NULL ) );
89 if (input[0] == '#') {
90 mothur = new ScriptEngine(argv[0], argv[1]);
92 mothur = new BatchEngine(argv[0], argv[1]);
96 mothur = new InteractEngine(argv[0]);
99 //used to intercept the terminate signal, so instead of terminating mothur it will end a command
100 //void (*prev_fn)(int);
101 //prev_fn = signal(SIGTERM, mothur->terminateCommand(0));
103 //if (prev_fn==SIG_IGN) signal (SIGTERM,SIG_IGN);
106 while(bail == 0) { bail = mothur->getInput(); }
112 catch(exception& e) {
113 errorOut(e, "mothur", "main");
118 /**************************************************************************************************/