Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback from users #39

Open
markaren opened this issue Feb 15, 2019 · 20 comments
Open

Feedback from users #39

markaren opened this issue Feb 15, 2019 · 20 comments
Labels
help wanted Extra attention is needed

Comments

@markaren
Copy link
Member

Hi,
I would very much like to hear from you, the person reading this.
Why are you interested in this project, have you tried it?
What is unclear, what can be improved?

Note that it is also possible to chat on gitter!

@markaren markaren added the help wanted Extra attention is needed label Feb 15, 2019
@greenwoodms06
Copy link

I'll respond to this "issue". I'm interested in trying to get FMUs running in Unreal Engine. I'm just starting (and have minimal C++ experience). So I'm about to try this and/or the FMI++ work....

Curious if you have any insight on if this is a bad idea or if you have any tips to being successful?

@markaren
Copy link
Member Author

I have no experience with Unreal, but if you can import third party libraries using Unreal (which I must assume you can) then it should not be a problem. fmi4cpp is just another C++ library.

@greenwoodms06
Copy link

Super duper. I'm going to give it a go over the next bit. If it works out I'll be sure to give your work a shout out in anything I may produce with it. In any case, thanks for making this available :)

@greenwoodms06
Copy link

Alright. I'm going to risk asking a question and expose my naivety.

Any suggestions for getting this thing to work in Visual Studio (not dealing with unreal yet)? Just trying to do something super simple like your example. c++ noob. Initial efforts had boost and libzip issues, was able to install boost and (I think) libzip but libzip still seems to not be found. The conan approach seems nice but I couldn't get the conan plugin to do anything.

Pointers would be great (pun not intended), though I understand if this is may be more of a "me" problem.

#include <fmi4cpp/fmi4cpp.hpp>

using namespace fmi4cpp;

@markaren
Copy link
Member Author

There is an old vcpkg package available that might be easier to use from a Visual Studio workflow. However, it is unmaintained as I dare not update it as v0.8.0 (master branch) is not backwards compatible with 0.7.0, so an update there would break stuff (I don't know if anyone uses it though). But, I can give no advice on Visual Studio as I've never used it. I use CLion and when building it on the CI server I use raw cmake commands. Perhaps you should try the same? Just take a look at the github workflow file.

@greenwoodms06
Copy link

With a little help of a colleague we were able to get things working on windows/visual studio. Next up is to see if I can throw it in UE4.

@markaren
Copy link
Member Author

You should really consider using Conan to fetch the dependencies. Ideally one should use conan for installing fmi4cpp itself.

git clone https://github.com/NTNU-IHB/fmi4cpp
cd fmi4cpp
conan install . -s build_type=Release --install-folder=build
cmake . -G "Visual Studio 15 2017 Win64" -Bbuild -DFMI4CPP_USING_CONAN=TRUE -DFMI4CPP_BUILD_EXAMPLES=ON
cmake --build build --config Release

@markaren
Copy link
Member Author

Is #include <stdexcept> an issue with VS 2019 compiler?

@greenwoodms06
Copy link

conan might work but this works now. yes the #include <stdexcept> is an issue.

@markaren
Copy link
Member Author

Aight, added the include statement

@greenwoodms06
Copy link

Do you know what about your library forces it to use C++17 instead of c++14? Basically big things or just some simple thing somewhere?

@markaren
Copy link
Member Author

std::optional and std::filesystem comes to mind. Sure it's possible to implement it with boost types & c++14, but I have no interest in doing so. If you really wanted to you could probably make a C++14 compatible fork relatively quickly.

@greenwoodms06
Copy link

alrighty. yeah I'm not asking you to make the changes. just gathering information. thanks

@LaurentBauer
Copy link

Hello and thank you for this library

I read a parameric model exported as fmu with OMEdit
Now, i'd like to loop over different values for a parameter :

    auto slave = cs_fmu->new_instance();
    for (int i=0; i<10; ++i)
    {
        slave->reset();
        slave->setup_experiment();
        slave->enter_initialization_mode();
        slave->exit_initialization_mode();    // <=  *****HERE*****  crash in the second loop
        ... // change the parameter value in some way 
        slave->write_real(paramValRef, paramVal);  
        while ( (t = slave->get_simulation_time()) <= tmax)        
               slave->step(0.2)
        slave->terminate();
        //... read and cout some results
    }

I'm crashing in the 2nd loop
what am i doing wrong ?
Nota : it works perfectly if i create a new instance inside the loop. But that doesn't sounds correct to me.

Thank you for any help

@markaren
Copy link
Member Author

what am i doing wrong ?

Either there is an issue with the model or there is an issue with this library. I think you have to test the same logic using a different library to figure out which it is.

@LaurentBauer
Copy link

Thank you for the answer.
I've tried with another model (the notorious BouncingBall) and encountered the same issue.
When importing back my .fmu under OM Editor, I get an error "Operator reinit..." that sounds to be a known "import" bug. See https://trac.openmodelica.org/OpenModelica/ticket/5621
This could be the point if fmi4cpp runs the same engine in background

@prudhomm
Copy link
Contributor

prudhomm commented Feb 3, 2023

Hi

we use the library to couple FMUs (cosimulation currently) with PDE systems. We replaced fmilib by your library (way cleaner ). it was easy to make the change the maintenance is much easier. We are going to use it more and more in the coming month, we will be able to provide more feedback and possibly contribute.

thanks a lot for your work by the way @markaren !

@Andri-e
Copy link

Andri-e commented Mar 13, 2023

Hi,

Cant seem to get the newest version to work properly, is there a more up to date installation and build guide?

@markaren
Copy link
Member Author

Does it by any chance have to to with conan? They recently bumped the version to 2.x, which is a massive overhaul of the conan system. I wouldn't be surprised if it messed up the conan pipeline here. Assuming this is the issue, you could try switching to 1.x release of conan. In any case I should switch to a vcpkg workflow if I ever find the time.

@FDzhang
Copy link

FDzhang commented Jul 29, 2024

hello, May I ask if this library will update version tags in the future? Because I haven't seen any updates in two years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

6 participants