I got cannot compile OCI error while installing ruby-oci8 on linux
the command i used is gem install ruby-oci8 -v '2.2.7'
i'm using oracle full client
[root#advlints01 redf]# gem install 'ruby-oci8' -v '2.2.7'
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7/ext/oci8
/usr/local/rvm/rubies/ruby-2.5.1/bin/ruby -I /usr/local/rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190916-29697-1loq660.rb extconf.rb
checking for load library path...
LD_LIBRARY_PATH...
checking /oracle/app/oracle/product/12.2.0/client_1/lib... skip: /oracle/app/oracle/product/12.2.0/client_1/lib/libclntsh.so.12.1 is for i386 cpu.
checking ld.so.conf... no
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for sys/types.h... yes
checking for ruby header... ok
Get the version of Oracle from SQL*Plus... 1220
try -I/oracle/app/oracle/product/12.2.0/client_1/rdbms/public
checking for oci.h... yes
checking for OCIEnvCreate() in oci.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/rvm/rubies/ruby-2.5.1/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
/usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7/ext/oci8/oraconf.rb:755:in `initialize': RuntimeError (RuntimeError)
from /usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7/ext/oci8/oraconf.rb:269:in `new'
from /usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7/ext/oci8/oraconf.rb:269:in `get'
from extconf.rb:22:in `<main>'
---------------------------------------------------
Error Message:
cannot compile OCI
Backtrace:
/usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7/ext/oci8/oraconf.rb:755:in `initialize'
/usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7/ext/oci8/oraconf.rb:269:in `new'
/usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7/ext/oci8/oraconf.rb:269:in `get'
extconf.rb:22:in `<main>'
---------------------------------------------------
See:
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-full-client.md for Oracle full client
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-instant-client.md for Oracle instant client
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-on-osx.md for OS X
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/report-installation-issue.md to report an issue.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/extensions/x86_64-linux/2.5.0/ruby-oci8-2.2.7/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/gems/ruby-oci8-2.2.7 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.5.1#real_estate_fund/extensions/x86_64-linux/2.5.0/ruby-oci8-2.2.7/gem_make.out
[root#advlints01 redf]#
Looks like I found the cause of the issue. Im running arch linux (manjaro 18 xfce), there is a specific to arch linux oracle installation process using makepkg and pacman, so, everything goes ok with oracle-xe package and after installing it I can run sqlplus and connect to xe database which is a database created by default (usually), but I was not able to compile ruby-oci8 gem (2.2.8 v), after some researches I've found out that the problem were missing links in $ORACLE_HOME/lib folder:
libclntsh.so -> libclntsh.so.11.1 and
libocci.so -> libocci.so.11.1
11.1 is a lib version (it depends on oracle version, eg. 11.2, 19.5 and etc.)
After creating these links via ln -s under oracle user, ruby-oci8 can be compiled.
Note:
I'm using a full oracle client instead of instant one and all the guides do not say a word about linking these .so files but all the guides related to instant client do say it =D, here is a guide from developer of ruby-oci8 - instant client installation
Related
I'm trying to install a gem ruby-oci8 on the rails.
I get the following error,
$ gem install ruby-oci8
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
current directory: /home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8
/home/solovievga/.rvm/rubies/ruby-2.4.2/bin/ruby -r ./siteconf20180213-21757-1hli0rl.rb extconf.rb
checking for load library path...
LD_LIBRARY_PATH is not set.
checking ld.so.conf... no
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for sys/types.h... yes
checking for ruby header... ok
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/solovievga/.rvm/rubies/ruby-2.4.2/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
/home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:909:in `get_home': RuntimeError (RuntimeError)
from /home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:728:in `initialize'
from /home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:269:in `new'
from /home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:269:in `get'
from extconf.rb:22:in `<main>'
---------------------------------------------------
Error Message:
Set the environment variable ORACLE_HOME if Oracle Full Client.
Append the path of Oracle client libraries to LD_LIBRARY_PATH if Oracle Instant Client.
Backtrace:
/home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:909:in `get_home'
/home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:728:in `initialize'
/home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:269:in `new'
/home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1/ext/oci8/oraconf.rb:269:in `get'
extconf.rb:22:in `<main>'
---------------------------------------------------
See:
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-full-client.md for Oracle full client
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-instant-client.md for Oracle instant client
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-on-osx.md for OS X
* http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/report-installation-issue.md to report an issue.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/solovievga/.rvm/gems/ruby-2.4.2/extensions/x86_64-linux/2.4.0/ruby-oci8-2.2.5.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/solovievga/.rvm/gems/ruby-2.4.2/gems/ruby-oci8-2.2.5.1 for inspection.
Results logged to /home/solovievga/.rvm/gems/ruby-2.4.2/extensions/x86_64-linux/2.4.0/ruby-oci8-2.2.5.1/gem_make.out
I wonder how I can install the ruby-oci8 package?
You have to set LD_LIBRARY_PATH to install ruby-oci8 gem. Here I am assuming you are using linux os. Try this on your terminal.
$ LD_LIBRARY_PATH=$ORACLE_HOME/lib
$ export LD_LIBRARY_PATH
$ gem install ruby-oci8
Edit:
If you uses mswin32 ruby, use the following command instead.
gem install --platform x86-mingw32 ruby-oci8
or
gem install --platform x64-mingw32 ruby-oci8
Let me know If you have any query or question.
Happy Coding
These steps take you through the instant client installation process as well, just to provide some context. Download the instant and SDK zip files here:
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Unzip both files in the following directory as root.
/opt/oracle
Enter the instantclient_12_2 directory following the unzip and create a symlink for the libclntsh.so file:
ln -s libclntsh.so.12.1 libclntsh.so
Now, depending on your OS, you'll need to update your LD_LIBRARY_PATH location. In Ubuntu, do the following:
sudo nano /etc/ld.so.conf.d/moreLibs.conf
And enter the following in the file and save
/opt/oracle/instantclient_12_2
Now run the following command:
sudo ldconfig
And rerun your gem install
gem install ruby-oci8
This solution worked for me
Before executing bundle install, Run below code on the console or add it to bash and source.
Export OCI_DIR=/opt/oracle/instantclient_12_2
Here /opt/oracle/instantclient_12_2 is path to instantclient on my mac machine.
You need to download instantclient from
https://www.oracle.com/database/technologies/instant-client/downloads.html
Unzip the download into /opt/oracle directory and export OCI_DIR environment variable.
I have a similar problem installing the ruby-oci8 gem. In my case, there is already an app that uses it. When I deployed another app using the same gem, during bundle install, this error occurred. It asked for the LD_LIBRARY_PATH environment variable. Apparently, the installer of the old app did not set the variable to persist.
I thought that there should be an oracle library somewhere in the server so I searched for it. It was not in /opt but in /usr/lib. I set the variable to /usr/lib/oracle/11.1/client64/lib then the gem was installed smoothly.
My first step when trying to install the gem puma is to enter gem install puma --version 2.12.3 into my command prompt. Then this error appears. I don't know what to make of it.
C:\Users>gem install puma --version 2.12.3
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150809-8352-14jkju1.rb extconf.rb
checking for BIO_read() in -lcrypto... no
checking for BIO_read() in -llibeay32... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-cryptolib
--without-cryptolib
--with-libeay32lib
--without-libeay32lib
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/puma-2
.12.3 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
/puma-2.12.3/gem_make.out
Once I receive this , I follow these instructions https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows
And I receive this error:
C:\Users>gem install puma -- --with-opt- dir=c:\
openssl
ERROR: Loading command: install (LoadError)
127: The specified procedure could not be found. - C:/Ruby22-x64/lib/r
uby/2.2.0/x64-mingw32/openssl.so
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Side note: here is the mkmf.log
mkmf.log
Please Help! thanks!
I think I have found answer for your question. Here the link
You must download OpenSSL libraries. There are two types OpenSSL libraries, one for 32bit other for 64bit.
After you installed them run gem install puma -- --with-opt-dir=D:\openssl
--with-opt-dir=D:\openssl is folder direction where you have downloaded libs.
Some tutorials have links to openssl which is for 32bit computers. I realized this after several failures. Then I have downloaded 64 bit version.
I created free account on heroku. Now I am trying this getting started. My DevKit Ruby and openssl are placed inside my D:\ disk, not C:\, beacuse there is reason why I can't use C:\ disk. All files directories are placed in my path.
I have tried to install puma gem by this method, only defference is that disk name is D:\.
When I run gem install puma -- --with-opt-dir=D:\openssl it throws me an long error:
D:\>gem install puma -- --with-opt-dir=D:\openssl
Building native extensions with: '--with-opt-dir=D:\openssl'
This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
D:/Ruby21-x64/bin/ruby.exe -r ./siteconf20150406-5096-1vz5x1.rb extconf.rb -
-with-opt-dir=D:\openssl
checking for BIO_read() in -lcrypto... no
checking for BIO_read() in -llibeay32... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=D:/Ruby21-x64/bin/ruby
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-cryptolib
--without-cryptolib
--with-libeay32lib
--without-libeay32lib
extconf failed, exit code 1
Gem files will remain installed in D:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/puma-2
.11.1 for inspection.
Results logged to D:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0
/puma-2.11.1/gem_make.out
UPDATE
I have copied my libeay32.dll and ssleay32.dll inside of my D:\openssl\bin to D:\Ruby21-x64\bin. It said me that it already has these files, so I replaced them.
When I run gem install puma -- --with-opt-dir=D:\openssl it still throws me an error.
I have found solution.
Heroku site in this link gives OpenSSL ONLY FOR x86. If you have x64 you need to download it from there.
I hope in future Heroku will provide x64 ssl links in their tutorials.
I am install Oracle Instant Client: Basic, SDK and SQL*Plus packages v 10.2.0.5.
mkdir /opt
mkdir /opt/oracle
cd /opt/oracle
unzip path/to/instantclient-basic-OS-VERSION.zip
unzip path/to/instantclient-sdk-OS-VERSION.zip
unzip path/to/instantclient-sqlplus-OS-VERSION.zip
after that i set vim ~/.oracle_client
export ORACLE_HOME=/opt/oracle/
export TNS_ADMIN=/admin/network/
export LD_LIBRARY_PATH="/opt/oracle/instantclient_10_2/"
echo "source ~/.oracle_client" >> ~/.bash_profile
source ~/.bash_profile
create tnsnames.ora and test connection sqlplus opsvod/agatb137#FESTEST
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Oct 31 14:55:17 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
But whan i try to install gem install ruby-oci8 -v '2.1.5' i have error:
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for load library path...
LD_LIBRARY_PATH...
checking /opt/oracle/instantclient_10_2/... skip: /opt/oracle/instantclient_10_2/libclntsh.so.10.1 is for i386 cpu.
checking ld.so.conf... skip: /opt/oracle/instantclient_10_2/libclntsh.so.10.1 is for i386 cpu.
no
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for sys/types.h... yes
checking for ruby header... ok
Get the version of Oracle from SQL*Plus... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-instant-client
--without-instant-client
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:760:in `get_version': RuntimeError (RuntimeError)
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:709:in `initialize'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `new'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `get'
from extconf.rb:18:in `<main>'
---------------------------------------------------
Error Message:
cannot get Oracle version from sqlplus
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:760:in `get_version'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:709:in `initialize'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `new'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `get'
extconf.rb:18:in `<main>'
---------------------------------------------------
See:
* http://ruby-oci8.rubyforge.org/en/HowToInstall.html
* http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/gem_make.out
How to resols this isue?
We don't install the gem for our Oracle deployments, but build from source:
Make sure that ORACLE_HOME is pointing to the oracle full client or oracle instaclient
Make sure that inside the $ORACLE_HOME/lib libclntsh.so exists as a symbolic link to libclntsh.so.11.1
Change into the ruby-oci8-2.1.x directory and run
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
Install activerecord-oracle_enhanced-adapter ONLY WHEN the ruby-oci8 adapter is installed.
skip: /opt/oracle/instantclient_10_2/libclntsh.so.10.1 is for i386 cpu.
The instant client is 32-bit.
checking for LP64... yes
The ruby is 64-bit.
The bitness of instant client must be same with that of ruby.
You need 64-bit instant client to use with the 64-bit ruby.
If you are by any chance trying to install this gem on Fedora 27 and are faced with a very similar error message, try to do:
dnf install rpm-build libnsl*
This fixed my errors (found it here).
EDIT: As of Fedora 28, libnsl* is no longer included as default dependency. This will make the ruby-oci8 gem fail for less than obvious reasons. The install directive above has been updated with this finding.
i just installed MAMP on this iMac and the rubygems but when i run:
sudo gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
gives me
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
ERROR: could not find gem — locally or in a repository
ERROR: could not find gem –with-mysql-config=/usr/local/mysql/bin/mysql_config locally or in a repository
how can i install this gem ?
I found this and worked out perfectly:
you can go to http://www.tmtm.org/en/ruby/mysql/ to download the tar
file, and run the command below
# ruby ./install.rb
to install the mysql.rb
Use the following it worked with me
brew install mysql
Do you have the Xcode developer tools installed on Mac OS X? If not, I'd start there.
You can download them here: http://developer.apple.com/technologies/xcode.html
Once you've installed that, try again.
i'm still getting this
$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
* extconf.rb failed *
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-mysql-config
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
You need the mysql development libs to compile it. If you were on linux you could use "yum install mysql-devel". Not sure about how to get them installed on a mac, but try downloading the connector libraries from here:
MySql Connector Downloads
You may have to pass in a --with-mysql-libs option to point to the directory when the C libraries are unpacked to. Hope this points you in the right direction.
Or you can just put the libraries in the default directory:
/usr/lib64/mysql
Download mysql-dev from mysql.com