107

I'm trying to build: https://github.com/kanzure/nanoengineer

But it looks like it errors out on:

gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/python2.7   -std=c99 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -MT libstructcompare_a-structcompare.o -MD -MP -MF .deps/libstructcompare_a-structcompare.Tpo -c -o libstructcompare_a-structcompare.o `test -f 'structcompare.c' || echo './'`structcompare.c
gcc: error: x86_64-linux-gnu-gcc: No such file or directory

x86_64-linux-gnu-gcc definitely exists in /usr/bin (It's a symlink) and the target definitely exists as well. It looks to me like the Makefile wasn't generated correctly, perhaps there is a flag that should be passed before specifying x86_64-linux-gnu-gcc? I am unsure as well what specifying x86_64-linux-gnu-gcc is supposed to accomplish.

Finally, this makefile was generated by configure, so once we narrow down the cause of the error, I'll have to figure out what files to modify in order to fix this. (I'm a CMake kind of guy myself, but of course I didn't choose the build system for this project.) My OS is Debian.

I've tried building this branch as well: https://github.com/kanzure/nanoengineer/branches/kirka-updates

If you can try getting this to build on your system, I would greatly appreciate it! Thanks!

cat pants
  • 1,485
  • 4
  • 13
  • 22
  • 4
    Do you have python-dev package installed? – P̲̳x͓L̳ Mar 22 '14 at 00:53
  • 1
    How did you invoke the `configure` script? It looks like you added garbage to CXXFLAGS or something. Where does `x86_64-linux-gnu-gcc` appear inside the `Makefile`? – DanielKO Mar 22 '14 at 17:12
  • Yes, python-dev is installed. I invoked configure with "./configure". I greped the entire 449MB (!) source tree for x86_64-linux-gnu-gcc but no results. I also tried building on a different machine, and I ended up with the exact same error. I appreciate the help. Thanks!! – cat pants Mar 23 '14 at 04:45
  • I grabbed this branch instead, thinking maybe that error was fixed: https://github.com/kanzure/nanoengineer/branches/kirka-updates but no luck! – cat pants Mar 23 '14 at 20:03
  • 1
    cat pants, please, run the gcc command with `-v` option added and post its output. Actually the error in the posted command is `gcc ...options... x86_64-linux-gnu-gcc ..options..` and gcc trys to use `x86_64-linux-gnu-gcc` as input file, which is wrong. So, you should debug the Makefile. – osgx Mar 27 '14 at 10:56
  • And can anybody explain to me *why* one might specify `x86_64-linux-gnu-gcc` as a flag unto itself? `man gcc` doesn't give me any clues. Can it be safely removed from the command? – AndyG Mar 27 '14 at 18:59
  • 2
    @AndyG That's where the error is coming from - the command being run is `gcc ... x86_64-linux-gnu-gcc ...` - `gcc` doesn't see the `x86_64-linux-gnu-gcc` argument as an option/flag/etc, so assumes it is a file that it is supposed to compile. Since it has no path attached, it assumes that the file should be in the current directory, doesn't find it, and produces the error message. Why that command line is what it is, though is an issue with `configure` or how it was run, or with the `Makefile` - the command as listed does not make sense. – twalberg Mar 27 '14 at 19:43
  • Once fully configured you still can't find that string in any of the files in the nanoengineer directory? What about in your environment? Does `env` or `declare` contain it? – Etan Reisner Mar 27 '14 at 20:05
  • cat pants, can you please try to remove the entire nanoengineer directory (or rename it) and run through my instructions below? If it still doesn't work can you post the results of the command env as Etan suggested. Also, can you let me know exactly what version of Debian you are using? The instructions below work fine for me on Debian 7.4 x86_64. – mdadm Mar 28 '14 at 01:51
  • cat pants... did my latest update resolve the issue? are you able to get the program to compile and run now? Check the troubleshooting section of my answer, the part on x86_64-linux-gnu-gcc should get you past this problem now. – mdadm Mar 31 '14 at 18:26
  • mdadm, many many thanks to you. You have gone above and beyond anything I expected when I posted this question, and for that I am very grateful! Due to my current schedule I have not had a chance to try the instructions for jessie just yet, but my plan is to try that tonight. At any rate, I'll mark your answer as accepted, because...wow!! :D – cat pants Mar 31 '14 at 19:51

10 Answers10

121

After a fair amount of work, I was able to get it to build on Ubuntu 12.04 x86 and Debian 7.4 x86_64. I wrote up a guide below. Can you please try following it to see if it resolves the issue?

If not please let me know where you get stuck.

Install Common Dependencies

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

Install NumArray 1.5.2

wget http://goo.gl/6gL0q3 -O numarray-1.5.2.tgz
tar xfvz numarray-1.5.2.tgz
cd numarray-1.5.2
sudo python setup.py install

Install Numeric 23.8

wget http://goo.gl/PxaHFW -O numeric-23.8.tgz
tar xfvz numeric-23.8.tgz
cd Numeric-23.8
sudo python setup.py install

Install HDF5 1.6.5

wget ftp://ftp.hdfgroup.org/HDF5/releases/hdf5-1.6/hdf5-1.6.5.tar.gz
tar xfvz hdf5-1.6.5.tar.gz
cd hdf5-1.6.5
./configure --prefix=/usr/local
sudo make 
sudo make install

Install Nanoengineer

git clone https://github.com/kanzure/nanoengineer.git
cd nanoengineer
./bootstrap
./configure
make
sudo make install

Troubleshooting

On Debian Jessie, you will receive the error message that cant pants mentioned. There seems to be an issue in the automake scripts. x86_64-linux-gnu-gcc is inserted in CFLAGS and gcc will interpret that as a name of one of the source files. As a workaround, let's create an empty file with that name. Empty so that it won't change the program and that very name so that compiler picks it up. From the cloned nanoengineer directory, run this command to make gcc happy (it is a hack yes, but it does work) ...

touch sim/src/x86_64-linux-gnu-gcc

If you receive an error message when attemping to compile HDF5 along the lines of: "error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments", then modify the file perform/zip_perf.c, line 548 to look like the following and then rerun make...

output = open(filename, O_RDWR | O_CREAT, S_IRUSR|S_IWUSR);

If you receive an error message about Numeric/arrayobject.h not being found when building Nanoengineer, try running

export CPPFLAGS=-I/usr/local/include/python2.7
./configure
make
sudo make install

If you receive an error message similar to "TRACE_PREFIX undeclared", modify the file sim/src/simhelp.c lines 38 to 41 to look like this and re-run make:

#ifdef DISTUTILS
static char tracePrefix[] = "";
#else
static char tracePrefix[] = "";

If you receive an error message when trying to launch NanoEngineer-1 that mentions something similar to "cannot import name GL_ARRAY_BUFFER_ARB", modify the lines in the following files

/usr/local/bin/NanoEngineer1_0.9.2.app/program/graphics/drawing/setup_draw.py
/usr/local/bin/NanoEngineer1_0.9.2.app/program/graphics/drawing/GLPrimitiveBuffer.py
/usr/local/bin/NanoEngineer1_0.9.2.app/program/prototype/test_drawing.py

that look like this:

from OpenGL.GL import GL_ARRAY_BUFFER_ARB
from OpenGL.GL import GL_ELEMENT_ARRAY_BUFFER_ARB

to look like this:

from OpenGL.GL.ARB.vertex_buffer_object import GL_ARRAY_BUFFER_AR
from OpenGL.GL.ARB.vertex_buffer_object import GL_ELEMENT_ARRAY_BUFFER_ARB

I also found an additional troubleshooting text file that has been removed, but you can find it here

Dima Tisnek
  • 11,241
  • 4
  • 68
  • 120
mdadm
  • 1,333
  • 1
  • 12
  • 9
  • Looks like I still have it there, I never removed it: http://diyhpl.us/~bryan/irc/nanoengineer/kirka_NE1_work_log.txt – kanzure Mar 28 '14 at 02:38
  • Thanks, I must have ended up at a bad URL. – mdadm Mar 28 '14 at 02:40
  • Thank you so much for your work here. I had "libhdf5-dev" installed via apt, I removed that and installed HDF5 1.6.5 via source the way you described. However, I'm still getting the same error: gcc: error: x86_64-linux-gnu-gcc: No such file or directory. I'm running Debian jessie though. I wonder if that's the problem here. (I opted for jessie over 7 originally as 7 doesn't have drivers for my wifi card.) Thanks! – cat pants Mar 29 '14 at 18:35
  • 1
    Cool. Thanks, let me try Jessie and see if I can reproduce. Did you try starting over from scratch with a new clone of the nanoengineer directory, all the packages described in the first step, then running bootstrap, and then configure? – mdadm Mar 29 '14 at 19:02
  • Yep, fresh clone. All steps followed as described above, although I already had Numeric 24.2 installed rather than Numeric 23.8. Unsure how to uninstall via setup.py. Thanks! – cat pants Mar 29 '14 at 21:16
  • 1
    Okay, I was able to get Debian Jessie loaded and reproduced the issue. I'm rather rusty on automake and m4, and there seems to be an error somewhere that is causing an erroneous x86_64-linux-gnu-gcc to show up in the compile command. Here is a workaround, that lets me get past the error and compile everything. From the nanoengineer directory run touch src/sim/x86_64-linux-gnu-gcc ... this will give gcc an empty file, and make it shut up. It is a nasty hack, but it works :) I'll keep digging around and see if I can find a way to fix the automake system. – mdadm Mar 30 '14 at 06:35
  • I added another troubleshooting step. It seems that there was some modifications to the version of python-opengl on Jessie, and 3 of the nanoengineer python files need to be updated. See the new note in the troubleshooting section. It seems to all be running just fine for me now on Jessie. – mdadm Mar 30 '14 at 06:58
  • Following your awesome instructions, this compiles and installs!! Although currently getting the following now when trying to run NanoEngineer-1: ImportError: No module named idlelib.Delegator – cat pants Mar 31 '14 at 23:20
  • @catpants try installing idle-python2.7 via apt-get... that should take care of it (at least it did for me). Thanks for accepting the answer. Don't forget to award the bounty if you think my answer is worthy of it :) – mdadm Mar 31 '14 at 23:26
  • Ah, never mind on the idlelib issue, the dependencies weren't fully installed. – cat pants Mar 31 '14 at 23:44
  • It runs!! :D I had to fix the OpenGL stuff too, but it seems to be working. I can load and display molecules and all that. Thank you so much for your help!! – cat pants Mar 31 '14 at 23:55
  • This is not right approach, we shouldn't install all the common packages if most of them aren't required. – Nitin Bhojwani Jul 14 '19 at 17:03
  • It's been a while since I wrote this, but I'm pretty sure every package I installed was required to build it. It's certainly likely some could be removed after though. If you've found some that are not needed to build, or are no longer needed this is a community wiki now so please update. – mdadm Sep 27 '19 at 16:30
97

You just need to enter this command:

sudo apt install python-dev gcc
Blairg23
  • 11,334
  • 6
  • 72
  • 72
Liao Zhuodi
  • 3,144
  • 5
  • 26
  • 46
60

the error can be due to one of several missing package. Below command will install several packages like g++, gcc, etc.

sudo apt-get install build-essential
StackUP
  • 1,233
  • 12
  • 22
30
apt-get install python-dev

...solved the problem for me.

Stephan Kristyn
  • 15,015
  • 14
  • 88
  • 147
10

sudo apt-get -y install python-software-properties && \
sudo apt-get -y install software-properties-common && \
sudo apt-get -y install gcc make build-essential libssl-dev libffi-dev python-dev

You need the libssl-dev and libffi-dev if especially you are trying to install python's cryptography libraries or python libs that depend on it(eg ansible)

Komu
  • 14,174
  • 2
  • 28
  • 22
  • Thank you for that - I wasn't installing Autotools but ReviewBoard and it required the libssl-dev and libffi-dev packages to complete the `pip install` step – Robert Petz Aug 08 '16 at 17:07
6

What worked for me is : sudo apt-get install python3-dev build-essential gcc libpq-dev

Arjun
  • 105
  • 2
  • 8
6

Maybe you should install python3-pip
It worked for me.

sudo apt install python3-pip
MD Mushfirat Mohaimin
  • 1,966
  • 3
  • 10
  • 22
Reza Zarin
  • 61
  • 1
  • 3
0

I was getting the error “gcc: error: x86_64-linux-gnu-gcc: No such file or directory” as I was trying to build a simple c-extension module to run in Python. I tried all the things above to no avail, and finally realized that I had an error in my module.c code! So I thought it would be helpful to add that, if you are getting this error message but you have python-dev and everything correctly installed, you should look for issues in your code.

camelia
  • 1
  • 1
  • I'm not sure this answers the question asked. Moreover, other answers more complete than yours have already been published. – Joseph Budin Oct 02 '20 at 08:05
0

try sudo apt-get -y install unixodbc-dev it worked for me

Sergey Ka
  • 25
  • 9
  • 1
    From the [debian package page of `unixodbc-dev`](https://packages.debian.org/en/sid/unixodbc-dev): "You should not need to install this package unless you intend to develop C language applications which use ODBC, or to compile ODBC-using applications from source". I quickly searched through the source code of nanoengineer but I found no dependency on ODBC. – He3lixxx Jul 13 '21 at 11:25
0

I'm facing the same issue (error message) with django.cryptography installation.

Steps that helps me:

  1. Upgrade pip (as recomendation taken from cryptography: pip3 install --upgrade pip
  2. Install cryptography as it is one of requirements for django.cryptography and was missed in my case: pip3 install cryptography
  3. And finally error is gone and I can install django.cryptography and start using encrypted fields.
Kiryl
  • 180
  • 13