>From STRUMPACK-Dense-1.1.1/src/StrumpackDensePackage_C.cpp >>>>>>>>> /* This C++ file implements the functions of the C interface. */ #include "StrumpackDensePackage.hpp"
extern "C" { #include "StrumpackDensePackage.h" <<<<<<<<<< So looks like you have to use StrumpackDensePackage.h with "extern C". i.e mainSDP.cc should have: #include <petsc.h> extern "C" { #include "StrumpackDensePackage.h" } [usually such details should be handled in the public include file - and not exposed to the user..] Satish On Mon, 16 Nov 2015, Niels Aage wrote: > > Hi all, > > First of all, I hope this is the right place to pose the following question. > We're trying to create a shell preconditioner based on low rank properties of > a linear system. For this to be efficient it requires a fast > (mpi-parallelized) method for compressing (low rank) dense matrices. A tool > that offers just this is STRUMPACK > (http://portal.nersc.gov/project/sparse/strumpack/). > > So we simply need to link our petsc program to strumpack, but we have a hard > time performing the linking. We have cooked our code down to a very simple > test problem (see the attached code) that tries to invoke a single method > from strumpack. This results in an "undefined reference to > SDP_C_double_init(....)" even though the method clearly is in the object file > "StrumpackDensePackage_C.o". > > Note that my PETSc (3.6.2) is build with scalapack support which is needed by > strumpack - and that I have used the PETSc libs to build and link the > strumpack test example "STRUMPACK-Dense-1.1.1/examples/c_example.c". And that > this works just fine:-) > > We hope you have suggestions on how we can proceed - and let me know if any > additional information is needed. > > Thanks, > Niels Aage > > Associate Professor, Ph.D. > Department of Mechanical Engineering, > Section for Solid Mechanics > Centre for Acoustic-Mechanical Micro Systems > Technical University of Denmark, Building 404, DK-2800 Lyngby, Denmark > > Phone: (+45) 4525 4253, Fax: (+45) 4593 1475, > E-mail: na...@mek.dtu.dk, Office: b404-122 > Group homepage: www.topopt.dtu.dk<http://www.topopt.dtu.dk> > Centre homepage: www.camm.elektro.dtu.dk<http://www.camm.elektro.dtu.dk/> >