DPI ERROR WHILE COMPILING ON QUESTA : Undifeined function 'ippfilter_real64' introduced from ..../MYlib.so

2 次查看(过去 30 天)
Hi All,
I am using Matlab 2020.
I created C,C++ code using MATLAB DPIGEN feature. I am working on Linux System. When I was compiling created files on QuestaSim, I received an error 'Undifeined function 'ippfilter_real64' introduced from ..../MYlib.so' There is a header file called libmwippfilter.h which includes the prototype of the 'ippfilter_real64'. I dig deeper and found that it is called inside imfilter function. (Please refer)
How can I fix this problem? I tried to call coder.config('dll') and coder.config('lib') but it did not work.
Matlab gives a make file to use files generated from MATLAB DPI GEN to create SystemVerilog DPI files.
As far as I understand, it creates SRC by using all *.c files to create OBJ and then created SHARED LIBRARY. Is it possible to find 'ippfilter_real64' function and put it into my folder including all files to create it by using make file given below.
Or, is there another way to create a STANDALONE C function. I tried following page but I could not achieve. (Matlab Question --> Referrance Web Page )
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
SHARE_LIB_NAME=DPI_Component.so
all: $(SRC) $(SHARE_LIB_NAME)
@echo "### Successfully generated all binary outputs."
$(SHARE_LIB_NAME): $(OBJ)
gcc -shared -lm $(OBJ) -o $@
.c.o:
gcc -c -fPIC -Wall -pedantic -Wno-long-long -fwrapv -O0 $< -o $@
Regards,
Hakan
  6 个评论
Hak
Hak 2022-6-16
Hi Vignesh,
Thanks for your time!
I tried them. You can check other comments. Another staff of MATLAB, dear Tianqi, said something to try.
Specifally, is it possible to create a standalone C function including imfilter or image processing library? I had checked links given by you before, I could not achieve yet.
Thanks,
Hakan
Vignesh
Vignesh 2022-6-16
Hakan,
Yes, it is technically possible to create a standalone C function including imfilter and other Image Processing Toolbox function. The following links include information on generating standalone code and packaging code.
When you use the "codegen" command the generated C code will be standalone. Using the codegen command you can create MEX, DLL, EXE by setting the coder build configuration object (i.e. coder.config(<target_file>) ). The generated MEX file will of course need MATLAB to run. The others DLL and EXE can run standalone. Using packNGo, you should be able to package all the required files to run the code standalone.

请先登录,再进行评论。

回答(1 个)

Tianqi Liu
Tianqi Liu 2022-6-10
Hi Hak,
Thanks for the clarification. This "-o output" option is used to specify the name of the generated library only. In Windows platform you can only get .dll library. In Linux platform you can only get .so library. If you want to do the cross-platform dpi generation, you can follow the steps in the "Port Generated Component and Test Bench to Linux" section of the following document:
Thanks,
Tianqi
  10 个评论
Hak
Hak 2022-6-16
Hi Tianqi,
I am thankful for your help.
When I tried a simpler function on Linux OS, I took all dll(s) as so(s). I run make file again to obtain my_lib.so file. I did not work as well. Do you think, there is something else to try?
Are there other ways to compile .c.h files with Questa? I think there are libraries and it is not enough to compile .h, .c files because of relationships between functions and libraries?
Thanks,
Hakan
Tianqi Liu
Tianqi Liu 2022-6-16
Hi Hak,
If all your work is done in linux and code generation configuration is set to coder.config('dll'), you should get a generated .so library directly from codegen or dpigen without using makefile separately. If you are doing cross-platform compile, using packNGo should package all the dependecy files that are needed to compile the .so library.
If you have futher questions, you can contact technical support. And we can invetigate it further.
Thanks,
Tianqi

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Code Generation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by