Hi Michele,

A 'cleaner' way is through 'toolchainopts', i.e. by adding this line to your easyconfig file:

    toolchainopts = {'cstd': 'c++11'}

See also https://github.com/hpcugent/easybuild-easyconfigs/blob/68176cd383d3bc3569894bced5a3fda001d0e4fb/easybuild/easyconfigs/m/MRtrix/MRtrix-0.3.14-intel-2016a-Python-2.7.11.eb#L10


The only difference here is that you don't need to worry which flag to use exactly (-std, or maybe another flag when a different compiler is used).


regards,

Kenneth

PS: an overview of supported toolchain options per toolchain is available at http://easybuild.readthedocs.io/en/latest/version-specific/toolchain_opts.html; to evaluate the effect of setting a particular toolchain option you can use -x, cfr. http://easybuild.readthedocs.io/en/latest/Extended_dry_run.html

On 05/10/16 19:23, Michele Dolfi wrote:
Thanks.
configopts actually seems to work.

I think before I actually overlooked the verbose cmake command, and didn’t see that the CMAKE_CXX_FLAGS was actually repeated.






On Oct 5, 2016, at 7:11 PM, Jack Perdue <[email protected] <mailto:[email protected]>> wrote:

On 10/05/2016 11:40 AM, Michele Dolfi wrote:
Dear EasyBuild experts,

I would like to enable C++11 inside some EB config file.
Usually, in a CMake project, I was doing -DCMAKE_CXX_FLAGS=“-std=c++11”. However EB overrides it if I put it in `configopts`.


If I read the log correctly, EB is setting the optimization options in the CMAKE_CXX_FLAGS. Personally I think this is a wrong behavior, because optimization flags in CMake are delivered by the BuildMode (Debug, Release, …), and those CXXFLAGS should be overridden in CMAKE_CXX_FLAGS_RELEASE.


preconfigopts most definitely won't work given
the CMakeMake.py easyblock.

I usually add to configopts something like:

 -DCMAKE_CXX_FLAGS=“$CXXFLAGS -std=c++11"

which usually works since it appears later on the command
line and seems to override EB's setting,

YMMV (not sure why it isn't working for you)

jack



Reply via email to