LCOV - code coverage report
Current view: top level - config - ConfigInstall.inc (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 41 61 67.2 %
Date: 2020-11-18 11:20:57 Functions: 15 23 65.2 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2011-2019 The plumed team
       3             :    (see the PEOPLE file at the root of the distribution for a list of names)
       4             : 
       5             :    See http://www.plumed.org for more information.
       6             : 
       7             :    This file is part of plumed, version 2.
       8             : 
       9             :    plumed is free software: you can redistribute it and/or modify
      10             :    it under the terms of the GNU Lesser General Public License as published by
      11             :    the Free Software Foundation, either version 3 of the License, or
      12             :    (at your option) any later version.
      13             : 
      14             :    plumed is distributed in the hope that it will be useful,
      15             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      16             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17             :    GNU Lesser General Public License for more details.
      18             : 
      19             :    You should have received a copy of the GNU Lesser General Public License
      20             :    along with plumed.  If not, see <http://www.gnu.org/licenses/>.
      21             : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
      22             : 
      23             : #include "Config.h"
      24             : #include "version.h"
      25             : #include <cstdlib>
      26             : #include <cstring>
      27             : 
      28             : namespace PLMD {
      29             : namespace config {
      30             : 
      31             : // This is a fix to allow conda to correctly replace paths in binary files.
      32             : // These functions should not be static or they will be optimized away!
      33        3412 : const char* plumed_root() {return "/home/runner/opt/lib/plumed";}
      34           2 : const char* plumed_soext() {return "so";}
      35         341 : const char* plumed_htmldir() {return "/home/runner/opt/share/doc/plumed";}
      36         341 : const char* plumed_includedir() {return "/home/runner/opt/include";}
      37         341 : const char* plumed_program_name() {return "plumed";}
      38             : 
      39           2 : std::string getSoExt() {
      40           2 :   return plumed_soext();
      41             : }
      42             : 
      43        1036 : bool isInstalled() {
      44        1036 :   return true;
      45             : }
      46             : 
      47        3412 : std::string getPlumedRoot() {
      48        3412 :   char *env = std::getenv("PLUMED_ROOT");
      49             :   std::string ss;
      50        3412 :   if( env == NULL) {
      51        3412 :     ss=plumed_root();
      52             :   } else {
      53           0 :     ss=std::string( env );
      54             :   }
      55        3412 :   return ss;
      56             : }
      57             : 
      58         341 : std::string getPlumedHtmldir() {
      59         341 :   if(!isInstalled()) return getPlumedRoot();
      60         341 :   char *env = std::getenv("PLUMED_HTMLDIR");
      61             :   std::string ss;
      62         341 :   if( env == NULL) {
      63         341 :     ss=plumed_htmldir();
      64             :   } else {
      65           0 :     ss=std::string( env );
      66             :   }
      67             :   return ss;
      68             : }
      69             : 
      70         341 : std::string getPlumedIncludedir() {
      71         341 :   if(!isInstalled()) return getPlumedRoot()+"/include";
      72         341 :   char *env = std::getenv("PLUMED_INCLUDEDIR");
      73             :   std::string ss;
      74         341 :   if( env == NULL) {
      75         341 :     ss=plumed_includedir();
      76             :   } else {
      77           0 :     ss=std::string( env );
      78             :   }
      79             :   return ss;
      80             : }
      81             : 
      82         341 : std::string getPlumedProgramName() {
      83         341 :   if(!isInstalled()) return "plumed";
      84         341 :   char *env = std::getenv("PLUMED_PROGRAM_NAME");
      85             :   std::string ss;
      86         341 :   if( env == NULL) {
      87         341 :     ss=plumed_program_name();
      88             :   } else {
      89           0 :     ss=std::string( env );
      90             :   }
      91             :   return ss;
      92             : }
      93             : 
      94         341 : std::string getEnvCommand() {
      95        1705 :   return "env PLUMED_ROOT=\""+getPlumedRoot()+"\""+
      96        2046 :          " env PLUMED_HTMLDIR=\""+getPlumedHtmldir()+"\""+
      97        2046 :          " env PLUMED_INCLUDEDIR=\""+getPlumedIncludedir()+"\""+
      98        2046 :          " env PLUMED_PROGRAM_NAME=\""+getPlumedProgramName()+"\""+
      99        1023 :          " env PLUMED_IS_INSTALLED=\""+(true?"yes":"no")+"\"";
     100             : }
     101             : 
     102           0 : std::string getVersion() {
     103           0 :   return PLUMED_VERSION_SHORT;
     104             : }
     105             : 
     106         635 : std::string getVersionLong() {
     107         635 :   return PLUMED_VERSION_LONG;
     108             : }
     109             : 
     110         635 : std::string getVersionGit() {
     111         635 :   return PLUMED_VERSION_GIT;
     112             : }
     113             : 
     114          26 : std::string getMakefile() {
     115             :   static const char conf [] = {
     116             : #include "Makefile.conf.xxd"
     117             :     , 0x00
     118             :   };
     119          52 :   return std::string(conf,conf+std::strlen(conf));
     120             : }
     121             : 
     122           0 : bool hasMatheval() {
     123             : #if __PLUMED_HAS_MATHEVAL
     124           0 :   return true;
     125             : #else
     126             :   return false;
     127             : #endif
     128             : }
     129             : 
     130           0 : bool hasDlopen() {
     131             : #if __PLUMED_HAS_DLOPEN
     132           0 :   return true;
     133             : #else
     134             :   return false;
     135             : #endif
     136             : }
     137             : 
     138           0 : bool hasCregex() {
     139             : #if __PLUMED_HAS_CREGEX
     140           0 :   return true;
     141             : #else
     142             :   return false;
     143             : #endif
     144             : }
     145             : 
     146           0 : bool hasMolfile() {
     147             : #if __PLUMED_HAS_MOLFILE_PLUGINS
     148           0 :   return true;
     149             : #else
     150             :   return false;
     151             : #endif
     152             : }
     153             : 
     154           0 : bool hasExternalMolfile() {
     155             : #if __PLUMED_HAS_EXTERNAL_MOLFILE_PLUGINS
     156             :   return true;
     157             : #else
     158           0 :   return false;
     159             : #endif
     160             : }
     161             : 
     162           0 : bool hasZlib() {
     163             : #if __PLUMED_HAS_ZLIB
     164           0 :   return true;
     165             : #else
     166             :   return false;
     167             : #endif
     168             : }
     169             : 
     170           0 : bool hasXdrfile() {
     171             : #if __PLUMED_HAS_XDRFILE
     172           0 :   return true;
     173             : #else
     174             :   return false;
     175             : #endif
     176             : }
     177             : 
     178             : }
     179             : }
     180             : 

Generated by: LCOV version 1.13