I see that there are a number of topics on this error message, but I've tried every solution I have found to no avail. This is my first question here, but I'm going to try and include all of the info that has been useful in other threads.

I'm attempting to install the flagmatic software, which is a mathematical package that works with SAGE and python. However, I'm having a compiler issue. Namely when I run

sage -python setup.py install

I receive the output:

running install
running build
running build_py
running build_ext
skipping 'flagmatic/flag.c' Cython extension (up-to-date)
building 'flagmatic.flag' extension
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/lib/sagemath/local/include -I/usr/lib/sagemath/local/include/csage -I/usr/lib/sagemath/devel/sage/sage/ext -I/usr/lib/sagemath/devel/sage -I/usr/lib/sagemath/local/include/python2.7 -c flagmatic/flag.c -o build/temp.linux-x86_64-2.7/flagmatic/flag.o -O3 -Wall -Wno-strict-prototypes
**gcc: error trying to exec 'cc1': execvp: No such file or directory
error: command 'gcc' failed with exit status 1**

Where I've bolded the last bit for emphasis, as I believe it to be at the heart of my problem. I have reinstalled the package build-essential (sudo apt-get install build-essential) to no avail.

gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

cc --version
cc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

It seems like the compiler gcc can't find cc1 when I run it in sage. As far as I can tell, cc1 is located:

/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1

and when do this:

more /etc/environment

I get:

PATH="/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib"

It seems like since /usr/lib ins in my path, gcc should be looking there, correct? Is there an easy way to see why execvp can't find cc1 when I try and install the aforementioned package?

Please let me know if there is anything else that would be helpful re: my system specs or versions of anything. I will update here with edits:

EDIT:

gcc -print-prog-name=cc1
/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1

apt-cache policy cpp
cpp:
Installed: 4:4.8.2-1ubuntu6
Candidate: 4:4.8.2-1ubuntu6
Version table:
*** 4:4.8.2-1ubuntu6 0
500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
100 /var/lib/dpkg/status
  • IIRC gcc doesn't use $PATH to locate cc1: instead it uses built-in locations. What are the outputs of gcc -print-prog-name=cc1 and apt-cache policy cpp? – steeldriver Dec 29 '15 at 0:03
  • gcc -print-prog-name=cc1 /usr/lib/gcc/x86_64-linux-gnu/4.8/cc1 apt-cache policy cpp cpp: Installed: 4:4.8.2-1ubuntu6 Candidate: 4:4.8.2-1ubuntu6 Version table: *** 4:4.8.2-1ubuntu6 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages 100 /var/lib/dpkg/status EDITED to include the second bit of info. Will edit into the main post as well. – Bill Kay Dec 29 '15 at 0:09
  • Hmm... so I suspect that the installation process is invoking /usr/lib/sagemath/local/bin/gcc instead of the system's gcc – steeldriver Dec 29 '15 at 1:17
  • How did you install sage? If you used the AIMS ppa, it looks like their sagemath-upstream-binary package doesn't include a cc1 for the packaged gcc - but the package sagemath-upstream-binary-full does – steeldriver Dec 29 '15 at 1:29
  • I compiled sage from source. Should I install from a binary instead? – Bill Kay Dec 29 '15 at 1:36

How did you install sage? If you used the AIMS ppa, it looks like their sagemath-upstream-binary package doesn't include a cc1 for the packaged gcc - but the package sagemath-upstream-binary-full does –steeldriver

This comment was key. I uninstalled my version of SAGE and used the AIMS ppa with the package sagemath-upstream-binary-full. This fixed my CC1 issue.

An addendum: If you are here because of trouble with flagmatic, I was still receiving an error message about a failed cython compilation. In the file hypergraph_flag.pyx I changed line 38 from:

include "cdefs.pxi"

to

#include "cdefs.pxi"

Just in case you happened upon this thread specifically due to a flagmatic compilation error.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.