How to install a new Modelica library in Dymola? - modelica

I would like to know:
the most efficient way to install a library in Dymola, so that it appears in my list of libraries in File > Libraries.
is it possible to have it preloaded in my package browser when I open Dymola, as for instance the Modelica Standard Library?
I would like to install the free library ExternData, using Dymola 2021.

Dymola 2021 (and later) has Tools>Library Management>Modelica Path where you can add the directory containing your external libraries.
To make libraries appear preloaded you have to add a libraryInfo.mos script in the corresponding library; you can look at Modelica Standard Library in the Dymola installation for inspiration.
The latter is described in more detail in the section "More about libraries and the building of menus of libraries and demo" page 200 in Dymola User Manual 1A.pdf.

Related

Enabling Java User Function Library in Crystal Reports 2020 Designer

Is there a way to enable and use Java UFL in Crystal Reports 2020 Designer?
In the designer itself you can choose to use only Java User Function Libraries in File > Options > Formula Editor > "UFL Support" dropdown menu.
I was able to code my own functions in Eclipse, building a jar of the library, but the problem is;
Where do I specify the location and name of the library to the designer?
This topic User Function Libraries in formulas (and many others) refers to a "Java Reporting Component Developer's Guide" to make Java UFL work, but I have not found it anywhere!
I also tried to add the jar under C:\Program Files (x86)\SAP BusinessObjects\java\lib and in similar folders, but had no success.
Any help will be appreciated
Thanks,
Enrico
Tried to find documentation, tried to locate jar file of the library under the designer installation path

Build system for not compiled languages

I did create a python projet with gnome-builder using the Gnome Application template. I realized that the template builds the entire project structure and adds build capabilities using the meson build system, so I was curious. Why use build system for languages that are not compiled like python?
Build systems aren't only for compiling, they're also for distributing; full applications often include other data like CSS files, UI description files, application metadata files, settings schema files, etc. All these need to be packaged with the application and installed into the right place.
An additional reason is that many applications in a non-compiled language like Python or Javascript sometimes include a private library written in a compiled language, for things that are performance-sensitive.

Eclipse CDT: combine a make project with a cmake one

I have a standard C project in Eclipse CDT. Naturally it uses make. I have decided to add some JSON support to my application to be able to load/save its configuration in a readable format that the user (if such desire occurs) can alter those manually and/or through an external tool. I've looked up two options so far namely Jansson and Json-C. The problem is that both are using cmake, which, if I recall correctly, can be imported in Eclipse CDT without problems (though in itself CDT can't create cmake projects).
I was thinking of adding a script for the pre-build step of my project that runs cmake (as an external command) and sets up the JSON library (static and/or dynamic) so that when the build process of my projects starts the library file will be available.
Is there a better way to combine a cmake with a make project in Eclipse CDT? I know that cmake basically generates a Makefile but I've never done such a combination before.
Even if there is a JSON C library somewhere out ther that uses make (I'm 99.9% sure there is such thing :D) I'd still like to know how to tackle this situation.

Windows.Devices.Bluetooth.dll

For my Unity-UWP project, I want to interact with iBeacons.
I wanted to add the library to my project, but I can't seem to locate it.
What do I have to do, in order to use it with my Unity project?
You need to compile a dll separately that interacts with Windows.Devices.Bluetooth.dll then include the dll in the in your project under the Assets/Plugins/WSA folder to add it as a plugin. Once you do that you can reference the DLL like you would in any normal .NET project as if you added a reference to the dll.
There are some other requirements beyond that (For example you also need to make a 2nd version of the plugin compiled with the full .NET framework with the same type names and version number to be used in-editor), see the unity documentation "Windows Store Apps: Plugins on .NET Scripting Backend" for the full details.

Exporting Executable jar file that uses opencv

While exporting in eclipse I choose "Package required libraries into generated jar".
The jar file works only in my machine. However, when I test it on other machine it gives this Exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
at com.googlecode.javacpp.Loader.load(Loader.java:489)
at com.googlecode.javacpp.Loader.load(Loader.java:431)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
at mains.<clinit>(mains.java:25)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
Short answer
You must install OpenCV (as mentioned in JavaCV requirements) and JavaCV on the system in order to use JavaCV. As you probably installed them for development on your computer the application work, but the other machine probably has not them installed and thus the jar does'nt work.
Long answer
The problem is not the JavaCV library, which appears to be correctly included into your jar as shown by the lines:
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
at com.googlecode.javacpp.Loader.load(Loader.java:489)
at com.googlecode.javacpp.Loader.load(Loader.java:431)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
The fact is JavaCV is build on top of OpenCV. OpenCV being a C++ library, the only way to use it from Java is to use JNI calls.
JNI require two components:
A java library (usually with extension *.jar) containing java method that calls native library
A native library (usually with extension *.so for linux or *.dll for windows) that "do the work", in this case that "use OpenCV library"
The first one is provided by JavaCV and included into your jar application. The second one is system dependent (Os, architecture, ...) and must be into the java library path.
This is the actual error: it can not find libjniopencv_core.so into java.library.path. The jniopencv_core library is provided by JavaCV too but is installed somewhere on the system (/usr/lib/ for instance) and thus not included into the final jar.
Even if you find a way to include it into the final application, this library will need to use OpenCV libraries which are not installed on the system too. To summarize the needs:
JavaCV java library, that will call (with JNI):
JavaCV native library, that will use:
OpenCV libraries, that will really do the work.
Without one of this point the application will not work. Thus OpenCV and JavaCV must be installed into the system.