Using sunperf in shared libraries

Hi,
I would like to support sunperf in one software project which uses cblas. The code using cblas is a dynamically loadable library (python module). My problem is that using -xlic_lib=sunperf does not work when building shared libraries. More concretely:
file: floupi.c
enum CBLAS_ORDER { CblasRowMajor = 101, CblasColMajor = 102 };
enum CBLAS_TRANSPOSE { CblasNoTrans = 111, CblasTrans =
     112, CblasConjTrans = 113 };
void cblas_sgemm(const enum CBLAS_ORDER Order,
          const enum CBLAS_TRANSPOSE TransA,
          const enum CBLAS_TRANSPOSE TransB, const int M,
          const int N, const int K, const float alpha,
          const float A, const int lda, const float B,
          const int ldb, const float beta, float *C, const int ldc);
int main(void)
int lda = 3;
float A[] = { 1, 2, 3,
     4, 5, 6
int ldb = 2;
float B[] = { 1, 2,
     3, 4,
     5, 6
int ldc = 2;
float C[] = { 0.00, 0.00,
     0.00, 0.00
/* Compute C = A B */
cblas_sgemm(CblasRowMajor,
          CblasNoTrans, CblasNoTrans, 2, 2, 3,
          1.0, A, lda, B, ldb, 0.0, C, ldc);
return 0;
This can be compiled easily using cc floupi.c -xlic_lib=sunperf; the executable works as expected. Now, let's say that instead of main, I use another symbol, to compile the code as a shared library:
cc -G floupi.c -xlic_lib=sunperf
Then the built shared library has the cblas_sgemm undefined (according to nm), and ldd shows that libsunperf is not linked. This of course means that for my python module, I have an error with undefined symbols when I try to import it. Why is sunperf not linked at all for shared libraries ? The problem appears both on solaris studio express on x86 and on linux x86 (sunstudio 12 in both cases).
I also noticed that if instead, I use
cc -G floupi.c -lsunperf
Then it seems that cblas_sgemm is not undefined anymore (according to nm), but this looks like linking the cblas_sgemm statically, which is not what I want.
Thanks,
David

I finally found the verbose option for suncc (-#), and this confirms what the above suggested, that is when -G is used, sunperf is not linked:
### Note: LD_LIBRARY_PATH = /home/david/local/intel/cc/9.1.042/lib:/home/david/opt/intel/fc/10.0.023//lib:/home/david/opt/intel/cc/10.0.023//lib:/home/david/local/lib:
### Note: LD_RUN_PATH = <null>
/usr/bin/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 --enable-new-dtags /home/david/opt/sun/sunstudio12/prod/lib/crti.o /home/david/opt/sun/sunstudio12/prod/lib/values-xa.o -shared floupi.o -Y "/home/david/opt/sun/sunstudio12/prod/lib:/lib:/usr/lib" -Qy -lc /home/david/opt/sun/sunstudio12/prod/lib/libc_supp.a /home/david/opt/sun/sunstudio12/prod/lib/crtn.o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Pacman uses the wrong shared libraries

    Hi!
    I had had MCR's path in the PATH. Since then pacman uses (or at least it tries to) the shared libraries found in MCR's path. It causes errors like this:
    pacman: /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcurl.so.4: no version information available (required by /usr/lib/libalpm.so.8
    The output of 'ldd $(which pacman)':
    /usr/bin/pacman: /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcurl.so.4: no version information available (required by /usr/lib/libalpm.so.8)
    linux-vdso.so.1 (0x00007fff709fc000)
    libalpm.so.8 => /usr/lib/libalpm.so.8 (0x00007f56f80ad000)
    libarchive.so.13 => /usr/lib/libarchive.so.13 (0x00007f56f7e0a000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f56f7a67000)
    libgpgme.so.11 => /usr/lib/libgpgme.so.11 (0x00007f56f782e000)
    libcurl.so.4 => /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcurl.so.4 (0x00007f56f75e7000)
    libcrypto.so.1.0.0 => /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libcrypto.so.1.0.0 (0x00007f56f7205000)
    libacl.so.1 => /usr/lib/libacl.so.1 (0x00007f56f6ffc000)
    libattr.so.1 => /usr/lib/libattr.so.1 (0x00007f56f6df7000)
    libexpat.so.1 => /home/labuwx/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64/libexpat.so.1 (0x00007f56f6bcf000)
    liblzo2.so.2 => /usr/lib/liblzo2.so.2 (0x00007f56f69ad000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f56f678a000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f56f657a000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f56f6364000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f56f82dd000)
    libassuan.so.0 => /usr/lib/libassuan.so.0 (0x00007f56f6153000)
    libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f56f5f41000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f56f5d25000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f56f5b21000)
    How can I get pacman to use the proper libraries?
    Last edited by labuwx (2014-10-06 15:59:47)

    labuwx wrote:
    I had had MCR's path in the PATH. Since then pacman uses (or at least it tries to) the shared libraries found in MCR's path. It causes errors like this:
    How can I get pacman to use the proper libraries?
    presumably, there's your problem remove it from the PATH and your problems will likely vanish.
    you should install it following the wiki page

  • Use of deployment classpath or shared-libraries to pick-up "custom" classes

    Hi,
    I’m trying to determine an approach to dealing with how classes are found in a deployed ADF application via classpath, etc. I’ve tried to explain the situation below as best I can so it’s clear. If you have any comments/suggestions as to how this could be done, it would be much appreciated
    Current Application structure:
    Consists of an application initially deployed to OC4J 10.1.3.4 using an alesco-wss.ear file
    Application contains a single Web Module, initially deployed as wss.war file within the alesco-wss.ear file above.
    The Web Module (wss) was built in JDeveloper 10.1.3.4 using 2 projects, a Model and ViewController project, and uses ADFBC.
    The Model project seems to also generate an alesco-model.jar file in the /WEB-INF/lib/ folder, even though Model classes are in the /WEB-INF/classes/ folder below?
    Exploded structure of application on application server looks something like:
    applications/alesco-wss/META-INF/
    /application.xml <- specifies settings for the Application such as Web Module settings
    /wss/
    /app/ <- directory containing application .jspx pages protected by security
    /images/ <- directory containing application images
    /infrastructure/ <- directory containing .jspx files for login, logout and error reduced security
    /skins/ <- directory containing Skin image, CSS and other files
    /WEB-INF/
    /classes/ <- directory containing application runtime class files as per package sub-directories
    /lib/ <- JAR files used by application (could move some to shared-libaries?) – seems to contain alesco-model.jar
    /regions/ <- directory containing .jspx pages used for Regions within JSPX template page
    /templates/ <- directory containing template .jspx pages used for development (not really required for deployment)
    /adf-faces-config.xml
    /adf-faces-skins.xml
    /faces-config.xml
    /faces-config-backing.xml
    /faces-config-nav.xml
    /region-metadata.xml
    /web.xml
    testpage.jspx <- Publicly accessible page just to test
    The application runs successfully using the above deployment structure.
    We plan to use the exploded deployment structure so that updates to pages, etc. can be applied individually rather than requiring construction and re-deployment of complete .EAR or .JAR files.
    What I’m trying to determine/establish is whether there is a mechanism to cater for a customisation of a class, where such a class would be used instead of the original class, perhaps using a classpath mechanism or shared library?
    For example, say there is a class “talent2.alesco.model.libraries.ModelUtil.class”, this would in the above structure be found under:
    applications/alesco-wss/META-INF/classes/talent2/alesco/model/libraries/ModelUtil.class
    Classes using the above class would import “talent2.alesco.model.libraries.ModelUtil”, so they effectively use that full-reference to the class (talent2.alesco.model.libraries as a path, either expanded or within a JAR).
    From the Oracle Containers for J2EE Developer’s Guide 10.1.3 page 3-17, it lists the following:
    Table 3–1 Configuration Options Affecting Class Visibility
    Classloader Configuration Option
    Configured shared library <code-source> in server.xml
    <import-shared-library> in server.xml
    app-name.root <import-shared-library> in orion-application.xml
    <library> jars/directories in orion-application.xml
    <ejb> JARs in orion-application.xml
    RAR file: all JARs at the root.
    RAR file: <native-library> directory paths.
    Manifest Class-Path of above JARs
    app-name.web.web-mod-name WAR file: Manifest Class-Path
    WAR file: WEB-INF/classes
    WAR file: WEB-INF/lib/ all JARs
    <classpath> jars/directories in orion-web.xml
    Manifest Class-Path of above jars.
    search-local-classes-first attribute in orion-web.xml
    Shared libraries are inherited from the app root.
    We have reasons why we prefer not to use .JAR files for these “non-standard” or “replaced” classes, so prefer an option that doesn’t involve creating a .JAR file.
    Our ideal solution would be to have such classes placed in an alternate directory that is referred to in a classpath such that IF a class exists in that location, it will be used instead of the one in the WEB-INF/classes/ directories, and if not such class is found it would then locate it in the WEB-INF/classes/ directories.
    - Can a classpath be set to look for such classes in a directory?
    - Do the classes have to replicate the original package directory structure within that directory (<dir>/talent2/alesco/model/libraries)?
    - If the class were put in such a directory, without replicating the original package directory structure, I assume the referencing “import” statements would not locate it correctly.
    - Is the classpath mechanism “clever” enough to search the package directory structure to locate the class (i.e. just points to <dir>)?
    - Or would the classpath mechanism require each individual path replicating the package structure to be added (i.e. <dir>/talent2/alesco/model/libraries/ and any other such package path)?
    If we are “forced” to resort to the use of JAR files, does a JAR file used for the purpose of overwrite/extending a sub-set of classes in the original location need to contain ALL related package classes? Or does it effectively “superset” classes it finds in all JAR files, etc. in the whole classpath? That is, it finds talent2.alesco.model.libraries.ModelUtil in the custom.jar file and happily goes on to get the remainder of talent2.alesco.model.libraries classes in the other core JAR/location. Or does it need all of them to be in the first JAR file for that package?
    Any help would be appreciated to understand how these various class visibility mechanisms could be used to achieve what is required would be appreciated.
    Gene

    So, nobody's had any experience with deploying an ADF application, and providing a means for a client to place custom classes in such a way as they're used in preference to the standard application class, effectively to implement a customised class without overwriting the original "standard" class?
    Gene

  • Having issues setting up the use of two iTunes libraries on one Apple TV.  I can set up my iTunes library as I can turn home sharing on from my own computer, however, my fiance only has an iPad with home sharing turned on and it does not find his account?

    I have a new Apple TV which I am struggling to set up with both mine and my fiances music.  I have a laptop, but my fiance only has an ipad and it only seems to sync my music library from my iTunes account.  He has homesharing turned on on his iPad but the Apple TV does not recognise his iPad.  It seems from the help that I have read online that homesharing works when you use the same itunes account, is not possible to be able to use two different itunes libraries with two different accounts (and only one computer)?
    Thanks

    Both libraries would need to have been setup to use home sharing with the same Apple ID in order for that to work.

  • Implementation of Shared Libraries on Palm Using J2ME

    Hi,
    I am currently working on the Palm Shared Libraries using C...Kind of drag....so I wonder is there any way to implement this on the Palm using J2ME...
    Thanks and Regards,
    Joseph

    From memory, I dont think that J2ME provides a an implementations at the moment that can access the Palm shared libraries, it's too specific for the generic implementation of MIDP, although I've heard of a PDA profile that SUN is working on, may or may not be true , but it's worth checking out : )
    Vance

  • I meet a problem about linking when I use Sharing Libraries.

    I meet a problem when I use Sharing Libraries.
    When I debug my flash on my local end, I can set the URL to "ShareLibrary.swf" (For “Export for runtime sharing”).
    All Files linking the file "ShareLibrary.swf" are working correctly.
    But When I put this swf on the net, the link can't work unless changing the URL to full path including the ip address.
    Is there any way that I can make it work using the same URL, no matter the file is on the local or on the net?

    Morning Alex,
    Thanks for using Apple Support Communities.
    For troubleshooting on this, take a look at this article:
    iPhone: Sound muffled or low from the speaker or when speaking into the mic.
    http://support.apple.com/kb/TS1631
    Resolution
    Check the following:
    Check the volume setting on your iPhone. You can adjust the volume by pressing the volume up and down buttons on the left side of the iPhone.
    If you are using a third-party iPhone case, make sure it is not covering the speaker, microphone, or top microphone. Try making some calls without the case to see if a caller can now hear you more clearly or play music to see if the speaker's volume is better.
    If you have not removed the plastic display film used for protection during shipment, either ensure that the microphone and speaker are not covered or remove the film completely.
    Check that the speaker, microphone mesh covers, and top microphone hole are not clogged with lint or other debris.
    If the speaker, microphone mesh, or top microphone (iPhone 4 only) appear clogged, please use a clean, small, dry, soft-bristled brush to clean them. To do this follow these instructions:
    Use the brush to carefully and gently brush the speaker and microphone mesh.
    Brush away from the 30-pin dock connector to avoid getting any debris into the dock connector.
    Hope this helps,
    Mario

  • OC4J 10.1.3 Shared Libraries -- legal use of library-compatible attribute?

    I notice that several seeded shared libraries set the library-compatible attribute to allow arbitrary java archives to be picked up from an included code-source location that is a plain directory (i.e. not an explicity java archive reference).
    As one solution to a BPEL/WSIF/Java Binding configuration that I'm working on, adding library-compatible="true" to oracle.bpel.common allowed me to easily deploy JARs that are accessible to the BPEL WSIF framework at runtime (i.e. you can then put your JARs in $ORACLE_HOME/bpel/system/classes and they will be found by the specific loader).
    Question: OC4J documentation says that the library-compatible attribute is internal use only and also doesn't describe all its possible effects (besides the convenient one above). What's the scoop on this shared-library attribute?
    Thanks,
    Todd

    I notice that several seeded shared libraries set the library-compatible attribute to allow arbitrary java archives to be picked up from an included code-source location that is a plain directory (i.e. not an explicity java archive reference).
    As one solution to a BPEL/WSIF/Java Binding configuration that I'm working on, adding library-compatible="true" to oracle.bpel.common allowed me to easily deploy JARs that are accessible to the BPEL WSIF framework at runtime (i.e. you can then put your JARs in $ORACLE_HOME/bpel/system/classes and they will be found by the specific loader).
    Question: OC4J documentation says that the library-compatible attribute is internal use only and also doesn't describe all its possible effects (besides the convenient one above). What's the scoop on this shared-library attribute?
    Thanks,
    Todd

  • Using shared libraries

    I've just installed some shared libraries and I'm trying to write some code to access them. The libraries are in /usr/local/lib and the headers are in /usr/local/include .
    My C code can find the headers but when I try to compile it I get a load of  "undefined reference to" errors referring to the functions which come from the library. At the end I get
    collect2: ld returned 1 exit status
    This is when I use gcc as a compiler.
    I've ran ldconfig since installing the libraries.
    What do I need to do to use the libraries?

    I wouldn't do so. There are reason why there are libraries, and you can simply depend on libs (as most things in linux do anyway). If you don't want the deps, and say it's a distributed 1-exe-baby (as oracle) link them statically.
    Usually, you can speicfy in the installer where the libs shall go. Also, a .la file is compiled with libtool. I don't know if  you actually can do so, but i'd try to disable libtools (if it's not binary distributed).
    Also, you can simply make a pacman packages of the lib with headers, installing the needed things into the path you need it.
    If you're a developer, and develop together with other guys, i'd recommend you to create a package, and build up a own local repository, with the devel packages needed. I've done so here, that's really a nice solution, especially for libs installed like this for which you can create nice pacman packages.
    // STi

  • How do I import music using homeshare with iTunes 11...I can see the shared libraries but I can't drag and drop and there is no import button.  Thanks!

    How do I import music using homeshare with iTunes 11...I can see the shared libraries but I can't drag and drop and there is no import button.  Thanks!

    Yes, that appears how Mavericks works right now. However, you can open the Address Panel, select all your contacts, then click the To (or CC, or Bcc) buttons to move the selection to the address field.
    If it is not already in the Toolbar, right-click on the Toolbar and select Customize Toolbar…
    Then, drag the address panel up to wherever you want it.
    You may also want to add it to the New Message window in the same way.

  • How to use g++ to build shared libraries for labview in linux?

    does anyone knows if it's possible to compile a shared library in linux with g++ that could be recognized by labview?
    thks
    JP

    Hi JP,
    Yes you can use g++ to build shared libraries that labview can use. You'll want to give your C++ library a C interface. This is really common practice. You can do this by simply declaring functions as 'extern "C"'. Here is a link with more information:
    http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-30.8
    I've personally worked on projects that do exactly what you want to do.

  • What are analogous shared libraries that can be called using a call library function to user32.dll and lvtoolbox.dll when using Linux and Mac?

    I am wondering if anyone is familiar with how to get similar information with a LV program using a Linux shared library as well as the corrolate Mac library to the Windows user32.dll and lvtoolbox.dll.  I specifically am trying to get system metrics such as screen resolution information and cursor information as well as being able to set mouse position.   I am trying to convert a LV Windows program to these other operating systems and I am unfamiliar with these platforms.
    Thanks for your time - I really appreciate it.

    There is no simple answer to that. On Linux you will likely have to call into X Server, which would be a pain to do, due to various versions and implementations of that. On the Mac there would be the difficulty that you can't call into the native ObjectiveC API but would need to find a Carbon API or something like that to do what you want.
    If you seriously want to do something like this for multiplatform, you should bite the bullet and start coding an intermediate shared library in C. This library would export a LabVIEW friendly C API and access whatever system API you need to have for the particular functions. But multiplatform programming on this level is a pain in the ass, no matter what.
    Message Edited by rolfk on 04-21-2010 08:26 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Urgent: Can a standalone RA use shared libraries?

    OC4J 10.1.3
    already checked all documents: Developer's Guide, RA Admin Guide, Deployment Guide.... No answer for this.
    I know how to do this for an application (add imported-shared-libraries tag) but this won't work for standalones RAs. I added the tag into orion-ra.xml and tried..
    Thank you!

    Standalone RAs are childs of the default application. Have you already tried to add the import-shared-library tag to the j2ee/home/config/application.xml file ?

  • Sharing Libraries across accounts on one computer

    I'd like to know an easy method to share iPhoto libraries across accounts on one computer. It looks like iPhoto is more or less ignoring this topic. I have searched the web for tips, found some, yet the instructions are complicated and what seemed to be the best one didn't work. Anyone in this forum that can help me?

    haha, brian has a hidden message in there.
    Anyway, here all the links I have for sharing. The last link for using ACLs is the one I think you are thinking of.
    SHARING IPHOTO LIBRARIES
    Sharing libraries between users on the same local network
    You can also share a library on the same machine between users the same way.
    Sharing libraries between users on the same machine...
    -both users must have sharing enabled in their iPhoto Preferences
    -both users must be logged in and have iPhoto running
    -Remember that you can only view the other library. You can't edit the photos or play the saved slideshows or view the made books or burn them to CD or DVD. The books and slideshows will show up as an album. You can play that album as an "on the fly" slideshow. You can drag images from the sharing library to your library in the source column to import them to your library. You can then edit, add to albums, books, slideshow, etc.
    Sharing links from Apple....
    Sharing your photos between computers
    About shared photos
    Turning off photo sharing
    Looking for shared photos
    SHARING ONE IPHOTO LIBRARY BETWEEN USERS ON SAME MACHINE
    You can try one of these three methods:
    1- Use iPhoto Library Manager-the paid version
    The documentation page will give instructions on how it is done.
    2- Sharing one iPhoto library between several users on one machine
    3- Share an iPhoto Library in tiger Using ACL's

  • While booting linux VM getting error "error while loading shared libraries

    Hi Expert,
    while booting Oracle linux Virtual Machine getting error "error while loading shared libraries: libpopt.so.0 cannot open shared object file" no such file or directory
    Now i am unable to boot linux, any help appreciated.
    Note: Its Oracle Linux 5.8 x86_64 under Oracle VirtualBox
    Edited by: IgnitedMind on Apr 30, 2013 7:12 AM
    Edited by: IgnitedMind on May 1, 2013 12:04 AM
    Edited by: IgnitedMind on May 1, 2013 12:06 AM

    Without knowing what you have installed or what modifications you have done it is not possible to say what goes wrong. Like I previously mentioned, you may have installed an incompatible version of a core system library. Sorry, I'm not going to read any installation manual to find out what you might have done wrong. You may need to reinstall the complete system or just the popt installation package.
    Based on my experience people sometimes seem to misunderstanding the concept of software version requirements, which are always minimum version requirements and does not mean, for instance, software made for gcc 4.1.10 does not work under 4.1.12. You cannot simply upgrade or downgrade core system libraries without affecting the installed system. Using YUM to install software will check this and prevent you from breaking your system. RPM does not check any dependencies and hence can break your system beyond repair.

  • Lsnrctl: error while loading shared libraries: libclntsh.so.9.0:

    Hi
    I copied across an /opt folder from a Redhat 9 server that has Oracle 9.2.0 to a Redhat AS 4. I then set the oracle variables, hoping after that I can get the database up and running. However I get this error, when trying to start the listener or sqlplus:
    lsnrctl: error while loading shared libraries: libclntsh.so.9.0: cannot open shared object file: No such file or directory
    Is this library part of a certain RPM? Where can I get this RPM or this lirary?
    Thanks.

    I copied across an /opt folder from a Redhat 9server that has Oracle 9.2.0 to a Redhat AS 4.
    So you are saying that you copied the whole
    ORACLE_HOME to a new server?? Are you using same
    username/group on new server?? Did you relink the
    binaries after copying it? What is the output of ls
    -l on ORACLE_HOME dir and as what user you are
    running lsnrctl command??
    Daljit SinghYes I copied the folder that has Oracle_Home and datafiles.
    i have created the oracle user.
    How do I relink the binaries?
    I run it as oracle.

Maybe you are looking for