General Advice on Accessing the Library
When running any program linked with the NAG C Library the appropriate
DLLs need to be accessible.
The .\bin subfolder of the library folder must be included
in your PATH to run applications.
The .\MKL_ia32_8.0\bin subfolder of the library folder must
be included
in your PATH to run applications linked with MKL. This should appear
later in your PATH than the .\bin folder containing the NAG DLLs.
The installation script may have attempted to do this for you, but in
some cases manual intervention may be required. On most systems this
may be effected using the Environment Variables button on the Control
Panel | System | Advanced tab (Advanced System Settings on Windows
Vista).
To include functions from the Library in projects developed under an
integrated development environment (e.g. Microsoft Developer Studio),
the project environment must be set to search for include
(.h) files in
the .\include subfolder of the library folder. Library files must be
searched for under the .\lib subfolder of the library folder.
In Developer Studio open the Tools | Options dialog box, select the
Projects (or Projects and Solutions) | VC++ Directories section and
enter the appropriate setting
for each type of folder.
In this DLL implementation, for convenience, the MKL symbols are
exported directly from the NAG import library CLDLL084Z_mkl.lib, so
it is not necessary to specify the MKL import libraries subfolder
(.\MKL_ia32_8.0\lib) as well.
If your machine has more than one processor and you are using
Intel MKL, then it is recommended
that you set the environment variable OMP_NUM_THREADS to the number of
available processors, e.g.
set OMP_NUM_THREADS=2
This will enable the Intel MKL BLAS to make use of the extra
processor(s) and will thus speed up the computation of many of the NAG
library routines. On most systems setting this environment variable
may be effected using the Environment Variables button on the Control
Panel | System | Advanced tab (Advanced System Settings on Windows
Vista).
Normally you are advised to use NAG_ALLOC to allocate memory and
NAG_FREE to deallocate memory, however in mixed language programming,
these C preprocessor macros are not available. Instead you may call
the x04bjc and x04bdc functions directly to allocate
and deallocate
memory.
The function x04bjc is the NAG memory allocator in this
implementation.
Pointer NAG_CALL x04bjc(size_t size);
The function x04bdc is the NAG memory deallocator.
void NAG_CALL x04bdc(Pointer *ptr);
Note: Within a number of NAG C Library functions, memory is
allocated internally and returned to the calling function. This
allocated memory contains information that is potentially useful to
the user. Consequently freeing this memory has been left to user
discretion. However, in the context of DLLs such internally allocated
memory cannot be freed externally.
For an example of the use of x04bdc, please refer to the
g05eac
example program.
Note that the NAG C Library DLLs use the __stdcall calling convention
for function calls.
Learn more about the NAG DLLs.