NAG C Library, Mark 26

CLW32261EL - License Managed

Microsoft Windows, 32-bit, Intel C/C++ or Microsoft C/C++

Supplementary Information


1. Introduction

This page is for supplementary information relating to the implementation described in Section 2.1 of the Installer's Note. It may be augmented over the life-time of the product if further pertinent information becomes available.

2. Applicability

This implementation is considered suitable for operation on the computer systems detailed below:

hardware:          Intel ia32 systems and compatible
operating system:  Microsoft Windows 32-bit and 64-bit editions
C compiler:        Intel 32-bit C++ Compiler Version Build 20170411 and compatible
                   Microsoft 32-bit C/C++ Compiler Version 19.10 or compatible

3. Test Platforms

This implementation has been successfully tested using the following:

Note: This list is not exhaustive; other combinations of hardware, operating system and compiler may also work.

4. Accessing the NAG C Library 32-bit DLLs from Embarcadero C++

It is possible to call the DLL version of this NAG C Library from a 32-bit version of Embarcadero C++ (bcc32c), but some initial effort is required to make a usable variant of the NAG Library.

Embarcadero C++ requires that 32-bit import libraries be in OMF format, and they provide a tool with their compiler suite which can be used to generate such OMF format libraries. The tool is named implib.exe and it can be used like this, for example:

  set NAGLIBDIR=C:\Program Files\NAG\clw32261el
  implib "%NAGLIBDIR%"\lib\CLW32261E_nag_bcc.lib clw32261e_nag_bcc.def
where clw32261e_nag_bcc.def is an export definition file, CLW32261E_nag_bcc.lib is the output from implib.

The export definition file should contain the name of the DLL containing NAG library functions, along with a list of symbols to be exported from the DLL.

For example, the file clw32261e_nag_bcc.def can look like this:

  LIBRARY CLW32261E_nag.dll
  ... etc.
You can create a suitable file clw32261e_nag_bcc.def containing a list of just the NAG library routines that you wish to use, or a file containing a list of all functions can be obtained here: clw32261e_nag_bcc.def.

Before issuing the implib command, make sure that you set the variable NAGLIBDIR to be the actual location where your copy of the NAG Library is installed. Also, it is assumed that you have permission to create the file "%NAGLIBDIR%"\lib\CLW32261E_nag_bcc.lib - depending on how the NAG Library was installed, you may need Administrator privileges.

This similar command makes a bcc32c-compatible import library for the MKL-based NAG DLL library:

  implib "%NAGLIBDIR%"\lib\CLW32261E_mkl_bcc.lib clw32261e_mkl_bcc.def
- create the file clw32261e_mkl_bcc.def by copying the file clw32261e_nag_bcc.def and changing the first line from
  LIBRARY CLW32261E_nag.dll
  LIBRARY CLW32261E_mkl.dll

Once the library CLW32261E_nag_bcc.lib has been created, you can link to it using bcc32c like this:

  bcc32c -I"%NAGLIBDIR%"\include driver.c "%NAGLIBDIR%"\lib\CLW32261E_nag_bcc.lib
where driver.c is your C program.

There is one more thing to note, if you want to compile any of the example programs that are distributed with the NAG C library (from directory "%NAGLIBDIR%"\examples\source), using bcc32c. Most of the example programs make use of a macro _countof(x) which is defined in a Microsoft C compiler header file, but is not in header files used by bcc32c. The macro is used to compute the number of elements in an array of any type. It's easy to define this macro yourself, for example:

#ifndef _countof
#define _countof(x) sizeof(x) / sizeof(x[0])
- these lines can be inserted in the example program before you compile it, or you could add them to a local include file such as nag.h.

5. Accessing the NAG C Library 32-bit DLLs from Various Other Environments

General information on using the DLLs supplied with this implementation is available from the Using the NAG C Library Windows DLLs page. This includes information on calling the DLLs from various command line programs including cl, icl and gcc as well as links to information on the environments listed below.

Detailed information on calling the DLLs and examples of usage are available for various programming environments including:

Visual Basic header files (Mark 26.1) containing declare statements for each function are also available for download: