Skip to content

Commit

Permalink
Merge pull request NREL#3408 from NREL/redhat_builds
Browse files Browse the repository at this point in the history
Allow building on CentOS 7.5.1804
  • Loading branch information
macumber authored Feb 26, 2019
2 parents 9d75811 + 109d2b2 commit 00aeb9b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ if(BUILD_QT)
# also reference https://wiki.qt.io/Building_Qt_5_from_Git
# need to apply the workaround at https://bugreports.qt.io/browse/QTBUG-52605 manually
if( Qt5Static )
set(QT_CONFIGURE_COMMAND "-v -release -opensource -static -openssl -no-pch -no-ssse3 -qt-sql-sqlite -plugin-sql-sqlite -skip enginio -no-compile-examples -nomake examples -nomake tests -nomake tools -skip qtmultimedia -qt-xcb -confirm-license -no-qml-debug -prefix ${CMAKE_BINARY_DIR}/Qt-prefix/src/Qt-static-install")
set(QT_CONFIGURE_COMMAND "-v -release -opensource -static -openssl -no-pch -no-ssse3 -qt-sql-sqlite -plugin-sql-sqlite -qt-pcre -qt-harfbuzz -skip enginio -no-compile-examples -nomake examples -nomake tests -nomake tools -skip qtmultimedia -qt-xcb -confirm-license -no-qml-debug -prefix ${CMAKE_BINARY_DIR}/Qt-prefix/src/Qt-static-install")
else()
message(WARNING "Shared Unix Qt build untested")
set(QT_CONFIGURE_COMMAND "-v -release -opensource -shared -openssl -no-pch -no-ssse3 -qt-sql-sqlite -plugin-sql-sqlite -skip enginio -no-compile-examples -nomake examples -nomake tests -nomake tools -skip qtmultimedia -qt-xcb -confirm-license -no-qml-debug -prefix ${CMAKE_BINARY_DIR}/Qt-prefix/src/Qt-install")
set(QT_CONFIGURE_COMMAND "-v -release -opensource -shared -openssl -no-pch -no-ssse3 -qt-sql-sqlite -plugin-sql-sqlite -qt-pcre -qt-harfbuzz -skip enginio -no-compile-examples -nomake examples -nomake tests -nomake tools -skip qtmultimedia -qt-xcb -confirm-license -no-qml-debug -prefix ${CMAKE_BINARY_DIR}/Qt-prefix/src/Qt-install")
endif()
ExternalProject_Add(Qt
URL http://openstudio-resources.s3.amazonaws.com/dependencies/qt-everywhere-opensource-src-5.6.1.tar.gz
Expand Down
25 changes: 17 additions & 8 deletions openstudiocore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ if(UNIX)
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 xyz)
set(ENERGYPLUS_EXPECTED_HASH 42b2fe2ef5df1d4cfef2160e46529a2f)
set(ENERGYPLUS_PLATFORM "Redhat-x86_64")
else()
set(ENERGYPLUS_EXPECTED_HASH 135e17dd5e4ca355b25bf77b61fc8cf2)
Expand All @@ -400,7 +400,11 @@ if(UNIX)
unset(ENERGYPLUS_EXE CACHE)
unset(ENERGYPLUS_IDD CACHE)
unset(ENERGYPLUS_WEATHER_DIR CACHE)
if(EXISTS "/etc/redhat-release")
file(DOWNLOAD "http://openstudio-resources.s3.amazonaws.com/dependencies/${ENERGYPLUS_PATH}.tar.gz" "${CMAKE_BINARY_DIR}/${ENERGYPLUS_PATH}.tar.gz" INACTIVITY_TIMEOUT 320 SHOW_PROGRESS EXPECTED_MD5 ${ENERGYPLUS_EXPECTED_HASH})
else()
file(DOWNLOAD "https://github.com/NREL/EnergyPlus/releases/download/${ENERGYPLUS_RELEASE_NAME}/${ENERGYPLUS_PATH}.tar.gz" "${CMAKE_BINARY_DIR}/${ENERGYPLUS_PATH}.tar.gz" INACTIVITY_TIMEOUT 320 SHOW_PROGRESS EXPECTED_MD5 ${ENERGYPLUS_EXPECTED_HASH})
endif()
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()
Expand Down Expand Up @@ -439,8 +443,8 @@ if(UNIX)
set(RADIANCE_EXPECTED_HASH 115ef9052ad5011d3fc7cebc2991644f)
set(RADIANCE_PLATFORM "Darwin")
elseif(EXISTS "/etc/redhat-release")
#message(FATAL_ERROR "Radiance ${RADIANCE_VERSION} redhat build missing")
set(RADIANCE_EXPECTED_HASH c1f4211b131a445941eb91ed1a248891)
# DLM: note that the installer expects the extracted directory to be named radiance-5.0.a.12-Linux
set(RADIANCE_EXPECTED_HASH f75898bbfd238a740c1902d385c42b92)
set(RADIANCE_PLATFORM "Redhat")
else()
set(RADIANCE_EXPECTED_HASH 7b9e4df2b6050fe51c6e138e4c0e6a5a)
Expand All @@ -451,8 +455,13 @@ if(UNIX)
file(MD5 "${CMAKE_BINARY_DIR}/${RADIANCE_PATH}.tar.gz" RADIANCE_HASH)
endif()
if(NOT EXISTS "${CMAKE_BINARY_DIR}/${RADIANCE_PATH}.tar.gz" OR NOT "${RADIANCE_HASH}" MATCHES "${RADIANCE_EXPECTED_HASH}")
message(STATUS "Downloading Radiance ${RADIANCE_VERSION} (${RADIANCE_PLATFORM})")
message(STATUS "Downloading Radiance ${RADIANCE_VERSION} (${RADIANCE_PLATFORM})")
if(EXISTS "/etc/redhat-release")
message("http://openstudio-resources.s3.amazonaws.com/dependencies/radiance-${RADIANCE_VERSION}-${RADIANCE_PLATFORM}.tar.gz")
file(DOWNLOAD "http://openstudio-resources.s3.amazonaws.com/dependencies/radiance-${RADIANCE_VERSION}-${RADIANCE_PLATFORM}.tar.gz" "${CMAKE_BINARY_DIR}/${RADIANCE_PATH}.tar.gz" TIMEOUT 120 INACTIVITY_TIMEOUT 120 SHOW_PROGRESS EXPECTED_MD5 ${RADIANCE_EXPECTED_HASH})
else()
file(DOWNLOAD "http://github.com/NREL/Radiance/releases/download/${RADIANCE_VERSION}/radiance-${RADIANCE_VERSION}-${RADIANCE_PLATFORM}.tar.gz" "${CMAKE_BINARY_DIR}/${RADIANCE_PATH}.tar.gz" TIMEOUT 120 INACTIVITY_TIMEOUT 120 SHOW_PROGRESS EXPECTED_MD5 ${RADIANCE_EXPECTED_HASH})
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/${RADIANCE_PATH}")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz "${CMAKE_BINARY_DIR}/${RADIANCE_PATH}.tar.gz" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
endif()
Expand Down Expand Up @@ -510,7 +519,7 @@ if(NOT EXISTS ${RUBY_INSTALL_DIR})
set(RUBY_ZIP_EXPECTED_MD5 "7ac16f5791d210d425aef268d97bf734")
elseif(EXISTS "/etc/redhat-release")
set(RUBY_ZIP_FILENAME "ruby_2_2_4_redhat_static.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "0491123e60186896bae838f7d148bf20")
set(RUBY_ZIP_EXPECTED_MD5 "d130a17b23cc532975665ee4e9095c8d")
else()
set(RUBY_ZIP_FILENAME "ruby_2_2_4_linux_static.tar.gz")
set(RUBY_ZIP_EXPECTED_MD5 "d238febf646382fe1b323bcdf16ea0e2")
Expand Down Expand Up @@ -858,7 +867,7 @@ if(NOT EXISTS ${BOOST_INSTALL_DIR})
set(BOOST_ZIP_EXPECTED_MD5 "9e4c01a3f5c63e3bbf5cc76021eceb75")
elseif(EXISTS "/etc/redhat-release")
set(BOOST_ZIP_FILENAME "boost_1_55_0_redhat.tar.gz")
set(BOOST_ZIP_EXPECTED_MD5 "de952e0c36900a3ad000d74a1c41b7d2")
set(BOOST_ZIP_EXPECTED_MD5 "1517315d5b07fe5e1bdb135ecdc0213d")
else()
find_program(LSB_RELEASE lsb_release)
execute_process(COMMAND ${LSB_RELEASE} -r
Expand Down Expand Up @@ -938,7 +947,7 @@ if(NOT EXISTS ${QT_INSTALL_DIR})
set(QT_ZIP_EXPECTED_MD5 "326887393d55b5da97a1be9764fb0d1b")
elseif(EXISTS "/etc/redhat-release")
set(QT_ZIP_FILENAME "qt_5_6_redhat_shared.tar.gz")
set(QT_ZIP_EXPECTED_MD5 "b0610716854ed91a003347c455b22eb8")
set(QT_ZIP_EXPECTED_MD5 "12576637037b8d5428e2d63a5e298131")
else()
set(QT_ZIP_FILENAME "qt_5_6_linux_shared.tar.gz")
set(QT_ZIP_EXPECTED_MD5 "3322cce1806ef134391d94a73adf3f15")
Expand Down Expand Up @@ -1071,7 +1080,7 @@ elseif( APPLE )
set(QT_STATIC_ZIP_EXPECTED_MD5 "d24756746d2fe07212070f675871cf93")
elseif(EXISTS "/etc/redhat-release")
set(QT_STATIC_ZIP_FILENAME "qt_5_6_redhat_64_static.tar.gz")
set(QT_STATIC_ZIP_EXPECTED_MD5 "f5d9406349d1688e99db012862c22072")
set(QT_STATIC_ZIP_EXPECTED_MD5 "52159660cbdd95a41ab84a2c43140f11")
else()
set(QT_STATIC_ZIP_FILENAME "qt_5_6_linux_64_static.tar.gz")
set(QT_STATIC_ZIP_EXPECTED_MD5 "77e24a44ae6c194ce1f2c3cf4aaa8a48")
Expand Down
1 change: 1 addition & 0 deletions openstudiocore/src/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ target_link_libraries(openstudio

if (UNIX AND NOT APPLE)
target_link_libraries(openstudio ${RUBY_STATIC_LIBRARY} "dl" "crypt" "ssl")
target_link_libraries(openstudio "icui18n" "icuuc" "gmp")
elseif(WIN32)
target_link_libraries(openstudio debug ${RUBY_STATIC_LIBRARY_DEBUG} optimized ${RUBY_STATIC_LIBRARY})
target_link_libraries(openstudio wsock32 ws2_32 Dbghelp Shlwapi)
Expand Down

0 comments on commit 00aeb9b

Please sign in to comment.