Building EnergyPlus from source on ArchLinux

asked 2023-08-05 06:51:19 -0600

Frisbee's avatar

updated 2023-08-09 07:32:27 -0600

Hi,

I know that Arch Linux is not an officially supported platform. So asking the question here instead of GitHub.

ArchLinux does not bundle static library of libgfortran in their official gfortran package. EnergyPlus successfully builds with static linking of libgfortran disabled (uses dynamic library instead) using the following patch.

--- a/cmake/Fortran.cmake   2023-03-29 01:08:00.000000000 +0530
+++ b/cmake/Fortran.cmake   2023-07-20 13:52:08.017698503 +0530
@@ -106,8 +106,7 @@
     if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR})
       target_compile_options(fortran_project_options INTERFACE -cpp)
     endif()
-    set(FORTRAN_STATIC_EXE TRUE)
-    target_link_options(fortran_project_options INTERFACE -static)
+    set(FORTRAN_STATIC_EXE FALSE)
   endif()
 else() # Windows
   set(FORTRAN_STATIC_EXE TRUE)

Are there any issues with linking to libgfortran dynamic library?

Also, how to run the tests after building EnergyPlus? Couldn't figure it out from the wiki other than enabling BUILD_TESTING option in cmake.

Thanks in advance.

EDIT 1 : Found how to run the tests.

EDIT 2 : Floating point exception during tests.

...
[       OK ] AutoSizingFixture.WaterHeatingCoilUASizingGauntlet (60 ms)
[----------] 32 tests from AutoSizingFixture (1939 ms total)

[----------] 89 tests from SQLiteFixture
[ RUN      ] SQLiteFixture.BaseSizer_SQLiteRecordReportSizerOutputTest
[       OK ] SQLiteFixture.BaseSizer_SQLiteRecordReportSizerOutputTest (64 ms)
[ RUN      ] SQLiteFixture.DXCoils_TestComponentSizingOutput_TwoSpeed

Thread 1 "energyplus_test" received signal SIGFPE, Arithmetic exception.
0x0000555557064138 in EnergyPlus::CoolingCapacitySizer::size (this=this@entry=0x7fffffffd2e0, state=..., _originalValue=<optimized out>, errorsFound=@0x7fffffff9acb: false)
    at energyplus-23.1.0/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc:531
531                     DXFlowPerCapMinRatio = (DesVolFlow / state.dataHVACGlobal->MinRatedVolFlowPerRatedTotCap(state.dataHVACGlobal->DXCT)) /

Backtrace:

#0  0x0000555557064138 in EnergyPlus::CoolingCapacitySizer::size (this=this@entry=0x7fffffffd2e0, state=..., _originalValue=<optimized out>, errorsFound=@0x7fffffff9acb: false)
    at energyplus-23.1.0/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc:531
#1  0x00005555573473cd in EnergyPlus::DXCoils::SizeDXCoil (state=..., DXCoilNum=DXCoilNum@entry=1) at energyplus-23.1.0/src/EnergyPlus/DXCoils.cc:7675
#2  0x0000555556329e63 in EnergyPlus::SQLiteFixture_DXCoils_TestComponentSizingOutput_TwoSpeed_Test::TestBody (this=0x555560610490)
    at energyplus-23.1.0/tst/EnergyPlus/unit/DXCoils.unit.cc:2236
#3  0x0000555558dad0a1 in testing::Test::Run (this=0x555560610490) at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:2682
#4  testing::Test::Run (this=0x555560610490) at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:2672
#5  0x0000555558dad227 in testing::TestInfo::Run (this=0x55555aff8300) at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:2861
#6  testing::TestInfo::Run (this=0x55555aff8300) at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:2833
#7  0x0000555558dad334 in testing::TestSuite::Run (this=0x55555afe0bc0) at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:3015
#8  testing::TestSuite::Run (this=0x55555afe0bc0) at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:2993
#9  0x0000555558dbbab5 in testing::internal::UnitTestImpl::RunAllTests (this=0x55555afce960)
    at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:5855
#10 0x0000555558dad4cb in testing::UnitTest::Run (this=0x55555af92900 <testing::UnitTest::GetInstance()::instance>)
    at energyplus-23.1.0/third_party/gtest/googletest/src/gtest.cc:5438
#11 0x0000555555f4169a in RUN_ALL_TESTS () at energyplus-23.1.0/third_party/gtest/googletest/include/gtest/gtest.h:2490
#12 main (argc=<optimized out>, argv=<optimized out>) at energyplus-23.1.0/tst/EnergyPlus/unit/main.cc:71

Not sure if this is gfortran related.

edit retag flag offensive close merge delete