# Using Mkmf to Verify Libraries

**URL:** <https://www.ruby-forum.com/t/using-mkmf-to-verify-libraries/78476>\
**Category:** Ruby\
**Created:** [December 6, 2006, 1:51am UTC](https://www.ruby-forum.com/t/using-mkmf-to-verify-libraries/78476 "2006-12-06T01:51:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [December 6, 2006, 1:51am UTC](https://www.ruby-forum.com/t/using-mkmf-to-verify-libraries/78476/1 "2006-12-06T01:51:21Z")

</div>

Hi,

I’m trying to use the ‘mkmf’ library to determine if a given library is  
installed.

I have two identical machines.

On machine 1:  
find\_library(‘mysqlclient’, ‘mysql\_query’, ‘/path/to/lib’) =\> true

On machine 2:  
find\_library(‘mysqlclient’, ‘mysql\_query’, ‘/path/to/lib’) =\> false

I’m stumped. Does anyone have any idea what could be causing this?

libmysqlclient.a is installed in the exact same location on both  
machines.

Regards,  
Steven

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [December 6, 2006, 3:01am UTC](https://www.ruby-forum.com/t/using-mkmf-to-verify-libraries/78476/2 "2006-12-06T03:01:33Z")

</div>

Steven H. wrote:

> On machine 2:  
> find\_library(‘mysqlclient’, ‘mysql\_query’, ‘/path/to/lib’) =\> false
> 
> I’m stumped. Does anyone have any idea what could be causing this?
> 
> libmysqlclient.a is installed in the exact same location on both machines.

The last time I hit a similar situation it turned out I didn’t have read  
permissions on the library I was looking for. That may be it.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [December 6, 2006, 12:33pm UTC](https://www.ruby-forum.com/t/using-mkmf-to-verify-libraries/78476/3 "2006-12-06T12:33:13Z")

</div>

2006/12/6, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > I have two identical machines.
> 
> Careful, ‘identical’ means the md5sum of all disks match

Same md5 doesn’t mean identical.

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [December 6, 2006, 5:59pm UTC](https://www.ruby-forum.com/t/using-mkmf-to-verify-libraries/78476/4 "2006-12-06T17:59:10Z")

</div>

removed\_email\_address@domain.invalid wrote:

> > machines.  
> > Cheers,
> 
> Vince

Daniel and Vince, thanks for the leads. 🙂

Regards,  
Steven

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [December 6, 2006, 10:32am UTC](https://www.ruby-forum.com/t/using-mkmf-to-verify-libraries/78476/5 "2006-12-06T10:32:49Z")

</div>

> I have two identical machines.  
>   
> Careful, ‘identical’ means the md5sum of all disks match and the hardware is the same. That’s hard ;-)…  
>   
> \> On machine 1:  
> \> find\_library(‘mysqlclient’, ‘mysql\_query’, ‘/path/to/lib’) =\> true  
> \> On machine 2:  
> \> find\_library(‘mysqlclient’, ‘mysql\_query’, ‘/path/to/lib’) =\> false  
> \> libmysqlclient.a is installed in the exact same location on both   
> \> machines.  
>   
> There are several things that could be causing this. First, are you sure that the rbconfig.rb files are the same in both machines ? There are several path stored in this file. Moreover, mkmf is aware of some environment variables. Check first that   
> set   
> and   
> ruby -r rbconfig -e ‘p Config::CONFIG’   
> gives you the same things. If not, it should be easy to track the problem.  
>   
> Cheers,  
>   
> Vince
