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

matlab is crashed when I run the pipeline #166

Open
Liang-He-Harlan opened this issue Oct 9, 2024 · 6 comments
Open

matlab is crashed when I run the pipeline #166

Liang-He-Harlan opened this issue Oct 9, 2024 · 6 comments

Comments

@Liang-He-Harlan
Copy link

I have encountered some issues when applying your pipeline to my research. I started with the signed_distance_isosurface function to validate whether I have successfully installed gptoolbox .

Issues:

I try to run the code on Matlab 2018b to check installment of pipeline:

Pial = gifti(pialSurfLHFile);
C = Pial.faces;
D = Pial.vertices;

[V,F] = signed_distance_isosurface(D,C,'Level',10,'GridSize',400);

Here, the structure of the Pial surface and variables are shown below.
f1
f2

Then my matlab was crashed: the crash report is below .txt file:
matlab_crash_dump.txt

Here are some steps and the results to install the pipeline:

cd external/toolbox_fast_marching/
compile_mex

f3

Also, I tried to cmake and make in the mex folder

mkdir build
cd build
cmake ..    # and also try `cmake .. -DMatlab_ROOT_DIR=/usr/local/MATLAB/R2018b/ -DCMAKE_TOOLCHAIN_FILE=/home/liang/vcpkg/scripts/buildsystems/vcpkg.cmake`
make

f4
f5

I also tried to replace the libstdc++.so.6

cd /usr/local/MATLAB/R2018b/sys/os/glnxa64/
sudo mv libstdc++.so.6 libstdc++.so.6.backup

sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/local/MATLAB/R2018b/sys/os/glnxa64/libstdc++.so.6

However, the issue still exists.

@alecjacobson
Copy link
Owner

alecjacobson commented Oct 9, 2024 via email

@Liang-He-Harlan
Copy link
Author

Liang-He-Harlan commented Oct 9, 2024 via email

@alecjacobson
Copy link
Owner

Hi Liang,
I wonder if the attachments got lost in the email. Maybe try uploading them directly on the github conversation?

@Liang-He-Harlan
Copy link
Author

Dear alecjacobson,

There are the code and data.
code_and_data.zip

As mentioned, the Matlab R2018b will crash in the Ubuntu 22.04 when I try to run the signed_distance_isosurface function from the gptoolbox.
Thank you for your support!

Best,
Liang

@alecjacobson
Copy link
Owner

Thanks! The issue is that your face list C is a int32 type.

All my functions pretty much assume that all data (including index lists; as is common in matlab) are double type.

So the easiest fix is:

C = double(C);
D = double(D); % maybe not necessary; but good idea for gptoolbox

It's possible for me to handle this better on the mex side instead, but not something I'm planning to fix.

@Liang-He-Harlan
Copy link
Author

Dear alecjacobson,

It works now. Thanks for your support!

Best,
Liang

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

2 participants