FMI Library Installation with CMake

10 posts / 0 new
Last post
umutcanuguz
Offline
Joined: 2017-05-18
FMI Library Installation with CMake

I tried to build FMI Library(each version newer than 2.0.1, including 2.0.1 too) with CMake 2.8.6. Configuration and makefile generation give no error at all. When I try to make the files through Command Prompt I get the error in the attachment.

It should be an error with my compiler but I do not know how to solve it. Older versions of FMI Library do not give this error and can be installed easily but for PyFMI, FMI Library 2.0.1 is needed.

niharkopal
Offline
Joined: 2017-05-31
Reply

Hi,

Do we need to build the FMI library with Cmake ? Cant we directly install PyFMI using python commands and specifying the path to FMI library ? Also, were you able to solve this issue and install PyFMI ? 

umutcanuguz
Offline
Joined: 2017-05-18
PyFMI without CMake and other stuff

Hi,

theoretically I would say that it is okay to get the windows binaries and show the path as FMIL_HOME when you are installing PyFMI but it did not work for me so I am questioning myself, maybe it was a silly idea after all.

That leaves us with CMake to construct Makefiles and then installing them through command prompt but as I said it gave me errors probably due to compiler issues which has nothing to do with PyFMI itself.

So in some cases FMILibrary wasn't installed correctly and in some cases only the binaries were shown in the PATH. I either got error while installing PyFMI(this happens also if you have an earlier version of FMILibrary) or got no error at all while installing but I ended up with a dysfunctional PyFMI which I cannot import.

As a solution I installed Anaconda and created an environment. Pretty much the same thing, same version of python and else. It works quite alright so far. As for the package, I downloaded it thorugh conda. You can choose from many developers: mutirri, conda-forge, chria

 

 

AttachmentSize
conda_pyfmi.png 100.26 KB
niharkopal
Offline
Joined: 2017-05-31
Okay, thanks .. so I didn't

Okay, thanks .. so I didn't understand a bit here. How did you manage to install FMI library through conda ? Also did you use conda 32 bit or 64 bit ? And which version 2.7 or 3.5 ?

niharkopal
Offline
Joined: 2017-05-31
Hi, So I did install pyfmi

Hi,

So I did install pyfmi through conda 2.7 32 bit. Do we not need to install FMI library now ?

umutcanuguz
Offline
Joined: 2017-05-18
FMI Library through conda

I installed conda 64 bit as I use 64-bit Windows 7. To be clear I am writing down all steps some of which you have probably done pretty much same.

  • Create an environment

conda create -n niharkopal python=2.7
conda info -e

  • Activate the environment

activate niharkopal

This stuff is actually same. You can install packages either with pip or through conda. Yet, i would recommend manual downloading the packages and installing with "pip install" command by showing the file directory so that you can be sure you're installing the right version. Probably little bit overtedious but it does not harm.

  • Install FMI Library

conda install -c conda-forge fmilib

There are several conda developers as I gave some example links in the previous reply. For me, the package from
conda-forge worked but you can choose as well as chria or mutirri. Just check from the links if they have fmilib.

  • Install PyFMI

conda install -c conda-forge pyfmi

Same thing as fmilib package. You should be able to install the package through pip as well. Essentially, the only thing I did different is installing FMI Library through conda since I could not do it in other ways.

  • Just test it

python
from pyfmi import load_fmu

niharkopal
Offline
Joined: 2017-05-31
Thanks a lot :) .. I will try

Thanks a lot :) .. I will try out all these steps one by one and get back to you if I have any problem. Also, are you experienced with exporting Energyplus as FMU to PyFMI ?

umutcanuguz
Offline
Joined: 2017-05-18
You're welcome

Sorry I don't have any experience with EnergyPlus.

niharkopal
Offline
Joined: 2017-05-31
Okay, I actually had to use

Okay, I actually had to use this for energyplus. There is an error when I load the fmu. The erros is that FMU contains no binary for this platform. Do you have any idea how this can be rectified ?

umutcanuguz
Offline
Joined: 2017-05-18
Error: No binary for this platform

As far as I remember, you get this error if you haven't installed FMI Library correctly. Please make sure you installed FMI Library properly and then install PyFMI package. By the way, I assume you get the error while running this line

from pyfmi import load_fmu

 

 

Login or register to post comments