shared-libraries

Library method: Async or not?

强颜欢笑 提交于 2020-02-05 02:45:13
问题 I have gotten it through my head (perhaps incorrectly) that library methods that take some time should generally be made async. Is that true, and if so, how should that be done when there is nothing to await within the library method? I am designing my own library with the method: public Dictionary<FunctionEnum, double> Evaluate(Func<uint,uint> algorithm, IList<double> suggestedList) It takes in a method that takes a uint and returns a uint and uses that method many times over. In brief, I'm

typeinfo, shared libraries and dlopen() without RTLD_GLOBAL

随声附和 提交于 2020-01-31 03:34:45
问题 I'm having some trouble with exceptions not functioning correctly (or at least, as I would hope; I know there are issues with this) across shared libraries when loaded using dlopen . I include some simplified example code here. The actual situation is myapp =Matlab, myext1 =mexglx matlab extension, mylib is a shared library of my code between the two extensions ( myext1 , myext2 ) mylib.h struct Foo { Foo(int a); m_a; } void throwFoo(); mylib.cpp #include "mylib.h" Foo::Foo(int a): m_a(a) {}

Is it possible to call a shared library (.so) on linux platform from .NET core?

不问归期 提交于 2020-01-29 09:29:20
问题 I understand that aim of the .NET core is for cross platform development, but I am looking for backward compatibility. If I have a linux library available (maybe, legacy) and I want its functions to be called from .NET core application for linux platform. Is it possible? I am not talking about ASP.NET core, I need it for a desktop application. 回答1: Yes: https://github.com/dotnet/corefx/issues/343 That being said, I'll admit to not having actually tried it yet. I have used this a far bit on

Verifying two different build architectures (one a re-write of the other) are functionally equivalent

核能气质少年 提交于 2020-01-25 10:51:49
问题 I'm re-writing a build that produces a number of things (shared/static libraries, jars, executables, etc). The question came up whether there's a way to verify that the results are functionally equivalent without doing a full top-to-bottom test of the resulting software. However, that is proving to be more difficult to do than I anticipated. As an example, I expected that the md5 of two objects produced from the same source (sun studio C++ compiler) and command-line parameters would have the

How to change path to fix error "./main: error while loading shared library libmkl_core.so?

被刻印的时光 ゝ 提交于 2020-01-25 00:10:11
问题 I have installed intel mkl library. contents have path /home/user/intel/..... . I have to run a C++ code using make file on which it is mentioned. CC = /home/user/intel/bin/icpc -g INCLUDE = -I/home/user/intel/mkl/include LIB = -L/home/user/intel/mkl/lib/intel64 -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -liomp5 -lpthread -std=c++11 I have successfully installed parallel_studio_xe_2019_update5_cluster_edition . but still I'm getting an error message that ./main :error while loading shared

How is the attribute of the loader instance `cdll` created?

谁说胖子不能爱 提交于 2020-01-24 23:21:11
问题 From https://docs.python.org/3/library/ctypes.html#loading-shared-libraries Shared libraries can also be loaded by using one of the prefabricated objects, which are instances of the LibraryLoader class, either by calling the LoadLibrary() method , or by retrieving the library as attribute of the loader instance . I found an example for the first way Free the opened ctypes library in Python I was wondering how to use the second way? In particular, how is the attribute of the loader instance

How to tell where a shared library is loaded in process address space?

别来无恙 提交于 2020-01-24 11:06:04
问题 I'm trying to debug a shared library to which I have the source code and debugging symbols for using gdb. I do not have debugging symbols or code for the process that actually uses this shared library (I compile it myself, so I can have everything, but the resulting binary is stripped, to simulate a situation where I don't have the code). The process prints the address for target function foo I'm trying to debug, to test that gdb knows the right location for symbols from the shared library.

How to create shared library specific singleton instances

雨燕双飞 提交于 2020-01-24 09:47:09
问题 I have a set of plugins for an application which all link to a common base library. The base library defines a singleton which maintains a list of all object constructors in each plugin. On windows, I can create this base library as a static library and thus a copy of the singleton is placed in each plugin. However on Linux I have a bit of the opposite problem as this fellow. I've tried the following so far: Build base as shared library (as per the original author) Build base as static with

How to call methods on .so library in Android studio

泪湿孤枕 提交于 2020-01-24 05:37:45
问题 Edit: see my first answer. I'd like to use the android serialport api in my project. I have a lot of trouble doing so. There is an enormous amount of conflicting information about how to configure older versions of gradle or how to compile with NDK which both aren't useful. I am completely lost. The only thing I found that is probably correct is the following step: Progress #1. I placed the libserial_port.so in src/main/jnilibs/armeabi. It appears in the apk when I open it as a zip file. But

NuGet cross-project dependency

放肆的年华 提交于 2020-01-24 01:31:47
问题 My question is about production workflow with NuGet packages for shared code. Say we have project Pr1, that depends on NuGet package N1, that depends on package N2. Pr1 added as a reference projects for other projects within the solution. Those projects also have dependencies on packages N1 and N2. Now imagine, I've made changes in N2 package. After that I need to update package version of N2 for N1, for Pr1 and also for every project that use N2 and Pr1 together, because if I don't do that,