Skip to content

Commit

Permalink
Fix the Engeryplus to work with newer compiler and updated version nu…
Browse files Browse the repository at this point in the history
…mber
  • Loading branch information
d3j331 committed Nov 21, 2022
1 parent 89490d1 commit cf48985
Show file tree
Hide file tree
Showing 9 changed files with 15,044 additions and 249 deletions.
2 changes: 1 addition & 1 deletion examples/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def loadshed_test():
def loadshed_cli_test():
tesp.start_test('Loadshed examples for HELICS CLI')
os.chdir('capabilities/loadshed-HELICS3-EPlus')
subprocess.Popen('clean', shell=True).wait()
subprocess.Popen('./clean.sh', shell=True).wait()
subprocess.Popen('make clean > make.log', shell=True).wait()
subprocess.Popen('make >> make.log', shell=True).wait()
tesp.run_test('run.sh', 'Loadshed - HELICS/EPlus')
Expand Down
1 change: 1 addition & 0 deletions examples/capabilities/loadshed-HELICS3-EPlus/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rm -f *.log
rm -f *.csv
rm -f *.xml
rm -f *.bnd
rm -f *.o
rm -f out.txt
rm -f *metrics.json
rm -rf output
Binary file not shown.
Binary file not shown.
108 changes: 108 additions & 0 deletions scripts/build/EnergyPlus.patch
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,111 @@ index 667e11bff..8057eca58 100644
// std::cout << "requested time: " << preSimTim << ", returned time: " << time_returned << std::endl;
// if (preSimTim != time_returned) {
// ShowFatalError("helics::requestTime() was interrupted with earlier time");
diff --git a/third_party/BCVTB/utilXml.c b/third_party/BCVTB/utilXml.c
index 5ae4be2e7..16861a5d8 100644
--- a/third_party/BCVTB/utilXml.c
+++ b/third_party/BCVTB/utilXml.c
@@ -103,6 +103,30 @@ derivative works thereof, in binary and source code form.

#include "utilXml.h"

+char Buff[BUFFSIZE]; ///< Local buffer for reading in the xml file
+
+Stack2 expStk; ///< Variables for getxmlvalue function
+
+char * att; ///< Local global variable for function \c getxmlvalue
+char * vals; ///< Local global variable for function \c getxmlvalue
+int * numVals; ///< Local global variable for function \c getxmlvalue
+int PARSEVALUE; ///< flag for parsing xml values 1 if parse, 0 if not parse
+int ERROR_STATUS; ///< flag for xml element handler error status settings
+
+////////////////////////////////////////////////////////////////
+/// local global variables for function \c getepvariables
+////////////////////////////////////////////////////////////////
+char * outputVarsName; ///< the string pointer to the parsed output variable names
+char * outputVarsType; ///< the string pointer to the parsed output variable types
+int * numOutputVars; ///< the integer pointer to the number of output variables
+char * inputVars; ///< the string pointer to the input variables
+int * numInputVars; ///< the integer pointer to the number of input variables
+int * inputVarsType; ///< the integer array to store the types of each input variables
+char ** inputKeys; ///< the string array to store the types of input variable types
+int numInputKeys; ///< the number of input variable types
+int source; ///< flag for function /c getepvariables 0=EnergyPlus, 1=Ptolemy
+int const * strLen; ///< the length of string parsed to this function
+
////////////////////////////////////////////////////////////////
/// Call back functions that will be used by the expat xml parser.
///
diff --git a/third_party/BCVTB/utilXml.h b/third_party/BCVTB/utilXml.h
index 6879dcd77..a09b043c2 100644
--- a/third_party/BCVTB/utilXml.h
+++ b/third_party/BCVTB/utilXml.h
@@ -100,7 +100,8 @@ derivative works thereof, in binary and source code form.
/// \sa getepvariables()
///
//////////////////////////////////////////////////////////
-
+#ifndef _UTILXML_H_
+#define _UTILXML_H_
#include <stdio.h>
//#include <stdlib.h>
#include <string.h>
@@ -124,7 +125,7 @@ derivative works thereof, in binary and source code form.

#define BUFFSIZE 8192

-char Buff[BUFFSIZE]; ///< Local buffer for reading in the xml file
+extern char Buff[BUFFSIZE]; ///< Local buffer for reading in the xml file

////////////////////////////////////////////////////////////////
///\struct A simple stack structure to keep track of the parent elements
@@ -136,27 +137,27 @@ typedef struct Stack2 {
} Stack2;


-Stack2 expStk; ///< Variables for getxmlvalue function
+extern Stack2 expStk; ///< Variables for getxmlvalue function

-char * att; ///< Local global variable for function \c getxmlvalue
-char * vals; ///< Local global variable for function \c getxmlvalue
-int * numVals; ///< Local global variable for function \c getxmlvalue
-int PARSEVALUE; ///< flag for parsing xml values 1 if parse, 0 if not parse
-int ERROR_STATUS; ///< flag for xml element handler error status settings
+extern char * att; ///< Local global variable for function \c getxmlvalue
+extern char * vals; ///< Local global variable for function \c getxmlvalue
+extern int * numVals; ///< Local global variable for function \c getxmlvalue
+extern int PARSEVALUE; ///< flag for parsing xml values 1 if parse, 0 if not parse
+extern int ERROR_STATUS; ///< flag for xml element handler error status settings

////////////////////////////////////////////////////////////////
/// local global variables for function \c getepvariables
////////////////////////////////////////////////////////////////
-char * outputVarsName; ///< the string pointer to the parsed output variable names
-char * outputVarsType; ///< the string pointer to the parsed output variable types
-int * numOutputVars; ///< the integer pointer to the number of output variables
-char * inputVars; ///< the string pointer to the input variables
-int * numInputVars; ///< the integer pointer to the number of input variables
-int * inputVarsType; ///< the integer array to store the types of each input variables
-char ** inputKeys; ///< the string array to store the types of input variable types
-int numInputKeys; ///< the number of input variable types
-int source; ///< flag for function /c getepvariables 0=EnergyPlus, 1=Ptolemy
-int const * strLen; ///< the length of string parsed to this function
+extern char * outputVarsName; ///< the string pointer to the parsed output variable names
+extern char * outputVarsType; ///< the string pointer to the parsed output variable types
+extern int * numOutputVars; ///< the integer pointer to the number of output variables
+extern char * inputVars; ///< the string pointer to the input variables
+extern int * numInputVars; ///< the integer pointer to the number of input variables
+extern int * inputVarsType; ///< the integer array to store the types of each input variables
+extern char ** inputKeys; ///< the string array to store the types of input variable types
+extern int numInputKeys; ///< the number of input variable types
+extern int source; ///< flag for function /c getepvariables 0=EnergyPlus, 1=Ptolemy
+extern int const * strLen; ///< the length of string parsed to this function


////////////////////////////////////////////////////////////////
@@ -369,3 +370,5 @@ getxmlvalue(
////////////////////////////////////////////////////////////////
int
check_variable_cfg_Validate(char const * const fileName);
+
+#endif /* _UTILXML_H_ */
Loading

0 comments on commit cf48985

Please sign in to comment.