Ticket #5679 (closed: fixed)
build mantid with clang
Reported by: | Owen Arnold | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | minor | Milestone: | Release 2.3 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Nick Draper |
Description
clang is a new compiler that aims to provide very user friendly outputs, is good for template meta programming and is claimed to be faster (according to some reports) than gcc both in terms of build times and the runtime execution of the output binaries.
Aside from acting as a good development tool (seems to catch more & different programming errors than gcc). It might be useful to run as our target compiler on the mac, because it has good support for c++11. At the moment, we are severely limited in the number of modern c++ features we can use in Mantid because we are bounded by our most historical compilers.
Explore the possibilities of building mantid using a recent version of llvm clang.
Change History
comment:2 Changed 8 years ago by Owen Arnold
refs #5679. Can build and run minimal mantid plot
Changeset: 340fde75a089eb69499c1e17f1937d482d51a34e
comment:3 follow-up: ↓ 6 Changed 8 years ago by Russell Taylor
Definitely worth looking into as a developer tool but unfortunately it doesn't have OpenMP, which is why it was rejected when Intel was selected as the current compiler on the Mac (see http://www.mantidproject.org/Mac_OS_X_64_bit_build#Alternative_compilers_considered here).
(Not sure why you needed to reintroduce spaces between nested templates - the c++11 way should be supported by clang since 2.9 and it worked fine for me.)
comment:4 Changed 8 years ago by Owen Arnold
refs #5679. minimal build and run unit tests.
Changeset: 5b6bffb0ce982752268a9c743a45fc4c19bac940
comment:5 Changed 8 years ago by Owen Arnold
Built with MakeVates switched on, and ran the VatesAPITests. That all works too.
comment:6 in reply to: ↑ 3 Changed 8 years ago by Owen Arnold
Replying to Russell Taylor:
Definitely worth looking into as a developer tool but unfortunately it doesn't have OpenMP, which is why it was rejected when Intel was selected as the current compiler on the Mac (see http://www.mantidproject.org/Mac_OS_X_64_bit_build#Alternative_compilers_considered here).
(Not sure why you needed to reintroduce spaces between nested templates - the c++11 way should be supported by clang since 2.9 and it worked fine for me.)
How exactly did you set -std=c++0x in cmake for the clang compiler. When I try and switch it on it starts complaining about the boost::shared_pointer constructors? I've seen a patch associated with the move constructors https://svn.boost.org/trac/boost/changeset/73202.
comment:8 Changed 8 years ago by Owen Arnold
- Status changed from accepted to verify
- Resolution set to fixed
I had this building and running all the tests. Only test that fails is the CurveFittingTest_IkedaCarpenterPVTest test, which is probably due to a precision issue.
I'm going to stop the investigations at this point, because we need a more mature version of clang that is available at the moment to make it feasible for mantid production.
comment:9 Changed 8 years ago by Nick Draper
- Status changed from verify to verifying
- Tester set to Nick Draper
comment:10 Changed 8 years ago by Nick Draper
- Status changed from verifying to closed
until clang supports openmp we are unlikely to move to it, unless another tool can be used via the multithreaded wrapper.
comment:11 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 6525