Getting Data In

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

davecroto
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?

my_splunk_machine:MySQL-python-1.2.3 splunker$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.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 install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-universal-2.6/MySQLdb
running build_ext
building 'mysql' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,3,'final',0) -D
version_=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 x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
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

dwaddle
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

badben
New Member

Hello,

Same issue.
Did you found the solution ?
Thanks.

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...