PDA

View Full Version : Using the IMSL C Numerical Library with ClearSpeed Technology


DevProgram
04-21-2008, 11:56 PM
The IMSL C Numerical Library from Visual Numerics, Inc. is typically integrated into an application by compiling
with one of the pre‐configured environment variables like $LINK_CNL_STATIC_SMP or
$LINK_CNL_SHARED_SMP.

To enable the IMSL C Numerical Library to use ClearSpeed hardware running ClearSpeed software release 3.0,
$LINK_CNL_STATIC_SMP or $LINK_CNL_SHARED_SMP should be modified slightly to pick up the ClearSpeed
libraries also.

Add the ClearSpeed ‘lib’ directory to either the static or shared libraries:
-L/opt/clearspeed/csx600_m12_le/lib

Additionally a specific library needs to be added: -lcsxl_mkl.


Example running standard variables

The standard environment variables for static and shared builds that link the IMSL C library running on EM64T
hardware, the Intel 9.1 compiler, including in the Intel Math Kernel Library are as follows:

$ echo $LINK_CNL_STATIC_SMP

-L/opt/mkl90/lib/em64t /opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_smp.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_vblas.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat_vblas.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_smp.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_vblas.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat_vblas.a -lmkl_lapack
-lmkl_em64t /opt/mkl90/lib/em64t/libguide.a -lm -lpthread
-Xlinker –rpath -Xlinker /opt/mkl90/lib/em64t


$ echo $LINK_CNL_SHARED_SMP

-L/opt/vni/imsl/cnl601/lnxin91e64/lib -L/opt/mkl90/lib/em64t –limslcmath
-limslcmath_smp -limslcmath_vblas -limslcstat -limslcstat_vblas
-lmkl_lapack32 -lmkl_lapack64 -lmkl -lguide -lm -Xlinker –rpath
-Xlinker /opt/vni/imsl/cnl601/lnxin91e64/lib -Xlinker -rpath
-Xlinker /opt/mkl90/lib/em64t -lpthread


Example running variables modified to include the ClearSpeed accelerated libraries

Compare the above definitions with those below. This set of environment variables, again for static and shared
builds, replaces the MKL libraries with the ClearSpeed accelerated libraries. The differences are highlighted in
blue. For continued ease of use simplicity when building, new environment variable names are created,
$LINK_CNL_CLST for ClearSpeed Static and $LINK_CNL_CLSH for ClearSpeed Shared.

$ echo $LINK_CNL_CLST

-L/opt/mkl90/lib/em64t -L/opt/clearspeed/csx600_m512_le/lib
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_smp.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_vblas.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat_vblas.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_smp.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcmath_vblas.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat.a
/opt/vni/imsl/cnl601/lnxin91e64/lib/libimslcstat_vblas.a –lcsxl_mkl
-lmkl_lapack32 -lmkl_lapack64 -lmkl -lguide -lm -lpthread

$ echo $LINK_CNL_CLSH

-L/opt/vni/imsl/cnl601/lnxin91e64/lib -L/opt/mkl90/lib/em64t
-L/opt/clearspeed/csx600_m512_le/lib -limslcmath -limslcmath_smp
-limslcmath_vblas -limslcstat -limslcstat_vblas –lcsxl_mkl
-lmkl_lapack32 -lmkl_lapack64 -lmkl -lguide -lm -lpthread