Looks like this is some problem with the linux fork itself. I just left the code running overnight, and it was done in the morning. I checked again, and it looks like engOpen takes a few hours to start.
Problem with starting a matlab engine
5 次查看(过去 30 天)
显示 更早的评论
I'm starting a matlab engine in my c++ code using this code segment
Engine * ep;
if (!(ep=engOpen("\0")))
{
cerr << "failed to start matlab" << endl;
exit(1);
}
This code is stuck at engOpen. I tried to use gdb to get the stack trace of where the program os stuck and found this
Program received signal SIGINT, Interrupt.
0x00007ffff672c9c4 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c:130
130 ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c: No such file or directory.
(gdb) where
#0 0x00007ffff672c9c4 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c:130
#1 0x00007ffff7253ac5 in engOpen () from /usr/local/MATLAB/R2013a/bin/glnxa64/libeng.so
#2 0x0000000000495af8 in ckt::BTIvarMCEXMatlabpv (this=0x7fffffffd8a0, mcn=10000, t=20, d0=<optimized out>, dmean=@0x7fffffffd690: 287.0517774763029,
dvar=@0x7fffffffd698: 55.911876703670785) at cktanalysis7.cpp:1567
#3 0x000000000045975f in main8 (argc=<optimized out>, argv=<optimized out>) at main8.cpp:453
#4 0x00007ffff668cea5 in __libc_start_main (main=0x403510 <main(int, char**)>, argc=2, ubp_av=0x7fffffffe028, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe018) at libc-start.c:260
#5 0x0000000000403a59 in _start ()
(gdb) list
125 in ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c
It looks like it is stuck at a system call to fork. I am not sure how to proceed from here
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!