Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Segfault when calling library function that works correctly standalone

$
0
0

@M_K wrote:

So there’s this very basic example of finding the roots of unity using the MPSolve library. Calling from C

void test_mps(void);

int main(void)
{
  test_mps();
  return 0;
}

gives the correct results and passes valgrind check. However, when called from Julia

ccall((:test_mps, "./libmps_test"), Cvoid, ())

it prints

Enter solver

and then fails with “Segmentation error”. What could be causing this behaviour? The library uses libpthread internally, perhaps it conflicts with jula runtime somehow?

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles