
Installing the ASN1C Compiler Software
Version 5.5x of the ASN1C compiler software is packaged in a single distribution file containing the compiler executables files and run-time libraries and DLL's. There is a separate distribution for the documentation files. This is different than in prior releases in which the compiler executable files and run-time components were in separate packages.
The following sections contain installation instructions for Windows and UNIX versions of the ASN1C distribution files. This procedure is the same for all of the different configurations.
Microsoft Windows Distribution
The Microsoft Windows version of ASN1C is distributed either on a CD and/or electronically over the Internet. The distribution files are self-extracting, executable setup files. The format of the filename provides information on software version, platform, compiler, and configuration as follows:
ac<L>v55x<SYS><TYP>[_<CC>].exe
For example, the following filename would denote a v5.50 ASN1C evaluation kit for Windows with run-time libraries built with the Microsoft Visual C++ 6.0 compiler:
accv550w32evl.exeacjv551w32ubb.exe
ASN1C Installation
Double-click the installation program kit executable filename. This is the filename in the format described above.
- Follow the setup program instructions.
- You should have received a node-locked license file (acv55lic.dat) to enable the compiler to run on a given node. Copy this file into one of the following locations:
a. One of the directories specified in your PATH environment variable, or
b. In a different directory and create a new environment variable name ACLICDIR that points to this directory.If installation was successful, you should have both a graphical user interface (GUI) compilation wizard available as well as a command line version of the compiler. The GUI wizard can be tested by starting the application and entering the data requested in each of the dialog prompts. The command-line version of the compiler can be tested as follows:
- Open an MS-DOS or other command shell window.
- Change directory (cd) to the compiler root directory. The default directory in the setup script is c:\acv<version> where <version> is the version number of the compiler. For example, c:\acv550 is the default root directory for version 5.50 of the compiler.
- Enter .\bin\asn1c from the command line prompt. You should see a usage display of compiler command line options (these options are discussed later). This indicates the compiler is properly installed and working.
If you get a message indicating the license file could not be found, please review the procedure in step 3 above to make sure it is installed in the proper location.
You should include the <target>\bin (ex. c:\acv550\bin) directory in your PATH environment variable in order to run the compiler from anywhere.
Documentation Installation
The optional documentation package can be downloaded as either a .zip file or self-extracting .exe file. If the zip file was downloaded, simply unpack it in the doc subdirectory of the installation. If the self-extracting .exe file was downloaded or is present on the CD, double-click this file and provide the same root directory name as was provided for the ASN1C software installation above. This will cause the documentation files to be placed in the doc subdirectory of the installation.
Compiling and Linking ASN1C Generated Code
When building code generated by the ASN1C compiler, you will need to have one or more run-time source directories in your include path to compile the generated code with a C or C++ compiler. The run-time source directories are rtsrc (common), rtbersrc (BER/DER), rtpersrc (PER), and rtxersrc (XER). To link, you will need the lib subdirectory in your library path. This is where all of the library files are located.
Testing the C or C++ Run-time Components
The default C or C++ run-time libraries for Windows were built with Microsoft Visual C++ V6.0. Other packages are available that have been built with the Borland C++ compiler (v5.5) and with the Microsoft Visual C++ v7.0 (.NET) compiler. If you have the version of the product that includes run-time source code, you can rebuild the run-time libraries using any ANSI-standard C or C++ compiler.
You can verify operation of any of the different run-time libraries by executing the sample programs. These can be found in the sample_ber, sample_der, and (optionally) the sample_per or sample_xer subdirectories.
For example, we will assume that you installed ASN1C for C/C++. To test the BER C++ encode/decode capabilities, do the following:
- Change directory (cd) to the .\cpp\sample_ber\employee subdirectory. Execute the nmake command to build the writer and reader sample programs. nmake is utility program that comes with Visual C++. It may also be necessary to execute a Microsoft batch file named VCVARS32.BAT to set the path information so that the nmake utility can be found. (Important note: this assumes you are using Microsoft Visual C++ on your PC. Some PC specific include and library directories in the makefile may need to be changed to get the samples to work on your system. See the README.txt file for further details).
- Execute the writer.exe program to encode the sample record. The results of the encoding will be dumped to the screen and saved in a file called message.dat.
- Execute the reader.exe program to read and decode the contents of the message.dat file. This program will read the encoded record into memory, decode it, and then print the contents of the generated structure variable to standard output.
- Change directory (cd) to the .\sample_per\employee subdirectory. Execute nmake command to build the writer and reader sample programs.
- Execute the writer.exe program to encode the sample record. The -a switch can be used to encode a record using aligned PER. The -u switch encodes a record using unaligned PER. The results of the encoding will be dumped to the screen and saved in a file called message.dat.
- Execute the reader.exe program to read and decode the contents of the message.dat file. The -a or -u switch must be the same as that specified when the writer program was executed. This program will read the encoded record into memory, decode it, and then print the contents of the generated structure variable to standard output.
This test can be repeated for XER as well by going to the sample_xer\employee subdirectory and repeating the above sequence of steps.
UNIX Distribution
The UNIX version of ASN1C is distributed either on CD and/or electronically over the Internet. The distribution files are gzipped tar files. The format of the filename provides information on software version, platform, compiler, and configuration as follows:
ac<L>v55x<SYS>[<CC>]<TYP>.tar.gz
accv550sol7bas.tar.gzAnother example: the following would be an ASN1C v5.51 C/C++ kit for Solaris built with the Sun CC compiler:
accv551sol8CCubb.tar.gzThe `ubb' at the end indicates it is an unlimited binary BER/DER kit. The `CC' is optional compiler information indicating the libraries were built with the Sun C++ compiler.
ASN1C Installation
- Copy the distribution file <distfile> to the top-level directory where the compiler is to be installed.
- Unzip using the GNU unzip tool:
gunzip <distfile>
- Untar the file using the following command:
tar xvf <distfile>
This will create a directory tree structure with `asn1c-v<version>' as the root.
- You should have received a node-locked license file (acv55lic.dat) to enable the compiler on a given node. Copy this file into one of the following locations:
a. One of the directories specified in your PATH environment variable, or
b. In a different directory and create a new environment variable name ACLICDIR that points at this directory.
- Change directory (cd) to the compiler root directory. The default directory in the setup script is ./asn1c-v<version> where <version> is the version number of the compiler. For example, ./asn1c-v550 is the default root directory for version 5.50 of the compiler.
- Enter ./bin/asn1c from the command line prompt. You should see a usage display of compiler command line options (these options are discussed later). This indicates the compiler is properly installed and working.
After installing the compiler, you can modify your operating environment to access the compiler executable files from anywhere. To do this, you will need to add the path to the compiler to your PATH environment variable or add a link to it from a standard binary directory (such as /opt/bin). This is optional and not required for any of the run-time sample programs to work. They are all set up to use relative directory paths to access the compiler and libraries.
Documentation Files Installation
The optional documentation files for package for UNIX is a .tar.gz file containing the PDF document files. These can be installed by unpacking them in the doc subdirectory of the installation.
Testing the C or C++ Run-time Components
The basic C or C++ run-time libraries for UNIX are typically built with the GNU gcc/g++ compiler. In some cases, libraries are provided that are compiled with the native UNIX compiler for a particular platform. If you have the version of the product that includes run-time source code, you can rebuild the run-time libraries using any compiler you want.
You can verify operation of any of the different run-time kits by executing the sample programs. These can be found in the different sample directories (sample_ber, sample_der, sample_per and/or sample_xer depending on what run-time kits were installed).
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |