Issues running a Mex Function (.mexw64)

22 Ansichten (letzte 30 Tage)
Ryan de Silva
Ryan de Silva am 15 Okt. 2021
Beantwortet: Jan am 16 Okt. 2021
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
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?
Ryan de Silva
Ryan de Silva am 15 Okt. 2021
Hi thanks for the reply. So when I say run it I mean that I am calling the compiled .mexw64 function through my matlab script. As soon as I run the script it reaches the line where I call on the function and then displays the above error message.
As for the function itself, it was written by another grad student whose research I am taking over and I am trying to recreate some of his results.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
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.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by