Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c file not recognized : 'matlab_bgl_sp_mex' #25

Open
megalulu opened this issue Jul 29, 2021 · 10 comments
Open

c file not recognized : 'matlab_bgl_sp_mex' #25

megalulu opened this issue Jul 29, 2021 · 10 comments

Comments

@megalulu
Copy link

Hello,

Thank you for creating this algorithm! I downloaded it because it seems to be a dependency for the code of directional connectivity index (DCI). I want to calculate the DCI for a riparian ecosystem in two directions (along the river axis and perpendicular to the river axis).

I'm new to Matlab, but I get this error when running the code:

Error in shortest_paths (line 131)
[d pred] =
matlab_bgl_sp_mex(A,u,target,lower(options.algname),options.inf,...

Error in DCIu (line 29)
d = shortest_paths(distance, start_nodes(ii)); %A vector
of the shortest path between starting/source node and
all other nodes

Error in connectivity_at_angle (line 117)
fval = DCIu(distance, dx, pixelx)

the 'matlab_bgl_sp_mex.c' function seems to be written in c, and Matlab doesn't recognize it. There should be a matlab_bgl_sp_mex.h file associated to it?

Thank you for any help!
Meghana

@dgleich
Copy link
Owner

dgleich commented Aug 4, 2021

Hi there -- you might have to rename some of the mex files if you are on windows. What system do you have?

@Abhay2412
Copy link

Undefined function or variable 'matlab_bgl_sp_mex'.

Error in shortest_paths (line 131)
[d pred] = matlab_bgl_sp_mex(A,u,target,lower(options.algname),options.inf,...

Error in dijkstra_sp (line 53)
[d pred] = shortest_paths(A,u,options);

Error in OCY_assign_dist (line 70)
[d,~]=dijkstra_sp(A,cels(i).node);

Error in OCY_main (line 71)
[node,link,cell] = OCY_assign_dist(node,link,cells,A); %this is the step that takes longest, preallocate the struct for speed

Error in OCY_analyze_all (line 19)
OCY_main(path{i},'*.tif');
Hello, I have come across a similar situation as well when using this and I am new to MatLab as well. I am currently on Windows hoping to see if there was a resolution to this. Do I have to rename the .c files which end with _mex to something else?

@dgleich
Copy link
Owner

dgleich commented Oct 3, 2022

No, you may need to rename the .dll files to .mexw32 ...

@Abhay2412
Copy link

Sorry, but where would I find these .dll files

@dgleich
Copy link
Owner

dgleich commented Oct 3, 2022 via email

@Abhay2412
Copy link

privateDirectory
This is all I see in the private directory

@dgleich
Copy link
Owner

dgleich commented Oct 3, 2022

Please download the library from mathworks https://www.mathworks.com/matlabcentral/fileexchange/10922-matlabbgl

@Abhay2412
Copy link

Should I remove the old matlab-bgl-master from the MATLAB path as the link you shared once I added the private folder has more files and even with .mexw32 and .mexw64. And thank you so much for your help means alot 👍

@dgleich
Copy link
Owner

dgleich commented Oct 3, 2022

Correct, you don't need the old one.

@Abhay2412
Copy link

Just wanted to say a huge thanks for resolving the issue I was having. I appreciate your swift responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants