C compiler is being used to compile C++ code.

I was trying to build matplotlib 0.99.0 as part of Sage

http://www.sagemath.org/

on a Sun Blade 2000 workstation running Solaris 10 update 7, using the Sun Studio compiler version 12.1 (not gcc).

CC and CXX were defined properly as C and C++ compilers, but it would appear that the C compiler is being called to compile the file src/ft2font.cpp, which is of course a C++ file.

You might get away with this with gcc, but the Sun C compiler will not compile C++ code.

Here's the error I get:

/opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/local/include -I. -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o
error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit status 1

This is recorded in the Sage trac as:

http://trac.sagemath.org/sage_trac/ticket/7028

···

cc: No valid input files specified, no output generated

This is a years-old known bug in distutils (which it looks like you've already commented on...). I've looked at it many times over those years, and it's really very difficult to fix from outside without terrible monkey-patching hacks that are certain to break on as many systems as they fix. We just may be forced to deal with it at this point, though. (FWIW, we run Solaris here, too, but we build matplotlib on gcc). I'll comment on that bug as well and see if we can get some movement on it.

In the meantime, I'll investigate whether the scons work by David Cournapeau resolves this problem. See here:

   http://github.com/cournape/matplotlib/tree/scons_build

Mike

Dr. David Kirkby wrote:

···

I was trying to build matplotlib 0.99.0 as part of Sage

http://www.sagemath.org/

on a Sun Blade 2000 workstation running Solaris 10 update 7, using the Sun Studio compiler version 12.1 (not gcc).

CC and CXX were defined properly as C and C++ compilers, but it would appear that the C compiler is being called to compile the file src/ft2font.cpp, which is of course a C++ file.

You might get away with this with gcc, but the Sun C compiler will not compile C++ code.

Here's the error I get:

/opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/local/include -I. -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o
cc: No valid input files specified, no output generated
error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit status 1

This is recorded in the Sage trac as:

http://trac.sagemath.org/sage_trac/ticket/7028

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

I've attached patches against Python 2.5 and 2.6 to that bug. Neither is significantly different from the original patch.

http://bugs.python.org/issue1222585

Once doing that, you'll also need to make the following change to matplotlib so that the correct C++ runtime libraries are used. Once I figure out how to correctly detect the compiler being used, I'll make this change in the matplotlib SVN repository. (This is non-trivial, since distutils doesn't have a Sun compiler specialization -- it uses the "generic" Unix compiler support for both gcc and Sun Studio.)

Mike

Index: setupext.py

···

===================================================================
--- setupext.py (revision 7979)
+++ setupext.py (working copy)
@@ -221,7 +221,7 @@
if sys.platform == 'win32' and win32_compiler == 'msvc':
     std_libs =
else:
- std_libs = ['stdc++', 'm']
+ std_libs = ['m', 'Crun', 'Cstd']

def has_pkgconfig():
     if has_pkgconfig.cache is not None:

Michael Droettboom wrote:

This is a years-old known bug in distutils (which it looks like you've already commented on...). I've looked at it many times over those years, and it's really very difficult to fix from outside without terrible monkey-patching hacks that are certain to break on as many systems as they fix. We just may be forced to deal with it at this point, though. (FWIW, we run Solaris here, too, but we build matplotlib on gcc). I'll comment on that bug as well and see if we can get some movement on it.

In the meantime, I'll investigate whether the scons work by David Cournapeau resolves this problem. See here:

   http://github.com/cournape/matplotlib/tree/scons_build

Mike

Dr. David Kirkby wrote:
  

I was trying to build matplotlib 0.99.0 as part of Sage

http://www.sagemath.org/

on a Sun Blade 2000 workstation running Solaris 10 update 7, using the Sun Studio compiler version 12.1 (not gcc).

CC and CXX were defined properly as C and C++ compilers, but it would appear that the C compiler is being called to compile the file src/ft2font.cpp, which is of course a C++ file.

You might get away with this with gcc, but the Sun C compiler will not compile C++ code.

Here's the error I get:

/opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/local/include -I. -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o
cc: No valid input files specified, no output generated
error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit status 1

This is recorded in the Sage trac as:

http://trac.sagemath.org/sage_trac/ticket/7028

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Michael Droettboom wrote:

This is a years-old known bug in distutils (which it looks like you've already commented on...). I've looked at it many times over those years, and it's really very difficult to fix from outside without terrible monkey-patching hacks that are certain to break on as many systems as they fix. We just may be forced to deal with it at this point, though. (FWIW, we run Solaris here, too, but we build matplotlib on gcc). I'll comment on that bug as well and see if we can get some movement on it.

In the meantime, I'll investigate whether the scons work by David Cournapeau resolves this problem. See here:

  http://github.com/cournape/matplotlib/tree/scons_build

Mike

Well, on SPARC, the Sun compilers are better than gcc, so there really is an advantage to getting this sorted out.

I do not know SCons myself, but I do know that in the Sage project, SCons has caused many issues. Whether it is a fault of SCons, or the way people write the code for SCons, I do not know.

I know recently someone changed a package that was using SCons, and stripped it all out. There is some code I need to fix, and I will take the same course of action. It seems more trouble than it is worth to me.

Dave

···

Dr. David Kirkby wrote:

I was trying to build matplotlib 0.99.0 as part of Sage

http://www.sagemath.org/

on a Sun Blade 2000 workstation running Solaris 10 update 7, using the Sun Studio compiler version 12.1 (not gcc).

CC and CXX were defined properly as C and C++ compilers, but it would appear that the C compiler is being called to compile the file src/ft2font.cpp, which is of course a C++ file.

You might get away with this with gcc, but the Sun C compiler will not compile C++ code.

Here's the error I get:

/opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/local/include -I. -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o
cc: No valid input files specified, no output generated
error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit status 1

This is recorded in the Sage trac as:

http://trac.sagemath.org/sage_trac/ticket/7028

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

Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  

Dr. David Kirkby wrote:

Well, on SPARC, the Sun compilers are better than gcc, so there really is an
advantage to getting this sorted out.
  
numscons should support the Sun Studio compiler.

I do not know SCons myself, but I do know that in the Sage project, SCons has
caused many issues. Whether it is a fault of SCons, or the way people write the
code for SCons, I do not know.
  
That's because scons is a terrible tool for a full packaging solution:
at the moment, it is really just a (quite good) make replacement. But
numscons does not have this problem, as it reuses distutils for all the
packaging, and handles compilers in its own way.

I am pretty sure it will be easier to fix whatever numscons issues crop
up while trying to build matplotlib than building it from scratch or
worse, trying to fix distutils.

cheers,

David

A colleague of mine also suggested an alternative workaround that is almost humorously simple. Define both the C and C++ compilers to be "CC" when building matplotlib. That is, set the environment variable "CC" to "CC" and "CXX" to "CC". Distutils will then use the C++ compiler for everything (which for matplotlib we get lucky and it just works).

Mike

Michael Droettboom wrote:

···

I've attached patches against Python 2.5 and 2.6 to that bug. Neither is significantly different from the original patch.

Issue 1222585: C++ compilation support for distutils - Python tracker

Once doing that, you'll also need to make the following change to matplotlib so that the correct C++ runtime libraries are used. Once I figure out how to correctly detect the compiler being used, I'll make this change in the matplotlib SVN repository. (This is non-trivial, since distutils doesn't have a Sun compiler specialization -- it uses the "generic" Unix compiler support for both gcc and Sun Studio.)

Mike

Index: setupext.py

--- setupext.py (revision 7979)
+++ setupext.py (working copy)
@@ -221,7 +221,7 @@
if sys.platform == 'win32' and win32_compiler == 'msvc':
     std_libs =
else:
- std_libs = ['stdc++', 'm']
+ std_libs = ['m', 'Crun', 'Cstd']

def has_pkgconfig():
     if has_pkgconfig.cache is not None:

Michael Droettboom wrote:
  

This is a years-old known bug in distutils (which it looks like you've already commented on...). I've looked at it many times over those years, and it's really very difficult to fix from outside without terrible monkey-patching hacks that are certain to break on as many systems as they fix. We just may be forced to deal with it at this point, though. (FWIW, we run Solaris here, too, but we build matplotlib on gcc). I'll comment on that bug as well and see if we can get some movement on it.

In the meantime, I'll investigate whether the scons work by David Cournapeau resolves this problem. See here:

   http://github.com/cournape/matplotlib/tree/scons_build

Mike

Dr. David Kirkby wrote:
  

I was trying to build matplotlib 0.99.0 as part of Sage

http://www.sagemath.org/

on a Sun Blade 2000 workstation running Solaris 10 update 7, using the Sun Studio compiler version 12.1 (not gcc).

CC and CXX were defined properly as C and C++ compilers, but it would appear that the C compiler is being called to compile the file src/ft2font.cpp, which is of course a C++ file.

You might get away with this with gcc, but the Sun C compiler will not compile C++ code.

Here's the error I get:

/opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/local/include -I. -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o
cc: No valid input files specified, no output generated
error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit status 1

This is recorded in the Sage trac as:

http://trac.sagemath.org/sage_trac/ticket/7028

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Michael Droettboom wrote:

A colleague of mine also suggested an alternative workaround that is almost humorously simple. Define both the C and C++ compilers to be "CC" when building matplotlib. That is, set the environment variable "CC" to "CC" and "CXX" to "CC". Distutils will then use the C++ compiler for everything (which for matplotlib we get lucky and it just works).

Mike

As I understand it, C++ compilers do not generate as efficient binaries as C compilers do, so there would be a loss of speed I think. How much I do not know.

That seems more of a hack than a real solution to the problem, though in some cases, hacks are the best choice.

I know nothing about mathplotlib, other than it presented issues on Solaris. If it not CPU/memory intensive, then I suspect the performance penalty of using a C++ compiler to compile C could would not be significant.

David Kirkby.

···

Michael Droettboom wrote:

I've attached patches against Python 2.5 and 2.6 to that bug. Neither is significantly different from the original patch.

Issue 1222585: C++ compilation support for distutils - Python tracker

Once doing that, you'll also need to make the following change to matplotlib so that the correct C++ runtime libraries are used. Once I figure out how to correctly detect the compiler being used, I'll make this change in the matplotlib SVN repository. (This is non-trivial, since distutils doesn't have a Sun compiler specialization -- it uses the "generic" Unix compiler support for both gcc and Sun Studio.)

Mike

Index: setupext.py

--- setupext.py (revision 7979)
+++ setupext.py (working copy)
@@ -221,7 +221,7 @@
if sys.platform == 'win32' and win32_compiler == 'msvc':
     std_libs =
else:
- std_libs = ['stdc++', 'm']
+ std_libs = ['m', 'Crun', 'Cstd']

def has_pkgconfig():
     if has_pkgconfig.cache is not None:

Michael Droettboom wrote:

This is a years-old known bug in distutils (which it looks like you've already commented on...). I've looked at it many times over those years, and it's really very difficult to fix from outside without terrible monkey-patching hacks that are certain to break on as many systems as they fix. We just may be forced to deal with it at this point, though. (FWIW, we run Solaris here, too, but we build matplotlib on gcc). I'll comment on that bug as well and see if we can get some movement on it.

In the meantime, I'll investigate whether the scons work by David Cournapeau resolves this problem. See here:

   http://github.com/cournape/matplotlib/tree/scons_build

Mike

Dr. David Kirkby wrote:
     

I was trying to build matplotlib 0.99.0 as part of Sage

http://www.sagemath.org/

on a Sun Blade 2000 workstation running Solaris 10 update 7, using the Sun Studio compiler version 12.1 (not gcc).

CC and CXX were defined properly as C and C++ compilers, but it would appear that the C compiler is being called to compile the file src/ft2font.cpp, which is of course a C++ file.

You might get away with this with gcc, but the Sun C compiler will not compile C++ code.

Here's the error I get:

/opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/local/include -I. -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o
cc: No valid input files specified, no output generated
error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit status 1

This is recorded in the Sage trac as:

http://trac.sagemath.org/sage_trac/ticket/7028

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

Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
            

Dr. David Kirkby wrote:

Michael Droettboom wrote:

A colleague of mine also suggested an alternative workaround that is almost humorously simple. Define both the C and C++ compilers to be "CC" when building matplotlib. That is, set the environment variable "CC" to "CC" and "CXX" to "CC". Distutils will then use the C++ compiler for everything (which for matplotlib we get lucky and it just works).

Mike

As I understand it, C++ compilers do not generate as efficient binaries as C compilers do, so there would be a loss of speed I think. How much I do not know.

That seems more of a hack than a real solution to the problem, though in some cases, hacks are the best choice.

I know nothing about mathplotlib, other than it presented issues on Solaris. If it not CPU/memory intensive, then I suspect the performance penalty of using a C++ compiler to compile C could would not be significant.

It's mostly C++ anyway, with the exception of some of the font conversion, contouring and the (mostly obsolete) Gdk extension. I suspect it makes very little difference.

Mike

···

David Kirkby.

Michael Droettboom wrote:

I've attached patches against Python 2.5 and 2.6 to that bug. Neither is significantly different from the original patch.

Issue 1222585: C++ compilation support for distutils - Python tracker

Once doing that, you'll also need to make the following change to matplotlib so that the correct C++ runtime libraries are used. Once I figure out how to correctly detect the compiler being used, I'll make this change in the matplotlib SVN repository. (This is non-trivial, since distutils doesn't have a Sun compiler specialization -- it uses the "generic" Unix compiler support for both gcc and Sun Studio.)

Mike

Index: setupext.py

--- setupext.py (revision 7979)
+++ setupext.py (working copy)
@@ -221,7 +221,7 @@
if sys.platform == 'win32' and win32_compiler == 'msvc':
     std_libs =
else:
- std_libs = ['stdc++', 'm']
+ std_libs = ['m', 'Crun', 'Cstd']

def has_pkgconfig():
     if has_pkgconfig.cache is not None:

Michael Droettboom wrote:

This is a years-old known bug in distutils (which it looks like you've already commented on...). I've looked at it many times over those years, and it's really very difficult to fix from outside without terrible monkey-patching hacks that are certain to break on as many systems as they fix. We just may be forced to deal with it at this point, though. (FWIW, we run Solaris here, too, but we build matplotlib on gcc). I'll comment on that bug as well and see if we can get some movement on it.

In the meantime, I'll investigate whether the scons work by David Cournapeau resolves this problem. See here:

   http://github.com/cournape/matplotlib/tree/scons_build

Mike

Dr. David Kirkby wrote:
    

I was trying to build matplotlib 0.99.0 as part of Sage

http://www.sagemath.org/

on a Sun Blade 2000 workstation running Solaris 10 update 7, using the Sun Studio compiler version 12.1 (not gcc).

CC and CXX were defined properly as C and C++ compilers, but it would appear that the C compiler is being called to compile the file src/ft2font.cpp, which is of course a C++ file.

You might get away with this with gcc, but the Sun C compiler will not compile C++ code.

Here's the error I get:

/opt/xxxsunstudio12.1/bin/cc -DNDEBUG -O -xcode=pic32 -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/lib/python2.6/site-packages/numpy/core/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/local/include -I. -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/ -I/export/home/drkirkby/sage/gcc32/sage-4.1.2.alpha2/local/include/python2.6 -c src/ft2font.cpp -o build/temp.solaris-2.10-sun4u-2.6/src/ft2font.o
cc: No valid input files specified, no output generated
error: command '/opt/xxxsunstudio12.1/bin/cc' failed with exit status 1

This is recorded in the Sage trac as:

http://trac.sagemath.org/sage_trac/ticket/7028

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

Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
            
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA