-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4539 from NREL/MinGWbuild
Fix third-party library builds on MinGW.
- Loading branch information
Showing
11 changed files
with
78 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ modification, are permitted provided that the following conditions are met: | |
3. Neither the name of the University of California, Lawrence | ||
Berkeley National Laboratory, U.S. Dept. of Energy nor the names | ||
of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
derived from this software without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
|
@@ -83,7 +83,7 @@ derivative works thereof, in binary and source code form. | |
/// using BSD sockets. | ||
/// | ||
/// \author Michael Wetter, | ||
/// Simulation Research Group, | ||
/// Simulation Research Group, | ||
/// LBNL, | ||
/// [email protected] | ||
/// | ||
|
@@ -94,7 +94,7 @@ derivative works thereof, in binary and source code form. | |
/// This file provides methods that allow clients to | ||
/// establish a socket connection. Clients typically call | ||
/// the method \c establishclientsocket() | ||
/// once, and then call the method | ||
/// once, and then call the method | ||
/// \c exchangedoubleswithsocket() in each time step. | ||
/// At the end of the simulation, a client should call | ||
/// \c closeipc() to close the socket connection. | ||
|
@@ -108,7 +108,7 @@ derivative works thereof, in binary and source code form. | |
/////////////////////////////////////////////////////// | ||
#ifndef _UTILSOCKET_H_ | ||
#define _UTILSOCKET_H_ | ||
#ifdef _MSC_VER // Microsoft compiler | ||
#ifdef _WIN32 // Windows compiler | ||
#include <windows.h> | ||
#include <winsock.h> | ||
|
||
|
@@ -120,7 +120,7 @@ derivative works thereof, in binary and source code form. | |
#include <arpa/inet.h> | ||
#include <sys/socket.h> | ||
//#include <netinet/in.h> | ||
#include <netdb.h> | ||
#include <netdb.h> | ||
#endif | ||
|
||
#include <stdio.h> | ||
|
@@ -180,7 +180,7 @@ int assembleBuffer(int flag, | |
/// Gets an integer and does the required error checking. | ||
/// | ||
///\param nptr Pointer to character buffer that contains the number. | ||
///\param endptr After return, this variable contains a pointer to the | ||
///\param endptr After return, this variable contains a pointer to the | ||
/// character after the last character of the number. | ||
///\param base Base for the integer. | ||
///\param The value contained in the character buffer. | ||
|
@@ -192,11 +192,11 @@ int getIntCheckError(const char *nptr, char **endptr, const int base, | |
/// Gets a double and does the required error checking. | ||
/// | ||
///\param nptr Pointer to character buffer that contains the number. | ||
///\param endptr After return, this variable contains a pointer to the | ||
///\param endptr After return, this variable contains a pointer to the | ||
/// character after the last character of the number. | ||
///\param The value contained in the character buffer. | ||
///\return 0 if no error occurred. | ||
int getDoubleCheckError(const char *nptr, char **endptr, | ||
int getDoubleCheckError(const char *nptr, char **endptr, | ||
double* val); | ||
|
||
|
||
|
@@ -286,7 +286,7 @@ int establishclientsocket(const char *const docname); | |
///\param boolValWri Boolean values to write. | ||
///\sa int establishclientsocket(uint16_t *portNo) | ||
///\return The exit value of \c send, or a negative value if an error occured. | ||
int writetosocket(const int *sockfd, | ||
int writetosocket(const int *sockfd, | ||
const int *flaWri, | ||
const int *nDblWri, const int *nIntWri, const int *nBooWri, | ||
double *curSimTim, | ||
|
@@ -303,7 +303,7 @@ int writetosocket(const int *sockfd, | |
/// +1: simulation reached end time. | ||
/// -1: simulation terminates due to an (unspecified) error. | ||
/// -10: simulation terminates due to error during initialization. | ||
/// -20: simulation terminates due to error during time integration. | ||
/// -20: simulation terminates due to error during time integration. | ||
/// | ||
///\param sockfd Socket file descripter | ||
///\param flaWri Flag to be sent to the BCVTB | ||
|
@@ -353,7 +353,7 @@ int getrequiredbufferlength(const int nDbl, const int nInt, const int nBoo); | |
///\param intValRea Integer values read from socket. | ||
///\param boolValRea Boolean values read from socket. | ||
///\sa int establishclientsocket(uint16_t *portNo) | ||
int readfromsocket(const int *sockfd, int *flaRea, | ||
int readfromsocket(const int *sockfd, int *flaRea, | ||
int *nDblRea, int *nIntRea, int *nBooRea, | ||
double *curSimTim, | ||
double dblValRea[], int intValRea[], int booValRea[]); | ||
|
@@ -393,7 +393,7 @@ int readbufferfromsocket(const int *sockfd, | |
///\param boolValRea Boolean values read from socket. | ||
///\sa int establishclientsocket(uint16_t *portNo) | ||
///\return The exit value of \c send or \c read, or a negative value if an error occured. | ||
int exchangewithsocket(const int *sockfd, | ||
int exchangewithsocket(const int *sockfd, | ||
const int *flaWri, int *flaRea, | ||
const int *nDblWri, const int *nIntWri, const int *nBooWri, | ||
int *nDblRea, int *nIntRea, int *nBooRea, | ||
|
@@ -417,7 +417,7 @@ int exchangewithsocket(const int *sockfd, | |
///\param dblValRea Double values read from socket. | ||
///\sa int establishclientsocket(uint16_t *portNo) | ||
///\return The exit value of \c send or \c read, or a negative value if an error occured. | ||
int exchangedoubleswithsocket(const int *sockfd, | ||
int exchangedoubleswithsocket(const int *sockfd, | ||
const int *flaWri, int *flaRea, | ||
const int *nDblWri, | ||
int *nDblRea, | ||
|
@@ -444,7 +444,7 @@ int exchangedoubleswithsocket(const int *sockfd, | |
///\param flaexport Flag for FMUExport. | ||
///\sa int establishclientsocket(uint16_t *portNo) | ||
///\return The exit value of \c send or \c read, or a negative value if an error occured. | ||
int exchangedoubleswithsocketFMU(const int *sockfd, | ||
int exchangedoubleswithsocketFMU(const int *sockfd, | ||
const int *flaWri, int *flaRea, | ||
const int *nDblWri, | ||
int *nDblRea, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
/* ------------------------------------------------------------------------- | ||
/* ------------------------------------------------------------------------- | ||
/////////////////////////////////////////////////////// | ||
/// \file main.h | ||
/// | ||
/// \author Thierry Stephane Nouidui, | ||
/// Simulation Research Group, | ||
/// Simulation Research Group, | ||
/// LBNL, | ||
/// [email protected] | ||
/// | ||
/// \date 2011-10-11 | ||
/// | ||
/// This files contains the definition of all | ||
/// energyplus functions that are needed to mapped | ||
/// This files contains the definition of all | ||
/// energyplus functions that are needed to mapped | ||
/// to fmiFunctions | ||
/// This file is based on main.h that is copyrighted by | ||
/// QTronic GmbH and that is distributed under the BSD license. | ||
/// Function types for all FMU functions and a struct to wrap a FMU dll. | ||
/// Copyright 2010 QTronic GmbH. All rights reserved. | ||
/// QTronic GmbH and that is distributed under the BSD license. | ||
/// Function types for all FMU functions and a struct to wrap a FMU dll. | ||
/// Copyright 2010 QTronic GmbH. All rights reserved. | ||
/// ------------------------------------------------------------------------- | ||
*/ | ||
|
||
#ifndef main_h | ||
#define main_h | ||
|
||
// Use windows.h only for Windows | ||
#ifdef _MSC_VER | ||
// Use windows.h only for Windows | ||
#ifdef _WIN32 | ||
#include <windows.h> | ||
#define WINDOWS 1 | ||
#else | ||
|
@@ -38,95 +38,95 @@ | |
#include "xml_parser_cosim.h" | ||
#include "eplusModelFunctions.h" | ||
|
||
typedef const char* (*fGetTypesPlatform)(); | ||
typedef const char* (*fGetTypesPlatform)(); | ||
typedef const char* (*fGetVersion)(); | ||
typedef fmiComponent (*fInstantiateSlave)(fmiString instanceName, fmiString GUID, | ||
fmiString fmuLocation, fmiString mimeType, fmiReal timeout, | ||
fmiBoolean visible, fmiBoolean interactive, | ||
fmiCallbackFunctions functions, fmiBoolean loggingOn); | ||
typedef void (*fFreeSlaveInstance) (fmiComponent c); | ||
typedef fmiStatus (*fResetSlaveInstance) (fmiComponent c); | ||
typedef fmiComponent (*fInstantiateSlave)(fmiString instanceName, fmiString GUID, | ||
fmiString fmuLocation, fmiString mimeType, fmiReal timeout, | ||
fmiBoolean visible, fmiBoolean interactive, | ||
fmiCallbackFunctions functions, fmiBoolean loggingOn); | ||
typedef void (*fFreeSlaveInstance) (fmiComponent c); | ||
typedef fmiStatus (*fResetSlaveInstance) (fmiComponent c); | ||
typedef fmiStatus (*fSetDebugLogging) (fmiComponent c, fmiBoolean loggingOn); | ||
typedef fmiStatus (*fSetReal) (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiReal value[]); | ||
typedef fmiStatus (*fSetInteger)(fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiInteger value[]); | ||
typedef fmiStatus (*fSetBoolean)(fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiBoolean value[]); | ||
typedef fmiStatus (*fSetString) (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiString value[]); | ||
typedef fmiStatus (*fInitializeSlave)(fmiComponent c, fmiReal tStart, fmiBoolean StopTimeDefined, fmiReal tStop); | ||
typedef fmiStatus (*fInitializeSlave)(fmiComponent c, fmiReal tStart, fmiBoolean StopTimeDefined, fmiReal tStop); | ||
|
||
typedef fmiStatus (*fGetReal) (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiReal value[]); | ||
typedef fmiStatus (*fGetInteger)(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiInteger value[]); | ||
typedef fmiStatus (*fGetBoolean)(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiBoolean value[]); | ||
typedef fmiStatus (*fGetString) (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiString value[]); | ||
|
||
typedef fmiStatus (*fDoStep) (fmiComponent c, fmiReal currentCommunicationPoint, fmiReal communicationStepSize, | ||
typedef fmiStatus (*fDoStep) (fmiComponent c, fmiReal currentCommunicationPoint, fmiReal communicationStepSize, | ||
fmiBoolean newStep); // Zuo: add for co-sim | ||
|
||
typedef struct FMU{ | ||
int index; | ||
fmiString modelID; | ||
fmiString modelGUID; | ||
ModelDescription* modelDescription; | ||
HANDLE dllHandle; | ||
fGetTypesPlatform getTypesPlatform; | ||
fGetVersion getVersion; | ||
fInstantiateSlave instantiateSlave; | ||
fFreeSlaveInstance freeSlaveInstance; | ||
fResetSlaveInstance resetSlaveInstance; | ||
HANDLE dllHandle; | ||
fGetTypesPlatform getTypesPlatform; | ||
fGetVersion getVersion; | ||
fInstantiateSlave instantiateSlave; | ||
fFreeSlaveInstance freeSlaveInstance; | ||
fResetSlaveInstance resetSlaveInstance; | ||
fSetDebugLogging setDebugLogging; | ||
fSetReal setReal; | ||
fSetInteger setInteger; | ||
fSetBoolean setBoolean; | ||
fSetString setString; | ||
fInitializeSlave initializeSlave; | ||
fInitializeSlave initializeSlave; | ||
fGetReal getReal; | ||
fGetInteger getInteger; | ||
fGetBoolean getBoolean; | ||
fGetString getString; | ||
fDoStep doStep; | ||
fDoStep doStep; | ||
|
||
} FMU; | ||
|
||
fmiComponent fmiEPlusInstantiateSlave(char* fmuResFolder, | ||
fmiInteger *sizefmuResFolder, fmiReal *timeOut, fmiInteger *visible, | ||
fmiInteger *sizefmuResFolder, fmiReal *timeOut, fmiInteger *visible, | ||
fmiInteger *interactive, fmiInteger *loggingOn, fmiInteger *index); | ||
|
||
fmiStatus fmiEPlusInitializeSlave(fmiComponent *fmuInstance, | ||
fmiStatus fmiEPlusInitializeSlave(fmiComponent *fmuInstance, | ||
fmiReal *tStart, fmiInteger *newStep, fmiReal *tStop, fmiInteger *index); | ||
|
||
fmiStatus fmiEPlusGetReal(fmiComponent *fmuInstance, const fmiValueReference valRef [], | ||
fmiStatus fmiEPlusGetReal(fmiComponent *fmuInstance, const fmiValueReference valRef [], | ||
fmiReal outValue[], fmiInteger *numOutputs, fmiInteger *index); | ||
|
||
fmiStatus fmiEPlusSetReal(fmiComponent *fmuInstance, const fmiValueReference valRef[], | ||
fmiStatus fmiEPlusSetReal(fmiComponent *fmuInstance, const fmiValueReference valRef[], | ||
fmiReal inpVal[], fmiInteger *numInputs, fmiInteger *index); | ||
|
||
fmiStatus fmiEPlusDoStep(fmiComponent *fmuInstance, fmiReal *curCommPoint, | ||
fmiStatus fmiEPlusDoStep(fmiComponent *fmuInstance, fmiReal *curCommPoint, | ||
fmiReal *commStepSize, fmiInteger *newStep, fmiInteger *index); | ||
|
||
fmiStatus fmiEPlusFreeSlave(fmiComponent *fmuInstance, fmiInteger *index); | ||
|
||
fmiStatus fmiEPlusResetSlave(fmiComponent *fmuInstance, fmiInteger *index); | ||
fmiStatus fmiEPlusResetSlave(fmiComponent *fmuInstance, fmiInteger *index); | ||
|
||
fmiInteger fmiEPlusUnpack(char* fmuName, char* fmuOutputWorkingFolder, | ||
fmiInteger *sizefmuName, fmiInteger *sizefmuOutputWorkingFolder); | ||
fmiInteger fmiEPlusUnpack(char* fmuName, char* fmuOutputWorkingFolder, | ||
fmiInteger *sizefmuName, fmiInteger *sizefmuOutputWorkingFolder); | ||
|
||
fmiInteger addLibPathCurrentWorkingFolder(char* trimfmuOutputWorkingFolder_wLiB, | ||
char* fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder, | ||
fmiInteger addLibPathCurrentWorkingFolder(char* trimfmuOutputWorkingFolder_wLiB, | ||
char* fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder, | ||
fmiInteger *index); | ||
|
||
fmiInteger getValueReferenceByNameFMUInputVariables(char* variableName, | ||
fmiInteger getValueReferenceByNameFMUInputVariables(char* variableName, | ||
fmiInteger *sizeVariableName, fmiInteger *index); | ||
|
||
fmiInteger getValueReferenceByNameFMUOutputVariables(char* variableName, | ||
fmiInteger getValueReferenceByNameFMUOutputVariables(char* variableName, | ||
fmiInteger *sizeVariableName, fmiInteger *index); | ||
|
||
fmiInteger model_ID_GUID(char* fmuWorkingFolder, | ||
fmiInteger *sizefmuWorkingFolder, fmiInteger *numInputs, | ||
fmiInteger model_ID_GUID(char* fmuWorkingFolder, | ||
fmiInteger *sizefmuWorkingFolder, fmiInteger *numInputs, | ||
fmiInteger *numOutputs); | ||
|
||
fmiInteger addFMURootFolderName(char* fmuOutputWorkingFolder, | ||
fmiInteger addFMURootFolderName(char* fmuOutputWorkingFolder, | ||
char* fmuWorkingFolder, fmiInteger *sizefmuWorkingFolder); | ||
|
||
fmiInteger getfmiEPlusVersion(char* fmuWorkingFolder, | ||
fmiInteger getfmiEPlusVersion(char* fmuWorkingFolder, | ||
fmiInteger *sizefmuWorkingFolder, char *fmiVersionNumber, fmiInteger *index); | ||
|
||
fmiInteger checkOperatingSystem(char* errorMessage); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e5c9e89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (jasondegraw) - x86_64-MacOS-10.9-clang: OK (1119 of 1119 tests passed)
e5c9e89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (jasondegraw) - i386-Windows-7-VisualStudio-12: OK (1122 of 1122 tests passed)
e5c9e89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (jasondegraw) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (1122 of 1122 tests passed)
e5c9e89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (jasondegraw) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)
e5c9e89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (jasondegraw) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (622 of 622 tests passed)
e5c9e89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (jasondegraw) - Win64-Windows-7-VisualStudio-12: OK (1122 of 1122 tests passed)
e5c9e89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop (jasondegraw) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (1121 of 1122 tests passed)