Compiling Perl MySQL DBD on FreeBSB for BillMax

Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 15:43:24 von Peter LaForest

Hello,

I am a Unix newbie in desperate need of help.

We are building a billing server for our company:

OS: FreeBSD 4.6
APP: BillMax w/MySQL

I need to write some Perl DBI hooks to interact with the MySQL db.

I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.

I am trying to compile DBD-mysql-2.1020 and have read all available
documentation on how to set the --cflags and --libs when running Makefile.PL
but it still can't pass the make test. It fails 96% of the tests.

I know that there is also the issue with different compilers and I have
tried to tell Makefile to use gcc but I can't seem to get the syntax right
for my Makefile command.

Here is the info:

gcc is at /usr/lib/libgcc.a

mysql.h is at /usr/local/billmax/mysql/include/mysql

libs are at /usr/local/billmax/mysql/lib/mysql (libmysqlclient.so)

test db/user/pw are not default so I have to set these as well


I would be most appreciative if someone could help me get the syntax down
for the Makefile command.

Thank you.


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1937@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 17:43:20 von bruceablk

I had a similar problem where I compiled MySQL on my own. I tried to
compile DBD::MySQL I was using the following commands:

perl Makefile.PL \
--cflags=-I/usr/local/mysql/include/mysql \
--libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

When I ran this it would tell me -lmysqlclient -lz -lcrypt -lnsl -lm were
unknown options. I found these from getting into the MySQL bin directory
and running the following commands:
mysql_config --cflags
mysql_config --libs

After reading a bunch of archives I was still at a loss. The MySQL bin
directory was not part of roots path. I ran the command:
echo $PATH
And found out what was in my path. I then added a sym link to the
mysql_config file
ln -s /usr/local/mysql/bin/mysql_config /root/bin/mysql_config

I went back and did the makefile stuff without the --cflags and --libs
directives and it worked!
perl Makefile.PL

The make test had a couple failed tests with the test database. I had read
that this was common so I continued with the make install. My Perl scripts
are connecting fine to the MySQL database now.

Maybe this will help someone out there. My Perl was from a RedHat RPM,
MySQL was from source, DBI from source, DBD from source.

Bruce

-----Original Message-----
From: Peter LaForest [mailto:plaforest@fish5.com]
Sent: Tuesday, October 01, 2002 7:43 AM
To: msql-mysql-modules@lists.mysql.com
Subject: Compiling Perl MySQL DBD on FreeBSB for BillMax


Hello,

I am a Unix newbie in desperate need of help.

We are building a billing server for our company:

OS: FreeBSD 4.6
APP: BillMax w/MySQL

I need to write some Perl DBI hooks to interact with the MySQL db.

I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.

I am trying to compile DBD-mysql-2.1020 and have read all available
documentation on how to set the --cflags and --libs when running
Makefile.PL but it still can't pass the make test. It fails 96% of the
tests.

I know that there is also the issue with different compilers and I have
tried to tell Makefile to use gcc but I can't seem to get the syntax right
for my Makefile command.

Here is the info:

gcc is at /usr/lib/libgcc.a

mysql.h is at /usr/local/billmax/mysql/include/mysql

libs are at /usr/local/billmax/mysql/lib/mysql (libmysqlclient.so)

test db/user/pw are not default so I have to set these as well


I would be most appreciative if someone could help me get the syntax down
for the Makefile command.

Thank you.


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-
thread1937@lists.mysql.com

To unsubscribe, send a message to the address shown in the List-
Unsubscribe header of this message. If you cannot see it, e-mail msql-
mysql-modules-unsubscribe@lists.mysql.com instead.



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1938@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 17:43:20 von bruceablk

I had a similar problem where I compiled MySQL on my own. I tried to
compile DBD::MySQL I was using the following commands:

perl Makefile.PL \
--cflags=-I/usr/local/mysql/include/mysql \
--libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

When I ran this it would tell me -lmysqlclient -lz -lcrypt -lnsl -lm were
unknown options. I found these from getting into the MySQL bin directory
and running the following commands:
mysql_config --cflags
mysql_config --libs

After reading a bunch of archives I was still at a loss. The MySQL bin
directory was not part of roots path. I ran the command:
echo $PATH
And found out what was in my path. I then added a sym link to the
mysql_config file
ln -s /usr/local/mysql/bin/mysql_config /root/bin/mysql_config

I went back and did the makefile stuff without the --cflags and --libs
directives and it worked!
perl Makefile.PL

The make test had a couple failed tests with the test database. I had read
that this was common so I continued with the make install. My Perl scripts
are connecting fine to the MySQL database now.

Maybe this will help someone out there. My Perl was from a RedHat RPM,
MySQL was from source, DBI from source, DBD from source.

Bruce

-----Original Message-----
From: Peter LaForest [mailto:plaforest@fish5.com]
Sent: Tuesday, October 01, 2002 7:43 AM
To: msql-mysql-modules@lists.mysql.com
Subject: Compiling Perl MySQL DBD on FreeBSB for BillMax


Hello,

I am a Unix newbie in desperate need of help.

We are building a billing server for our company:

OS: FreeBSD 4.6
APP: BillMax w/MySQL

I need to write some Perl DBI hooks to interact with the MySQL db.

I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.

I am trying to compile DBD-mysql-2.1020 and have read all available
documentation on how to set the --cflags and --libs when running
Makefile.PL but it still can't pass the make test. It fails 96% of the
tests.

I know that there is also the issue with different compilers and I have
tried to tell Makefile to use gcc but I can't seem to get the syntax right
for my Makefile command.

Here is the info:

gcc is at /usr/lib/libgcc.a

mysql.h is at /usr/local/billmax/mysql/include/mysql

libs are at /usr/local/billmax/mysql/lib/mysql (libmysqlclient.so)

test db/user/pw are not default so I have to set these as well


I would be most appreciative if someone could help me get the syntax down
for the Makefile command.

Thank you.


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-
thread1937@lists.mysql.com

To unsubscribe, send a message to the address shown in the List-
Unsubscribe header of this message. If you cannot see it, e-mail msql-
mysql-modules-unsubscribe@lists.mysql.com instead.



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1938@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 17:57:35 von Schuyler W Langdon

> Hello,
>
> I am a Unix newbie in desperate need of help.
>
> We are building a billing server for our company:
>
> OS: FreeBSD 4.6
> APP: BillMax w/MySQL
>
> I need to write some Perl DBI hooks to interact with the MySQL db.
>
> I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.
>
> I am trying to compile DBD-mysql-2.1020 and have read all available
> documentation on how to set the --cflags and --libs when running
Makefile.PL
> but it still can't pass the make test. It fails 96% of the tests.
>
> I know that there is also the issue with different compilers and I have
> tried to tell Makefile to use gcc but I can't seem to get the syntax right
> for my Makefile command.
>
> Here is the info:
>
> gcc is at /usr/lib/libgcc.a
>
> mysql.h is at /usr/local/billmax/mysql/include/mysql
>
> libs are at /usr/local/billmax/mysql/lib/mysql (libmysqlclient.so)
>
> test db/user/pw are not default so I have to set these as well
>
>
> I would be most appreciative if someone could help me get the syntax down
> for the Makefile command.
>
> Thank you.
>
I had the same almost identical problem on FreeBSD 4.6. After hours of
trying MCPAN, and manually compiling against the what I thought were the
right mysql libraries, I finally broke down and used the ports as described.

1) Installed the mysqlclient port found in -- /usr/ports/databases/
You only need the client. This will install the libaries and bins so that
the DBD::mysql port makefile will find them in the default places without
having to add any flags.
2) Installed the DBD::mysql port -- think this is also in
/usr/ports/databases
I think this will skip the tests, not sure. But after this was installed,
the DBD::mysql driver worked.

--
Schuyler Langdon
GatorDev

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1940@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 17:57:35 von Schuyler W Langdon

> Hello,
>
> I am a Unix newbie in desperate need of help.
>
> We are building a billing server for our company:
>
> OS: FreeBSD 4.6
> APP: BillMax w/MySQL
>
> I need to write some Perl DBI hooks to interact with the MySQL db.
>
> I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.
>
> I am trying to compile DBD-mysql-2.1020 and have read all available
> documentation on how to set the --cflags and --libs when running
Makefile.PL
> but it still can't pass the make test. It fails 96% of the tests.
>
> I know that there is also the issue with different compilers and I have
> tried to tell Makefile to use gcc but I can't seem to get the syntax right
> for my Makefile command.
>
> Here is the info:
>
> gcc is at /usr/lib/libgcc.a
>
> mysql.h is at /usr/local/billmax/mysql/include/mysql
>
> libs are at /usr/local/billmax/mysql/lib/mysql (libmysqlclient.so)
>
> test db/user/pw are not default so I have to set these as well
>
>
> I would be most appreciative if someone could help me get the syntax down
> for the Makefile command.
>
> Thank you.
>
I had the same almost identical problem on FreeBSD 4.6. After hours of
trying MCPAN, and manually compiling against the what I thought were the
right mysql libraries, I finally broke down and used the ports as described.

1) Installed the mysqlclient port found in -- /usr/ports/databases/
You only need the client. This will install the libaries and bins so that
the DBD::mysql port makefile will find them in the default places without
having to add any flags.
2) Installed the DBD::mysql port -- think this is also in
/usr/ports/databases
I think this will skip the tests, not sure. But after this was installed,
the DBD::mysql driver worked.

--
Schuyler Langdon
GatorDev

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1940@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 18:05:44 von John Von Essen

I had the same problem.

MySQL built from src in /usr/local/mysql on FreeBSD

When I tried to build MySQL DBD I got 100% failures on make test.

mysql_config gets executed as it is in my path.

"perl Makefile.PL" runs fine and it displays:

I will use the following settings for compiling and testing:

cflags (mysql_config) = -I'/usr/local/mysql/include/mysql'
libs (mysql_config) = -L/usr/local/mysql/lib/mysql
-lmysqlclient -lz -lcrypt -lm
nocatchstderr (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testuser (default ) =


But at the beginning of make test I get the following:

install_driver(mysql) failed: Can't load '/root/DBD-mysql-2.1018/blib/arch/
auto/DBD/mysql/mysql.so' for module DBD::mysql: /root/DBD-
mysql-2.1018/blib/arch/auto/DBD/mysql/mysql.so: Undefined symbol
"mysql_real_escape_string" at
/usr/local/lib/perl5/5.8.0/i386-freebsd/DynaLoader.pm line 229.

....and this keeps repeating until STOP.

My solution so far has been to simply use the Pure-Perl version of the
MySQL DBD

-John


On Tuesday, October 1, 2002, at 10:54 AM, bruceablk@ida.net wrote:

> I had a similar problem where I compiled MySQL on my own. I tried to
> compile DBD::MySQL I was using the following commands:
>
> perl Makefile.PL \
> --cflags=-I/usr/local/mysql/include/mysql \
> --libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
>
> When I ran this it would tell me -lmysqlclient -lz -lcrypt -lnsl -lm were
> unknown options. I found these from getting into the MySQL bin directory
> and running the following commands:
> mysql_config --cflags
> mysql_config --libs
>
> After reading a bunch of archives I was still at a loss. The MySQL bin
> directory was not part of roots path. I ran the command:
> echo $PATH
> And found out what was in my path. I then added a sym link to the
> mysql_config file
> ln -s /usr/local/mysql/bin/mysql_config /root/bin/mysql_config
>
> I went back and did the makefile stuff without the --cflags and --libs
> directives and it worked!
> perl Makefile.PL
>
> The make test had a couple failed tests with the test database. I had read
> that this was common so I continued with the make install. My Perl scripts
> are connecting fine to the MySQL database now.
>
> Maybe this will help someone out there. My Perl was from a RedHat RPM,
> MySQL was from source, DBI from source, DBD from source.
>
> Bruce
>
> -----Original Message-----
> From: Peter LaForest [mailto:plaforest@fish5.com]
> Sent: Tuesday, October 01, 2002 7:43 AM
> To: msql-mysql-modules@lists.mysql.com
> Subject: Compiling Perl MySQL DBD on FreeBSB for BillMax
>
>
> Hello,
>
> I am a Unix newbie in desperate need of help.
>
> We are building a billing server for our company:
>
> OS: FreeBSD 4.6
> APP: BillMax w/MySQL
>
> I need to write some Perl DBI hooks to interact with the MySQL db.
>
> I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.
>
> I am trying to compile DBD-mysql-2.1020 and have read all available
> documentation on how to set the --cflags and --libs when running
> Makefile.PL but it still can't pass the make test. It fails 96% of the
> tests.
>
> I know that there is also the issue with different compilers and I have
> tried to tell Makefile to use gcc but I can't seem to get the syntax right
> for my Makefile command.
>
> Here is the info:
>
> gcc is at /usr/lib/libgcc.a
>
> mysql.h is at /usr/local/billmax/mysql/include/mysql
>
> libs are at /usr/local/billmax/mysql/lib/mysql (libmysqlclient.so)
>
> test db/user/pw are not default so I have to set these as well
>
>
> I would be most appreciative if someone could help me get the syntax down
> for the Makefile command.
>
> Thank you.
>
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-
> thread1937@lists.mysql.com
>
> To unsubscribe, send a message to the address shown in the List-
> Unsubscribe header of this message. If you cannot see it, e-mail msql-
> mysql-modules-unsubscribe@lists.mysql.com instead.
>
>
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-
> thread1938@lists.mysql.com
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1939@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 18:05:44 von John Von Essen

I had the same problem.

MySQL built from src in /usr/local/mysql on FreeBSD

When I tried to build MySQL DBD I got 100% failures on make test.

mysql_config gets executed as it is in my path.

"perl Makefile.PL" runs fine and it displays:

I will use the following settings for compiling and testing:

cflags (mysql_config) = -I'/usr/local/mysql/include/mysql'
libs (mysql_config) = -L/usr/local/mysql/lib/mysql
-lmysqlclient -lz -lcrypt -lm
nocatchstderr (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testuser (default ) =


But at the beginning of make test I get the following:

install_driver(mysql) failed: Can't load '/root/DBD-mysql-2.1018/blib/arch/
auto/DBD/mysql/mysql.so' for module DBD::mysql: /root/DBD-
mysql-2.1018/blib/arch/auto/DBD/mysql/mysql.so: Undefined symbol
"mysql_real_escape_string" at
/usr/local/lib/perl5/5.8.0/i386-freebsd/DynaLoader.pm line 229.

....and this keeps repeating until STOP.

My solution so far has been to simply use the Pure-Perl version of the
MySQL DBD

-John


On Tuesday, October 1, 2002, at 10:54 AM, bruceablk@ida.net wrote:

> I had a similar problem where I compiled MySQL on my own. I tried to
> compile DBD::MySQL I was using the following commands:
>
> perl Makefile.PL \
> --cflags=-I/usr/local/mysql/include/mysql \
> --libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
>
> When I ran this it would tell me -lmysqlclient -lz -lcrypt -lnsl -lm were
> unknown options. I found these from getting into the MySQL bin directory
> and running the following commands:
> mysql_config --cflags
> mysql_config --libs
>
> After reading a bunch of archives I was still at a loss. The MySQL bin
> directory was not part of roots path. I ran the command:
> echo $PATH
> And found out what was in my path. I then added a sym link to the
> mysql_config file
> ln -s /usr/local/mysql/bin/mysql_config /root/bin/mysql_config
>
> I went back and did the makefile stuff without the --cflags and --libs
> directives and it worked!
> perl Makefile.PL
>
> The make test had a couple failed tests with the test database. I had read
> that this was common so I continued with the make install. My Perl scripts
> are connecting fine to the MySQL database now.
>
> Maybe this will help someone out there. My Perl was from a RedHat RPM,
> MySQL was from source, DBI from source, DBD from source.
>
> Bruce
>
> -----Original Message-----
> From: Peter LaForest [mailto:plaforest@fish5.com]
> Sent: Tuesday, October 01, 2002 7:43 AM
> To: msql-mysql-modules@lists.mysql.com
> Subject: Compiling Perl MySQL DBD on FreeBSB for BillMax
>
>
> Hello,
>
> I am a Unix newbie in desperate need of help.
>
> We are building a billing server for our company:
>
> OS: FreeBSD 4.6
> APP: BillMax w/MySQL
>
> I need to write some Perl DBI hooks to interact with the MySQL db.
>
> I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.
>
> I am trying to compile DBD-mysql-2.1020 and have read all available
> documentation on how to set the --cflags and --libs when running
> Makefile.PL but it still can't pass the make test. It fails 96% of the
> tests.
>
> I know that there is also the issue with different compilers and I have
> tried to tell Makefile to use gcc but I can't seem to get the syntax right
> for my Makefile command.
>
> Here is the info:
>
> gcc is at /usr/lib/libgcc.a
>
> mysql.h is at /usr/local/billmax/mysql/include/mysql
>
> libs are at /usr/local/billmax/mysql/lib/mysql (libmysqlclient.so)
>
> test db/user/pw are not default so I have to set these as well
>
>
> I would be most appreciative if someone could help me get the syntax down
> for the Makefile command.
>
> Thank you.
>
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-
> thread1937@lists.mysql.com
>
> To unsubscribe, send a message to the address shown in the List-
> Unsubscribe header of this message. If you cannot see it, e-mail msql-
> mysql-modules-unsubscribe@lists.mysql.com instead.
>
>
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-
> thread1938@lists.mysql.com
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1939@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 19:22:07 von Nick Tonkin

On Tue, 1 Oct 2002, Peter LaForest wrote:

> Hello,
>
> I am a Unix newbie in desperate need of help.
>
> We are building a billing server for our company:
>
> OS: FreeBSD 4.6
> APP: BillMax w/MySQL
>
> I need to write some Perl DBI hooks to interact with the MySQL db.
>
> I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.
>
> I am trying to compile DBD-mysql-2.1020 and have read all available
> documentation on how to set the --cflags and --libs when running Makefile.PL
> but it still can't pass the make test. It fails 96% of the tests.

[ snip ]

If I were a Unix newbie using FreeBSD I would run, not walk, to the
built-in software library that provides up-to-date ports of MySQL, DBI,
DBD-mysql, and everything else you are likely to need. You can use the
FreeBSD 'Ports' system to automatically fetch, compile and build stuff --
this makes dependencies a breeze and will likely solve your problem. Or,
for even greater ease of use, you can use the 'Package' system which will
install pre-compiled binaries onto your system. Check the FreeBSD web site
for info.

Now that I am not a Unix newbie, on the other hand, I have learned that
you can get into trouble mixing the FreeBSD ports and hand-built
stuff. This is likely what you are experiencing. Nowadays I build a new
Perl with its own user in its own directory (/home/perl/) and start from
there. You've probably got a FreeBSD-configured Perl not behaving as the
new modules' compile-time routines expect. You can search the archives for
your problem and probably find the exact solution, but I'd still go with a
bigger picture solution if I were you. Either go the whole way with
FreeBSD's ports/package add; or go the whole way with hand-built stuff in
a new location.

This has been my experience anyway.

- nick




------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1941@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 19:22:07 von Nick Tonkin

On Tue, 1 Oct 2002, Peter LaForest wrote:

> Hello,
>
> I am a Unix newbie in desperate need of help.
>
> We are building a billing server for our company:
>
> OS: FreeBSD 4.6
> APP: BillMax w/MySQL
>
> I need to write some Perl DBI hooks to interact with the MySQL db.
>
> I was able to compile and install DBI-1.30 and Data-ShowTable-3.3 fine.
>
> I am trying to compile DBD-mysql-2.1020 and have read all available
> documentation on how to set the --cflags and --libs when running Makefile.PL
> but it still can't pass the make test. It fails 96% of the tests.

[ snip ]

If I were a Unix newbie using FreeBSD I would run, not walk, to the
built-in software library that provides up-to-date ports of MySQL, DBI,
DBD-mysql, and everything else you are likely to need. You can use the
FreeBSD 'Ports' system to automatically fetch, compile and build stuff --
this makes dependencies a breeze and will likely solve your problem. Or,
for even greater ease of use, you can use the 'Package' system which will
install pre-compiled binaries onto your system. Check the FreeBSD web site
for info.

Now that I am not a Unix newbie, on the other hand, I have learned that
you can get into trouble mixing the FreeBSD ports and hand-built
stuff. This is likely what you are experiencing. Nowadays I build a new
Perl with its own user in its own directory (/home/perl/) and start from
there. You've probably got a FreeBSD-configured Perl not behaving as the
new modules' compile-time routines expect. You can search the archives for
your problem and probably find the exact solution, but I'd still go with a
bigger picture solution if I were you. Either go the whole way with
FreeBSD's ports/package add; or go the whole way with hand-built stuff in
a new location.

This has been my experience anyway.

- nick




------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1941@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 19:59:10 von Peter LaForest

Bruce,

We seem to be on the right track here.

I am now able to get the mysql_config file to be used when running Makefile.

However, when I said I was a newbie I wasn't trying to be modest.

There is one last step I need to do, and I am hoping you can help (or anyone
else).

I need to be able to edit the mysql_config file to tell it to use my gcc
compiler.

All I have in the documentation is the statement,

If you know the directory, add a

-L -lgcc

to the list of C compiler flags.

I know the directory (/usr/bin/libgcc.a) but I don't know how to add this to
the config file.

I tried editting cflags line, but this just seems to make things worse.

Any help on how to do this would be a life saver.

Thanks.

Pete


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1942@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 01.10.2002 19:59:10 von Peter LaForest

Bruce,

We seem to be on the right track here.

I am now able to get the mysql_config file to be used when running Makefile.

However, when I said I was a newbie I wasn't trying to be modest.

There is one last step I need to do, and I am hoping you can help (or anyone
else).

I need to be able to edit the mysql_config file to tell it to use my gcc
compiler.

All I have in the documentation is the statement,

If you know the directory, add a

-L -lgcc

to the list of C compiler flags.

I know the directory (/usr/bin/libgcc.a) but I don't know how to add this to
the config file.

I tried editting cflags line, but this just seems to make things worse.

Any help on how to do this would be a life saver.

Thanks.

Pete


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1942@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 02.10.2002 16:30:36 von Peter LaForest

Hello,

I am still hoping someone out there knows how to edit the mysql_config file
so I can tell Makefile.PL to use gcc so that DBD-mysql-2.1020 will compile
correctly for MySQL.

Here is my best attempt:

#!/bin/sh
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

# This script reports various configuration settings that may be needed
# when using the MySQL client library.

ldata='/usr/local/billmax/mysql/var'
execdir='/usr/local/billmax/mysql/libexec'
bindir='/usr/local/billmax/mysql/bin'
pkglibdir='/usr/local/billmax/mysql/lib/mysql'
pkgincludedir='/usr/local/billmax/mysql/include/mysql'
gccdir='/usr/lib'
version='3.23.42'
socket='/tmp/mysql.sock'
port='3306'
ldflags=''
client_libs='-lz -lcrypt -lm '
gcc_lib='-lgcc '

libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs-L'$gccdir'
$gcc_lib"
cflags="-I'$pkgincludedir'"

usage () {
cat < Usage: $0 [OPTIONS]
Options:
--cflags [$cflags]
--libs [$libs]
--socket [$socket]
--port [$port]
--version [$version]
EOF
exit 1
}

if test $# -le 0; then usage; fi

while test $# -gt 0; do
case $1 in
--cflags) echo "$cflags" ;;
--libs) echo "$libs" ;;
--socket) echo "$socket" ;;
--port) echo "$port" ;;
--version) echo "$version" ;;
*) usage ;;
esac

shift
done

#echo "ldata: '"$ldata"'"
#echo "execdir: '"$execdir"'"
#echo "bindir: '"$bindir"'"
#echo "pkglibdir: '"$pkglibdir"'"
#echo "pkgincludedir: '"$pkgincludedir"'"
#echo "version: '"$version"'"
#echo "socket: '"$socket"'"
#echo "port: '"$port"'"
#echo "ldflags: '"$ldflags"'"
#echo "client_libs: '"$client_libs"'"

exit 0

I added the variables gccdir and gcc_lib and appended these using the same
syntax to the libs line. This is the best interpretation I can make from
the incomplete and contradictory documentation published for this DBD.

However I am still getting the error (several of them) that the DBD::mysql
documentation says would indicate the wrong compiler is being used.

Any help would be appreciated.



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1944@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 02.10.2002 16:30:36 von Peter LaForest

Hello,

I am still hoping someone out there knows how to edit the mysql_config file
so I can tell Makefile.PL to use gcc so that DBD-mysql-2.1020 will compile
correctly for MySQL.

Here is my best attempt:

#!/bin/sh
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

# This script reports various configuration settings that may be needed
# when using the MySQL client library.

ldata='/usr/local/billmax/mysql/var'
execdir='/usr/local/billmax/mysql/libexec'
bindir='/usr/local/billmax/mysql/bin'
pkglibdir='/usr/local/billmax/mysql/lib/mysql'
pkgincludedir='/usr/local/billmax/mysql/include/mysql'
gccdir='/usr/lib'
version='3.23.42'
socket='/tmp/mysql.sock'
port='3306'
ldflags=''
client_libs='-lz -lcrypt -lm '
gcc_lib='-lgcc '

libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs-L'$gccdir'
$gcc_lib"
cflags="-I'$pkgincludedir'"

usage () {
cat < Usage: $0 [OPTIONS]
Options:
--cflags [$cflags]
--libs [$libs]
--socket [$socket]
--port [$port]
--version [$version]
EOF
exit 1
}

if test $# -le 0; then usage; fi

while test $# -gt 0; do
case $1 in
--cflags) echo "$cflags" ;;
--libs) echo "$libs" ;;
--socket) echo "$socket" ;;
--port) echo "$port" ;;
--version) echo "$version" ;;
*) usage ;;
esac

shift
done

#echo "ldata: '"$ldata"'"
#echo "execdir: '"$execdir"'"
#echo "bindir: '"$bindir"'"
#echo "pkglibdir: '"$pkglibdir"'"
#echo "pkgincludedir: '"$pkgincludedir"'"
#echo "version: '"$version"'"
#echo "socket: '"$socket"'"
#echo "port: '"$port"'"
#echo "ldflags: '"$ldflags"'"
#echo "client_libs: '"$client_libs"'"

exit 0

I added the variables gccdir and gcc_lib and appended these using the same
syntax to the libs line. This is the best interpretation I can make from
the incomplete and contradictory documentation published for this DBD.

However I am still getting the error (several of them) that the DBD::mysql
documentation says would indicate the wrong compiler is being used.

Any help would be appreciated.



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1944@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 02.10.2002 19:47:25 von Peter LaForest

Hello,

Well I found someone with the answer from an old posting on Deja how to get
gcc to compile with Perl.

The simple answer is to leave the mysql_config file alone and run your
Makefile command like this:

perl Makefile.PL CC=gcc

Wow! That's simple enough.

With that I followed-up with the make command and watched with glee as gcc
was used to compile the Makefile.

Unfortunately, this did not solve the problem.

All of the same errors occurred.

Back to square 1.

Any help would be appreciated.


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1945@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 02.10.2002 19:47:25 von Peter LaForest

Hello,

Well I found someone with the answer from an old posting on Deja how to get
gcc to compile with Perl.

The simple answer is to leave the mysql_config file alone and run your
Makefile command like this:

perl Makefile.PL CC=gcc

Wow! That's simple enough.

With that I followed-up with the make command and watched with glee as gcc
was used to compile the Makefile.

Unfortunately, this did not solve the problem.

All of the same errors occurred.

Back to square 1.

Any help would be appreciated.


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1945@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 02.10.2002 21:57:09 von Todd Finney

At 01:47 PM 10/2/02, Peter LaForest wrote:
>Unfortunately, this did not solve the problem.
>All of the same errors occurred.

Maybe I missed a post, have you actually posted the output of make?

Seeing the actual error messages would be helpful.

Todd





------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1946@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 02.10.2002 21:57:09 von Todd Finney

At 01:47 PM 10/2/02, Peter LaForest wrote:
>Unfortunately, this did not solve the problem.
>All of the same errors occurred.

Maybe I missed a post, have you actually posted the output of make?

Seeing the actual error messages would be helpful.

Todd





------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1946@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 03.10.2002 16:30:06 von Peter LaForest

Hello,

Thank you to all who posted. Your help is appreciated.

In the end the only solution was to stick to the standard FreeBSD ports
install.

I was able to install the mysql323 port, followed by the p5-Mysql.

This solved the problem. Even more rewarding was that it did not interfere
with the mysql client configuration for BillMax.



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1947@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

RE: Compiling Perl MySQL DBD on FreeBSB for BillMax

am 03.10.2002 16:30:06 von Peter LaForest

Hello,

Thank you to all who posted. Your help is appreciated.

In the end the only solution was to stick to the standard FreeBSD ports
install.

I was able to install the mysql323 port, followed by the p5-Mysql.

This solved the problem. Even more rewarding was that it did not interfere
with the mysql client configuration for BillMax.



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1947@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.