Skip to Content.
Sympa Menu

charm - Re: [charm] Charm++ Template Compilation issue

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Charm++ Template Compilation issue


Chronological Thread 
  • From: Evan Ramos <evan AT hpccharm.com>
  • To: Jonathan Hoelzel <hoelzel2 AT illinois.edu>
  • Cc: charm AT cs.illinois.edu
  • Subject: Re: [charm] Charm++ Template Compilation issue
  • Date: Wed, 23 Jan 2019 10:46:29 -0600
  • Authentication-results: illinois.edu; spf=none smtp.mailfrom=evan AT hpccharm.com; dkim=pass header.d=hpccharm-com.20150623.gappssmtp.com header.s=20150623; dmarc=none

Hi Jonathan,

I took a quick look at your test case and I believe the issue is that child.h contains the line `#include "child.C"`. If I remove that line and uncomment `#include "child.def.h"` in child.C, I am able to compile and link the program successfully.

Regards,
--
Evan A. Ramos
Software Engineer
Charmworks, Inc.


On Thu, Jan 17, 2019 at 5:05 PM Jonathan Hoelzel <hoelzel2 AT illinois.edu> wrote:
Thanks for responding so quickly!  The code in the zip folder attached to my first email exhibits the described problem when compiling (at least on my computer).  I have attached another folder with a more minimized case.  This should exhibit the problem when compiling once the CHARMDIR variable in the Makefile is set appropriately.  Thanks again!

On Thu, Jan 17, 2019 at 1:17 PM Evan Ramos <evan AT hpccharm.com> wrote:
Hi Jonathan,

Could you post a minimal test case that exhibits the problem? We could diagnose the issue from there.

--
Evan Ramos
Software Engineer
Charmworks, Inc.


On Wed, Jan 16, 2019, 12:17 PM Jonathan Hoelzel <hoelzel2 AT illinois.edu wrote:
Hello,

I am working on a project using Charm++, and I have run into a compilation issue when trying to implement a templated chare.  I have attached a zip file with some example code that causes this problem.

Specifically, I get the following error when linking:

main.o: In function `_registermain()':
main.C:(.text+0x562): undefined reference to `_registerchild()'
collect2: error: ld returned 1 exit status

Looking in the child.def.h file, the '_registerchild()' method is only defined if CK_TEMPLATES_ONLY is not set when including child.def.h file.   However, if I include child.def.h again without setting CK_TEMPLATES_ONLY, then I get a similar error saying "multiple definition of 'registerchild()'".  I have been unable to work this out myself, so some help would be great.

Thanks,
Jonathan Hoelzel

Computer Science | College of Engineering
University of Illinois at Urbana-Champaign



--
Jonathan Hoelzel

Computer Science | College of Engineering
University of Illinois at Urbana-Champaign




Archive powered by MHonArc 2.6.19.

Top of Page