[lustre-discuss] Compile a C++ app. using the Lustre API

François Tessier ftessier at anl.gov
Wed Mar 15 12:00:31 PDT 2017


Hi All,

I'm working on a piece of code using the Lustre API. To do so, I include
lustreapi.h. When I compile my code with a C compiler (icc), everything
is fine. However, when I compile it with a C++ compiler (icpc), I get
these errors:

---------------------------------

In file included from /usr/include/lustre/lustreapi.h(47),
                 from topo.c(5):
/usr/include/lustre/lustre_user.h(914): error: argument of type "__u16={unsigned short}" is incompatible with parameter of type "changelog_rec_flags"
  	return changelog_rec_offset(rec->cr_flags);
  	                            ^

In file included from /usr/include/lustre/lustreapi.h(47),
                 from topo.c(5):
/usr/include/lustre/lustre_user.h(925): error: a value of type "int" cannot be used to initialize an entity of type "changelog_rec_flags"
  	enum changelog_rec_flags crf = rec->cr_flags & CLF_VERSION;
  	                               ^

In file included from /usr/include/lustre/lustreapi.h(47),
                 from topo.c(5):
/usr/include/lustre/lustre_user.h(935): error: a value of type "int" cannot be used to initialize an entity of type "changelog_rec_flags"
  	enum changelog_rec_flags crf = rec->cr_flags &
  	                               ^

In file included from /usr/include/lustre/lustreapi.h(47),
                 from topo.c(5):
/usr/include/lustre/lustre_user.h(945): error: argument of type "int" is incompatible with parameter of type "changelog_rec_flags"
  	return (char *)rec + changelog_rec_offset(rec->cr_flags &
  	                                          ^

In file included from /usr/include/lustre/lustreapi.h(47),
                 from topo.c(5):
/usr/include/lustre/lustre_user.h(986): error: this operation on an enumerated type requires an applicable user-defined operator function
  	crf_wanted &= CLF_SUPPORTED;
  	           ^

In file included from /usr/include/lustre/lustreapi.h(47),
                 from topo.c(5):
/usr/include/lustre/lustre_user.h(997): error: argument of type "int" is incompatible with parameter of type "changelog_rec_flags"
  		  changelog_rec_offset(crf_wanted & ~CLF_JOBID);
  		                       ^

In file included from /usr/include/lustre/lustreapi.h(47),
                 from topo.c(5):
/usr/include/lustre/lustre_user.h(999): error: argument of type "int" is incompatible with parameter of type "changelog_rec_flags"
  		  changelog_rec_offset(crf_wanted & ~(CLF_JOBID | CLF_RENAME));
  		                       ^

Makefile:10: recipe for target 'topo' failed
make: *** [topo] Error 2

---------------------------------

It's probably more a compiler issue than a Lustre one but a solution
could help other users or Lustre developers.

Any idea?

Thanks,

François


-- 
--
François TESSIER, Ph.D.
Postdoctoral Appointee
Argonne National Laboratory
LCF Division - Bldg 240, 4E 19
Tel : +1 (630)-252-5068
http://www.francoistessier.info



More information about the lustre-discuss mailing list