Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into update_gems3
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	openstudiocore/CMakeLists.txt
#	openstudiocore/src/cli/openstudio_cli.rb
#	openstudiocore/src/model/PumpConstantSpeed_Impl.hpp
#	openstudiocore/src/model/test/Space_GTest.cpp
#	openstudiocore/src/utilities/bcl/RemoteBCL.cpp
  • Loading branch information
macumber committed Mar 11, 2019
2 parents fda8085 + 2ad0f51 commit efa5b7a
Show file tree
Hide file tree
Showing 145 changed files with 3,631 additions and 754 deletions.
31 changes: 17 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
.vs
test_gems
test_fails.txt
/build/
/build_debug/
/build-debug/
/build-meta/
/build_release/
/build-release/
/build_64/
/build-64/
/build-relwithdebinfo/
/build_relwithdebinfo/
/build_profile/
/build-profile/
/core-build/
/super-build/
# Ignore build folders, no matter where in the tree they might be
build/
build_debug/
build-debug/
build-meta/
build_release/
build-release/
build_64/
build-64/
build-relwithdebinfo/
build_relwithdebinfo/
build_profile/
build-profile/
core-build/
super-build/
/super-build-shared/
/super-build-static/

Expand All @@ -28,4 +29,6 @@ cmake-build-debug

developer/msvc/Visualizers/all_concat.natvis
.vscode/
.vs/
*.cache

28 changes: 21 additions & 7 deletions openstudiocore/CMake/FindEnergyPlus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# 'EnergyPlusV${Major}-${Minor}-${Patch}-${Build}'. This finder assumes that
# internal releases of the same major/minor/patch versions are prefered to official
# release builds.
# Note: after 9.1.0 included, E+ doesn't ship with a sublevel 'EnergyPlusV${Major}-${Minor}-${Patch}' anymore
#
# The module defines the following variables:
# ENERGYPLUS_FOUND - was a compatible version of EnergyPlus found
Expand Down Expand Up @@ -42,8 +43,7 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)

file(GLOB ENERGYPLUS_POSSIBLE_PATHS "${CMAKE_BINARY_DIR}/../../../[eE]nergy[pP]lus?*")

file(GLOB ENERGYPLUS_POSSIBLE_PATHS "${CMAKE_BINARY_DIR}/[eE]nergy[pP]lus-*")
#if(WIN32)
# file(GLOB ENERGYPLUS_POSSIBLE_PATHS "C:/[eE]nergy[pP]lus?*")
#elseif(APPLE)
Expand All @@ -57,28 +57,42 @@ list(SORT ENERGYPLUS_POSSIBLE_PATHS)
list(APPEND ENERGYPLUS_POSSIBLE_PATHS $ENV{ENERGYPLUSDIR})
list(REVERSE ENERGYPLUS_POSSIBLE_PATHS)

# If modifying this file, you may want to uncomment these lines (they are only cleared when redownloading the E+ package)
# unset(ENERGYPLUS_FOUND CACHE)
# unset(ENERGYPLUS_EXE CACHE)
# unset(ENERGYPLUS_IDD CACHE)
# unset(ENERGYPLUS_WEATHER_DIR CACHE)

# try to find the first path that matches all of the version requirements where EnergyPlus is found
foreach(PATH ${ENERGYPLUS_POSSIBLE_PATHS})

# extract version from path
string(REGEX REPLACE "^.*[eE]nergy[pP]lus[vV]?[-]?" "" VERSION ${PATH})
# extract version from path, in the format X.Y.Z.buildsha (where '.' here can also be '-', and build sha could be omitted)
# (could also just get BUILD_SHA there isn't of opening IDD below...)
string(REGEX REPLACE "^.*[eE]nergy[pP]lus[vV]?[-]?([0-9]+[\\.|-][0-9]+[\\.|-][0-9]+)([\\.|-][0-9a-z]+)?.*$" "\\1" VERSION ${PATH})
string(REGEX REPLACE "-" "." VERSION ${VERSION})
string(REGEX REPLACE "^([0-9]+\\.[0-9]+)\\..*" "\\1" VERSION_MAJOR_MINOR ${VERSION})

# if 8.2.0 or greater then look for a build number in the idd file
if((${VERSION} VERSION_EQUAL 8.2.0) OR (${VERSION} VERSION_GREATER 8.2.0))
if(${VERSION} VERSION_GREATER_EQUAL 8.2.0)
# Check that the file actually exists first, if not skip iteration
find_file(ENERGYPLUS_IDD "Energy+.idd" PATHS "${PATH}" "${PATH}/bin" NO_DEFAULT_PATH)
if(NOT EXISTS "${ENERGYPLUS_IDD}")
continue()
endif()

# we just need to read the first part of this large file
file(READ "${PATH}/Energy+.idd" IDD_TEXT LIMIT 1000)
file(READ "${ENERGYPLUS_IDD}" IDD_TEXT LIMIT 1000)
string(REGEX MATCH "!IDD_BUILD [0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z]" BUILD_SHA_LINE "${IDD_TEXT}")
string(REGEX MATCH "[0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z]" BUILD_SHA "${BUILD_SHA_LINE}")
set(ENERGYPLUS_GE_8_2_0 true)
set(ENERGYPLUS_GE_8_2_0 TRUE)
endif()

# set is match false
set(IS_MATCH FALSE)

# if a build SHA is provided then assume we need an exact match
if(ENERGYPLUS_GE_8_2_0 AND ENERGYPLUS_BUILD_SHA)
# EnergyPlus_FIND_VERSION is the argument passed by `find_package(EnergyPlus "${ENERGYPLUS_VERSION}" REQUIRED)`
if(${VERSION} VERSION_EQUAL ${EnergyPlus_FIND_VERSION})
if(ENERGYPLUS_BUILD_SHA STREQUAL BUILD_SHA)
set(IS_MATCH TRUE)
Expand Down
155 changes: 87 additions & 68 deletions openstudiocore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ set(OPENSTUDIO_LONG_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.$

# EnergyPlus Idd version
set(ENERGYPLUS_VERSION_MAJOR 9)
set(ENERGYPLUS_VERSION_MINOR 0)
set(ENERGYPLUS_VERSION_PATCH 1)
set(ENERGYPLUS_VERSION_MINOR 1)
set(ENERGYPLUS_VERSION_PATCH 0)
set(ENERGYPLUS_VERSION "${ENERGYPLUS_VERSION_MAJOR}.${ENERGYPLUS_VERSION_MINOR}.${ENERGYPLUS_VERSION_PATCH}")
# Build SHA is not required to have a value, but if it does OpenStudio will require this build.
set(ENERGYPLUS_BUILD_SHA "bb7ca4f0da")
set(ENERGYPLUS_BUILD_SHA "d830726d9e")

# ENERGYPLUS_RELEASE_NAME is used to locate the E+ download
# from the github releases
set(ENERGYPLUS_RELEASE_NAME "v9.0.1")
set(ENERGYPLUS_RELEASE_NAME "v9.1.0-IOFreeze")

# Radiance
set(RADIANCE_VERSION "5.0.a.12")
Expand Down Expand Up @@ -408,14 +409,14 @@ endif()

if(UNIX)
if(APPLE)
set(ENERGYPLUS_EXPECTED_HASH 7b8b8481a5f261800570de0d86e9c608)
set(ENERGYPLUS_EXPECTED_HASH e88d0ad1078c9ee7b176a9e9fbcaf4b0)
set(ENERGYPLUS_PLATFORM "Darwin-x86_64")
elseif(EXISTS "/etc/redhat-release")
# TODO: There aren't any redhat releases anymore, see PR #3145 too
set(ENERGYPLUS_EXPECTED_HASH 42b2fe2ef5df1d4cfef2160e46529a2f)
set(ENERGYPLUS_PLATFORM "Redhat-x86_64")
else()
set(ENERGYPLUS_EXPECTED_HASH 135e17dd5e4ca355b25bf77b61fc8cf2)
set(ENERGYPLUS_EXPECTED_HASH 00c6e9ca936927efe719e2c0244ac56b)
set(ENERGYPLUS_PLATFORM "Linux-x86_64")
endif()
set(ENERGYPLUS_PATH "EnergyPlus-${ENERGYPLUS_VERSION}-${ENERGYPLUS_BUILD_SHA}-${ENERGYPLUS_PLATFORM}")
Expand All @@ -436,12 +437,19 @@ if(UNIX)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/${ENERGYPLUS_PATH}")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz "${CMAKE_BINARY_DIR}/${ENERGYPLUS_PATH}.tar.gz" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
endif()
set(ENV{ENERGYPLUSDIR} "${CMAKE_BINARY_DIR}/${ENERGYPLUS_PATH}/EnergyPlus-${ENERGYPLUS_VERSION_MAJOR}-${ENERGYPLUS_VERSION_MINOR}-${ENERGYPLUS_VERSION_PATCH}")
# Prior to E+ 9.1.0 (OS 2.7.2), zip/tar.gz would extract to something like `./EnergyPlus-9.0.0-buildsha-Linux-x86_64/EnergyPlus-9-0-0`
if (ENERGYPLUS_VERSION VERSION_LESS "9.1.0")
set(ENV{ENERGYPLUSDIR} "${CMAKE_BINARY_DIR}/${ENERGYPLUS_PATH}/EnergyPlus-${ENERGYPLUS_VERSION_MAJOR}-${ENERGYPLUS_VERSION_MINOR}-${ENERGYPLUS_VERSION_PATCH}")
else()
# After 9.1.0, due to QtIFW/Mac packaging (NREL/EnergPlus#7148), it is going directly to `./EnergyPlus-9.1.0-buildsha-Linux-x86_64/`
set(ENV{ENERGYPLUSDIR} "${CMAKE_BINARY_DIR}/${ENERGYPLUS_PATH}")
endif()

elseif(WIN32)
if(CMAKE_CL_64)
set(ENERGYPLUS_PATH "EnergyPlus-${ENERGYPLUS_VERSION}-${ENERGYPLUS_BUILD_SHA}-Windows-x86_64")
set(ENERGYPLUS_ARCH 64)
set(ENERGYPLUS_EXPECTED_HASH 4094c49b908ba2feb3f0b352126ea0ac)
set(ENERGYPLUS_EXPECTED_HASH 11926295eddb3d7b6d5bcd851a1a0849)
else()
set(ENERGYPLUS_PATH "EnergyPlus-${ENERGYPLUS_VERSION}-${ENERGYPLUS_BUILD_SHA}-Windows-i386")
set(ENERGYPLUS_ARCH 32)
Expand Down Expand Up @@ -1441,7 +1449,9 @@ add_subdirectory(resources)

add_subdirectory(ruby)

add_subdirectory(sketchup_plugin)
if(BUILD_OS_APP)
add_subdirectory(sketchup_plugin)
endif()

foreach(D ${project_directories})
add_subdirectory(src/${D})
Expand Down Expand Up @@ -1865,11 +1875,6 @@ endif()
include(CPack)
include(CPackIFW)

cpack_add_component(SketchUpPlugin
DISPLAY_NAME "SketchUp Plugin"
DESCRIPTION "SketchUp Plugin"
)

cpack_add_component(CLI
DISPLAY_NAME "Command Line Interface"
DESCRIPTION "Command Line Interface"
Expand All @@ -1880,26 +1885,6 @@ cpack_add_component(RubyAPI
DESCRIPTION "Ruby API"
)

cpack_add_component(CSharpAPI
DISPLAY_NAME "C# API"
DESCRIPTION "C# API"
)

cpack_add_component(PAT
DISPLAY_NAME "Parametric Analysis Tool"
DESCRIPTION "Parametric Analysis Tool"
)

cpack_add_component(OpenStudioApp
DISPLAY_NAME "OpenStudio Application"
DESCRIPTION "OpenStudio Application"
)

cpack_add_component(DView
DISPLAY_NAME "DView"
DESCRIPTION "DView Application for viewing results"
)

cpack_add_component(EnergyPlus
DISPLAY_NAME "EnergyPlus"
DESCRIPTION "Minimal EnergyPlus installation"
Expand All @@ -1910,17 +1895,6 @@ cpack_add_component(Radiance
DESCRIPTION "Full Radiance installation"
)

cpack_add_component(Resources
DISPLAY_NAME "Application Resources"
DESCRIPTION "Resource Files used by the OpenStudio Application and SketchUp Plugin"
)

cpack_ifw_configure_component(SketchUpPlugin
DEPENDS Resources
SCRIPT sketchup_plugin/install_operations.qs
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(CLI
SCRIPT src/cli/install_operations.qs
REQUIRES_ADMIN_RIGHTS
Expand All @@ -1930,42 +1904,87 @@ cpack_ifw_configure_component(RubyAPI
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(CSharpAPI
cpack_ifw_configure_component(EnergyPlus
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(PAT
DEPENDS CLI RubyAPI
SCRIPT pat/install_operations.qs
cpack_ifw_configure_component(Radiance
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(OpenStudioApp
DEPENDS Resources CLI
SCRIPT src/openstudio_app/install_operations.qs
cpack_ifw_configure_component(Unspecified
SCRIPT src/install_utility/install_operations.qs
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(DView
REQUIRES_ADMIN_RIGHTS
)
if(BUILD_CSHARP_BINDINGS)
cpack_add_component(CSharpAPI
DISPLAY_NAME "C# API"
DESCRIPTION "C# API"
)

cpack_ifw_configure_component(EnergyPlus
REQUIRES_ADMIN_RIGHTS
)
cpack_ifw_configure_component(CSharpAPI
REQUIRES_ADMIN_RIGHTS
)
endif()

cpack_ifw_configure_component(Radiance
REQUIRES_ADMIN_RIGHTS
)
if(BUILD_OS_APP)

cpack_add_component(Resources
DISPLAY_NAME "Application Resources"
DESCRIPTION "Resource Files used by the OpenStudio Application and SketchUp Plugin"
)

cpack_add_component(SketchUpPlugin
DISPLAY_NAME "SketchUp Plugin"
DESCRIPTION "SketchUp Plugin"
)

cpack_ifw_configure_component(Resources
REQUIRES_ADMIN_RIGHTS
)
cpack_add_component(OpenStudioApp
DISPLAY_NAME "OpenStudio Application"
DESCRIPTION "OpenStudio Application"
)

cpack_ifw_configure_component(Unspecified
SCRIPT src/install_utility/install_operations.qs
REQUIRES_ADMIN_RIGHTS
)
cpack_ifw_configure_component(Resources
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(SketchUpPlugin
DEPENDS Resources
SCRIPT sketchup_plugin/install_operations.qs
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(OpenStudioApp
DEPENDS Resources CLI
SCRIPT src/openstudio_app/install_operations.qs
REQUIRES_ADMIN_RIGHTS
)
endif()

if(BUILD_PAT)
cpack_add_component(PAT
DISPLAY_NAME "Parametric Analysis Tool"
DESCRIPTION "Parametric Analysis Tool"
)

cpack_ifw_configure_component(PAT
DEPENDS CLI RubyAPI
SCRIPT pat/install_operations.qs
REQUIRES_ADMIN_RIGHTS
)
endif()

if(BUILD_DVIEW)
cpack_add_component(DView
DISPLAY_NAME "DView"
DESCRIPTION "DView Application for viewing results"
)

cpack_ifw_configure_component(DView
REQUIRES_ADMIN_RIGHTS
)
endif()

if( BUILD_NUGET_PACKAGE )
configure_file( OpenStudio.nuspec.in OpenStudio.nuspec )
Expand Down
4 changes: 3 additions & 1 deletion openstudiocore/resources/eefg/dummy.idf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
! 8.8; !- Version Identifier
! Version,
! 8.9; !- Version Identifier

! Version,
! 9.0; !- Version Identifier

! Version,
! 9.1; !- Version Identifier

Building,
Building1, !- Name
Big, !- North Axis {deg}
Expand Down
Loading

0 comments on commit efa5b7a

Please sign in to comment.