The CEFLIB is divided in several parts :

  • The main library, used to read CEF files, parse metadata and variables content

  • A IDL interface, in order to call the previous one from IDL

  • A same interface for MATLAB

  • A last one for Python language.

1. Uncompress and extract sources


$ cd <install-directory>
$ gzip -d CEFLIB-x.y.z.tar.gz
$ tar xvf CEFLIB-x.y.z.tar


This delivery contains source code to generate the main CEFLIB library, and additional software interface to call it from different langages.

The delivery contains 5 sub-directories :

  • LIB

    General purpose tools used by all softwares, handling times for example

  • C

    The main C library used to parse CEF files content

  • IDL

    Source code used to write an IDL DLM (Dynamically Loadable Module), which will allow to call this library from IDL




    Source code and scripts to generate a dynamic library that can be use from Python language. Multi-dimensionnal variables need installation on a specific Python package, called numpy

Each library comes with a generic Makefile, which needs some external variables declarations, like compilation options, directories where to find libraries, etc…


2. Update the build script

In the install directory, you will find a shell script called build.

This script contains various definitions, depending on your environment (OS, compiler), used to build the librairy and its different interfaces to IDL, Matlab, Python.

The CEFLIB library has been tested for various operating systems:

  • Linux (CentOS > 5.6, CentOS 6.x)

  • Solaris (V9 and V10)

  • Mac OS (Darwin, Yosemite, El Capitan).

If your are working under other operating systems, try to make it work for your environment, by updating the content of the build script, or contact us in case of problem.

Depending on your environment, you may or not have both ksh and bash installed on your system.

You can use either /bin/ksh or /bin/bash by modifying the first line of the script, selecting one of the two lines below:

#! /bin/ksh
#! /bin/bash






2.1. IDL specific instructions

To build the IDL interface, you will have to set the IDL_DIR environment variable, which is done generally under Linux by a setup script file provided with IDL.



Bug with IDL 6.0

There is a problem between this IDL version and the usual zlib library, used to read compressed CEF files (.gz).

You will have to build the CEFLIB IDL version by linking with the IDL MGPEG library which is implementing its own version of zlib.

Please refer to the instructions given in the <install-dir>/IDL/Makefile, to select the expected zlib library, by commenting or not a makefile declaration.

2.2. MATLAB specific instructions



The Makefile in the MATLAB directory has to know the Matlab root directory, to be able to find some C include files located in the <matlab_root_directory>/extern/include/ directory.



2.3. Python specific instructions



Numpy is a specific Python package, which is not natively installed with Python, that allows handling of multi-dimensionnal arrays.

Informations should be found at :[]

Another useful package should be Matplotlib, that allows to plot data in a similar way than Matlab.[]

On recent Linux computers, you can use usual package manager to install these packages :

  • yum on RedHat based systems

  • aptget on Dedian based systems

For example, on our CentOS 6.2 computer :

$ yum install numpy
$ yum install python-matplotlib

3. Building the libraries

You can build the whole libraries, but you will need to have both IDL and MATLAB installed previously on your system.

In the other case, you can just build the LIB and CEFLIB libraries, and then choose to build either the IDL or MATLAB interface.

3.1. Recursive build of the 4 directories

To generate the whole librairies, enter the following commands :

$ cd <install-directory>
$ ./build clean raz all


Of course, you will need to have both IDL, Matlab and Python installed on your computer.

3.2. Separate build of libraries

In an usual case, you will probably generate only the library needed for your favourite software.

In all case, you need to build the core library.


4. Building the core C library


$ cd <install-dir>
$ cd LIB
$ cd ..
$ cd C
$ cd ..

5. Building the IDL interface

The IDL interface build process consists in:

$ cd <install-dir>
$ cd IDL

After binaries generation, you must obtain two files:

  • bin/idl_cef.dlm : Descriptive file of DLM module

  • bin/ : Shared library

In case of problem, you can have a look on Known bugs.

5.1. Configuration before use


  • in the current directory before running IDL

  • in the directory where IDL search for it’s dynamic libraries :

  • in a alternate directory, specified using the Unix IDL_DLM_PATH environment variable :


Another possibility is to copy manually the and idl_cef.dlm, in the IDL dynamic librairies directory, but you will need administrator rights.

You can obtain the IDL’s dynamic librairies directory by entering :

$ idl
IDL> print, !DLM_PATH

5.2. Using a profile script

In the IDL directory, you will find a script file:

#       Set the INSTALL_DIR to the directory where you extract the sources

#       Path to the .pro files

#       To tell IDL where to find the idl_cef.dlm and files

You can use this file, after updating the INSTALL_DIR variable, to configure the IDL interface environment variables.

Running manually:

. IDL/profile

Or incorporating this line in your current profile (generally

5.3. Testing the IDL library


$ cd pro
$ idl           ; plot FGM data
$ idl           ; plot CIS density and velocity
$ idl   ; plot CIS H+, O+ and WHISPER density
$ idl

You can also use separate commands like :

IDL> nrec = CEF_READ (<filename>)
IDL> print, CEF_META ("file_name")

6. Building the MATLAB interface

To build the CEFLIB Matlab interface enter the following commands:

$ cd <install-dir>


  • startup.m : Matlab script to describe where to find the CEFLIB binaries and Matlab scripts You can copy this file in your usual Matlab working directory, or insert its commands on your own startup file

  • lib/ : dynamic library used to access to the CEFLIB

  • lib/libcef_mfile.m : Matlab script file describing the CEFLIB interface (new)

  • lib/cef_init.m : small Matlab script file to load the library and facilitate functions call

In case of problems, consult Known bugs

6.1. Update startup.m


ceflib_install_dir = <directory>



ceflib_install_dir = /home/username/CEFLIB

7. Building Python interface

To build the CEFLIB Python interface, enter the following commands:

$ cd <install-dir>


  • : Dynamic library user to access to the CEFLIB interface

7.1. Configuration

In order to be accessible, the file has to be :

  • in the current directory

  • in a directory declared in the PYTHONPATH environment variable

You can add the following line in your current profile:


7.2. Testing


$ python
>>> import ceflib
>>> ("example_file.cef")

To get some help :

$ pydoc ceflib