Library name compatibility 32/64 bit and across platforms

Hi all,
I have a numerical C library which I wish to link to using JNI. The binary will be shipped in the jar file to keep everything "clean" for the client.
Unfortunately the SUN System.mapLibraryName method is completely useless when it comes to bundling binaries that are specific to an architecture. Some tests I have performed show:
Linux 64 bit Pentium M: os.name = "Linux", os.arch = "amd64", mapLibraryName = "libNAME.so"
Linux 32 bit: os.name = "Linux", os.arch = "i386", mapLibraryName = "libNAME.so"
iBook G4: os.name = "Mac OS X", os.arch = "ppc", mapLibraryName = "libNAME.jnilib"
Windows XP 32 bit: os.name = "Windows XP", os.arch = "x86", mapLibraryName = "NAME.dll"
Sun Blade 1500 (64 bit): os.name = "SunOS", os.arch = "sparc", mapLibraryName = "libNAME.so"
you will notice that Linux 32/64 and Solaris all use "libNAME.so"... despite the architecture they are running on! (Apple is not a problem because it supports Universal binaries).
I'm thinking that I will have to use some horrible library name and loading code to deal with these problems... creating library names along the lines of
Linux 64 bit Linux: "libNAME-linux-intel-64.so"
Linux 32 bit Linux: "libNAME-linux-intel-32.so"
Linux 32 bit PPC Linux: "libNAME-linux-ppc-32.so"
iBook G4: "libNAME.jnilib"
Windows XP 64 bit: "NAME-64.dll"
Windows XP 32 bit: "NAME-32.dll"
Sun Blade 1500 (64 bit): "libNAME-sunos-64.so"
My main concern is Linux and Windows 32/64 bit, rather than cross-CPU handling.
I am not looking forward to writing this... has this problem come up before? And if so, what have people done to deal with it? I guess an alternative would be to use a naming convention in the directory structure, but that's really the same solution.
Kind regards,
Sam

I have concluded that the best way to solve this problem is to create a pre-processing method for System.loadLibrary that takes the library name (as it would be passed to System.loadLibrary) and returns a more operating system and architecture-friendly String.
I have created a class that does OS/Architecture detection and then returns the following on various platforms for the input parameter "name":
Apple (G3, G4, G5, Intel): "name" (expects user to build Universal Binaries)
Linux (i686): "name-linux-x86"
Linux (Intel/AMD 64): "name-linux-x86_64"
Linux (sparc): "name-linux-sparc"
Linux (PPC 32 bit): "name-linux-ppc"
Linux (PPC 64 bit): "name-linux-ppc_64"
Windows XP/Vista (i686): "name-windows-x86"
Windows XP/Vista (Intel/AMD 64): "name-windows-x86_64"
Sun Solaris (Blade): "name-sun-sparc"
Sun Solaris (Intel 64 bit): "name-sun-x86_64"
This String can then be safely sent to System.loadLibrary, which will do the usual additions of "lib", ".so", ".jnilib" and ".dll" and search in all the right places. It is not possible to write a wrapper for System.loadLibrary itself as native library loading needs to know the name of the calling class.
I'd be happy to share the code with anyone who requests, but it's a bit too long to post here.
Incidentally... in my research into native library loading, I encountered the "Bundle-NativeCode" entry for Manifest files. It may be possible to construct an entry for each os.name/os.arch pair to assign native binaries accordingly. However it appeared that every pairing would need to be specified (whereas my solution is more forgiving), and I'm not entirely sure if that method allows one to define the (shortened form of the) library name... it may just be useful for bundling binaries inside the jar file.

Similar Messages

  • Compatibility between 32 bit and 64 bit of TimesTen

    Hi All,
    Please tell me is there any document avialable to see compatibility between 32 bit and 64 bit of TimesTen ?
    Regards
    Pratheej

    Hi Pratheej,
    1. You cannot replicate between 32 and 64 bit TimesTen.
    2. For direct mode connections, the application must be the same 'bittedness' as TimesTen 932-bit app -> 32-bit TT, 64-bit app to 64-bit TT).
    3. For client/server connections a 32-bit app can work with both 32 and 64 bit TT. A 64-bit app can only use 64-bit TT.
    If you want to deploy a 32-bit app using 64-bit TT on the same machine we have an optimised shared memory client/server connection (shmipc) mode. This is much faster than TCP or Unix sockets but is still much slower than direct mode.
    HTH,
    Chris

  • Will changing iPhoto library name affect my photos?

    I want to change the name of my iPhoto library from 'Samsung HDD' (in the picture) to other name. I'm going to change it via Finder -- by using Get Info and rename it, is this the right method? And will this affect my photos?
    Thanks in advances.

    no - but backup first and after changing the iPhoto library name you have to depress and hold he option key, launch iPhoto and select the libraqry withits new name
    LN

  • Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Aftershotz,
    You're going to have to give a bit more information.
    What do you mean by "opening a file in library?"  There is no function of Aperture to open files -- you can open (switch) libraries.
    You'll have to be more specific about error messages, too.  Perhaps some screenshots would be useful to diagnose your problem.  "Can't open database with library name" is not enough detail about what Aperture is really telling you.
    nathan

  • External library Same name of lib for windows and linux

    I have a VI library, under Windows. This library contains a bunch of SubVI who call our libAPI.dll We are currently adding support for Linux. And, thus, have the equivalent for our libAPI.dll which is libAPI.so for Linux. Is it possible to use a generic name in the field for Library name or path API (without .dll or .so). So that when we will create of Linux version of this library we wont have to edit all of the Library name or path for each VI. We already tried to use the subVIs under Linux. Labview asked to locate libAPI.dll. If we choose libAPI.dll, then it works fine, but we do not want to have a question asked to the user about locating API.dll under Linux.
    Regards,
    Nitrof

    Use "libAPI.*" in the call library function node configuration page.

  • Compatibility problem windows7- 64 bits and oracle 8

    I have a compatibility problem with windows 7 and 64 bits and oracle 8 client
    the data server is also version 8
    What type of client is compatible with oracle 8 and 64 bits?
    or any solution to the problem.
    I use the client to run a desktop application
    thanks

    Oracle 8 client is not certified on Windows 7. Client 10.2.0.5 is compatible with Oracle 8 and is certified on Windows 7 too.
    To install 10.2.0.5 client, please refer to the MOS document.
    How To Install Oracle 10.2.0.5 Client Software on Windows 7 (32 or 64-bit) and Windows 2008 R2 (64-bit) (Doc ID 1316079.1)

  • My imported movie shows up in the event library under 2006 date, month of march, the movie name.  I want the movie to show up in the event library under the date I choose and the movie name. How do I do this?

    My imported movie shows up in the event library under 2006 date, month of march, the movie name.  I want the movie to show up in the event library under the date I choose and the movie name. How do I do this?

    rogerhermans wrote:
    I did change the name of the event. I cannot change the date of the event in the Modify command. The date and month was selected by the system as I did not name my event to start with. I now want to change the date (from 2006 to 1987) , delete the month and show the event name. I want the event library to post all my events by year (specified by me) and name of event.
    you can change the date, so that FCPX categorizes it properly.  First delete the clip(s) from FCPX, but not from your computer entirely, make sure you have the originals somewhere.
    Open a terminal window and use the following command:
    touch -t 198711280800.00 <path/filename of clip>
    Where the format is:  (use leading zeros if necessary for date & time)
    first four digits: year
    next four:  month and day
    next four:  time of day (in 24 hour format)
    next 2:  seconds as a decimal (this is optional, if you leave it off you will get 00 seconds)
    The above example will change the file date to Nov. 8, 1987  08:00:00 AM
    This will change the created, modified and last access dates of the clip/file.
    Then reimport the clip(s) and FCPX should categorize it properly.

  • Compatibility of acrobat x and ms office 2013 64-bit

    Can someone tell me if these 2 programs have compatibility issues?  MS office 2013 64-bit and adobe acrobat x standard.  I cannot get the "choose sheets" function to work. It automatically comes up with a runtime error and then stops working...brand new computer...

    Hi, Bill. I'm not sure I understand how to do that when I'm trying to combine several different words docs with multiple tabs in an excel document where I have to actually choose the sheet b/c it will only combine the "active" sheet...

  • Uploading .WMV files to my Asset Library spawns 2 files in the library. One conent type = Video and the other = Image. Both have same name and are .wmv

    My 365 site is developed this rather odd behaviour.
    I think its as a result of something I did when I tried and failed to use Document Sets to mange video files.
    Anyway the result is like the title say's I know get two files in the library. What's interesting is the one that is content type = Video opens up the properties dialog for Video but does not play.
    The copntent type = Image file opens the image property dialog and does play.
    Note that I'm the admin for the sub-site, have very litle experience, no training and have ticked the site administrator off so much with stupid questions he's not talking to me so any help is very welcome.
    Thanks

    Hi Rebecca,
    Thanks for responding.
    I can't confirm that it's an OOB Asset Library becasue I don't know how to find that out. When I'm in Suite Content and click on ... then on About I get "Asset Library  A place to share, browse and mange rich media ssests, like image, audio and
    video files.' I so hopefully it is. Additional information - it worked okay before I messed something up when I was trying to create a documet set. It's broken all the libraries of this type on the site.
    Just tried creating a new library and I get the same problem.
    Just tried uploading an MP4 file and I get the same problem.
    I'm not sure what you mean by "When you uploaded the file, did you choose the content type as Video?" I use drag and drop or the Upload button and I am not prompted for a content type. The default content type is Video and I can't change the content
    type to video on the file that does actually play the video. The other file is a video content type but does not play.
    Sorry this is all very confusing I'm sure.
    I know I've done something to mess the site settings us when I fooled with Document Set's but exactly what I did and how to fix I know not.
    Thanks again for your help.

  • Compressor 64-bit and compatibility

    I want to use Compressor as part of my FCP workflow. However I have heard that there are crash problems. Is Compressor 4 now 64-bit and are there any alternatives you might recommend? I want to export movies to bespoke medium and small file sizes

    So, Compressor is still 32 bit.
    As to the stability of the app, you may be interested in what was posted here on a related question.
    I think the expectations for FCP X and Compressor need to be different. X is still very early in the development stage while C4 is mature. I have only been using X in any serious way for a few months and even though the latest versions are reportedly a lot more stable than the earlier versions, I still get far more frequent crashes than I ever experienced using Final Cut Studio.
    However, I have never had a Compressor crash of any sort…in C3, C3.5, or C4…and I use the software on a daily basis. The only issue I ever had with C4 was a cluster problem, which I was able to resolve.
    As far as alternatives are concerned, here is one that's free. It ca do a few tricks that Compressor can't, but C.4 does more overall…and IMHO, can produce higher quality. You might also check out Toast, which is a little more expensive. A lot more expensive are Sorenson Squeeze and Telestream Episode; I believe both have trial versions.
    Good luck.
    Russ

  • Can i install a mix of 32-bit and 64-bit package ? and they work together ?

    Customer environment is Linux x86-64 having package pam-0.99.6.2-6.el5_4.1.x86_64 installed as per x86-64 server and application requirement.
    i.e # rpm -qi pam-0.99.6.2-6.el5_4.1
    Name : pam Relocations: (not relocatable)
    Version : 0.99.6.2 Vendor: Oracle America
    Release : 6.el5_4.1 Build Date: Thu 11 Mar 2010 02:58:52 AM MST
    Install Date: Tue 27 Apr 2010 02:12:43 AM MST Build Host: ca-build9.us.oracle.com
    Group : System Environment/Base Source RPM: pam-0.99.6.2-6.el5_4.1.src.rpm
    Size : 2577739 License: GPL or BSD
    Signature : DSA/SHA1, Thu 11 Mar 2010 02:59:17 AM MST, Key ID 66ced3de1e5e0159
    URL : http://www.us.kernel.org/pub/linux/libs/pam/index.html
    Summary : A security tool which provides authentication for applications
    Description :
    PAM (Pluggable Authentication Modules) is a system security tool that
    allows system administrators to set authentication policy without
    having to recompile programs that handle authentication.
    Now customer is installing other oracle monitoring application which is looking/requesting for 32 bit version of pam-0.99.6.2.6.el5_4.1 (i386), i.e this library
    Question:
    So, is there any way we can install the 32 bit version of this ?  While 64 bit is still there ?
    Concern with installing the 32 bit library, is that something picks it up mistakenly when it expects the 64 bit version.
    Edited by: sgaraga on Jun 8, 2012 4:39 PM

    You can run 32-bit software under a x86-64 OS provided you install the necessary x86 (32-bit) libraries.
    The x86_64 CPU is fully backwards compatible with Intel x86 16-bit and 32-bit code. Because the full x86 16-bit and 32-bit instruction sets remains implemented in hardware without any intervening emulation, existing x86 executables run with no compatibility or performance penalties (http://en.wikipedia.org/wiki/X86-64)
    An application that is 32-bit or 64-bit will have to be linked or share the appropriate library. 32-bit and 64-bit libraries won't be confused because they use different names.

  • A  project on iMovie 09 that  Freezes(only the project)  the viwer window blocked in gray ... .. After editing that  took me a year I'm stuck . All my finished projects that are in the Library infected with the same symptoms and it happens only after I w

    a  project on iMovie 09 that  Freezes(only the project)  the viwer window blocked in gray ... .. After editing that  took me a year I'm stuck .
    All my finished projects that are in the Library infected with the same symptoms and it happens only after I went into the problematic project.  
    I tried to open a new project and everything works
    ...I also tried throwing Recent Files, in the past It solved the problem ,not this time ...
    the problem is that this project will take me a long, long time to rebuild
    imovie 09
    Model Name:          iMac 
      Model Identifier:          iMac10,1
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          3.06 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          3 MB
      Memory:          4 GB
      Bus Speed:          1.07 GHz

    This recently happened to me.  I am a novice, but it seemed like that project got corrupted some how.
    I deleted it.
    Went to time machine and picked it up again when I knew it was working ok.
    I lost a few hours of work, but not the entire project.
    Once I had the project back from time machine, it worked fine (but like I said, I lost a little bit of work).

  • Changed library name - FCPX won't open?

    Ouch.
    I inadvertently changed the Library name of an FCP X file in the Finder Window ... and now FCP X won't open.  I immediately changed it back to the original name, and FCP X still won't open.  The FCP X logo comes up, and then the app seems to freeze and not open.
    Sound familiar?
    There must be a work around or a fix, right?
    All ears,
    Ben

    HI Al,
    Interesting.  And that's why I did the change IN the Finder Window.  I couldn't click the Library open IN the app.  It was as if frozen.  I tried a dozen times to click, or to hit enter when highlighted.  So I thought it wasn't something that could be done.
    In fact, now that you've encouraged me that such a thing is possible I'm going to try again.
    In the meanwhile I had a few crashes, re-installed FCPX, muddled around a bit.  It seems to be working now.  Could have had something to do with FCPX 10.1.1 working with an earlier project done in FXPX 10.0 ... and when I opened FCPX (I think I opened it to set up another project) there was no automatic request to update the original project.  Maybe something weird happened there and caused some kind of corruption.  But in the end I did get the original project updated ... and am now learning how to organize in this little beastie.
    I did learn something interesting about relinking media though.  You can't JUST relink clips to their original media files in FCPX 10.1 ... because when you go to locate your original movie ... it's imbedded in the Library (all those hidden folders), and there is no way to access the library that way.  Someone over at Creative Cow created a workaround, quite brilliant I think.  It works anyhow.  In the Finder Window you 'open package contents', work your way to the folder that contains the unlinked media files, then drag that folder to the margin on the left of Finder Window (where you can drag folders you work on regularly).  THEN you can do a relink and work your way to the folder you need that way.  Works fine.
    I'm going to try renaming my Library now.  Wish me luck.  So useful to be able to do this.
    Thank you kindly Al,
    Ben

  • Can't change library name in version 7??

    I manage two iTunes libraries using the iTunes Library Manager script. After updating to version 7 it no longer displays the library name at the upper left, it only says "Library" and it doesn't seem to be editable. Am I missing something, or did this feature disappear? It's fairly important when managing more than one library to see which one you currently have loaded.

    The name 'Library' is no longer editable.
    You might also read what Doug says about compatibility with iTunes 7 here:
    http://www.dougscripts.com/itunes/itinfo/ituneslibrarymanager.php
    M

  • All my song names, artists etc are gone and have been replaced with

    I wanted to move my itunes library to external hard drive to make space on my internal hd. Ive been having trouble with backing up and to make a long story short, my music is gone of my hard drive ( internal), im now backing it up from the ipod directly to my external hd, I did it a bit wrong but its getting there anyway. The problem is that now all the song names, artists etc are gone and each one of my 9170 songs are just capital letters, like AURH, so i have no idea what is what. Anyone know what is goin on here and how to fix this?

    Yes, the iPad is designed to erase all data, when you connect it to a new computer.  It only syncs the data that is on the computer you connect to, to the device.  If you don't have your epub and pdf documents on the computer, and set to sync via iTunes.......they will erase. 
    You need to move the data from the other computer, to the mac.  Once they are on the mac, you can connect the iPad, and sync it to the iPad.
    Syncing your iPad or iPod - http://www.apple.com/itunes/how-to/#video-sync.

Maybe you are looking for