Mac Static Library Architecture

  1. Mac Static Library Architecture 2017
  2. Mac Static Library Architecture Free
  3. Mac Static Library Architecture Pictures
  4. Mac Static Library Architecture Pdf

Two important factors that determine the performance of apps are their launch times and their memory footprints. Reducing the size of an app’s executable file and minimizing its use of memory once it’s launched make the app launch faster and use less memory once it’s launched. Using dynamic libraries instead of static libraries reduces the executable file size of an app. They also allow apps to delay loading libraries with special functionality only when they’re needed instead of at launch time. This feature contributes further to reduced launch times and efficient memory use.

This article introduces dynamic libraries and shows how using dynamic libraries instead of static libraries reduces both the file size and initial memory footprint of the apps that use them. This article also provides an overview of the dynamic loader compatibility functions apps use to work with dynamic libraries at runtime.

Mar 28, 2018  First of all, a library is a collection of resources and the code itself, compiled for one or more architectures. Let’s briefly touch on what dynamic and static libraries are and clarify the main difference. The word static or dynamic refers to the way the compiled code is. Dec 16, 2019 Static Libraries in the lib directory However, some optional libraries are installed by default, while the rest are not. To get those libraries that are not installed by default, explicitly select the specified optional component during installation. I have a static library in my project which has the following architectures included, according to the 'lipo' utility. Xcode claims architecture is missing but it's not. Level 3 (180 points) Floating Wrench Nov 21, 2015 12:40 AM (in response to Operator).

What Are Dynamic Libraries?

Most of an app’s functionality is implemented in libraries of executable code. When an app is linked with a library using a static linker, the code that the app uses is copied to the generated executable file. A static linker collects compiled source code, known as object code, and library code into one executable file that is loaded into memory in its entirety at runtime. The kind of library that becomes part of an app’s executable file is known as a static library. Static libraries are collections or archives of object files.

Note: Static libraries are also known as static archive libraries and static linked shared libraries.

When an app is launched, the app’s code—which includes the code of the static libraries it was linked with—is loaded into the app’s address space. Linking many static libraries into an app produces large app executable files. Figure 1 shows the memory usage of an app that uses functionality implemented in static libraries. Applications with large executables suffer from slow launch times and large memory footprints. Also, when a static library is updated, its client apps don’t benefit from the improvements made to it. To gain access to the improved functionality, the app’s developer must link the app's object files with the new version of the library. And the apps users would have to replace their copy of the app with the latest version. Therefore, keeping an app up to date with the latest functionality provided by static libraries requires disruptive work by both developers and end users.

A better approach is for an app to load code into its address space when it’s actually needed, either at launch time or at runtime. The type of library that provides this flexibility is called dynamic library. Dynamic libraries are not statically linked into client apps; they don't become part of the executable file. Instead, dynamic libraries can be loaded (and linked) into an app either when the app is launched or as it runs.

Note: Dynamic libraries are also known as dynamic shared libraries, shared objects, or dynamically linked libraries.

Figure 2 shows how implementing some functionality as dynamic libraries instead of as static libraries reduces the memory used by the app after launch.

Using dynamic libraries, programs can benefit from improvements to the libraries they use automatically because their link to the libraries is dynamic, not static. That is, the functionality of the client apps can be improved and extended without requiring app developers to recompile the apps. Apps written for OS X benefit from this feature because all system libraries in OS X are dynamic libraries. This is how apps that use Carbon or Cocoa technologies benefit from improvements to OS X.

Another benefit dynamic libraries offer is that they can be initialized when they are loaded and can perform clean-up tasks when the client app terminates normally. Static libraries don’t have this feature. For details, see Module Initializers and Finalizers.

One issue that developers must keep in mind when developing dynamic libraries is maintaining compatibility with client apps as a library is updated. Because a library can be updated without the knowledge of the client-app’s developer, the app must be able to use the new version of the library without changes to its code. To that end, the library’s API should not change. However, there are times when improvements require API changes. In that case, the previous version of the library must remain in the user’s computer for the client app to run properly. Dynamic Library Design Guidelines explores the subject of managing compatibility with client apps as a dynamic library evolves.

How Dynamic Libraries Are Used

When an app is launched, the OS X kernel loads the app’s code and data into the address space of a new process. The kernel also loads the dynamic loader ( /usr/lib/dyld ) into the process and passes control to it. The dynamic loader then loads the app’s dependent libraries. These are the dynamic libraries the app was linked with. The static linker records the filenames of each of the dependent libraries at the time the app is linked. This filename is known as the dynamic library’s install name. The dynamic loader uses the app’s dependent libraries’ install names to locate them in the file system. If the dynamic loader doesn’t find all the app’s dependent libraries at launch time or if any of the libraries is not compatible with the app, the launch process is aborted. For more information on dependent-library compatibility, see Managing Client Compatibility With Dependent Libraries. Dynamic library developers can set a different install name for a library when they compile it using the gcc -install_name option. See the gcc man page for details.

The dynamic loader resolves only the undefined external symbols the app actually uses during the launch process. Other symbols remain unresolved until the app uses them. For details on the process the dynamic loader goes when an app is launched, see “Executing Mach-O Files” in Mach-O Programming Topics.

The dynamic loader—in addition to automatically loading dynamic libraries at launch time—loads dynamic libraries at runtime, at the app’s request. That is, if an app doesn't require that a dynamic library be loaded when it launches, developers can choose to not link the app’s object files with the dynamic library, and, instead, load the dynamic library only in the parts of the app that require it. Using dynamic libraries this way speeds up the launch process. Dynamic libraries loaded at runtime are known as dynamically loaded libraries. To load libraries at runtime, apps can use functions that interact with the dynamic loader for the platform under which they're running.

Note: The target architecture of the client and the dynamic library must be the same. Otherwise, the dynamic loader doesn’t load the library.

Different platforms implement their dynamic loaders differently. They may also have custom dynamic code-loading interfaces that make code difficult to port across platforms. To facilitate porting an app from UNIX to Linux, for example, Jorge Acereda and Peter O'Gorman developed the dynamic loader compatibility (DLC) functions. They offer developers a standard, portable way to use dynamic libraries in their apps.

The DLC functions are declared in /usr/include/dlfcn.h. There are five of them:

  • dlopen(3) OS X Developer Tools Manual Page: Opens a dynamic library. An app calls this function before using any of the library’s exported symbols. If the dynamic library hasn’t been opened by the current process, the library is loaded into the process’s address space. The function returns a handle that’s used to refer to the opened library in calls to dlsym and dlclose. This handle is known as the dynamic library handle. This function maintains a reference count that indicates the number of times the current process has used dlopen to open a particular dynamic library.

  • dlsym(3) OS X Developer Tools Manual Page: Returns the address of a symbol exported by a dynamically loaded library. An app calls this function after obtaining a handle to the library through a call to dlopen. The dlsym function takes as parameters the handle returned by dlopen or a constant specifying the symbol search scope and the symbol name.

  • dladdr(3) OS X Developer Tools Manual Page: Returns information on the address provided. If the address corresponds to a dynamically loaded library within the app’s address space, this function returns information on the address. This information is returned in a Dl_info structure, which encapsulates the pathname of the dynamic library, the library’s base address, and the address and value of the nearest symbol to the address provided. If no dynamic library is found at the address provided, the function returns no information.

  • dlclose(3) OS X Developer Tools Manual Page: Closes a dynamically loaded library. This function takes as a parameter a handle returned by dlopen. When the reference count for that handle reaches 0, the library is unloaded from the current process’s address space.

  • dlerror(3) OS X Developer Tools Manual Page: Returns a string that describes an error condition encountered by the last call to dlopen, dlsym, or dlclose.

For more information on the DLC functions, see OS X ABI Dynamic Loader Reference.



Copyright © 2012 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2012-07-23

Intel® Data Analytics Acceleration Library (Intel® DAAL) is the library of Intel® architecture optimized building blocks covering all stages of data analytics: data acquisition from a data source, preprocessing, transformation, data mining, modeling, validation, and decision making.

Intel DAAL is installed standalone and as part of the following suites:

Intel DAAL is also provided as a standalone package under the Community Licensing Program.

Prerequisites

System Requirements.

Install Intel DAAL on Your System

Intel DAAL installs in the directory <install dir>/daal.

By default, <install dir> is /opt/intel/compilers_and_libraries_2020.x.xxx/mac.

For installation details, refer to Intel DAAL Installation Guide.

Set Environment Variables

  1. Run the <install dir>/daal/bin/daalvars.sh or .csh script as appropriate to your target architecture:

    • IA-32 architecture:
      daalvars.sh ia32

    • Intel® 64 architecture:
      daalvars.sh intel64

  2. Optionally: Specify the Java* compiler different from the default compiler:
    export JAVA_HOME=$PATH_TO_JAVA_SDK
    export PATH=$JAVA_HOME/bin:$PATH

C++ Language

Step 1: Choose the Compiler Option for Automatic Linking of Your Application with Intel DAAL

Decide on the variant of the the -daal option of the Intel® C++ Compiler 16 or higher or configure your project in the Integrated Development Environment (IDE):

Compiler Option

IDE Equivalent

daal or ‑daal=parallel

Tells the compiler to link with standard threaded Intel DAAL.

Eclipse*:

  1. Go to Project > Properties > C/C++ Build > Settings > Intel C++ Compiler > Performance Library Build Components > Use Intel Data Analytics Acceleration Library.
  2. Select Use threaded Intel DAAL (-daal=parallel) or Use non-threaded Intel DAAL (-daal=sequential), as appropriate.

Xcode*:

  1. Go to Project > Build Settings > ICC InteL C++ Compiler XE yy.y > Performance Library Build Components > Use Intel Data Analytics Acceleration Library.
  2. Select Use threaded Intel Data Analytics Acceleration Library or Use non-threaded Intel Data Analytics Acceleration Library, as appropriate.

‑daal=sequential

Tells the compiler to link with sequential version of Intel DAAL.

For more information on the daal compiler option, see the Intel® Compiler User and Reference Guide.

Step 2: Create and Run Your First Application with Intel DAAL

This short application computes Cholesky decomposition with Intel DAAL.

  1. Paste the application code into the editor of your choice.

  2. Save the file as my_first_daal_program.cpp.

  3. Compile with the following command, providing the selected variant of the ‑daal compiler option, for example, ‑daal=parallel:
    icc my_first_daal_program.cpp -daal=parallel -o my_first_daal_program

  4. Run the application.

Step 3 (Optional): Build Your Application with Different Compilers

List the following Intel DAAL libraries on a link line, depending on Intel DAAL threading mode and linking method:

Single-threaded (non-threaded) Intel DAAL

Multi-threaded (internally threaded) Intel DAAL

Static linking

libdaal_core.a
libdaal_sequential.a

libdaal_core.a
libdaal_thread.a

Dynamic linking

libdaal_core.dylib
libdaal_sequential.dylib

libdaal_core.dylib
libdaal_thread.dylib

These libraries are located in the directory <install dir>/daal/lib.

Regardless of the linking method, also add to your link line the library on which Intel DAAL libraries depend:

  • Intel® Threading Building Blocks run-time library of the Intel® compiler libtbb.dylib

For example, to build your application by statically linking with multi-threaded Intel DAAL:

icc my_first_daal_program.cpp ‑o my_first_daal_program
$DAALROOT/lib/libdaal_core.a $DAALROOT/lib/libdaal_thread.a ‑ltbb -ldl

Step 4: Build and Run Intel DAAL Code Examples

  1. Build an example:

    Go to the C++ examples directory and execute the make command:
    cd <install dir>/daal/examples/cpp
    make {libia32|dylibia32|libintel64|dylibintel64}
    example=<example_name>
    compiler={intel|gnu|clang}
    threading={parallel|sequential}
    mode=build

    Among the {libia32|dylibia32|libintel64|dylibintel64} parameters, choose the one that matches the architecture parameter you provided to the daalvars.sh script and has the prefix that matches the type of executables you want to build: lib for static and dylib for dynamic executables.

    The names of the examples are available in the daal.lst file.

    The command creates a directory for the chosen compiler, architecture, and library extension (a or dylib). For example: _results/intel_intel64_a.

  2. Run an example:

    Go to the C++ examples directory and execute the make command in the run mode. For example, if you ran the daalvars script with the intel64 target:
    cd <install dir>/daal/examples/cpp
    make libintel64 example=cholesky_batch.cpp mode=run

    The make command builds the static library for the Intel 64 architecture and cholesky_batch.cpp example with Intel® compiler, assumed by default, and runs the executable.

Java* Language

Build and Run Intel DAAL Code Examples

To build and run Java code examples, use the version of the Java Virtual Machine* corresponding to the architecture parameter you provided to the daalvars.sh script during setting environment variables.

  1. Free 4 gigabytes of memory on your system.
  2. Build examples:

    Go to the Java examples directory and execute the launcher command with the build parameter:
    cd <install dir>/daal/examples/java
    launcher.sh build $PATH_TO_JAVAC

    The command builds executables *.class (for example, CholeskyBatch.class) in the
    <install dir>/daal/examples/java/com/intel/daal/examples/<example name> directory.

  3. Run examples:

    Go to the Java examples directory and execute the launcher command with the run parameter:
    cd <install dir>/daal/examples/java
    launcher.sh {ia32|intel64} run $PATH_TO_JAVAC

    Choose the same architecture parameter as you provided to the daalvars.sh script.

    The output for each example is written to the file <example name>.res located in the ./_results/ia32 or ./_results/intel64 directory, depending on the specified architecture.

Python* Language

Deprecation Notice: With the introduction of daal4py, a package that supersedes PyDAAL, Intel is deprecating PyDAAL and will discontinue support starting with Intel® DAAL 2021 and Intel® Distribution for Python 2021. Until then Intel will continue to provide compatible pyDAAL pip and conda packages for newer releases of Intel DAAL and make it available in open source. However, Intel will not add the new features of Intel DAAL to pyDAAL. Intel recommends developers switch to and use daal4py.

Step 1: Set Up the Build Environment

Set up the C++ build environment as explained under C++ Language.

Mac Static Library Architecture 2017

Mac Static Library Architecture

Step 2: Install Intel DAAL for Python

Go to the directory with Python sources of Intel DAAL and run the install script:
cd <install dir>/pydaal_sources
<python home>/python setup.py install

This script compiles code using Intel DAAL for C++. It builds and installs the pyDAAL package for using Intel DAAL in Python programs.

Mac static library architecture free

Step 3: Run Intel DAAL Code Examples

Mac Static Library Architecture Free

To run Intel DAAL code examples, use the same version of Python as you used to install pyDAAL.

  • Go to the directory with Intel DAAL Python examples:
    cd <install dir>/examples/python

  • To run all the examples, execute the command:
    <python home>/python run_examples.py

    The output for each example is written to the ./_results/intel64/<example name>.res file.

  • To run one specific example, execute the command:
    <python home>/python <algorithm name>/<example name>.py

    For example: /usr/local/bin/python3.5.1/python cholesky/cholesky_batch.py

    This command prints the output to your console.

Training and Documentation

To learn more about the product, see the following resources:

Resource

Description

Get access to Intel DAAL in-depth webinars and featured articles.

Developer Guide for Intel® Data Analytics Acceleration Library:

Find recommendations on programming with Intel DAAL, including performance tips.

View detailed API descriptions for the following programming languages:

  • C++
  • Java*
  • Python*

Learn about installation options available for the product and get installation instructions.

Learn about:

  • New features of the product
  • Directory layout
  • Hardware and software requirements

<install dir>/daal/examples folder

Get access to the collection of programs that demonstrate usage of Intel DAAL application programming interfaces.

Get access to the collection of code samples for various algorithms that you can include in your program and immediately use with Hadoop*, Spark*, message-passing interface (MPI), or MySQL*.

View full documentation library for this and other Intel software products.

Notices and Disclaimers

No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.

This document contains information on products, services and/or processes in development. All information provided here is subject to change without notice. Contact your Intel representative to obtain the latest forecast, schedule, specifications and roadmaps.

Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. No product or component can be absolutely secure. Check with your system manufacturer or retailer or learn more at [intel.com].

The products and services described may contain defects or errors which may cause deviations from published specifications. Current characterized errata are available on request

Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.

Intel, the Intel logo and Xeon are trademarks of Intel Corporation in the U.S. and/or other countries.

Microsoft, Windows, and the Windows logo are trademarks, or registered trademarks of Microsoft Corporation in the United States and/or other countries.

OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission of The Khronos Group.

*Other names and brands may be claimed as the property of others.

Mac Static Library Architecture Pictures

© Intel Corporation.

Optimization Notice

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804

Mac Static Library Architecture Pdf

For more complete information about compiler optimizations, see our Optimization Notice.