AnsweredAssumed Answered

segmentation fault with multithreaded library

Question asked by jkmcrobe on Mar 26, 2012
Latest reply on Mar 28, 2012 by jkmcrobe

When I compile the acml lapack examples and linking to the single threaded library (libacml), everything works great.  But when I try the examples using the mutlithreaded library (libacml_mp) I get a segmentation fault after the program ends.  For example, when I compile the dgesdd example using the following:

 

gcc -m64 -I/home/james/acml5.1.0/gfortran64/include dgesdd_c_example.c -L/home/james/acml5.1.0/gfortran64/lib -lacml -lgfortran -static -lm

 

and I run a.out I get get this:

 

ACML example: SVD of a matrix A using dgesdd

--------------------------------------------

 

Matrix A:

-0.5700  -1.2800  -0.3900   0.2500

-1.9300   1.0800  -0.3100  -2.1400

  2.3000   0.2400   0.4000  -0.3500

-1.9300   0.6400  -0.6600   0.0800

 

Singular values of matrix A:

  3.9147   2.2959   1.1184   0.3237

 

But when I compile dgesdd using the multithreaded library, like this:

 

gcc -fopenmp -m64 -I/home/james/acml5.1.0/gfortran64_mp/include dgesdd_c_example.c -L/home/james/acml5.1.0/gfortran64_mp/lib -lacml_mp -lgfortran -static -lm

 

and run a.out I get:

 

ACML example: SVD of a matrix A using dgesdd

--------------------------------------------

 

Matrix A:

-0.5700  -1.2800  -0.3900   0.2500

-1.9300   1.0800  -0.3100  -2.1400

  2.3000   0.2400   0.4000  -0.3500

-1.9300   0.6400  -0.6600   0.0800

 

Singular values of matrix A:

  3.9147   2.2959   1.1184   0.3237

Segmentation fault

 

The program gives the correct answer, but seg faults.  My system:

 

OS: Ubuntu 11.10 64-bit

CPU: Intel Core i7-2600

gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1

GNU Fortran (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1

Outcomes