Docker running EnergyPlus in Raspberry Pi 4 with Linux ARMv8 64 bits

133 views
Skip to first unread message

Juanca Oviedo

unread,
May 31, 2021, 10:00:24 PM5/31/21
to energyplus-fmu
Hello everyone, 

Docker image: arm64v8/python:3.8-slim-buster, EnergyPlus: 9.4.0, EnergyPlusToFMU: 3.1.0.

I'm cloning E+ from github and afterwards compiling it in a docker container using cmake. Additionally, I copied the folder of EnergyPlusToFMU inside of the docker. The docker container is running in a Raspberry Pi 4, which means that everything is running over an ARMv8 64 bits architecture. 

When I execute the command to make the conversion of the idf file to the FMU (python EnergyPlusToFMU/Scripts/EnergyPlusToFMU.py -i /usr/local/IDD/Energy+.idd -w /usr/src/app/eplusmodels/example/troisrivieres.epw -a 2 /usr/src/app/eplusmodels/example/examplehouse.idf) the process starts, finds some warnings, and after a while stops. I do not think that the warnings are important, so, I will skip directly to the error. 

The error that currently appears is the following: 
/usr/bin/ld: /usr/src/app/EnergyPlusToFMU/Scripts/../SourceCode/v20/fmusdk-shared/parser/linux64/libxml2.so.2: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
ERROR from script file {utilManageCompileLink.py}
Failed to link object files into {examplehouse.so} 

Checking in internet I found some things that seem to be related to the architecture of the processor, but I do not know if that is the case for the error I'm having. To be honest, I have no clue what is causing the problem. 

Note: For some reason the installation of EnergyPlus did not install the Energy+.idd file inside the docker container. To solve this problem, I copied the file manually (I took it from a windows installation). However, I believe that this is not related to the problem I'm having since the conversion starts without problems. 

Note 2: If the construction of the Docker is required I can post it here. 

I will highly appreciate any light on this problem, 

Kind regards, 
Juan

Joser

unread,
May 31, 2021, 10:45:11 PM5/31/21
to Juanca Oviedo, energyplus-fmu
Hi Juan, 

Are you able to run the user guide's E+toFMU basic test ?

Did you update the compiler address in the E+toFMU batch files pointing to the right gcc folder? 

As you're trying to compile a FMU 2.0, double checking the installed py version could be helpful aswell, it should match the arch (x64)

Hope this helps 
Best
Jose




 


--
You received this message because you are subscribed to the Google Groups "energyplus-fmu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/ee6e138b-2a1d-423e-8b16-b96c46bcb714n%40googlegroups.com.

Thierry Stephane Nouidui

unread,
Jun 1, 2021, 4:14:09 AM6/1/21
to energyplus-fmu, Juanca Oviedo
Could you do the following tests

1. Try to run the docker with an FMI 1.0 generated FMU and see if it works.

2. If it works, then we will know that you are first well setup and that the problem comes from generating FMU 2.0. I will then suspect that libxml2.so.2 which shipped with E+FMU may not be compatible with the target machine you are running the FMU. 

In which case, I think that you will have to get the libxml2 code, recompile it, and then replace the one that is distributed with the tool with your compiled version as you are doing with the IDD.

P.S. libxml2 has been pre-compiled on Ubuntu. The library may hence not work with other architectures. 

P.P.S. I will try to see if we could distribute E+FMU with the source code of libxml2 so they can be recompiled on the fly (at least on Unix system).

Thanks!


Am Dienstag, 1. Juni 2021, 05:08:20 GMT+3 hat Juanca Oviedo <oviedo...@gmail.com> Folgendes geschrieben:


Juanca Oviedo

unread,
Jun 14, 2021, 10:31:21 AM6/14/21
to Thierry Stephane Nouidui, energyplus-fmu
Hello, 

As suggested, the problem was the libxml2.so.2 library. 

The way to solve it was to use the libxml2.so.2 library compiled in the docker base image ( arm64v8/python:3.8-slim-buster).

To find the location of the file, a search over the OS of docker image was performed. 

Afterwards, the directory pointing at the library in the file "makeFMULib.py" was replaced. The change look like this (around line 409):

Original: 
      if( PLATFORM_NAME.startswith('lin'and str(nbits)=='64'):
          incLinkerLibs = os.path.join(dirname, "..""SourceCode""v20",
          "fmusdk-shared""parser", ops, "libxml2.so.2")


New one:
      if( PLATFORM_NAME.startswith('lin'and str(nbits)=='64'):
          incLinkerLibs = os.path.join("/usr","lib","aarch64-linux-gnu","libxml2.so.2")
          printDiagnostic('Link with the libxml2.so.2 located in {' +incLinkerLibs +'}')

Like this it worked well. 

Thank you very much to all of you for your suggestions. 

Kind regards, 
Juan

Thierry Stephane Nouidui

unread,
Jun 15, 2021, 2:59:15 AM6/15/21
to Juanca Oviedo, energyplus-fmu
Great!


Am Montag, 14. Juni 2021, 17:31:23 GMT+3 hat Juanca Oviedo <oviedo...@gmail.com> Folgendes geschrieben:


Reply all
Reply to author
Forward
0 new messages