Comments (6)
Hi
Have you read this section https://github.com/modelica-3rdparty/ExternalMedia/blob/master/README_compilation.md#quick-start-guide?
In there it says that you can use cmake --build build --config Release --target install-as-default
to override the compiler specifications and install the libraries to linux64 or linux.
To build a shared library, you can change line 143 in https://github.com/modelica-3rdparty/ExternalMedia/blob/master/Projects/CMakeLists.txt#L143 to 'SHARED' instead of 'STATIC', but that is untested - thank you being the lab mouse here...
from externalmedia.
It seems to be looking for a shared library .so extension and the CMAKE makes a static. Is this the reason for not finding these external functions?
Because OpenModelica can only run functions at compile-time if they are in a shared library (you cannot use dlopen
on a static library), and it thinks the function must be evaluated because some structural information is returned by the function call.
from externalmedia.
Yes - this is also the reason why the roadmap says that we want to move to shared libraries as the new default. However, we are no there yet.
from externalmedia.
Yes - this is also the reason why the roadmap says that we want to move to shared libraries as the new default. However, we are no there yet.
I would compile both static (with -fPIC) and shared, so the library can be linked into an FMU without problem as well (so many issues with FMUs not finding its dependencies).
from externalmedia.
Hi
The change to SHARED on line 143 did not work. There is an issue with CoolProp.
/usr/bin/ld: CoolProp/CMakeFiles/CoolProp.dir/src/CoolPropTools.cpp.o: relocation R_X86_64_TPOFF32 against `_ZL10ftw_summer' can not be used when making a shared object; recompile with -fPIC
from externalmedia.
This can now be closed. You need to do the following
69 SET(COOLPROP_STATIC_LIBRARY OFF CACHE BOOL "Force the static library")
70 SET(COOLPROP_SHARED_LIBRARY ON CACHE BOOL "Force the shared library")
71 SET(COOLPROP_OBJECT_LIBRARY OFF CACHE BOOL "Force the object library")
143 add_library(${LIBRARY_NAME} SHARED ${LIB_SOURCES})
147 target_compile_definitions(${LIBRARY_NAME} PRIVATE EXTERNALMEDIA_MODELICA_ERRORS=0) # Use 0 for a shared library and 1 for a static library
With these changes the shared library compiles and runs the examples in OpenModelica
from externalmedia.
Related Issues (20)
- Incompressible package runs in OpenModelica but not Dymola
- Model fails to execute when using two different fluids
- Model fails to run when using Modelica.Fluid.Sensors.Temperature
- Call ExternalMedia from OMPython HOT 1
- External function could not be found in any of the given shared libraries HOT 1
- External functions in ExternalMedia should be explicitly declared as pure
- Adding new fluids to CoolProp and use it in Modelica HOT 3
- support for older gcc versions HOT 4
- Compilation errors in OpenModelica HOT 7
- Selection of different state variables (ph, pt, dT) for a CoolProp 2-phase medium HOT 1
- Cannot compute arbitrary partial derivatives with function `partialDeriv_state` HOT 2
- Wrong version of cmake required to compile the library HOT 1
- Restructuring of the repository HOT 4
- build error using cmake on windows HOT 1
- State functions do not seem to work properly HOT 6
- Compressible mixture support? HOT 2
- Custom fluid property support
- Incompressible CoolProp tests do not compile HOT 3
- Remove experiment annotation from partial models
- how to use fliudprop in external Media?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from externalmedia.