Skip to Content.
Sympa Menu

charm - Re: [charm] 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] Compiling charm++ 6.5.0 with clang's C++11 on OS X 10.8.3


Chronological Thread 
  • From: Kelly Davis <kdavis AT alum.mit.edu>
  • To: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] Compiling charm++ 6.5.0 with clang's C++11 on OS X 10.8.3
  • Date: Mon, 8 Apr 2013 01:27:30 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-RocketYMMF:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=K6Bgsazu7mABIuABFMIBuXrwPX9icMQw0oD5CC7wb6rTTFqPfhGYx6075wmi+d5jTHr+CzUOGtGvrxR3zGPDcZnat3s7YdWpBxaqpB3cCby1B37eC1zzc/on0klfaZfnyQmqKxvt2W52YKQQPAboCVAtA+z17ebHfg92rTVIwZo=;
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

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







Archive powered by MHonArc 2.6.16.

Top of Page