필터 지우기
필터 지우기

Matlab R2015a crashes when importing/using external libraries

조회 수: 3 (최근 30일)
Slim
Slim 2015년 4월 8일
댓글: Slim 2015년 5월 2일
Hello,
I'm trying to call python libraries through Matlab but it leads me to segmentation faults ...
First of all, I use Matlab R2015a installed on Ubuntu 14.04 (64bits). My Python interpreter is Anaconda3 (thus based on python 3.4) and I have included pyopengl and another external library (referred as bpy). In addition, I have eclipse Luna with PyDev plugin installed on it so I can check the validity of my python scripts.
That being set, my problems are as follow :
  1. The command " import py.bpy.* " makes Matlab crash. The only terminal output I get is " Erreur de segmentation (core dumped) ".
  2. I have a test script calling openGL functionalities (cf. attachment). Basically, it opens a window and draw a ball in it. So far so good, but when I close the window, Matlab crashes again (but I don't get any log).
Of course, these 2 tests works fine under eclipse and the python interpreter is correctly recognized by Matlab (pyversion returns expected results).
Last but not least, I also tried the second test in a Windows 8 environment for the same results...
Help would be more than appreciated !
  댓글 수: 1
Slim
Slim 2015년 5월 2일
As Robert Snoeberger guessed, the second problem was link to GLUT itself. Adding the following line before the window creation solved it :
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION)
Nervertheless, the first problem remains. I ended up switching from calling python from Matlab to calling Matlab from python.

댓글을 달려면 로그인하십시오.

채택된 답변

Robert Snoeberger
Robert Snoeberger 2015년 4월 9일
For problem 2, what windowing system is your OpenGL script using? Is it GLUT? I have a feeling that closing the window is terminating the application, which is MATLAB. See this stackoverflow question. Does your script use glutMainLoop?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by