cmake flags on user yaml script

73 views
Skip to first unread message

Luis Costa

unread,
Jan 5, 2016, 4:17:28 PM1/5/16
to hashdist
Hello again,

Is there a way to submit cmake flags (namely -D CMAKE_C_COMPILER) at the level of the user yaml script?  It looks like cmake rigorously picks the compiler in /usr/bin (gcc v4.3.4 for me) instead of the compiler I have loaded (gcc v4.8.4) through the modules environment. Setting an environment variable $CC=gcc or even aliasing cc to the newer gcc doesn't work either. I think it limits you to edit CMakeLists.txt or pass -DCMAKE_C_COMPILER to change the default compiler.

I noticed this when building PARMETIS and I am confronted with the following error:
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"

This is because "-Wno-unused-but-set-variable" was only added to gcc 4.6 and the default compiler does not recognize it.

Any help is appreciated. Thank you.

Luis Costa

Johannes Ring

unread,
Jan 6, 2016, 2:59:35 AM1/6/16
to hash...@googlegroups.com
On Tue, Jan 5, 2016 at 10:17 PM, Luis Costa <lcost...@gmail.com> wrote:
> Is there a way to submit cmake flags (namely -D CMAKE_C_COMPILER) at the
> level of the user yaml script? It looks like cmake rigorously picks the
> compiler in /usr/bin (gcc v4.3.4 for me) instead of the compiler I have
> loaded (gcc v4.8.4) through the modules environment. Setting an environment
> variable $CC=gcc or even aliasing cc to the newer gcc doesn't work either. I
> think it limits you to edit CMakeLists.txt or pass -DCMAKE_C_COMPILER to
> change the default compiler.

To change the default compiler, set the environment variables (like
CC, CXX, etc) in the PROLOGUE parameter in your hashdist profile. You
should also load the modules you use in the PROLOGUE. You can find
examples of this in hashstack.

Johannes

Luis Costa

unread,
Jan 6, 2016, 10:39:41 AM1/6/16
to hashdist
Johannes,

Thanks for the reply.

I did as you instructed but I'm having the same issue even though

lcosta@thunder11:~/FEniCS/fenics-developer-tools> gcc --version
gcc (GCC) 4.8.4

It looks to be using

lcosta@thunder11:~/FEniCS/fenics-developer-tools> /usr/bin/gcc --version
gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

I've uploaded my yaml file and build.log for PARMETIS.

Thanks again!

Regards,
Luis Costa
build.log
fenics.yaml

Ondřej Čertík

unread,
Jan 6, 2016, 12:26:43 PM1/6/16
to hash...@googlegroups.com
Hi Luis,

On Wed, Jan 6, 2016 at 8:39 AM, Luis Costa <lcost...@gmail.com> wrote:
> Johannes,
>
> Thanks for the reply.
>
> I did as you instructed but I'm having the same issue even though
>
> lcosta@thunder11:~/FEniCS/fenics-developer-tools> gcc --version
> gcc (GCC) 4.8.4
>
> It looks to be using
>
> lcosta@thunder11:~/FEniCS/fenics-developer-tools> /usr/bin/gcc --version
> gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
>
> I've uploaded my yaml file and build.log for PARMETIS.

It looks like you loaded a module for the Intel compiler, but then set
compilers to the old gcc? Maybe that's the problem.

Ondrej

>
> Thanks again!
>
> Regards,
> Luis Costa
>
>
>
> On Wednesday, January 6, 2016 at 2:59:35 AM UTC-5, johannr wrote:
>>
>> On Tue, Jan 5, 2016 at 10:17 PM, Luis Costa <lcost...@gmail.com> wrote:
>> > Is there a way to submit cmake flags (namely -D CMAKE_C_COMPILER) at the
>> > level of the user yaml script? It looks like cmake rigorously picks the
>> > compiler in /usr/bin (gcc v4.3.4 for me) instead of the compiler I have
>> > loaded (gcc v4.8.4) through the modules environment. Setting an
>> > environment
>> > variable $CC=gcc or even aliasing cc to the newer gcc doesn't work
>> > either. I
>> > think it limits you to edit CMakeLists.txt or pass -DCMAKE_C_COMPILER to
>> > change the default compiler.
>>
>> To change the default compiler, set the environment variables (like
>> CC, CXX, etc) in the PROLOGUE parameter in your hashdist profile. You
>> should also load the modules you use in the PROLOGUE. You can find
>> examples of this in hashstack.
>>
>> Johannes
>
> --
> You received this message because you are subscribed to the Google Groups
> "hashdist" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hashdist+u...@googlegroups.com.
> To post to this group, send email to hash...@googlegroups.com.
> Visit this group at https://groups.google.com/group/hashdist.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hashdist/07bbe987-311e-493a-bc5b-caab04950a87%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Johannes Ring

unread,
Jan 7, 2016, 4:54:34 AM1/7/16
to hash...@googlegroups.com
On Wed, Jan 6, 2016 at 6:26 PM, Ondřej Čertík <ondrej...@gmail.com> wrote:
> On Wed, Jan 6, 2016 at 8:39 AM, Luis Costa <lcost...@gmail.com> wrote:
>> I did as you instructed but I'm having the same issue even though
>>
>> lcosta@thunder11:~/FEniCS/fenics-developer-tools> gcc --version
>> gcc (GCC) 4.8.4
>>
>> It looks to be using
>>
>> lcosta@thunder11:~/FEniCS/fenics-developer-tools> /usr/bin/gcc --version
>> gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
>>
>> I've uploaded my yaml file and build.log for PARMETIS.
>
> It looks like you loaded a module for the Intel compiler, but then set
> compilers to the old gcc? Maybe that's the problem.

It looks like Ondrej is right.

I have a branch where I have built FEniCS with mkl and the Intel
compilers that might be useful for you:

https://github.com/hashdist/hashstack/tree/johannr/mkl-abel

Here is the yaml profile I used:

https://github.com/hashdist/hashstack/blob/johannr/mkl-abel/examples/fenics-1.6.0.abel.intel.yaml

I also see that you set a parameter TARGET for openblas:

blas:
use: openblas
TARGET: SANDYBRIDGE

That won't work (unless you have modified openblas.yaml). However, you
can use the extra_flags parameter instead like this:

blas:
use: openblas
extra_flags: TARGET=SANDYBRIDGE

Johannes
Reply all
Reply to author
Forward
0 new messages