Changeset 1341 in Sophya for trunk/SophyaProg/PrgUtil/runcxx.cc
- Timestamp:
- Nov 21, 2000, 5:05:55 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/PrgUtil/runcxx.cc
r1329 r1341 23 23 static void Usage(bool fgerr); 24 24 static int GetInput(string & codeflnm); 25 static int FillCxxFile(string & codeflnm, string & cxxfile); 25 static int FillCxxFile(string & codeflnm, string & cxxfile, 26 vector<string> & inc1, vector<string> & inc2); 26 27 27 28 /* --Fonction-- */ … … 35 36 cout << " Usage: runcxx [-compopt CompileOptions] [-linkopt LinkOptions] \n" 36 37 << " [-tmpdir TmpDirectory] [-f C++CodeFileName] \n" 38 << " [-inc includefile] [-inc includefile ...] \n" 39 << " [-import modulename] [-import modulename ...] \n" 37 40 << " [-uarg UserArg1 UserArg2 ...] \n" 38 << " if no file name is specified, read from standard input \n" << endl; 41 << " if no file name is specified, read from standard input \n" 42 << " modulenames: SkyMap, Samba, SkyT, FitsIOServer, LinAlg, IFFTW \n" 43 << endl; 44 39 45 exit(0); 40 46 } … … 59 65 60 66 vector<string> uarg; 67 vector<string> inc1; 68 vector<string> inc2; 61 69 62 70 cout << " runcxx: Decoding command line options ... " << endl; … … 82 90 codefile = arg[k]; 83 91 } 92 else if (strcmp(arg[k], "-inc") == 0) { 93 if (k == narg-1) Usage(true); 94 k++; inc2.push_back(arg[k]); 95 } 96 else if (strcmp(arg[k], "-import") == 0) { 97 if (k == narg-1) Usage(true); 98 k++; 99 if (strcmp(arg[k], "SkyMap")) inc1.push_back("skymap.h"); 100 else if (strcmp(arg[k], "Samba")) inc1.push_back("samba.h"); 101 else if (strcmp(arg[k], "SkyT")) inc1.push_back("skyt.h"); 102 else if (strcmp(arg[k], "FitsIOServer")) inc1.push_back("fitsautoreader.h"); 103 else if (strcmp(arg[k], "LinAlg")) inc1.push_back("intflapack.h"); 104 else if (strcmp(arg[k], "IFFTW")) inc1.push_back("fftwserver.h"); 105 } 106 84 107 else if (strcmp(arg[k], "-uarg") == 0) { 85 108 if (k == narg-1) Usage(true); … … 115 138 if (rc == 0) { 116 139 flnm = tmpdir + "acxxrun.cc"; 117 rc = FillCxxFile(codefile, flnm );140 rc = FillCxxFile(codefile, flnm, inc1, inc2); 118 141 } 119 142 … … 196 219 197 220 /* --Fonction-- */ 198 int FillCxxFile(string & code, string & cxxfile) 221 int FillCxxFile(string & code, string & cxxfile, 222 vector<string>& inc1, vector<string>& inc2) 199 223 { 200 224 ofstream os(cxxfile.c_str(),ios::out); … … 226 250 <<"#include \"array.h\" \n" 227 251 <<"#include \"histats.h\" \n" 228 <<"#include \"skymap.h\" \n"229 <<"#include \"samba.h\" \n"230 <<"#include \"skyt.h\" \n"231 252 <<endl; 253 254 int ki; 255 for(ki=0; ki<inc1.size(); ki++) 256 os << "#include \"" << inc1[ki] << "\" \n" ; 257 os << endl; 258 for(ki=0; ki<inc2.size(); ki++) 259 os << "#include \"" << inc2[ki] << "\" \n" ; 260 os << endl; 261 262 os<<"//---- function for Adding and displaying Objects " << endl; 263 os<<"//---- compatibility with piapp cxxexecutor " << endl; 264 os<<"void Keep_Object(AnyDataObj & obj, string const & nom) \n{ \n" 265 <<" POutPersist pos(nom); \n" 266 <<" pos.PutObject(obj); \n" 267 <<"} \n" << endl; 268 269 os<<"//---- Objects and variables saving"<<endl 270 <<"#define KeepObj(obj) Keep_Object(obj, #obj);"<<endl 271 <<endl; 272 273 os<<"//---- Displaying objects and command execution"<<endl; 274 os<<"#define DisplayObj(obj, att) " 275 <<" cout << \"DisplayObj() available only in piapp \" << endl; " << endl; 276 os<<"#define ExecuteCommand(cmd) " 277 <<" cout << \"ExecuteCommand() available only in piapp \" << endl; " << endl; 278 232 279 233 280 os << "extern \"C\" { \n"
Note:
See TracChangeset
for help on using the changeset viewer.