[ English | Japanese ]
Compiling and Linking (For C)
This page describes how to compile your program that uses NEC Numeric Library Collection for Vector Engine and how to link it with the library.
The required compiler options vary depending on:
- the libraries you are to use,
- the distributed memory parallelism,
- the shared memory parallelism, and
- the size of the default integer type.
Preparation
Before compiling and linking, you need to execute the compiling environment setup script nlcvars.sh
or nlcvars.csh
once in advance.
sh or its variant:
$ source /opt/nec/ve/bin/nlcvars.sh [Argument...]
csh or its variant:
% source /opt/nec/ve/bin/nlcvars.csh [Argument...]
The arguments required to be specified are as shown in Table 1.
Distributed Memory parallelism | Default Integer Type | Arguments |
---|---|---|
none | 32bit | (none) |
none | 64bit | i64 |
MPI | 32bit | mpi |
MPI | 64bit | mpi i64 |
Remarks |
---|
|
Preparation with specifying the version of NEC Numeric Library Collection
NEC Numeric Library Collection 3.0.0 and later provides libraries and include files for VE30 and for VE20, VE10, or VE10E.
-
For VE30
/opt/nec/ve3/nlc/X.X.X/{include/, lib/, bin/}
-
For VE20, VE10, or VE10E
/opt/nec/ve/nlc/X.X.X/{include/, lib/, bin/}
If you want to specify the version of the NEC Numeric Library Collection, specify the version in the following manner before compiling and linking.
-
For VE30
sh or its variant:
$ source /opt/nec/ve3/nlc/X.X.X/bin/nlcvars.sh [Argument...]
csh or its variant:
% source /opt/nec/ve3/nlc/X.X.X/bin/nlcvars.csh [Argument...]
Here, X.X.X denotes the version number of NEC Numeric Library Collection. The arguments required to be specified are as shown in Table1.
-
For VE20, VE10, or VE10E
sh or its variant:
$ source /opt/nec/ve/nlc/X.X.X/bin/nlcvars.sh [Argument...]
csh or its variant:
% source /opt/nec/ve/nlc/X.X.X/bin/nlcvars.csh [Argument...]
Here, X.X.X denotes the version number of NEC Numeric Library Collection. The arguments required to be specified are as shown in Table1.
Compiling
The command for compiling is ncc when using the sequential or OpenMP parallel libraries, and is mpincc when using the MPI parallel or hybrid parallel libraries. The compiling options described in Table 2 are required when using the 32-bit integer libraries. The compiling options described in Table 3 are required when using the 64-bit integer libraries.
Libraries | Compiling Options | |
---|---|---|
ASL Native Interface | Sequential | (none) |
OpenMP parallel | -fopenmp | |
ASL Unified Interface | Sequential | (none) |
OpenMP parallel | -fopenmp | |
MPI Parallel | (none) | |
Hybrid Parallel | -fopenmp | |
FFTW3 Interface | Sequential | (none) |
OpenMP parallel | -fopenmp | |
MPI Parallel | (none) | |
Hybrid Parallel | -fopenmp | |
CBLAS | Sequential | (none) |
OpenMP parallel | -fopenmp | |
SBLAS | Sequential | (none) |
OpenMP parallel | -fopenmp | |
HeteroSolver | OpenMP parallel | -fopenmp |
Hybrid Parallel | ||
Stencil Code Accelerator | Sequential | (none) |
OpenMP parallel | -fopenmp |
Libraries | Compiling Options | |
---|---|---|
ASL Native Interface | Sequential | (none) |
OpenMP parallel | -fopenmp | |
ASL Unified Interface | Sequential | (none) |
OpenMP parallel | -fopenmp | |
MPI Parallel | (none) | |
Hybrid Parallel | -fopenmp | |
FFTW3 Interface | Sequential | (none) |
OpenMP parallel | -fopenmp | |
MPI Parallel | (none) | |
Hybrid Parallel | -fopenmp | |
CBLAS | Sequential | (none) |
OpenMP parallel | -fopenmp | |
SBLAS | Sequential | (none) |
OpenMP parallel | -fopenmp | |
HeteroSolver | OpenMP parallel | -fopenmp |
Hybrid Parallel | (not available) | |
Stencil Code Accelerator | Sequential | (none) |
OpenMP parallel | -fopenmp |
Linking
The command for linking is ncc when using the sequential or OpenMP parallel libraries, and is mpincc when using the MPI parallel or hybrid parallel libraries. The linking options described in Table 4 are required when using the 32-bit integer libraries. The linking options described in Table 5 are required when using the 64-bit integer libraries. The linking option -static is required when creating executable files with static linking. No additional options are required when creating executable files with dynamic linking, but -shared-mpi must be specified only when using MPI.
Libraries | Linking Options | |
---|---|---|
ASL Native Interface | Sequential | -lasl_sequential |
OpenMP parallel | -lasl_openmp -fopenmp | |
ASL Unified Interface | Sequential | -lasl_sequential |
OpenMP parallel | -lasl_openmp -fopenmp | |
MPI Parallel | -lasl_mpi_sequential | |
Hybrid Parallel | -lasl_mpi_openmp -fopenmp | |
FFTW3 Interface | Sequential | -laslfftw3 -lasl_sequential |
OpenMP parallel | -laslfftw3 -lasl_openmp -fopenmp | |
MPI Parallel | -laslfftw3_mpi -lasl_mpi_sequential | |
Hybrid Parallel | -laslfftw3_mpi -lasl_mpi_openmp -fopenmp | |
CBLAS | Sequential | -lcblas -lblas_sequential |
OpenMP parallel | -lcblas -lblas_openmp -fopenmp | |
SBLAS | Sequential | -lsblas_sequential |
OpenMP parallel | -lsblas_openmp -fopenmp | |
HeteroSolver | OpenMP parallel | -lheterosolver_openmp -lblas_sequential -fopenmp |
Hybrid Parallel | -lheterosolver_mpi_openmp -lblas_sequential -fopenmp |
|
Stencil Code Accelerator | Sequential | -lsca_sequential |
OpenMP parallel | -lsca_openmp -fopenmp |
Libraries | Linking Options | |
---|---|---|
ASL Native Interface |
Sequential | -lasl_sequential_i64 |
OpenMP parallel | -lasl_openmp_i64 -fopenmp | |
ASL Unified Interface | Sequential | -lasl_sequential_i64 |
OpenMP parallel | -lasl_openmp_i64 -fopenmp | |
MPI Parallel | -lasl_mpi_sequential_i64c | |
Hybrid Parallel | -lasl_mpi_openmp_i64c -fopenmp | |
FFTW3 Interface | Sequential | -laslfftw3_i64 -lasl_sequential_i64 |
OpenMP parallel | -laslfftw3_i64 -lasl_openmp_i64 -fopenmp | |
MPI Parallel | -laslfftw3_mpi_i64c -lasl_mpi_sequential_i64c | |
Hybrid Parallel | -laslfftw3_mpi_i64c -lasl_mpi_openmp_i64c -fopenmp | |
CBLAS | Sequential | -lcblas_i64 -lblas_sequential_i64 |
OpenMP parallel | -lcblas_i64 -lblas_openmp_i64 -fopenmp | |
SBLAS | Sequential | -lsblas_sequential_i64 |
OpenMP parallel | -lsblas_openmp_i64 -fopenmp | |
HeteroSolver | OpenMP parallel | -lheterosolver_openmp_i64 -lblas_sequential_i64 -fopenmp |
Hybrid Parallel | (not available) | |
Stencil Code Accelerator | Sequential | -lsca_sequential_i64 |
OpenMP parallel | -lsca_openmp_i64 -fopenmp |