<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Static executable was OK, but dynamic one caused segmentation fault. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-executable-was-OK-but-dynamic-one-caused-segmentation/m-p/908793#M11962</link>
    <description>Hi, everyone!&lt;BR /&gt;&lt;BR /&gt;I used a subroutine named 'spevd' (in Fortran 95 syntax) provided in Intel MKL for Linux to obtain eigenvalues of a real symmetric matrix. The source code and Makefile are attached below. The problem that I encountered was the static executable was OK, but dynamic executable could cause segmentation fault.&lt;BR /&gt;&lt;BR /&gt;Suggestions are appreciated!&lt;BR /&gt; &lt;BR /&gt; Thank you!&lt;BR /&gt;&lt;BR /&gt;! More detailed information goes here!&lt;BR /&gt;&lt;BR /&gt;The OS and ifort version are:&lt;BR /&gt;&lt;BR /&gt;abc@debian:~/test/eigentest$ uname -a&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;Linux debian 2.6.26-1-amd64 #1 SMP Sat Jan 10 17:57:00 UTC 2009 x86_64 GNU/Linux&lt;/SPAN&gt;&lt;BR /&gt;abc@debian:~/test/eigentest$ ifort -V&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.0 Build 20081105 Package ID: l_cprof_p_11.0.074&lt;BR /&gt;Copyright (C) 1985-2008 Intel Corporation. All rights reserved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;The fortran source code is:&lt;BR /&gt;&lt;BR /&gt;abc@debian:~/test/eigentest$ cat eigentest.f90 &lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;program eigentest&lt;BR /&gt;! This program is used to calculate the eigenvalues of a symmetric&lt;BR /&gt;! matrix mat(6,6).&lt;BR /&gt; use mkl95_precision, only: wp =&amp;gt; sp&lt;BR /&gt; use mkl95_lapack, only: spevd&lt;BR /&gt; implicit none&lt;BR /&gt; integer,parameter::n=6,pklen=(1+n)*n/2&lt;BR /&gt;! matev(n) is the eigenvalues of mat(n,n).&lt;BR /&gt; real::mat(n,n),matev(n)&lt;BR /&gt; integer::r,c,err,k&lt;BR /&gt; real,allocatable::matpk(:)&lt;BR /&gt;&lt;BR /&gt; data ((mat(c,r),c=1,r),r=1,6) &amp;amp;&lt;BR /&gt; &amp;amp; / 1.81311, &amp;amp;&lt;BR /&gt; &amp;amp; -0.19827, 1.21229, &amp;amp;&lt;BR /&gt; &amp;amp; -0.26697, 0.14556, 1.30019, &amp;amp;&lt;BR /&gt; &amp;amp; 0.00000, 0.00000, 0.00000, 2.00000, &amp;amp;&lt;BR /&gt; &amp;amp; 0.33784, 0.92300, 0.06331, 0.00000, 0.83720, &amp;amp;&lt;BR /&gt; &amp;amp; 0.33784,-0.20619, 0.90189, 0.00000,-0.05861, 0.83720 /&lt;BR /&gt;&lt;BR /&gt; do r=1, n-1&lt;BR /&gt; do c=r+1, n&lt;BR /&gt; mat(c,r)=mat(r,c)&lt;BR /&gt; enddo&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; write(*,"('----------------------------',/,'MAT(6,6)')")&lt;BR /&gt; write(*,"(6F10.5)") mat&lt;BR /&gt;&lt;BR /&gt; allocate(matpk(pklen),stat=err)&lt;BR /&gt; if (err/=0) then&lt;BR /&gt; write(*,"('The band storage of MAT(6,6) failed (stat= ',I3,').')") err&lt;BR /&gt; stop&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt;! matpk(pklen) is a packed storage of mat(n,n)&lt;BR /&gt; do r=1, n&lt;BR /&gt; k=r*(r-1)/2&lt;BR /&gt; matpk(1+k:r+k) = mat(1:r,r)&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; write(*,"('----------------------------',/,'MAT(6,6) Packed Storage')")&lt;BR /&gt; write(*,"(7F10.5)") matpk&lt;BR /&gt;&lt;BR /&gt; call spevd(matpk, matev)&lt;BR /&gt;&lt;BR /&gt; write(*,"('----------------------------',/,'Eigenvalues of MAT(6,6)')")&lt;BR /&gt; write(*,"(6F10.5)") matev&lt;BR /&gt;&lt;BR /&gt; stop&lt;BR /&gt;end&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;The Makefile is:&lt;BR /&gt; &lt;BR /&gt;abc@debian:~/test/eigentest$ cat Makefile &lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;FC = ifort&lt;BR /&gt;MKLOPT = -lmkl_lapack95&lt;BR /&gt;SLIBS = -lguide -lpthread&lt;BR /&gt;LDFLAGS = -L$(MKLPATH)&lt;BR /&gt;INFLAGS = -I$(MKLINCLUDE)&lt;BR /&gt;&lt;BR /&gt;static:&lt;BR /&gt; $(FC) eigentest.f90 $(LDFLAGS) $(INFLAGS) $(MKLOPT) \&lt;BR /&gt; -Wl,--start-group \&lt;BR /&gt; $(MKLPATH)/libmkl_intel_lp64.a \&lt;BR /&gt; $(MKLPATH)/libmkl_intel_thread.a \&lt;BR /&gt; $(MKLPATH)/libmkl_lapack.a \&lt;BR /&gt; $(MKLPATH)/libmkl_em64t.a \&lt;BR /&gt; $(MKLPATH)/libmkl_core.a \&lt;BR /&gt; -Wl,--end-group \&lt;BR /&gt; $(SLIBS) -o eigentest.exe&lt;BR /&gt;&lt;BR /&gt;dynamic:&lt;BR /&gt; $(FC) eigentest.f90 $(LDFLAGS) $(INFLAGS) $(MKLOPT) \&lt;BR /&gt; -lmkl_intel_lp64 \&lt;BR /&gt; -lmkl_intel_thread \&lt;BR /&gt; -lmkl_lapack \&lt;BR /&gt; -lmkl_em64t \&lt;BR /&gt; -lmkl_core \&lt;BR /&gt; $(SLIBS) -o eigentest.exe&lt;/SPAN&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 06 Feb 2009 21:29:41 GMT</pubDate>
    <dc:creator>theochem</dc:creator>
    <dc:date>2009-02-06T21:29:41Z</dc:date>
    <item>
      <title>Static executable was OK, but dynamic one caused segmentation fault.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-executable-was-OK-but-dynamic-one-caused-segmentation/m-p/908793#M11962</link>
      <description>Hi, everyone!&lt;BR /&gt;&lt;BR /&gt;I used a subroutine named 'spevd' (in Fortran 95 syntax) provided in Intel MKL for Linux to obtain eigenvalues of a real symmetric matrix. The source code and Makefile are attached below. The problem that I encountered was the static executable was OK, but dynamic executable could cause segmentation fault.&lt;BR /&gt;&lt;BR /&gt;Suggestions are appreciated!&lt;BR /&gt; &lt;BR /&gt; Thank you!&lt;BR /&gt;&lt;BR /&gt;! More detailed information goes here!&lt;BR /&gt;&lt;BR /&gt;The OS and ifort version are:&lt;BR /&gt;&lt;BR /&gt;abc@debian:~/test/eigentest$ uname -a&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;Linux debian 2.6.26-1-amd64 #1 SMP Sat Jan 10 17:57:00 UTC 2009 x86_64 GNU/Linux&lt;/SPAN&gt;&lt;BR /&gt;abc@debian:~/test/eigentest$ ifort -V&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.0 Build 20081105 Package ID: l_cprof_p_11.0.074&lt;BR /&gt;Copyright (C) 1985-2008 Intel Corporation. All rights reserved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;The fortran source code is:&lt;BR /&gt;&lt;BR /&gt;abc@debian:~/test/eigentest$ cat eigentest.f90 &lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;program eigentest&lt;BR /&gt;! This program is used to calculate the eigenvalues of a symmetric&lt;BR /&gt;! matrix mat(6,6).&lt;BR /&gt; use mkl95_precision, only: wp =&amp;gt; sp&lt;BR /&gt; use mkl95_lapack, only: spevd&lt;BR /&gt; implicit none&lt;BR /&gt; integer,parameter::n=6,pklen=(1+n)*n/2&lt;BR /&gt;! matev(n) is the eigenvalues of mat(n,n).&lt;BR /&gt; real::mat(n,n),matev(n)&lt;BR /&gt; integer::r,c,err,k&lt;BR /&gt; real,allocatable::matpk(:)&lt;BR /&gt;&lt;BR /&gt; data ((mat(c,r),c=1,r),r=1,6) &amp;amp;&lt;BR /&gt; &amp;amp; / 1.81311, &amp;amp;&lt;BR /&gt; &amp;amp; -0.19827, 1.21229, &amp;amp;&lt;BR /&gt; &amp;amp; -0.26697, 0.14556, 1.30019, &amp;amp;&lt;BR /&gt; &amp;amp; 0.00000, 0.00000, 0.00000, 2.00000, &amp;amp;&lt;BR /&gt; &amp;amp; 0.33784, 0.92300, 0.06331, 0.00000, 0.83720, &amp;amp;&lt;BR /&gt; &amp;amp; 0.33784,-0.20619, 0.90189, 0.00000,-0.05861, 0.83720 /&lt;BR /&gt;&lt;BR /&gt; do r=1, n-1&lt;BR /&gt; do c=r+1, n&lt;BR /&gt; mat(c,r)=mat(r,c)&lt;BR /&gt; enddo&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; write(*,"('----------------------------',/,'MAT(6,6)')")&lt;BR /&gt; write(*,"(6F10.5)") mat&lt;BR /&gt;&lt;BR /&gt; allocate(matpk(pklen),stat=err)&lt;BR /&gt; if (err/=0) then&lt;BR /&gt; write(*,"('The band storage of MAT(6,6) failed (stat= ',I3,').')") err&lt;BR /&gt; stop&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt;! matpk(pklen) is a packed storage of mat(n,n)&lt;BR /&gt; do r=1, n&lt;BR /&gt; k=r*(r-1)/2&lt;BR /&gt; matpk(1+k:r+k) = mat(1:r,r)&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; write(*,"('----------------------------',/,'MAT(6,6) Packed Storage')")&lt;BR /&gt; write(*,"(7F10.5)") matpk&lt;BR /&gt;&lt;BR /&gt; call spevd(matpk, matev)&lt;BR /&gt;&lt;BR /&gt; write(*,"('----------------------------',/,'Eigenvalues of MAT(6,6)')")&lt;BR /&gt; write(*,"(6F10.5)") matev&lt;BR /&gt;&lt;BR /&gt; stop&lt;BR /&gt;end&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;The Makefile is:&lt;BR /&gt; &lt;BR /&gt;abc@debian:~/test/eigentest$ cat Makefile &lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;FC = ifort&lt;BR /&gt;MKLOPT = -lmkl_lapack95&lt;BR /&gt;SLIBS = -lguide -lpthread&lt;BR /&gt;LDFLAGS = -L$(MKLPATH)&lt;BR /&gt;INFLAGS = -I$(MKLINCLUDE)&lt;BR /&gt;&lt;BR /&gt;static:&lt;BR /&gt; $(FC) eigentest.f90 $(LDFLAGS) $(INFLAGS) $(MKLOPT) \&lt;BR /&gt; -Wl,--start-group \&lt;BR /&gt; $(MKLPATH)/libmkl_intel_lp64.a \&lt;BR /&gt; $(MKLPATH)/libmkl_intel_thread.a \&lt;BR /&gt; $(MKLPATH)/libmkl_lapack.a \&lt;BR /&gt; $(MKLPATH)/libmkl_em64t.a \&lt;BR /&gt; $(MKLPATH)/libmkl_core.a \&lt;BR /&gt; -Wl,--end-group \&lt;BR /&gt; $(SLIBS) -o eigentest.exe&lt;BR /&gt;&lt;BR /&gt;dynamic:&lt;BR /&gt; $(FC) eigentest.f90 $(LDFLAGS) $(INFLAGS) $(MKLOPT) \&lt;BR /&gt; -lmkl_intel_lp64 \&lt;BR /&gt; -lmkl_intel_thread \&lt;BR /&gt; -lmkl_lapack \&lt;BR /&gt; -lmkl_em64t \&lt;BR /&gt; -lmkl_core \&lt;BR /&gt; $(SLIBS) -o eigentest.exe&lt;/SPAN&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Feb 2009 21:29:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-executable-was-OK-but-dynamic-one-caused-segmentation/m-p/908793#M11962</guid>
      <dc:creator>theochem</dc:creator>
      <dc:date>2009-02-06T21:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Static executable was OK, but dynamic one caused segmentati</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-executable-was-OK-but-dynamic-one-caused-segmentation/m-p/908794#M11963</link>
      <description>Sorry, I think I really need to read the Intel MKL User's Guide very carefully!&lt;BR /&gt;&lt;BR /&gt;After I read Chapter 3 and 5, I found the aforementioned problem is in the Makefile.&lt;BR /&gt;&lt;BR /&gt;The corrected one is attached:&lt;BR /&gt;&lt;BR /&gt;abc@debian:~/test/eigentest$ cat Makefile &lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;FC = ifort&lt;BR /&gt;MKLOPT = -lmkl_lapack95&lt;BR /&gt;SLIBS = -lguide -lpthread&lt;BR /&gt;LDFLAGS = -L$(MKLPATH)&lt;BR /&gt;INFLAGS = -I$(MKLINCLUDE)&lt;BR /&gt;&lt;BR /&gt;static:&lt;BR /&gt; $(FC) eigentest.f90 $(LDFLAGS) $(INFLAGS) $(MKLOPT) &lt;BR /&gt; -Wl,--start-group &lt;BR /&gt; $(MKLPATH)/libmkl_intel_lp64.a &lt;BR /&gt; $(MKLPATH)/libmkl_intel_thread.a &lt;BR /&gt; $(MKLPATH)/libmkl_core.a &lt;BR /&gt; -Wl,--end-group &lt;BR /&gt; $(SLIBS) -o eigentest.exe&lt;BR /&gt;&lt;BR /&gt;dynamic:&lt;BR /&gt; $(FC) eigentest.f90 $(LDFLAGS) $(INFLAGS) $(MKLOPT) &lt;BR /&gt; -lmkl_intel_lp64 &lt;BR /&gt; -lmkl_intel_thread &lt;BR /&gt; -lmkl_core &lt;BR /&gt; $(SLIBS) -o eigentest.exe&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Feb 2009 21:54:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-executable-was-OK-but-dynamic-one-caused-segmentation/m-p/908794#M11963</guid>
      <dc:creator>theochem</dc:creator>
      <dc:date>2009-02-06T21:54:13Z</dc:date>
    </item>
  </channel>
</rss>

