Issues running a Mex Function (.mexw64)
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi I am very new to Matlab Mex functions. I was able to compile and create a .mexw64 file using Visual Studio 2019 which I am calling from Matlab. When I run it I get the following error:
"Couldn't open source file ./optixRaycasting_generated_OptiXRaycastingContext.cu.ptx"
I foulnd the specified file and added its path to the Matlab path as well. I am unfamiliar with files of type .ptx and I am not sure if this is an error associated with the build of the mex function itself or something that I may not be doing on the Matlab side of things.
2 Kommentare
Jan
am 15 Okt. 2021
Please explain exactly, when this message appears. Does "When I run it" mean the compilation or the calling?
I guess, that the compiled function try to open this file and does not find it. Adding the folder to Matlab's path does not help, because the C code does not search in the path automatically.
Did you write thefunction? Is there any documentation which explains, where this file should be stored?
Antworten (1)
Jan
am 16 Okt. 2021
The leading "./" means, that it is searching in the current folder. Assuming, that the current folder is chosen as expected, is a standard source of bugs. Prefer absolute file names. Search in the file for the command, to open this file, and include the abolute path there. If this does not work for any reasons, use cd() to change to the folder, in which the file is found.
0 Kommentare
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!