shared-libraries

how to deal with shared-libraries for many web applications using the same libraries

两盒软妹~` 提交于 2019-12-03 09:19:09
问题 We have a web application made in Java, which uses struts2, spring and JasperReport. This application runs on glassfish 4.0. The libraries of the application are in the WEB-INF/lib folder, and also in glassfish are installed 4 more than uses the same libraries. Glassfish is configured to use 1024mb for heapspace and 512m for permgen, and the most of the memory consumption when i use libraries per application is in the struts actions and spring aop classes (using netbeans profiler). The

Theme/style Angular 2 reusable component libraries

邮差的信 提交于 2019-12-03 09:15:19
General problem I want to style reusable Angular components to match the style of the specific client project. I maintain the reusable components in a separate project and generate an npm package out of it. That package is published to a private NPM repository (Sinopia) and then installed into multiple client projects. The general styling is - of course - specific to the component, but color and font - for example - should match the client project. How can I best apply styles such as color and font, defined in the client project, to the reusable components? Current implementation At the moment

DLL Main on Windows Vs. __attribute__((constructor)) entry points on Linux

ⅰ亾dé卋堺 提交于 2019-12-03 09:07:35
Consider code EXE: int main () { printf("Executable Main, loading library\n"); #ifdef HAVE_WINDOWS HMODULE lib = LoadLibraryA ("testdll.dll"); #elif defined(HAVE_LINUX) void * lib = dlopen("testdll.so", RTLD_LAZY); #endif if (lib) { printf("Executable Main, Freeing library\n"); #ifdef HAVE_WINDOWS FreeLibrary (lib); #elif defined(HAVE_LINUX) dlclose(lib); #endif } printf("Executable Main, exiting\n"); return 0; } DLL struct Moo { Moo() { printf("DLL Moo, constructor\n"); } ~Moo() { printf("DLL Moo, destructor\n"); } }; Moo m; #ifdef HAVE_WINDOWS BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul

replace a dynamic shared library in run time

淺唱寂寞╮ 提交于 2019-12-03 09:02:28
问题 I need to use different dynamic library over a execution cycle of a program. Looking at dlfcn.h I thought this was possible. I confess of not reading much literature on dynamic library loading. OK here is what I do - I have created shared library called `libdynamicTest.so.1` The main APP opens this solib ( dlopen ), gets the function pointer ( dlsym ), run it and then close it back ( dlclose ) Everything is fine until here. Now suppose I replace my libdynamicTest.so.1 by another

LD_LIBRARY_PATH ignored on Android sometimes

南楼画角 提交于 2019-12-03 08:59:12
i have an android app which spawns many native executables dinamically linked with libraries i distribute with the package. To launch those binaries, i use the LD_LIBRARY_PATH environment variable to make them aware of the place to load the libraries from, but on some devices this doesn't work at all, the LD_LIBRARY_PATH is correctly updated but the binary fails to find the library anyway. This is not something i can reproduce because on my two devices ( Galaxy Nexus & Nexus 7 with stock roms ) it just works fine. I tried many ways, for instance i spawn: LD_LIBRARY_PATH=/my/package/custom/libs

understanding shared libraries using gcc

与世无争的帅哥 提交于 2019-12-03 08:33:25
I am trying to understand the following behavior of shared libraries in C Machine One $ cat one.c #include<stdio.h> int main() { printf ("%d", 45); } $ gcc one.c -o one -O3 $ ldd one linux-gate.so.1 => (0x00331000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00bc2000) /lib/ld-linux.so.2 (0x006dc000) $ cat two.c int main() { int i = 0; } $ gcc two.c -o two -O3 $ ldd two linux-gate.so.1 => (0x006f7000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00110000) /lib/ld-linux.so.2 (0x00eb0000) $ Machine Two $ cat three.c #include<stdio.h> int main() { printf ("%d", 45); } $ gcc three.c -o three -O3 $

How to make sure the numpy BLAS libraries are available as dynamically-loadable libraries?

放肆的年华 提交于 2019-12-03 08:27:38
问题 The theano installation documentation states, that theano will as a default use the BLAS libraries from numpy, if the "BLAS libraries are available as dynamically-loadable libraries". This seems not to be working on my machine, see error message. How do I find out, if the numpy BLAS libraries are availalbe as dynamically-loadable? How do I recompile the numpy BLAS libraries, if they are not dynamically-loadable? Please indicate, if you would need more information! Error message We did not

Link a static library to a shared one during build?

China☆狼群 提交于 2019-12-03 08:04:25
问题 I have a problem building a shared library with GCC/Linux. Currently this shared library is created with GCC/libtool option "-shared" and everything is fine. Now there are two additional, static libraries (.a-files) that have to be added to this shared one since they provide some functionality that is required by the shared one. Adding these static libraries with option "-l" does not help, afterwards they are not part of the .so file. So how can I force GCC/libtool to really add the code of

how to link shared library against other shared library in linux?

喜欢而已 提交于 2019-12-03 08:03:11
My application dynamically loads liba.so (with dlopen ). liba.so uses libb.so so I want to link liba.so against libb.so . How to do this in Linux? Thanks in advance. If you build liba.so yourself, you need to link it with -l option gcc -o liba.so liba.o -L/libb/path -lb If you don't have liba sources, perhaps you could create libawrapper.so linked against liba and libb and to load dynamically this library gcc -o libawrap.so -L/liba/ -L/libb/ -la -lb 来源: https://stackoverflow.com/questions/3625836/how-to-link-shared-library-against-other-shared-library-in-linux

checking shared libraries for non default loaders

狂风中的少年 提交于 2019-12-03 07:45:23
ldd is a good simple way to check for shared libraries a given executable is or will be using. However it does not always work as expected. For example, see the following shell snippet that demonstrates how it "fails" to found the libreadline "dependency" into the python binary I've tried many other distributions, but I'm copying from Tikanga $ lsb_release -a LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat