Getting Data In
Highlighted

Unable to execute gcc-4.2 No such file or directory when adding MySQLdb Module

Splunk Employee
Splunk Employee

Trying to add the MySQLdb Module to my Splunk Python for Splunk scripted inputs from a db. It is complaining about gcc-4.2 Is there any suggestions on a safe way to add it or find it?

mysplunkmachine:MySQL-python-1.2.3 splunker$ sudo python setup.py install
running install
running bdistegg
running egg
info
writing MySQLpython.egg-info/PKG-INFO
writing top-level names to MySQL
python.egg-info/toplevel.txt
writing dependency
links to MySQLpython.egg-info/dependencylinks.txt
reading manifest file 'MySQLpython.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
writing manifest file 'MySQL
python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-universal/egg
running installlib
running build
py
copying MySQLdb/release.py -> build/lib.macosx-10.6-universal-2.6/MySQLdb
running buildext
building '
mysql' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLEDTRACE -pipe -Dversioninfo=(1,2,3,'final',0) -Dversion=1.2.3 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c mysql.c -o build/temp.macosx-10.6-universal-2.6/mysql.o -g -Os -arch x8664 -fno-common -DP10031BVISIBLE -DSIGNALWITHVIOCLOSE -DSIGNALSDONTBREAKREAD -DIGNORESIGHUPSIGQUIT -DDONTDECLARECXAPUREVIRTUAL
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1

Any help?

Tags (2)
0 Karma
Highlighted

Re: Unable to execute gcc-4.2 No such file or directory when adding MySQLdb Module

New Member

Hello,

Same issue.
Did you found the solution ?
Thanks.

0 Karma
Highlighted

Re: Unable to execute gcc-4.2 No such file or directory when adding MySQLdb Module

SplunkTrust
SplunkTrust

This really isn't a Splunk question, but it's been here forever and has double points so I'll try. 😄

It looks like you are compiling on an OS X machine. Normally gcc is not named gcc-4.2. Make sure your system has the gcc compiler - you may need to install it either from a ports package or install XCode. (My imac at home has XCode and has /usr/bin/gcc but not /usr/bin/gcc-4.2)

You have a variety of possible paths:

  • look for this code already compiled as part of a ports package
  • consult with the MySQL lists for assistance with compiling their driver
  • make sure you have gcc installed, then hack in a symlink to gcc-4.2 -> gcc like this

    sudo ln -s /usr/bin/gcc /usr/local/bin/gcc-4.2