4.6. Building Applications with the VSIPL API

Building applications with Sourcery VSIPL works very much as described in Section 4.1, “Building Manually”. Start by setting the PKG_CONFIG_PATH variable, then use pkg-config to determine the relevant build parameters. The notable difference is that the packagename here is vsip, not vsip++:

> export PKG_CONFIG_PATH=/opt/sourceryvsipl++-2.2-9/lib/pkgconfig
> `pkg-config --variable=cc vsipl` -c `pkg-config --cflags vsipl` \
      /opt/sourceryvsipl++-2.2-9/share/sourceryvsipl++/cvsip/fft.cpp
> `pkg-config --variable=cxx vsipl` -o fft fft.o `pkg-config --libs vsipl`
    

Please note that, while the compilation itself can be carried out with a C compiler, the link step has to be done with a C++ compiler to make sure all the C++ system libraries are properly linked in.

And, similar to Section 4.2, “Building with GNU Make”, a Makefile is provided with a demo application, which you may use as a starting point for writing VSIPL application:

> cd /opt/sourceryvsipl++-2.2-9/share/sourceryvsipl++/cvsip
> make
g++ -I/opt/sourceryvsipl++-2.2-9/include -o fft fft.c -L/opt/sourceryvsipl++-2.2-9/lib
  -lsvsip -lsvpp