[Trilinos-Users] [EXTERNAL] Not able to load shared library, undefined symbol in Trilinos
Lo, Chaomei
c.lo at pnnl.gov
Thu Jun 26 12:14:02 MDT 2014
This is an interesting circle of community - when I sent this request, I did not know David - the developer of the code.
Ok. I will do David suggested. However, I found the fix but I do not understand why, that is - if the type of the global index is defined as "long", the this "undefined symbol" occurs when I load the shared library generated from R. If the type is "int" then it does not have problem. Also I noticed that in the code the this Tpetra::CrsMatrix has only four template parameter (see the matrix_t type defined in below), but it actually has five as the document specified. I am not sure if this was another problem.
" Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >"
typedef Tpetra::CrsMatrix<scalar_t, local_ordinal_t, global_ordinal_t, node_t> matrix_t;
Thanks,
Chaomei
-----Original Message-----
From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of David Hysom
Sent: Wednesday, June 25, 2014 4:36 PM
To: trilinos-users at software.sandia.gov
Subject: Re: [Trilinos-Users] [EXTERNAL] Not able to load shared library, undefined symbol in Trilinos
Chaomei,
Just on a hunch, could you try moving the code for the Dendogram ctors from the cpp to the header file? (note, there are two Ctors)
On 06/25/2014 04:28 PM, David Hysom wrote:
> Hi, all,
>
> I'll jump in here since I wrote the Dendogram class.
> Dendogram is not templated; the constructor *is* implemented in
> Dendogram.cpp (I can send you the code, if that's needed and would
> help diagnose the problem).
>
> - David
>
> On 06/25/2014 04:20 PM, Bill Spotz wrote:
>> So I get the following:
>>
>> $ c++filt
>> __ZN9DendogramC1EiiiRN7Teuchos3RCPIN6Tpetra9CrsMatrixIdiiN13KokkosCla
>> ssic10OpenMPNodeENS4_20DefaultHostSparseOpsIviS5_NS4_7details22FirstT
>> ouchCRSAllocatorEEEEEEEii
>>
>> Dendogram::Dendogram(int, int, int,
>> Teuchos::RCP<Tpetra::CrsMatrix<double, int, int,
>> KokkosClassic::OpenMPNode, KokkosClassic::DefaultHostSparseOps<void,
>> int, KokkosClassic::OpenMPNode,
>> KokkosClassic::details::FirstTouchCRSAllocator> > >&, int, int)
>>
>> It looks to me like a Dendogram constructor (which I assume is on
>> your side, as it is not a Trilinos class I am aware of) is defined in
>> a header but not implemented. It may not be called, but the dynamic
>> linker thinks it needs it anyway. If it works, you could delete the
>> prototype, or if not, you will need to implement the constructor.
>>
>> -Bill
>>
>> On Jun 16, 2014, at 4:09 PM, Chaomei Lo <chaomeilo at gmail.com> wrote:
>>
>>> I have an application (using Trilinos) which I am not the author,
>>> but I created a share library using "-fPIC "and "-shared". The
>>> application ran fine by creating an executable and the shared
>>> library was created fine.
>>>
>>> Then I created R package using Rcpp to call the functions in this
>>> application, when I do "R CMD check gpkg" - do compilation and
>>> linking, it gave me the following error. I have linked the shared
>>> library created from the application which use Trilinos, and I have
>>> linked to a lot of Trilinos libraries. From the following error
>>> with the undefined symbol. it seems trying to find "KokkosClassic
>>> OpenMPNode DefaultHostSparseOps details FirstTouchCRSAllocator". The
>>> application I am running used "Kokkos::OpenMPNode" to create
>>> Tpetra::CrsMatrix.
>>> --------------------------------------------------------------------
>>> -----------------
>>>
>>> Error in dyn.load(file, DLLpath = DLLpath, ...) :
>>> unable to load shared object '/people/me/.Rlibs/gpkg/libs/gpkg.so':
>>> /people/me/.Rlibs/gpkg/libs/gpkg.so: undefined symbol:
>>> _ZN9DendogramC1EiiiRN7Teuchos3RCPIN6Tpetra9CrsMatrixIdiiN13KokkosCla
>>> ssic10OpenMPNodeENS4_20DefaultHostSparseOpsIviS5_NS4_7details22First
>>> TouchCRSAllocatorEEEEEEEii
>>> --------------------------------------------------------------------
>>> ----------------------------------------
>>>
>>> If anyone can give me some suggestion what I miss here would be
>>> highly appreciated.
>>>
>>> Thanks.
>>> _______________________________________________
>>> Trilinos-Users mailing list
>>> Trilinos-Users at software.sandia.gov
>>> https://software.sandia.gov/mailman/listinfo/trilinos-users
>> ** Bill Spotz **
>> ** Sandia National Laboratories Voice: (505)845-0170 **
>> ** P.O. Box 5800 Fax: (505)284-0154 **
>> ** Albuquerque, NM 87185-0370 Email: wfspotz at sandia.gov **
>>
>>
>>
>>
>>
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> https://software.sandia.gov/mailman/listinfo/trilinos-users
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> https://software.sandia.gov/mailman/listinfo/trilinos-users
_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov
https://software.sandia.gov/mailman/listinfo/trilinos-users
More information about the Trilinos-Users
mailing list