Rate This Document
Findability
Accuracy
Completeness
Readability

Special Usage Description

If both the KVSIP and open-source VSIP need to be used, dynamically link the VSIP.

To compile the VSIP dynamic library, perform the following steps:

  1. Download the open source VSIP library.
  2. Modify the c_VSIP_src/Makefile file.
    1. Open c_VSIP_src/Makefile.
      vi c_VSIP_src/Makefile
    2. Change the value of CFLAGS, delete the -arch x86_64 parameter that specifies x86, and add the -fPIC option.
      CFLAGS= -O3 -Wall -std=c89 -pedantic -fPIC
    3. Add the following content to line 13:
      gcc --shared $(OBJECTS) -o libvsip.so

    4. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Modify Makefile.
    1. Open Makefile.
      vi Makefile
    2. Change the value of CFLAGS and add the -fPIC option.
      CFLAGS=-O3 -Wall -std=gnu99 -pedantic -fPIC
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Generate a dynamic library libvsip.so in the c_VSIP_src directory.
    make
  5. Replace the Huawei-developed vsip.h file with the open source vsip.h file.
    cp -rf ./c_VSIP_src/vsip.h /usr/local/include/KVSIP/

When calling this function library, you need to add the following compilation options:

gcc test.c -o test -I /usr/local/include/KVSIP/ -L /usr/local/lib/KVSIP/ -lkvsip_fft -lkvsip_fftf -lkvsip -lm -fPIC -L ./c_VSIP_src -lvsip -Wl,-rpath=./c_VSIP_src