]> Creatis software - bbtk.git/blob - kernel/src/bbtkConfigurationFile.cxx
ef03aa2f4a234b381906e187b508a62ca233b240
[bbtk.git] / kernel / src / bbtkConfigurationFile.cxx
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbtkConfigurationFile.cxx,v $
4   Language:  C++
5   Date:      $Date: 2008/10/17 08:18:13 $
6   Version:   $Revision: 1.18 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31 /**
32  *\file
33  *\brief Class bbtk::ConfigurationFile
34  */
35
36 #include "bbtkConfigurationFile.h"
37 #include "bbtkMessageManager.h"
38 #include "bbtkXML.h"
39 #include "bbtkUtilities.h"
40
41 #if defined(WIN32)
42 #include <direct.h> // for getcwd
43 #endif
44
45
46
47 namespace bbtk
48 {
49
50   //====================================================================
51   /// Constructor
52   ConfigurationFile::ConfigurationFile()
53   {
54
55         mFile_separator = VALID_FILE_SEPARATOR;
56     
57     // ==> Set system paths 
58     mBin_path = GetExecutablePath();
59 //EED    mInstall_path = mBin_path + mFile_separator + "..";
60     mInstall_path = mBin_path + "/..";
61     // The relative path to the doc folder (=BBTK_DOC_REL_PATH)
62     mDoc_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH);
63     // The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path)
64 //EED    mDoc_path = mInstall_path + mFile_separator + mDoc_rel_path;
65     mDoc_path = mInstall_path + "/" + mDoc_rel_path;
66     // The relative path to the doc folder (=BBTK_BBS_REL_PATH)
67     mBbs_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_BBS_REL_PATH);
68     // The path to the bbs folder (=mInstall_path+"/"+mBbs_rel_path)
69 //EED    mBbs_path = mInstall_path + mFile_separator + mBbs_rel_path;
70     mBbs_path = mInstall_path + "/" + mBbs_rel_path;
71     // The relative path to the rsc folder (=BBTK_RSC_REL_PATH)
72     //   mRsc_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_RSC_REL_PATH);
73     // The path to the rsc folder (=mInstall_path+"/"+mRsc_rel_path)
74     //   mRsc_path = mInstall_path + mFile_separator + mRsc_rel_path;
75     // The path to the bbtk data folder 
76     // Initialized to mInstall_path+"/"+BBTK_DATA_REL_PATH
77     // But can be overriden by value read from bbtk_config.xml
78 //EED    mData_path = mInstall_path + mFile_separator + BBTK_STRINGIFY_SYMBOL(BBTK_DATA_REL_PATH);
79     mData_path = mInstall_path + "/" + BBTK_STRINGIFY_SYMBOL(BBTK_DATA_REL_PATH);
80
81         Utilities::replace( mBin_path           , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
82         Utilities::replace( mInstall_path       , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
83         Utilities::replace( mDoc_rel_path       , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
84         Utilities::replace( mDoc_path           , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
85         Utilities::replace( mBbs_path           , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
86         Utilities::replace( mData_path          , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
87
88     bbtkMessage("Config",1," ==> bin    : '"<<mBin_path<<"'"<<std::endl);
89     bbtkMessage("Config",1," ==> prefix : '"<<mInstall_path<<"'"<<std::endl);
90     bbtkMessage("Config",1," ==> doc    : '"<<mDoc_path<<"'"<<std::endl);
91     bbtkMessage("Config",1," ==> bbs    : '"<<mBbs_path<<"'"<<std::endl);
92     bbtkMessage("Config",1," ==> data   : '"<<mData_path<<"'"<<std::endl);
93
94
95
96     
97     // bbs_paths
98     // always add "." (current working directory) at the begining
99         mBbs_paths.push_back( "." ); 
100     // add system bbs path 
101     mBbs_paths.push_back(mBbs_path);
102     // add toolsbbtk/appli 
103 //EED    std::string toolsappli_rel_path(mFile_separator);
104     std::string toolsappli_rel_path("/");
105 //EED    toolsappli_rel_path +=  "toolsbbtk" + mFile_separator + "appli";
106     toolsappli_rel_path +=  "toolsbbtk/appli";
107     //
108     //-----------------------------------------------------------
109     // LG : REMOVE BUGGY PATH WITH include *:
110     // 
111     //    mBbs_paths.push_back(mBbs_path + toolsappli_rel_path);
112     //-----------------------------------------------------------
113     int iStrVec,sizeStrVec;
114     
115     sizeStrVec = mBbs_paths.size();
116     for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
117       Utilities::replace( mBbs_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
118     }
119
120     
121     // always add "." (current working directory) at the begining
122     mPackage_paths.push_back(".");   
123     // add system bin path (for build tree / standalone folder install)
124     mPackage_paths.push_back(mBin_path);
125     // add system lib path (for install tree)
126 //EED    mPackage_paths.push_back(mInstall_path + mFile_separator + "lib");
127     mPackage_paths.push_back(mInstall_path + "/lib");
128 #ifdef WIN32
129     // add bin/Debug bin/Release paths (for build/install tree)
130 //EED    mPackage_paths.push_back(mBin_path + mFile_separator + "Debug");
131     mPackage_paths.push_back(mBin_path + "/Debug");
132 //EED    mPackage_paths.push_back(mBin_path + mFile_separator + "Release");
133     mPackage_paths.push_back(mBin_path + "/Release");
134 #endif
135
136         sizeStrVec = mPackage_paths.size();
137         for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
138                 Utilities::replace( mPackage_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
139         }
140
141
142
143     GetHelp(2);
144    
145     // ==> First we look for bbtk_config.xml in "."
146     char buf[2048];
147     const char *currentDir = getcwd(buf, 2048);
148     
149     if( !currentDir )
150       {
151         std::cerr << "Path was too long to fit on 2048 bytes ?!?" << std::endl;
152         // \todo : what else?
153         // How abort a constructor and warn the caller function?
154         // LG : throw an exception 
155       }
156     
157 //    std::string configXmlFullPathName = currentDir + mFile_separator + "bbtk_config.xml";
158     std::string configXmlFullPathName = currentDir ;
159                 configXmlFullPathName += "/bbtk_config.xml";
160         Utilities::replace( configXmlFullPathName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
161
162     if ( Utilities::FileExists( configXmlFullPathName ))
163       {
164         bbtkMessage("Config",1, "ConfigurationFile : [" << configXmlFullPathName << 
165                     "] found in current directory" << std::endl); 
166         //Read(configXmlFullPathName.c_str());
167         // traiter le fichier local     
168       }
169     
170     // ==> Then we look for bbtk_config.xml in ".bbtk"
171     else 
172       {
173         configXmlFullPathName = Utilities::MakeUserSettingsFullFileName("bbtk_config.xml");
174         if (!Utilities::FileExists( configXmlFullPathName ))
175           {         
176             // ==> Nothing found, we create bbtk_config.xml in ".bbtk"
177             InstallPath ();
178           }
179       }
180     
181     // In any case, deal with bbtk_config.xml!
182     Read(configXmlFullPathName.c_str());
183   }
184   //=========================================================================
185
186   //=========================================================================
187   /// Destructor
188   ConfigurationFile::~ConfigurationFile()
189   {
190   }
191   //=========================================================================
192   
193
194
195
196   //=========================================================================
197   void ConfigurationFile::CreateConfigXML( char *rootDirectory )
198   {
199     FILE *fp;
200     char configXml[250];
201     sprintf (configXml , "%s/bbtk_config.xml", rootDirectory);
202     bbtkMessage("Config",1, "in CreateConfigXML[" << configXml << "]" << std::endl);
203     fp = fopen (configXml, "w");
204     fprintf(fp, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
205     //  fprintf(fp, "<!DOCTYPE config SYSTEM \"/mnt/windows/bbtk/bbtk_config.xml>\n");
206     fprintf(fp, "<config>\n");
207     fprintf(fp, "   <description>  </description>\n");
208     //   fprintf(fp, "   <url>  http://www.creatis.insa-lyon.fr/software/bbtk  </url>\n");
209     //  fprintf(fp, "   <install_path> </install_path>\n");
210     fprintf(fp, "   <bbs_path>     </bbs_path>\n");
211     // fprintf(fp, "   <ext_dll_path> </ext_dll_path>\n");
212     fprintf(fp, "   <package_path> </package_path>\n");
213     fprintf(fp, "   <data_path> </data_path>\n");//, BBTK_DATA_PATH);
214     /// \todo find a decent default value !
215       ///fprintf(fp, "   <default_temp_dir>  %s </default_temp_dir>\n", " ");
216       // when $ will be found, default_temp_dir value will be replaced
217       fprintf(fp, "   <default_temp_dir>$</default_temp_dir>\n");
218       fprintf(fp, "</config>\n");
219       fclose(fp);
220   }
221   //=========================================================================  
222
223
224   //=========================================================================
225   std::string ConfigurationFile::GetExecutablePath()
226   {
227     /// \todo : Think to delete it!
228     char *buf = (char *)malloc(512);
229     char *slash;
230     
231 #if defined(WIN32)
232     GetModuleFileName(NULL, buf, 511);
233     slash = strrchr(buf, '\\');
234     if (slash)
235       {
236         *slash = 0;
237       }
238 #elif defined(__GNUC__)
239     int res;
240     res = readlink("/proc/self/exe", buf, 512);
241     if (res == -1)
242       return "";
243     buf[res] = 0;
244     slash = strrchr(buf, '/');
245     if (slash)
246       {
247         *slash = 0;
248       }
249 #else
250     return "";
251 #endif
252     std::string ret(buf);
253     free(buf);
254     return ret;
255   }
256   //=========================================================================
257
258
259   //=========================================================================
260   void ConfigurationFile::InstallPath ()
261   {
262     
263     /*--------------------------------------------------
264       New policy for bbtk_config.xml :
265       
266       if bbtk_config.xml found in current directory (user is an aware user!)
267       use it!
268       
269       else if bbtk_config.xml found in HOME/.bbtk (user already worked with it)
270       use it!
271       
272       else if bbtk_config.xml.tmp found in /usr/local/bin or c:\\Program Files\\BBTK\\bin
273       copy it as .bbtk/bbtk_config.xml
274       
275       else (nothing installed)
276       create a minimum version in HOME/.bbtk
277       ----------------------------------------------------*/
278     
279     
280     // -----------------------------------------------------------------
281 #if defined(__GNUC__)
282     
283     // ------------------ create some usefull strings ----------------
284     // installed bbtk_path
285     char bbtk_path[100];
286     strcpy(bbtk_path, "/usr/local/bin");
287     
288     // rootDirectory
289     char rootDirectory[200];
290     sprintf( rootDirectory,  "%s/.bbtk", getenv("HOME"));
291     
292     // configPath
293     char configPath[200];
294     sprintf(configPath, "%s/bbtk_config.xml",rootDirectory);
295     
296     // makeDir
297     char makeDir[250];
298     sprintf( makeDir, "mkdir \"%s\" ", rootDirectory);
299     
300     // configXmlTmp
301     char configXmlTmp[250]; 
302     sprintf(configXmlTmp, "%s/bbtk_config.xml.tmp", bbtk_path);
303     
304     // copyFile
305     char copyFile[250];
306     
307     if (!Utilities::FileExists(configXmlTmp)) // bbtk_config.xml.tmp not found (not installed)
308       {  
309         if (!Utilities::FileExists(rootDirectory)) // .bbtk not found
310           {
311             system(makeDir);  // create .bbtk
312           }
313         
314         // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
315         CreateConfigXML( rootDirectory );// create .bbtk
316       }
317     else
318       {
319         sprintf(copyFile,"cp %s  %s/bbtk_config.xml ",configXmlTmp,rootDirectory );
320         if (!Utilities::FileExists(rootDirectory))
321           {
322             //std::cout << "makeDir[" << makeDir << "]" << std::endl;
323             system(makeDir);
324           }
325         
326         if (!Utilities::FileExists(configPath))
327           {
328             system(copyFile);
329           }
330       }
331     return;
332     
333     // ------------------------------------------------------------------
334 #elif defined(WIN32)
335     
336     
337     // installed bbtk_path
338     char bbtk_path[100];
339     strcpy(bbtk_path, "\"c:\\Program Files\\BBTK\\bin\"");
340     char bbtk_path2[100];
341     strcpy(bbtk_path2, "c:\\Program Files\\BBTK\\bin");
342     
343     // rootDirectory
344     char rootDirectory[200];  
345     sprintf(rootDirectory, "%s\\.bbtk",getenv("USERPROFILE"));
346     //  std::cout << "[" << rootDirectory << "]" << std::endl;
347     
348     // configPath
349     char configPath[200];
350     sprintf(configPath, "%s\\bbtk_config.xml",rootDirectory);
351     
352     // makeDir
353     char makeDir[250];
354     sprintf( makeDir, "mkdir \"%s\" ", rootDirectory);
355     
356     // configXmlTmp
357     char configXmlTmp[250]; 
358     sprintf(configXmlTmp, "%s\\bbtk_config.xml.tmp", bbtk_path2);
359     
360     // copyFile
361     char copyFile[250];
362     
363     if (!Utilities::FileExists(configXmlTmp)) // bbtk_config.xml.tmp not found
364       {
365         if (!Utilities::FileExists(rootDirectory)) // .bbtk not found
366           {
367             system(makeDir);  // create .bbtk
368           }
369         
370         // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
371         CreateConfigXML( rootDirectory );// create .bbtk
372         return;
373       }  
374     
375     sprintf(copyFile,"copy %s\\bbtk_config.xml.tmp \"%s\"\\bbtk_config.xml ",bbtk_path,rootDirectory );
376     
377     int attribs = GetFileAttributes (rootDirectory);
378     bbtkMessage("Config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl);
379     if ( attribs != 0xFFFFFFFF)
380       {
381         if ((attribs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY ) /// \TODO : check !
382           {
383             if ( GetFileAttributes( configPath ) == 0xFFFFFFFF)
384               {
385                 system(copyFile);  
386               } 
387           }
388       } 
389     else 
390       {
391         system(makeDir);
392         system(copyFile); 
393       }    
394     return;  
395     // ------------------------------------------------------------------    
396 #else
397 /// \todo  ConfigurationFile::InstallPath() : exit when for not WIN32 and not__GNUC__
398
399   return;    
400 #endif
401
402 }
403   //=========================================================================
404
405
406
407   //=========================================================================
408   // Gets the list of directories holding bb scripts, packages, dll, ... from the xml file
409   //      bbtk_config.xml
410   
411   void ConfigurationFile::Read(const std::string& filename)
412   {
413     
414     bbtkDebugMessage("Config",1,"ConfigurationFile::Read(" <<filename << ")" << std::endl);
415     
416     mConfig_xml_full_path = filename;
417     XMLResults* res = new XMLResults;
418     XMLNode BB = XMLNode::parseFile((XMLCSTR)filename.c_str(),(XMLCSTR)"config",res);
419     
420     if ( res->error != eXMLErrorNone ) 
421       {
422         std::string mess = GetErrorMessage(res,filename);
423         delete res;
424         bbtkDebugMessage("Config",1,mess<< std::endl);
425         bbtkError(mess);
426       }
427     delete res;
428     
429     bbtkDebugMessage("Config",1,"OK" << std::endl);
430   
431     int i,j;
432     
433     // Description
434     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"description"); i++) 
435       {
436         std::string val;
437         GetTextOrClear(BB.getChildNode((XMLCSTR)"description",&j),val);
438         mDescription += val;
439       }    
440     
441     // Url
442     if( BB.nChildNode((XMLCSTR)"url") ) 
443       GetTextOrClear(BB.getChildNode((XMLCSTR)"url"),mUrl);
444     
445     // Data_Path
446     if( BB.nChildNode((XMLCSTR)"data_path") ) 
447       GetTextOrClear(BB.getChildNode((XMLCSTR)"data_path"),mData_path);
448     
449     // install_path
450     //  if( BB.nChildNode((XMLCSTR)"install_path") )
451     //   GetTextOrClear(BB.getChildNode((XMLCSTR)"install_path"),mInstall_path);
452     
453     // add user bbs paths
454     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"bbs_path"); i++) 
455       {
456         std::string val;
457         GetTextOrClear(BB.getChildNode((XMLCSTR)"bbs_path",&j),val);
458         mBbs_paths.push_back(val);
459       }
460     
461     // package_paths
462     
463     // add user package path
464     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"package_path"); i++) 
465       {
466         std::string val;
467         GetTextOrClear(BB.getChildNode((XMLCSTR)"package_path",&j),val);
468         mPackage_paths.push_back(val);
469       }
470     
471     // default_temp_dir
472     if( BB.nChildNode((XMLCSTR)"default_temp_dir") ) 
473       GetTextOrClear(BB.getChildNode((XMLCSTR)"default_temp_dir"),mDefault_temp_dir);
474     
475     if ( mDefault_temp_dir == "$") // no value found in config_xml
476       {
477         size_t pos = mConfig_xml_full_path.find("bbtk_config.xml");
478         mDefault_temp_dir = mConfig_xml_full_path.substr (0,pos); 
479       }    
480
481     GetHelp(2);
482   }
483   //=========================================================================
484   
485   //=========================================================================
486   bool ConfigurationFile::AddPackagePathsAndWrite( const std::string& path )
487   {
488     bbtkDebugMessageInc("Config",9,
489                         "ConfigurationFile::AddPackagePathsAndWrite("
490                         <<path<<")"<<std::endl);
491     
492      XMLResults* res = new XMLResults;
493     XMLNode BB = 
494       XMLNode::parseFile((XMLCSTR)Get_config_xml_full_path().c_str(),
495                          (XMLCSTR)"config",res);
496     
497     if ( res->error != eXMLErrorNone ) 
498       {
499         std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
500         delete res;
501         bbtkDebugMessage("Config",1,mess<< std::endl);
502         bbtkError(mess);
503       }
504    delete res;
505
506 #ifdef _WIN32
507     std::string bbs_path = path + "/bbs";
508 #else
509     std::string bbs_path = path + "/share/bbtk/bbs" ;
510 #endif
511     XMLNode BBSPATH = BB.addChild((XMLCSTR)"bbs_path");
512     BBSPATH.addText((XMLCSTR)bbs_path.c_str());
513     Utilities::replace(bbs_path, INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR);
514     mBbs_paths.push_back(bbs_path);
515  
516 #ifdef _WIN32
517     std::string pack_path = path + "/bin";
518 #else
519     std::string pack_path = path ;
520 #endif
521     XMLNode PACKPATH = BB.addChild((XMLCSTR)"package_path");
522     PACKPATH.addText((XMLCSTR)pack_path.c_str());
523     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
524     mPackage_paths.push_back(pack_path);
525
526 #ifdef _WIN32
527     pack_path = path + "/Debug";
528     PACKPATH = BB.addChild((XMLCSTR)"package_path");
529     PACKPATH.addText((XMLCSTR)pack_path.c_str());
530     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
531     mPackage_paths.push_back(pack_path);
532     pack_path = path + "/Release";
533     PACKPATH = BB.addChild((XMLCSTR)"package_path");
534     PACKPATH.addText((XMLCSTR)pack_path.c_str());
535     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
536     mPackage_paths.push_back(pack_path);
537 #endif
538
539
540     XMLError err = BB.writeToFile((XMLCSTR)Get_config_xml_full_path().c_str());
541     if ( err != eXMLErrorNone ) 
542       {
543         std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
544         bbtkDebugMessage("Config",1,mess<< std::endl);
545         bbtkError(mess);
546       }
547
548     return true;
549   }
550   //=========================================================================
551
552   //=========================================================================
553   void ConfigurationFile::GetHelp(int level) const
554   {
555     bbtkDebugMessageInc("Config",9,"ConfigurationFile::GetHelp("<<level
556                         <<")"<<std::endl);
557     
558     const std::string config_xml_full_path      = Get_config_xml_full_path();    
559     const std::string description               = Get_description();
560     const std::string url                       = Get_doc_path();
561     const std::string data_path                 = Get_data_path();
562     const std::string default_temp_dir          = Get_default_temp_dir();    
563     const std::string file_separator            = Get_file_separator();    
564     const std::vector<std::string>bbs_paths     = Get_bbs_paths();
565     const std::vector<std::string>package_paths = Get_package_paths();
566     
567     bbtkMessage("Help",level, "============="   << std::endl);           
568     bbtkMessage("Help",level, "Configuration"   << std::endl);
569     bbtkMessage("Help",level, "============="   << std::endl);
570     bbtkMessage("Help",level, "bbtk_config.xml    : [" << config_xml_full_path  << "]" << std::endl); 
571     bbtkMessage("Help",level, "Documentation Path : [" << url             << "]" << std::endl);
572     bbtkMessage("Help",level, "Data Path          : [" << data_path       << "]" << std::endl);
573     bbtkMessage("Help",level, "Temp Directory     : [" << default_temp_dir << "]" << std::endl);
574     bbtkMessage("Help",level, "File Separator     : [" << file_separator  << "]" << std::endl);
575
576     std::vector<std::string>::const_iterator i;
577            
578     bbtkMessage("Help",level, "BBS Paths   " << std::endl);     
579     for (i = bbs_paths.begin(); i!=bbs_paths.end(); ++i )
580     {
581       bbtkMessage("Help",level,"--- ["<<*i<<"]"<<std::endl);
582     }    
583     
584     bbtkMessage("Help",level, "PACKAGE Paths : " << std::endl);     
585     for (i = package_paths.begin(); i!=package_paths.end(); ++i )
586     {
587       bbtkMessage("Help",level,"--- ["<<*i<<"]"<<std::endl);
588     }
589
590     bbtkDebugDecTab("Config",9);
591   }
592   //=========================================================================
593
594
595 } // namespace bbtk