<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
p.p1, li.p1, div.p1
        {mso-style-name:p1;
        margin:0in;
        font-size:8.5pt;
        font-family:Menlo;
        color:black;}
span.s1
        {mso-style-name:s1;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We recently switched the CMake configuration on our GridPACK application to use the PkgConfig utility instead of Jeb Brown’s FindPETSc.cmake module. This seems to work on a number of platforms but it is failing to link on others. It appears
 that the build cannot find the LAPACK and BLAS libraries. The PETSc library I’m linking to (v3.16.3) was configured with -download-f2cblaslapack so it should have these libraries, but when I try and link one of the test applications in GridPACK I get the errors<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="p1"><span class="s1">/share/apps/gcc/6.1.0/bin/g++ -pthread -g -rdynamic CMakeFiles/greetings.dir/test/greetings.cpp.o -o greetings</span><span class="apple-converted-space"> 
</span><span class="s1">-Wl,-rpath,/qfs/projects/ops/rh6/openmpi/3.0.1/gcc/6.1.0/lib ../math/libgridpack_math.a libgridpack_parallel.a ../timer/libgridpack_timer.a ../environment/libgridpack_environment.a ../math/libgridpack_math.a /pic/projects/gridpack/software/boost_1_65_0/lib/libboost_mpi.a
 /pic/projects/gridpack/software/boost_1_65_0/lib/libboost_serialization.a /pic/projects/gridpack/software/boost_1_65_0/lib/libboost_random.a /pic/projects/gridpack/software/boost_1_65_0/lib/libboost_filesystem.a /pic/projects/gridpack/software/boost_1_65_0/lib/libboost_system.a
 /pic/projects/gridpack/software/ga-5.7/build_pr/lib/libga++.a /pic/projects/gridpack/software/ga-5.7/build_pr/lib/libga.a /pic/projects/gridpack/software/ga-5.7/build_pr/lib/libarmci.a -lrt /usr/lib64/librt.so /usr/lib64/libdl.so /qfs/projects/ops/rh6/openmpi/3.0.1/gcc/6.1.0/lib/libmpi.so
 ../timer/libgridpack_timer.a libgridpack_parallel.a ../configuration/libgridpack_configuration.a /pic/projects/gridpack/software/petsc-3.16.3/linux-openmpi-gnu-cxx-complex-opt/lib/libpetsc.a</span><span class="apple-converted-space"> </span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/linux-openmpi-gnu-cxx-complex-opt/lib/libpetsc.a(zstart.o): In function `petscinitializef_':</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/src/sys/objects/ftn-custom/zstart.c:280: undefined reference to `mpi_init_'</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/linux-openmpi-gnu-cxx-complex-opt/lib/libpetsc.a(baijfact.o): In function `MatSolve_SeqBAIJ_N':</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/src/mat/impls/baij/seq/baijfact.c:1462: undefined reference to `zgemv_'</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/src/mat/impls/baij/seq/baijfact.c:1475: undefined reference to `zgemv_'</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/src/mat/impls/baij/seq/baijfact.c:1478: undefined reference to `zgemv_'</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/linux-openmpi-gnu-cxx-complex-opt/lib/libpetsc.a(baijfact.o): In function `MatSolve_SeqBAIJ_N_NaturalOrdering':</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/src/mat/impls/baij/seq/baijfact.c:1407: undefined reference to `zgemv_'</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/src/mat/impls/baij/seq/baijfact.c:1420: undefined reference to `zgemv_'</span><o:p></o:p></p>
<p class="p1"><span class="s1">/pic/projects/gridpack/software/petsc-3.16.3/linux-openmpi-gnu-cxx-complex-opt/lib/libpetsc.a(baijfact.o):/pic/projects/gridpack/software/petsc-3.16.3/sr</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I suspect that the reason it worked for others and not for me is that they had viable blas and lapack libraries in their path and I don’t. Is there anything special you need to do to make sure that the build is pointed at the libraries
 that get created with the -download-f2cblaslapack option?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Bruce Palmer<o:p></o:p></p>
</div>
</body>
</html>