Skip to Content.
Sympa Menu

charm - Re: [charm] [ppl] Creating a NAMD Shared Library -> Undefined Symbols in Charm libs

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] [ppl] Creating a NAMD Shared Library -> Undefined Symbols in Charm libs


Chronological Thread 
  • From: Phil Miller <mille121 AT illinois.edu>
  • To: "Michael S. Sellers (Cont, ARL/WMRD)" <michael.s.sellers.ctr AT us.army.mil>
  • Cc: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: Re: [charm] [ppl] Creating a NAMD Shared Library -> Undefined Symbols in Charm libs
  • Date: Thu, 2 Dec 2010 12:02:39 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

On Thu, Dec 2, 2010 at 11:53, Michael S. Sellers (Cont, ARL/WMRD)
<michael.s.sellers.ctr AT us.army.mil>
wrote:
> Okay, so I need to have charm build these as shared libraries (memory-os and
> threads-context), and then link them when I build the NAMD shared library?
>
> Is there a short answer to why I need to do this, but it's not necessary for
> the NAMD executable?

I'm not too familiar with NAMD's build system, but if it uses charmc
(the Charm compiler wrapper) to link the executable, that
automatically links in memory allocation and threading libraries,
either the platform default or whatever was specified on the command
line.

Please let us know if you encounter other issues like this, or have in
the past, even if you figured out the solution on your own. We'll
definitely look at fixing things to make life easier.

> Thanks,
>
> Mike
>
> Phil Miller wrote:
>>
>> I may have been a bit too hasty. You'll also need one of the thread
>> libraries as well. It looks like multicore-linux64 uses context
>> threads, so libthreads-context.o.
>>
>> On Thu, Dec 2, 2010 at 11:35, Michael S. Sellers (Cont, ARL/WMRD)
>> <michael.s.sellers.ctr AT us.army.mil>
>> wrote:
>>
>>>
>>> Phil,
>>>
>>> Thanks a lot for the quick response.
>>>
>>> -Mike
>>>
>>> Phil Miller wrote:
>>>
>>>>
>>>> It looks like you're missing the memory allocation library. The
>>>> multicore-linux64 build target defaults to the OS/C-library provided
>>>> memory allocation routines (per charm/src/arch/multicore-linux64), so
>>>> you should link in charm/multicore-linux64/lib/libmemory-os.o as well.
>>>> You may need to adapt things to build that as a shared object as well,
>>>> but you seem to have a handle on that.
>>>>
>>>> Phil
>>>>
>>>> On Thu, Dec 2, 2010 at 11:05, Michael S. Sellers (Cont, ARL/WMRD)
>>>> <michael.s.sellers.ctr AT us.army.mil>
>>>> wrote:
>>>>
>>>>
>>>>>
>>>>> All,
>>>>>
>>>>> This message was sent to the NAMD listserv about a week ago, and I
>>>>> haven't
>>>>> heard anything back so I thought I would try charm.
>>>>> I am trying to build NAMD as a shared library, but having some linking
>>>>> trouble.  I realize it can't "work" as is without an interface, but
>>>>> this
>>>>> is
>>>>> a first step.
>>>>>
>>>>> I first compiled Charm++ as a shared libary, as well as FFTW and TCL.
>>>>>  Then
>>>>> I edited the NAMD Makefile and added -fPIC in the compiler options, and
>>>>> an
>>>>> additional linkage section to create "libnamd.so" with "-charm-shared"
>>>>> and
>>>>> "-rdynamic" options.  It seems to compile and link okay via the edited
>>>>> Makefile.  "namd2" from the compile runs fine.
>>>>>
>>>>> I'm testing the libnamd.so library using a simple program that sets
>>>>> "dlopen("path-to-library", RTLD_LAZY);" equal to a dummy pointer.
>>>>>  However,
>>>>> with this I am getting an error.
>>>>>
>>>>> ****loadNAMD.C******
>>>>>  ....
>>>>>
>>>>>  cout << "Opening libnamd.so...\n";
>>>>>  void* handle = dlopen("software/lib/NAMD/libnamd.so", RTLD_LAZY);
>>>>>  if (handle == NULL){
>>>>>    printf("%s\n", dlerror());
>>>>>    return 0;
>>>>>  }
>>>>>
>>>>> ***********************
>>>>>
>>>>> []$ g++ loadNAMD.C -o loadNAMD -rdynamic -ldl
>>>>> []$ ./loadNAMD
>>>>>
>>>>> The output of dlerror() is:
>>>>>
>>>>> Opening libnamd.so...
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libconv-core.so:
>>>>> undefined symbol: Cpv_CthData_
>>>>>
>>>>> I'm wondering if this is being caused by a lack of Charm++ (via
>>>>> charmrun
>>>>> or
>>>>> charmc), or the fact that dlopen invokes any _init() methods existing
>>>>> in
>>>>> the
>>>>> code (I read that somewhere...) ?  I would appreciate any suggestions
>>>>> from
>>>>> those who are familiar with this type of thing.  I have included the
>>>>> output
>>>>> of "ldd -d libnamd.so" at the bottom of this message.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Michael Sellers
>>>>>
>>>>> []$ ldd -d ~/software/lib/NAMD/libnamd.so
>>>>>    libmoduleNeighborLB.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libmoduleNeighborLB.so
>>>>> (0x00002b7fe9318000)
>>>>>    libmoduleHybridLB.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libmoduleHybridLB.so
>>>>> (0x00002b7fe9524000)
>>>>>    libmoduleRefineLB.so =>
>>>>>
>>>>>
>>>>> /software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libmoduleRefineLB.so
>>>>> (0x00002b7fe9730000)
>>>>>    libmoduleGreedyLB.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libmoduleGreedyLB.so
>>>>> (0x00002b7fe993b000)
>>>>>    libck.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so
>>>>> (0x00002b7fe9b48000)
>>>>>    libconv-cplus-y.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libconv-cplus-y.so
>>>>> (0x00002b7fe9f23000)
>>>>>    libconv-core.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libconv-core.so
>>>>> (0x00002b7fea138000)
>>>>>    libconv-util.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libconv-util.so
>>>>> (0x00002b7fea3d4000)
>>>>>    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b7fea61a000)
>>>>>    libckqt.so =>
>>>>>
>>>>>
>>>>> software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libckqt.so
>>>>> (0x00002b7fea835000)
>>>>>    libdl.so.2 => /lib64/libdl.so.2 (0x00002b7feaa39000)
>>>>>    libtcl8.5.so => software/lib/libtcl8.5.so (0x00002b7feac3d000)
>>>>>    libsrfftw.so.2 => software/lib/libsrfftw.so.2 (0x00002b7feaf58000)
>>>>>    libsfftw.so.2 => software/lib/libsfftw.so.2 (0x00002b7feb188000)
>>>>>    libm.so.6 => /lib64/libm.so.6 (0x00002b7feb3be000)
>>>>>    libstdc++.so.6 => /usr/local/lib64/libstdc++.so.6
>>>>> (0x00002b7feb641000)
>>>>>    libgcc_s.so.1 => /usr/local/lib64/libgcc_s.so.1 (0x00002b7feb947000)
>>>>>    libc.so.6 => /lib64/libc.so.6 (0x00002b7febb5c000)
>>>>>    /lib64/ld-linux-x86-64.so.2 (0x0000003f25000000)
>>>>> undefined symbol: Cpv_CthData_
>>>>>
>>>>>
>>>>>  
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libconv-core.so)
>>>>> undefined symbol: cpd_memory_pup
>>>>>
>>>>>
>>>>>  
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> undefined symbol: memory_stack_top
>>>>>
>>>>>
>>>>>  
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> undefined symbol: Cpv_CthData_
>>>>>
>>>>>
>>>>>  
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> undefined symbol: cpd_memory_length
>>>>>
>>>>>
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> undefined symbol: cpd_memory_getLength
>>>>>
>>>>>
>>>>>  
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> undefined symbol: cpdInSystem
>>>>>
>>>>>
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> undefined symbol: cpd_memory_get
>>>>>
>>>>>
>>>>>  
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> undefined symbol: memory_status_info
>>>>>
>>>>>
>>>>>  
>>>>> (software/src/NAMD_CVS_Source/Linux-x86_64-g++/.rootdir/charm-6.2.2/multicore-linux64/lib_so/libck.so)
>>>>> []$
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> charm mailing list
>>>>> charm AT cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/charm
>>>>>
>>>>> _______________________________________________
>>>>> ppl mailing list
>>>>> ppl AT cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/ppl
>>>>>
>>>>>
>>>>>
>>>>>
>





Archive powered by MHonArc 2.6.16.

Top of Page