It finishes (with the below warning:) by creating two folders “bin” and “include”
┌ Warning: it is not recommended to create an app/library without a preexisting manifest
â”” @ PackageCompiler
1- Are all the above steps are correct?
2- How can I solve the above warning?
3- I expect to have a file libtest.dll in this path ./Projectfolder/Generated/bin, but I did not find. So, does this mean that the compilation is not done correctly?
Run pkg> instantiate in your project before you run create_library.
Make sure you are using the latest PackageCompiler version (2.0.5). There was a bug in earlier version that made the library be called sys.dll on windows.
2- I have update PackageCompiler to version (2.0.5), and now I can see a my library name HiAmro.dll along with other 53 dll files. If I need to use my dll somewhere, do I need to put all other files with mine HiAmro.dll in the same folder to let it work? I tried to test the HiAmro.dll by running the below but it gave me a fast message which disappeared and then and
I am not sure what you are reffering to. Do you mean include/julia_init.h? That contains the declaration of the “entry points” to the library and you would typically include that file in a c program that you want to call the library with.
You cannot ccall into the generated library. It is a technical limitation that you cannot call a julia library from another julia session. You can call it from C or Python for example.
Dear @kristoffer.carlsson could you give me a hand here please!
I am trying to load my generated library (“HiAmro.dll”) for the above function (cited below again for reference).
Base.@ccallable function test()::Cint
return(2)
end
I am trying to call this function via OpenModelica tool. So, I created a model in Modelica in a package called OpenEMTP and I put inside it the generated files as follow; …\OpenEMTP\Resources\source_julia\include\julia_init.h and …\OpenEMTP\Resources\source_julia\bin\HiAmro.dll. I have build the below package/model in OMEdit:
within OpenEMTP;
package TestJuliaPackage
extends UserGuide.Icons.Library;
function Externaljuliafunc1
extends Modelica.Icons.Function;
output Real y;
external y=test() annotation(Include="#include \"julia_init.h\"", IncludeDirectory="modelica://OpenEMTP/Resources/source_julia/include",Library = "HiAmro.dll",LibraryDirectory="modelica://OpenEMTP/Resources/source_julia/bin");
end Externaljuliafunc1;
model ExternaljuliaLibraries
output Real y;
equation
y=Externaljuliafunc1();
end ExternaljuliaLibraries;
end TestJuliaPackage;
1- Is it enough to call the function test() or I need also to call julia_init() and shutdown_julia() somewhere? If so, could you please guide me?
2- What does Makefile do? Do I need to include it also somewhere in the destination tool?