Re: [hwloc-users] Building hwloc on Cray with /opt/cray/craype/2.5.4/bin/cc

2017-01-05 Thread Xavier LACOSTE
Yes, indeed, __GNUC__ is 4 and __GNUC_MINOR__ 8 

-Message d'origine-
De : Samuel Thibault [mailto:samuel.thiba...@inria.fr] 
Envoyé : jeudi 5 janvier 2017 14:35
À : Hardware locality user list
Cc : Brice Goglin
Objet : Re: [hwloc-users] Building hwloc on Cray with 
/opt/cray/craype/2.5.4/bin/cc

Xavier LACOSTE, on Thu 05 Jan 2017 13:25:56 +, wrote:
> It seems that the __GNU__ is defined so I don’t get into the 
> HWLOC_HAVE_FFSL section.

Do you mean __GNUC__?  And which value does it have?

In other words: what, exactly, actually gets included from that file?
:)

Samuel
___
hwloc-users mailing list
hwloc-users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users

Re: [hwloc-users] Building hwloc on Cray with /opt/cray/craype/2.5.4/bin/cc

2017-01-05 Thread Xavier LACOSTE
Hello Samuel,

With my test I get : 
CPU_Vendor : (null) 
Socket : CPUModel="Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz" | CPUType=x86_64

Meanwhile, the CPUVendor Field is in the generated xml.

XL.

-Message d'origine-
De : Samuel Thibault [mailto:samuel.thiba...@inria.fr] 
Envoyé : jeudi 5 janvier 2017 13:12
À : Hardware locality user list
Objet : Re: [hwloc-users] Building hwloc on Cray with 
/opt/cray/craype/2.5.4/bin/cc

Xavier LACOSTE, on Thu 05 Jan 2017 11:31:23 +, wrote:
> Hwloc builds correctly with gcc compiler but the CPUVendor field is 
> not available using this code :

The code looks right and works here. What output do you get? Could you post the 
output of

lstopo test.xml

Samuel


test.xml
Description: test.xml
___
hwloc-users mailing list
hwloc-users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users

Re: [hwloc-users] Building hwloc on Cray with /opt/cray/craype/2.5.4/bin/cc

2017-01-05 Thread Xavier LACOSTE
Yes, with no warning, and I can also execute my a.out.

$> cc toto.c
$> ./a.out
$> cat toto.c
int main(int argc, char *argv[])
{
  return __builtin_ffsl((unsigned long) argc);
}
De : Brice Goglin [mailto:brice.gog...@inria.fr]
Envoyé : jeudi 5 janvier 2017 15:03
À : Xavier LACOSTE
Cc : Hardware locality user list
Objet : Re: [hwloc-users] Building hwloc on Cray with 
/opt/cray/craype/2.5.4/bin/cc

Does this even build with the cray compiler?

int main(int argc, char *argv[])
{
  return __builtin_ffsl((unsigned long) argc);
}



Le 05/01/2017 14:56, Xavier LACOSTE a écrit :
Indeed,

If I had a #undef __GNUC__ in misc.h the compilation finished (I still have the 
link complaining about recompiling with -fPIE and linking with -pie, but I 
should be able to handle that)
I tried all available cray cc (2.2.1 and 2.5.6) and they behave the same.
I'll see how to report bug to Cray and may ask for a new compiler installation.

XL.

De : Brice Goglin [mailto:brice.gog...@inria.fr]
Envoyé : jeudi 5 janvier 2017 14:39
À : Xavier LACOSTE
Cc : Hardware locality user list
Objet : Re: [hwloc-users] Building hwloc on Cray with 
/opt/cray/craype/2.5.4/bin/cc

Ah ok now I remember we've seen the same issue 4 years ago.
https://mail-archive.com/hwloc-users@lists.open-mpi.org/msg00816.html
Basically the Cray compiler claimed to be GCC compatible it was not. But that 
users explicitly requested the cray compiler to behave as GNU with "-h gnu". 
Did you pass any option to the compiler?

We could workaround the issue by not using __builtin_ffsl() when we detect the 
cray compiler, but that would be overkill since earlier versions worked fine. 
Do you have ways to report bugs to Cray? Or install a different cray compiler 
version?

Brice



Le 05/01/2017 14:25, Xavier LACOSTE a écrit :
It seems that the __GNU__ is defined so I don't get into the HWLOC_HAVE_FFSL 
section.

Maybe because I already configured once with gcc before ? Do I have to do 
anything more than make clean an reconfigure to change compiler ?

De : Brice Goglin [mailto:brice.gog...@inria.fr]
Envoyé : jeudi 5 janvier 2017 14:18
À : Xavier LACOSTE
Cc : Hardware locality user list
Objet : Re: [hwloc-users] Building hwloc on Cray with 
/opt/cray/craype/2.5.4/bin/cc

configure seems to have detected ffsl() properly, but it looks like our ffsl() 
redefinition gets enabled anyway, and conflicts with the system-wide one.

Does it help if you comment out line #66 of include/private/misc.h ?
extern int ffsl(long) __hwloc_attribute_const;

Brice




Le 05/01/2017 13:52, Xavier LACOSTE a écrit :
Hello Brice,

I attached the files.

I could build hwloc and link with it using the default (gcc) compiler.
But If I use gcc to build the library I can link with gcc/icc/pgcc but not with 
cc from cray.

Thanks,

XL.


De : Brice Goglin [mailto:brice.gog...@inria.fr]
Envoyé : jeudi 5 janvier 2017 12:50
À : Xavier LACOSTE
Cc : Hardware locality user list
Objet : Re: [hwloc-users] Building hwloc on Cray with 
/opt/cray/craype/2.5.4/bin/cc

Hello Xavier
Can you send the /usr/include/string.h from that cray machine, your config.log 
and include/private/autogen/config.h from the hwloc build directory?
Do you get the same error if building from the default compiler instead of 
/opt/cray/craype/2.5.4/bin/cc?
thanks
Brice




Le 05/01/2017 12:31, Xavier LACOSTE a écrit :

Hello,

I'm trying to build hwloc on a cray machine with cray compiler 
:/opt/cray/craype/2.5.4/bin/cc

I get the following error :
$> CC=cc ./configure --prefix=$PWD-cc-install
$> make
Making all in src
make[1]: Entering directory `/home/j0306818/xavier/hwloc-1.11.5/src'
  CC   bitmap.lo
CC-147 craycc: ERROR
  Declaration is incompatible with "int ffsl(long)" (declared at line 526 of
  "/usr/include/string.h").


Total errors detected in bitmap.c: 1
make[1]: *** [bitmap.lo] Error 1
make[1]: Leaving directory `/home/j0306818/xavier/hwloc-1.11.5/src'
make: *** [all-recursive] Error 1

Do you have any idea of what I am doing wrong ?
Is this a known issue ?

Another secondary question :

Hwloc builds correctly with gcc compiler but the CPUVendor field is not 
available using this code :

#include 

int main(int argc, char *argv[])
{
  hwloc_topology_t topo;
  hwloc_obj_t obj;
  int err;
  int i;
  char obj_str[2048];
  char attr_str[2048];

  /* initialize a topology context */
  err = hwloc_topology_init();
  assert(!err);

  /* insert optional topology configuration here */

  /* build the topology created and configured above */
  err = hwloc_topology_load(topo);

  /* play with the topology here */
  obj = hwloc_get_obj_by_type(topo, HWLOC_OBJ_PACKAGE, 0);
  fprintf(stdout, "CPU_Vendor : %s \n", 
hwloc_obj_get_info_by_name(obj,"CPUVendor"));
  hwloc_obj_type_snprintf(obj_str, 2048, obj, 1);
  hwloc_obj_attr_snprintf(attr_str,2048, obj, " | ", 1);
  fprintf(stdout, "%s : %s\n", obj_str, attr_str);

  /* terminate this topology context */
  hwloc_topology_destroy(topo);

  return 0;
}

Am I using the correct 

Re: [hwloc-users] Building hwloc on Cray with /opt/cray/craype/2.5.4/bin/cc

2017-01-05 Thread Brice Goglin
Does this even build with the cray compiler?

int main(int argc, char *argv[])
{
  return __builtin_ffsl((unsigned long) argc);
}




Le 05/01/2017 14:56, Xavier LACOSTE a écrit :
>
> Indeed,
>
>  
>
> If I had a #undef __GNUC__ in misc.h the compilation finished (I still
> have the link complaining about recompiling with –fPIE and linking
> with –pie, but I should be able to handle that)
>
> I tried all available cray cc (2.2.1 and 2.5.6) and they behave the same.
>
> I’ll see how to report bug to Cray and may ask for a new compiler
> installation.
>
>  
>
> XL.
>
>  
>
> *De :*Brice Goglin [mailto:brice.gog...@inria.fr]
> *Envoyé :* jeudi 5 janvier 2017 14:39
> *À :* Xavier LACOSTE
> *Cc :* Hardware locality user list
> *Objet :* Re: [hwloc-users] Building hwloc on Cray with
> /opt/cray/craype/2.5.4/bin/cc
>
>  
>
> Ah ok now I remember we've seen the same issue 4 years ago.
> https://mail-archive.com/hwloc-users@lists.open-mpi.org/msg00816.html
> Basically the Cray compiler claimed to be GCC compatible it was not.
> But that users explicitly requested the cray compiler to behave as GNU
> with "-h gnu". Did you pass any option to the compiler?
>
> We could workaround the issue by not using __builtin_ffsl() when we
> detect the cray compiler, but that would be overkill since earlier
> versions worked fine. Do you have ways to report bugs to Cray? Or
> install a different cray compiler version?
>
> Brice
>
>
> Le 05/01/2017 14:25, Xavier LACOSTE a écrit :
>
> It seems that the __GNU__ is defined so I don’t get into the
> HWLOC_HAVE_FFSL section.
>
>  
>
> Maybe because I already configured once with gcc before ? Do I
> have to do anything more than make clean an reconfigure to change
> compiler ?
>
>  
>
> *De :*Brice Goglin [mailto:brice.gog...@inria.fr]
> *Envoyé :* jeudi 5 janvier 2017 14:18
> *À :* Xavier LACOSTE
> *Cc :* Hardware locality user list
> *Objet :* Re: [hwloc-users] Building hwloc on Cray with
> /opt/cray/craype/2.5.4/bin/cc
>
>  
>
> configure seems to have detected ffsl() properly, but it looks
> like our ffsl() redefinition gets enabled anyway, and conflicts
> with the system-wide one.
>
> Does it help if you comment out line #66 of include/private/misc.h ?
> extern int ffsl(long) __hwloc_attribute_const;
>
> Brice
>
>
>
> Le 05/01/2017 13:52, Xavier LACOSTE a écrit :
>
> Hello Brice,
>
>  
>
> I attached the files.
>
>  
>
> I could build hwloc and link with it using the default (gcc)
> compiler.
>
> But If I use gcc to build the library I can link with
> gcc/icc/pgcc but not with cc from cray.
>
>  
>
> Thanks,
>
>  
>
> XL.
>
>  
>
>  
>
> *De :*Brice Goglin [mailto:brice.gog...@inria.fr]
> *Envoyé :* jeudi 5 janvier 2017 12:50
> *À :* Xavier LACOSTE
> *Cc :* Hardware locality user list
> *Objet :* Re: [hwloc-users] Building hwloc on Cray with
> /opt/cray/craype/2.5.4/bin/cc
>
>  
>
> Hello Xavier
> Can you send the /usr/include/string.h from that cray machine,
> your config.log and include/private/autogen/config.h from the
> hwloc build directory?
> Do you get the same error if building from the default
> compiler instead of /opt/cray/craype/2.5.4/bin/cc?
> thanks
> Brice
>
>
>
> Le 05/01/2017 12:31, Xavier LACOSTE a écrit :
>
>  
>
> Hello,
>
>  
>
> I’m trying to build hwloc on a cray machine with cray
> compiler :/opt/cray/craype/2.5.4/bin/cc
>
>  
>
> I get the following error :
>
> $> CC=cc ./configure --prefix=$PWD-cc-install
>
> $> make
>
> Making all in src
>
> make[1]: Entering directory
> `/home/j0306818/xavier/hwloc-1.11.5/src'
>
>   CC   bitmap.lo
>
> CC-147 craycc: ERROR
>
>   Declaration is incompatible with "int ffsl(long)"
> (declared at line 526 of
>
>   "/usr/include/string.h").
>
>  
>
>  
>
> Total errors detected in bitmap.c: 1
>
> make[1]: *** [bitmap.lo] Error 1
>
> make[1]: Leaving directory
> `/home/j0306818/xavier/hwloc-1.11.5/src'
>
> make: *** [all-recursive] Error 1
>
>  
>
> Do you have any idea of what I am doing wrong ?
>
> Is this a known issue ?
>
>  
>
> Another secondary question :
>
>  
>
> Hwloc builds correctly with gcc compiler but the CPUVendor
> field is not available using this code :
>
>  
>
> #include 
>
>  
>
> int main(int argc, char *argv[])
>
> {
>
>   

[hwloc-users] Building hwloc on Cray with /opt/cray/craype/2.5.4/bin/cc

2017-01-05 Thread Xavier LACOSTE

Hello,

I'm trying to build hwloc on a cray machine with cray compiler 
:/opt/cray/craype/2.5.4/bin/cc

I get the following error :
$> CC=cc ./configure --prefix=$PWD-cc-install
$> make
Making all in src
make[1]: Entering directory `/home/j0306818/xavier/hwloc-1.11.5/src'
  CC   bitmap.lo
CC-147 craycc: ERROR
  Declaration is incompatible with "int ffsl(long)" (declared at line 526 of
  "/usr/include/string.h").


Total errors detected in bitmap.c: 1
make[1]: *** [bitmap.lo] Error 1
make[1]: Leaving directory `/home/j0306818/xavier/hwloc-1.11.5/src'
make: *** [all-recursive] Error 1

Do you have any idea of what I am doing wrong ?
Is this a known issue ?

Another secondary question :

Hwloc builds correctly with gcc compiler but the CPUVendor field is not 
available using this code :

#include 

int main(int argc, char *argv[])
{
  hwloc_topology_t topo;
  hwloc_obj_t obj;
  int err;
  int i;
  char obj_str[2048];
  char attr_str[2048];

  /* initialize a topology context */
  err = hwloc_topology_init();
  assert(!err);

  /* insert optional topology configuration here */

  /* build the topology created and configured above */
  err = hwloc_topology_load(topo);

  /* play with the topology here */
  obj = hwloc_get_obj_by_type(topo, HWLOC_OBJ_PACKAGE, 0);
  fprintf(stdout, "CPU_Vendor : %s \n", 
hwloc_obj_get_info_by_name(obj,"CPUVendor"));
  hwloc_obj_type_snprintf(obj_str, 2048, obj, 1);
  hwloc_obj_attr_snprintf(attr_str,2048, obj, " | ", 1);
  fprintf(stdout, "%s : %s\n", obj_str, attr_str);

  /* terminate this topology context */
  hwloc_topology_destroy(topo);

  return 0;
}

Am I using the correct code to retrieve the CPUVendor ? As far as I see the 
topology is correctly detected anyway.

Regards,

XL.
___
hwloc-users mailing list
hwloc-users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users