I'm trying to build the python module msgpack-python on Solaris with the Sun compiler and am getting this error during the python ./setup.py build:
/opt/SUNWspro/bin/cc -DNDEBUG -O -xO3 -m32 -xarch=sparc -I/opt/csw/include -xcode=pic32 -I/opt/csw/include/python2.6 -c msgpack/_msgpack.c -o build/temp.solaris-2.10-sun4v-2.6/msgpack/_msgpack.o
"/usr/include/stdbool.h", line 42: #error: "Use of <stdbool.h> is valid only in a c99 compilation environment."
I also tried compiling by adding'-std=c99' like mentioned here: Node.JS on Solaris
but end up with:
cc: Warning: illegal option -d=c99
Anyone have any ideas on what this stdbool.h error is and how to work around it.
Thanks.
I don't know which version of Sun Studio you are running (which is important when it comes to whether or not it supports the Solaris 10 release you are using), but to get C99 mode, you can do one of two things:
Run the command /opt/SUNWspro/bin/c99
- This is a wrapper executable which will kick off the Sun CC compiler in C99 mode.
Run your command with the -xc99
flag - which will also trigger C99 mode in the compiler:
/opt/SUNWspro/bin/cc -xc99 ...
Alternatively, you can also use the GCC compiler (usually installed in /usr/sfw/bin/gcc
) to compile this C module, which is the compiler that supports the -std=c99
flag option. If I remember my Solaris work correctly, the gcc
included with Solaris will use Sun's ld
and link against the normal libc.so
on the system just like cc
will (not true at all for the C++ versions of each compiler).