Пример #1
0
/**
 * @brief Prints a greeting message to the standard output containing code
 * version and revision number
 */
void greetings(void) {

  printf(" Welcome to the cosmological code\n");
  printf("    ______       _________________\n");
  printf("   / ___/ |     / /  _/ ___/_  __/\n");
  printf("   \\__ \\| | /| / // // /_   / /   \n");
  printf("  ___/ /| |/ |/ // // __/  / /    \n");
  printf(" /____/ |__/|__/___/_/    /_/     \n");
  printf(" SPH With Inter-dependent Fine-grained Tasking\n\n");

  printf(" Version : %s\n", package_version());
  printf(" Revision: %s, Branch: %s\n", git_revision(), git_branch());
  printf(" Webpage : www.swiftsim.com\n\n");
  printf(" Compiler: %s, Version: %s\n", compiler_name(), compiler_version());
#ifdef HAVE_HDF5
  printf(" HDF5 library version: %s\n", hdf5_version());
#endif
#ifdef WITH_MPI
  printf(" MPI library: %s\n", mpi_version());
#ifdef HAVE_METIS
  printf(" METIS library version: %s\n", metis_version());
#endif
#endif
  printf("\n");
}
Пример #2
0
int remove(const std::string& package_name, const po::variables_map& config_file)
{
  std::cout << translate("remove_attempt") << " " << package_name << '\n';

  std::string installed_pkgs = config_var("installed_packages", config_file);
  std::string installed_version = package_version(package_name, installed_pkgs);

  if(installed_version == "")
  {
    std::cout << translate("pkg_not_installed") << '\n';
    return 0;
  }

  std::string local = config_var("local", config_file);
  std::string pkg_file = local + package_name + "_" + installed_version + ".tar";
  
  package* pkg = load_package(local + package_name + "_" + installed_version + ".tar");

  if(pkg)
  {
    // wypisanie informacji o pakiecie
     std::cout << translate("removing") << ": " << std::endl
	      << " " << translate("name") << ": " << pkg->name << std::endl
	      << " " << translate("version") << ": " << pkg->version << std::endl
	      << " " << translate("licence") << ": " << pkg->licence << std::endl
	      << " " << translate("description") << ": " << pkg->description << std::endl;

     // wypisanie plików, które zostaną usunięte
    for(std::vector<std::pair<std::string, std::string> >::iterator ins = pkg->files.begin();
	ins != pkg->files.end(); ++ins)
    {
      std::cout << translate("removing") << " " << (*ins).first << " "+ translate("from") << " " <<
	(*ins).second << std::endl;
    }

    // usunięcie pakietu - operacje dyskowe
    remove_package(pkg, config_file);
    
    delete pkg;
  }
  return 0;
}