Skip to Content.
Sympa Menu

charm - Re: [charm] [ppl] Compiling charm++ 6.5.0 with clang's C++11 on OS X 10.8.3

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] [ppl] Compiling charm++ 6.5.0 with clang's C++11 on OS X 10.8.3


Chronological Thread 
  • From: Phil Miller <mille121 AT illinois.edu>
  • To: Kelly Davis <kdavis AT alum.mit.edu>
  • Cc: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] [ppl] Compiling charm++ 6.5.0 with clang's C++11 on OS X 10.8.3
  • Date: Mon, 8 Apr 2013 11:41:06 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

While it's not a very pleasant solution, as a workaround you could
edit the desired flags directly into our compiler wrapper's
configuration scripts. In this case, those would be
src/arch/net-darwin-x86_64/conv-mach.sh and
src/arch/common/cc-clang.sh.

The 64-bit issue is probably the lack of the argument -m64 to the
compilers, which we have for gcc/g++ on that platform, but don't have
in the generic clang compiler script. I'll see about generalizing that
at least so that non-default compilers on 64-bit platforms still get
passed the appropriate flag.

I'm sorry this has gotten in the way of your work. Please let us know
if the above gets you through your trouble, or if we can help you
further.

Phil

On Mon, Apr 8, 2013 at 3:27 AM, Kelly Davis
<kdavis AT alum.mit.edu>
wrote:
> Hi Ben,
>
> This also does not work...
>
> ./build charm++ net-darwin-x86_64 clang --basedir=/usr/local
> CXXFLAGS='-std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7' LIBS=-lc++
> Error> option: CXXFLAGS=-std=c++11 is not supported in this version!
> Supported compilers: clang cxx gcc gcc3 icc icc8 iccstatic kcc pgcc xlc
> xlc64
> Supported options: bigemulator bigsim causalft g95 gfortran ifc ifort lcs
> local mlogft ooc papi persistent pgf90 pxshm smp syncft tcp
>
> From what I understand of the build script the final options one passed to
> it are then passed to the compilers not the configure script. So, one would
> hope something like the following would work...
>
> ./build charm++ net-darwin-x86_64 clang --basedir=/usr/local -std=c++11
> -stdlib=libc++ -mmacosx-version-min=10.7 -lc++
>
> However, this has at least two problems. First, the problem with the
> configuration script not catching the fact that my machine is 64 bit...
>
> ...
> ../bin/charmc -host xi-main.C
> In file included from xi-main.C:4:
> In file included from ./xi-symbol.h:4:
> In file included from ./xi-util.h:8:
> ./conv-config.h:65:2: error: "Compiler not generating 64 bit binary, please
> check compiler flags."
> #error "Compiler not generating 64 bit binary, please check compiler flags."
>
> Second, if I by hand alter the value of CMK_SIZET_64BIT, these options are
> passed to C and C++ compilers. So, the above results in the options
> "-std=c++11 -stdlib=libc++..." being passed to the C compiler which fails as
> the C compiler doesn't know anything about the C++ standard library.
>
>>If this doesn't help progress the compilation, I'll have a shot at
>> compiling this my self.
>
> Thanks! This would be a huge help!
>
> Best,
> Kelly
>
>
> ________________________________
> From: Ben Porebski
> <ben.porebski AT monash.edu>
> To: Kelly Davis
> <kdavis AT alum.mit.edu>
> Cc:
> "charm AT cs.uiuc.edu"
>
> <charm AT cs.uiuc.edu>
> Sent: Monday, April 8, 2013 9:52 AM
> Subject: Re: [charm] Compiling charm++ 6.5.0 with clang's C++11 on OS X
> 10.8.3
>
> Hi Kelly,
>
> I haven't come across this error before.
> But what I can think of trying would be to avoid using the export and put
> your flags in the build line as follows:
>
> ./build charm++ net-darwin-x86_64 clang --basedir=/usr/local
> CXXFLAGS='-std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7' LIBS=-lc++
>
> From memory, you can put compiler flags such as CXXFLAGS etc directly into
> the build command.
> If this doesn't help progress the compilation, I'll have a shot at compiling
> this my self.
>
>
> Cheers, Ben
>
>
> On Mon, Apr 8, 2013 at 5:38 PM, Kelly Davis
> <kdavis AT alum.mit.edu>
> wrote:
>
> WHAT: I am trying to compile charm++ 6.5.0 with clang's C++11 on OS X 10.8
> with no success.
>
>
> WHY: The rest of my executable uses C++11. Clang's C++11 uses libc++ and not
> libstdc++ for the C++ standard library, and code in some third party
> libraries I rely on use the C++ standard library and have an API that does
> not respect ABI compatibility. Furthermore, the third party libraries are
> flagrant enough ABI violators that clang's use of inline namespaces to catch
> ABI versioning problems does not catch the ABI versioning problem at compile
> time and thus an executable using libc++ and libstdc++ crashes more or less
> randomly.
>
>
> HOW: My initial attempt to compile charm++ with clang's C++11 used the
> export...
>
> export CONFIG_OPTS="CXXFLAGS='-std=c++11 -stdlib=libc++
> -mmacosx-version-min=10.7' LIBS=-lc++"
>
> then the build...
>
> ./build charm++ net-darwin-x86_64 clang --basedir=/usr/local
>
> This does not work as the configure script which is passed CONFIG_OPTS does
> not recognize the configure options. In particular it yields...
>
> ...
> make charmxi
> Makefile:1144: Variable OPTS is defined to an empty string. Are you sure
> this is what you want?
> ./config_opts.sh: line 1: -stdlib=libc++: command not found
> ./configure CXXFLAGS="-std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7"
> LIBS=-lc++
> configure: error: unrecognized option: -stdlib=libc++
> Try `./configure --help' for more information.
> make[1]: *** [conv-autoconfig.h] Error 1
> make: *** [headers] Error 2
>
>
> My next attempt didn't use the export but simply used...
>
> ./build charm++ net-darwin-x86_64 clang --basedir=/usr/local
>
> This doesn't work as the configuration scripts do not properly detect that I
> am on a 64 bit machine when I compile with clang. In particular it yields...
>
> ...
> ../bin/charmc -host xi-main.C
> In file included from xi-main.C:4:
> In file included from ./xi-symbol.h:4:
> In file included from ./xi-util.h:8:
> ./conv-config.h:65:2: error: "Compiler not generating 64 bit binary, please
> check compiler flags."
> #error "Compiler not generating 64 bit binary, please check compiler flags."
>
> Has anyone done this or does anyone have hints?
>
> Best,
> Kelly
>
> _______________________________________________
> charm mailing list
> charm AT cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/charm
>
>
>
>
>
> _______________________________________________
> 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