command 'cc' failed even though gcc is installed

I'm trying to build some python modules on a Solaris 10 machine. It has gcc as /usr/sfw/bin/gcc.

[root@localhost astLib-0.17.1]# CC=gcc python setup.py build
running build
running build_py
running build_ext
cc -c actread.c -o actread.o
unable to execute cc: No such file or directory
error: command 'cc' failed with exit status 1

How would I build this software on Solaris 10 - do I have to install another compiler?

Solaris has its own cc compiler. It looks like your makefile does not expect gcc.
Warning:
This means if you use gcc it may not succeed. Or work correctly if it does compile.

Try this for starters:

alias cc="/usr/sfw/bin/gcc"

That didn't work unfortunately. I think because (now that I've looked into it some more) this python module I'm trying to compile is using python's distutils. However even setting the compiler location directly using distutils functions doesn't work.

download the package again and install cc as well as gcc.
Simple solution.

When you download gcc from Sunfreeware - Freeware Open Source Software for Sun Microsystem's Solaris the precompiled package will install into /usr/local/bin.

Make sure this is in your PATH before you execute you command.

That should work.

I've just tried installing gcc from sunfreeware, but there's no cc binary:

/usr/local/bin/c++        
/usr/local/bin/cpp        
/usr/local/bin/g++        
/usr/local/bin/g77        
/usr/local/bin/gcc        
/usr/local/bin/gccbug     
/usr/local/bin/gcov       
/usr/local/bin/sparc-sun-solaris2.10-c++
/usr/local/bin/sparc-sun-solaris2.10-g++
/usr/local/bin/sparc-sun-solaris2.10-gcc
/usr/local/bin/sparc-sun-solaris2.10-gcc-3.4.6

Any other ideas?

I ended up using a different python install (python 2.5 now) and creating a cc symlink:
ln -s /usr/sfw/bin/gcc /usr/local/bin/cc

The compilation now works but fails on linking:

<unknown>                           0x3c60      PyWCSTools/src/worldpos.o
<unknown>                           0x3ca8      PyWCSTools/src/worldpos.o
<unknown>                           0x3cac      PyWCSTools/src/worldpos.o
<unknown>                           0x3cd4      PyWCSTools/src/worldpos.o
<unknown>                           0x3cd8      PyWCSTools/src/worldpos.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

This is likely due to discrepancies between gcc and cc options.
Why aren't you simply installing the real cc on the Solaris box ?

Sun Studio Downloads

Because it's like using a bazooka to take out a butterfly :slight_smile: A half gig download, a huge amount of space taken up on the root partition and a long installation process. I really can't understand why gcc doesn't just work, all I need is a compilation suite to build some software, it's not a development machine so I don't want a full massive IDE, SDKs etc.</rant>

But yeah if no one has any other suggestions I'll just bite the bullet and try Sun Studio :frowning: