Changes between Version 9 and Version 10 of AppLibraries


Ignore:
Timestamp:
Jun 19, 2014, 9:17:21 AM (10 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppLibraries

    v9 v10  
    11= Dynamic library naming issues =
    22
    3 Suppose your application uses a dynamic library, say '''example.dll'''.
     3BOINC applications may include dynamically-loaded libraries
     4('''.dll''' on Windows, '''.so''' on Unix).
     5
     6The search order for libraries is:
     7
     8 1. The project directory
     9 1. The slot directory
     10 1. other directories
     11
    412Recall that [BoincFiles BOINC files are immutable].
    5 If you use the physical name '''example.dll'''
    6 there will be a problem if either
     13Suppose that an app version uses a dynamic library
     14with the physical name '''example.dll'''.
     15There will be name collisions if either
    716
    817 * You support multiple platforms (say, Win32 and Win64),
    9    and there are different versions of '''example.dll''' for each platform.
     18   and there are different versions of the library for each platform.
    1019 * You need to update to new versions of the library.
    1120
    12 The easiest solution is:
    13  * Give the libraries physical names that encode the platform and version number,
    14    e.g. '''example_win32_1_17.dll''' and '''example_win64_1_17.dll'''.
    15  * Use '''example.dll''' as the logical name.
    16   To do this, use something like the following in your
    17   [AppVersionNew#Theversiondescriptionfile version description file]:
     21Name collisions can be avoided by giving the libraries physical names
     22that encode the platform and version number,
     23e.g. '''example_win32_1_17.dll''' and '''example_win64_1_17.dll'''.
     24
     25It may be inconvenient to rebuild the application to refer to these names
     26rather than '''example.dll'''.
     27To avoid this, include something like
    1828{{{
    1929...
     
    2434...
    2535}}}
    26 
    27 The '''copy_file''' flag tells the BOINC to copy the library to
    28 the application's runtime directory.
    29 
    30 == Avoiding name conflicts ==
    31 
    32 The search order for libraries is:
    33 
    34  1. The project directory
    35  1. The slot directory
    36  1. other directories
    37 
    38 Hence if you use '''example.dll''' as a physical name in one app version,
    39 other app versions will use that library even if they
    40 use the above scheme.
    41 
    42 To avoid this problem, use logical names that don't conflict with physical names.
     36in your [AppVersionNew#Theversiondescriptionfile version description file].
     37This tells the BOINC client to copy the library to
     38the application's slot directory with the name '''example.dll'''.
     39When the application tries to load '''example.dll''',
     40it will look in the project directory and not find it;
     41then it will look in the slot directory and find it there.
    4342
    4443== .NET applications ==
     
    4645.NET does not use the current directory as a search path for dependencies.
    4746
    48 Our workaround is to install a handler for the AssemblyResolve event and use the
     47A workaround is to install a handler for the !AssemblyResolve event and use the
    4948current directory (slot) to load the dependencies: