Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into Geometry_Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Mar 9, 2021
2 parents 3371648 + 83b05b5 commit e004637
Show file tree
Hide file tree
Showing 216 changed files with 42,828 additions and 3,646 deletions.
63 changes: 38 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ endif()

# EnergyPlus Idd version
set(ENERGYPLUS_VERSION_MAJOR 9)
set(ENERGYPLUS_VERSION_MINOR 4)
set(ENERGYPLUS_VERSION_MINOR 5)
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 "998c4b761e")
set(ENERGYPLUS_BUILD_SHA "003df71316")

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

# Radiance
set(RADIANCE_VERSION "5.0.a.12")
Expand Down Expand Up @@ -542,8 +542,6 @@ elseif(UNIX)
OUTPUT_STRIP_TRAILING_WHITESPACE
)

message(STATUS "LSB_RELEASE_ID_SHORT = ${LSB_RELEASE_ID_SHORT}")

# -is outputs "Ubuntu" or "Fedora"
execute_process(COMMAND ${LSB_RELEASE} -is
OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT
Expand All @@ -552,31 +550,29 @@ elseif(UNIX)

# eg: `-Ubuntu18.04`
set(ENERGYPLUS_SYSTEM_VERSION "-${LSB_RELEASE_ID_SHORT}${LSB_RELEASE_VERSION_SHORT}")

message(STATUS "LSB_RELEASE_ID_SHORT=${LSB_RELEASE_ID_SHORT}, LSB_RELEASE_VERSION_SHORT=${LSB_RELEASE_VERSION_SHORT}")

elseif(MSVC)
# no-op
set(ENERGYPLUS_SYSTEM_VERSION "")
endif()

# EnergyPlus

if((DEFINED ENERGYPLUS_EXE) AND NOT (ENERGYPLUS_EXE STREQUAL ""))
get_filename_component(OLD_ENERGYPLUS_EXTRACTED_DIR "${ENERGYPLUS_EXE}" DIRECTORY)
message("OLD_ENERGYPLUS_EXTRACTED_DIR=${OLD_ENERGYPLUS_EXTRACTED_DIR}")
endif()

if(UNIX)
if(APPLE)
set(ENERGYPLUS_EXPECTED_HASH ba91a82e2fd6f3ea6998ea14869ccb63)
set(ENERGYPLUS_EXPECTED_HASH 0bf64f4b153a87c3a4822321bc5878e1)
set(ENERGYPLUS_PLATFORM "Darwin${ENERGYPLUS_SYSTEM_VERSION}-x86_64")
elseif(EXISTS "/etc/redhat-release")
# TODO: There aren't any redhat releases anymore, see PR #3145 too
set(ENERGYPLUS_EXPECTED_HASH DOES_NOT_EXIST_02ed618aab65bf46c96bf1faf2e1905b)
set(ENERGYPLUS_PLATFORM "Redhat-x86_64")
else()
if(LSB_RELEASE_VERSION_SHORT MATCHES "20.04")
set(ENERGYPLUS_EXPECTED_HASH f355b78b137341836882d773e1ebdfc6)
set(ENERGYPLUS_EXPECTED_HASH c1a9d2a5628844ae8fe155f5430bc8b1)
else() # 18.04
set(ENERGYPLUS_EXPECTED_HASH 009b2e6811ef4b3ae02cd500bbbdf056)
set(ENERGYPLUS_EXPECTED_HASH b43e176d532cb28f5ce5ffdcbd6f93c6)
endif()
set(ENERGYPLUS_PLATFORM "Linux${ENERGYPLUS_SYSTEM_VERSION}-x86_64")
endif()
Expand All @@ -600,10 +596,6 @@ if(UNIX)
EXPECTED_MD5 ${ENERGYPLUS_EXPECTED_HASH})
endif()

# Remove the old extracted dir if exists
if(DEFINED OLD_ENERGYPLUS_EXTRACTED_DIR)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${OLD_ENERGYPLUS_EXTRACTED_DIR}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${PROJECT_BINARY_DIR}/${ENERGYPLUS_PATH}")

endif()
Expand All @@ -612,11 +604,11 @@ elseif(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bit
set(ENERGYPLUS_PATH "EnergyPlus-${ENERGYPLUS_VERSION}-${ENERGYPLUS_BUILD_SHA}-Windows-x86_64")
set(ENERGYPLUS_ARCH 64)
set(ENERGYPLUS_EXPECTED_HASH 8e126177317a1f72bde682b8f5f461c0)
set(ENERGYPLUS_EXPECTED_HASH 0a8a78c639e0007dcea300ef05e4acd4)
else()
set(ENERGYPLUS_PATH "EnergyPlus-${ENERGYPLUS_VERSION}-${ENERGYPLUS_BUILD_SHA}-Windows-i386")
set(ENERGYPLUS_ARCH 32)
set(ENERGYPLUS_EXPECTED_HASH 0ef542aab0852590994dd54c2debc566)
set(ENERGYPLUS_EXPECTED_HASH 95d566581a6841f6c86b7e8dca6a74a2)
endif()
if(EXISTS "${PROJECT_BINARY_DIR}/${ENERGYPLUS_PATH}.zip")
file(MD5 "${PROJECT_BINARY_DIR}/${ENERGYPLUS_PATH}.zip" ENERGYPLUS_HASH)
Expand All @@ -629,16 +621,30 @@ elseif(WIN32)
SHOW_PROGRESS
EXPECTED_MD5 ${ENERGYPLUS_EXPECTED_HASH})

# Remove the old extracted dir if exists
if(DEFINED OLD_ENERGYPLUS_EXTRACTED_DIR)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${OLD_ENERGYPLUS_EXTRACTED_DIR}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${PROJECT_BINARY_DIR}/${ENERGYPLUS_PATH}")

endif()

endif()

if((DEFINED ENERGYPLUS_EXE) AND NOT (ENERGYPLUS_EXE STREQUAL ""))
get_filename_component(OLD_ENERGYPLUS_EXTRACTED_DIR "${ENERGYPLUS_EXE}" DIRECTORY)
if(NOT "${OLD_ENERGYPLUS_EXTRACTED_DIR}" MATCHES ".*${ENERGYPLUS_PATH}.*")

message(STATUS "Removing old extracted dir = ${OLD_ENERGYPLUS_EXTRACTED_DIR}")
# Remove the old extracted dir
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${OLD_ENERGYPLUS_EXTRACTED_DIR}")

# Unset variables so that FindEnergyPlus is called again
unset(ENERGYPLUS_FOUND CACHE)
unset(ENERGYPLUS_EXE CACHE)
unset(ENERGYPLUS_IDD CACHE)
unset(ENERGYPLUS_WEATHER_DIR CACHE)

endif()
endif()


# Allows placing the archive manually in the build dir too
if (NOT EXISTS "${ENERGYPLUS_PATH}")
unset(ENERGYPLUS_FOUND CACHE)
Expand Down Expand Up @@ -934,6 +940,7 @@ set(project_directories
utilities
model
energyplus
epjson
radiance
gbxml
airflow
Expand Down Expand Up @@ -1179,6 +1186,7 @@ if(APPLE)
set(CPACK_IFW_TARGET_DIRECTORY /Applications/OpenStudio-${OpenStudio_VERSION}/)
elseif(UNIX)
# Default method doesn't use IFW but Deb, so this one is probably useless (but harmless)
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OPENSTUDIO_LONG_VERSION}-${LSB_RELEASE_ID_SHORT}-${LSB_RELEASE_VERSION_SHORT}")
set(CPACK_IFW_TARGET_DIRECTORY /usr/local/openstudio-${OpenStudio_VERSION}/)
# These two will set the .deb install path correctly
set(CPACK_SET_DESTDIR ON)
Expand Down Expand Up @@ -1255,6 +1263,7 @@ if(APPLE)
install(PROGRAMS "${ENERGYPLUS_DIR}/libintl.8.dylib" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
#install(PROGRAMS "${ENERGYPLUS_DIR}/libpythonwrapper.dylib" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
install(PROGRAMS "${ENERGYPLUS_DIR}/libgcc_s.1.dylib" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
install(PROGRAMS "${ENERGYPLUS_DIR}/ssc.dylib" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
elseif(WIN32)
file(GLOB ENERGYPLUS_MSVC_FILES "${ENERGYPLUS_DIR}/msvc*.dll")
foreach(msvc_file IN LISTS ENERGYPLUS_MSVC_FILES)
Expand All @@ -1276,9 +1285,13 @@ elseif(WIN32)
#install(PROGRAMS "${ENERGYPLUS_DIR}/pythonwrapper.dll" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
#install(PROGRAMS "${ENERGYPLUS_PATH}/libgfortran.5.dylib" DESTINATION ./EnergyPlus/)
#install(PROGRAMS "${ENERGYPLUS_PATH}/libquadmath.0.dylib" DESTINATION ./EnergyPlus/)
install(PROGRAMS "${ENERGYPLUS_DIR}/ssc.dll" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
elseif(UNIX)
install(PROGRAMS "${ENERGYPLUS_DIR}/libpython3.6m.so.1.0" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
#install(PROGRAMS "${ENERGYPLUS_DIR}/libpythonwrapper.so" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
file(GLOB ENERGYPLUS_PYTHON_LIBS "${ENERGYPLUS_DIR}/libpython*")
foreach(python_lib IN LISTS ENERGYPLUS_PYTHON_LIBS)
install(PROGRAMS "${python_lib}" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
endforeach()
install(PROGRAMS "${ENERGYPLUS_DIR}/ssc.so" DESTINATION ./EnergyPlus/ COMPONENT EnergyPlus)
else()
#install(PROGRAMS "${ENERGYPLUS_PATH}/libgfortran.5.dylib" DESTINATION ./EnergyPlus/)
#install(PROGRAMS "${ENERGYPLUS_PATH}/libquadmath.0.dylib" DESTINATION ./EnergyPlus/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Build for PR to develop branch only.
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) {

openstudio_incremental_develop_linux()
openstudio_incremental_develop_ubuntu_1804()

}
11 changes: 11 additions & 0 deletions Jenkinsfile_develop_ubuntu_2004
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

//Jenkins pipelines are stored in shared libaries. Please see: https://github.com/NREL/cbci_jenkins_libs

@Library('cbci_shared_libs') _

// Build for PR to develop branch only.
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) {

openstudio_incremental_develop_ubuntu_2004()

}
2 changes: 1 addition & 1 deletion ProjectMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ macro(MAKE_SWIG_TARGET NAME SIMPLENAME KEY_I_FILE I_FILES PARENT_TARGET PARENT_S
set_target_properties(${swig_target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ruby/")
set_target_properties(${swig_target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ruby/")
target_link_libraries(${swig_target} ${${PARENT_TARGET}_depends})
target_include_directories(${swig_target} PRIVATE ${RUBY_INCLUDE_DIRS})
target_include_directories(${swig_target} SYSTEM PRIVATE ${RUBY_INCLUDE_DIRS})
add_dependencies(${swig_target} ${PARENT_TARGET})

# QT-Separation-Move
Expand Down
16 changes: 16 additions & 0 deletions csharp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,19 @@ if( BUILD_NUGET_PACKAGE )
endif()

endif()

if(BUILD_TESTING)
if(NOT SYSTEM_RUBY_EXECUTABLE)
message(WARNING "Your system ruby wasn't found, you won't be able to run the `ctest -R CSharpTest` command and the tests won't be created at all.")
else()
# Call with Ruby itself
add_test(NAME "CSharpTest-FindMissingSWIGTypes"
COMMAND "${CMAKE_COMMAND}" -E chdir "${CMAKE_CURRENT_BINARY_DIR}" "${SYSTEM_RUBY_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/developer/ruby/FindMissingSWIGTypes.rb"
"--generated-sources-directory" "${PROJECT_BINARY_DIR}/csharp_wrapper/generated_sources"
# We ignore existing errors for now until we eventually perhaps all fix them. The goal is to find new failures on PRs
"--ignore-existing-errors"
)

set_tests_properties("CSharpTest-FindMissingSWIGTypes" PROPERTIES TIMEOUT 660 )
endif()
endif()
Loading

0 comments on commit e004637

Please sign in to comment.