Compiling MySQL 5.0.51 under Ubuntu 7.10

I’ve finally decided to work on a number of improvements in Instrumentation within the MySQL Server I’ve wanted for the first year, See What is the optimal thread specific buffer size?. It’s been a while since I’ve compiled from source, and from these issues, the first under Ubuntu 7.10 (a fresh install). Here are some of the problems, and solutions overcome, just for some others that may experience them.

I should have simply read my own notes from years ago in Compiling MySQL, specifically the pre-requisites list, but it sometimes helps to remember why things are so.

In summary, I needed the following:

apt-get install automake libtool g++ ncurses-dev

Thanks Miademora, I meant to say that, forgot

First error, “aclocal: not found”

$ ./BUILD/compile-pentium-debug
BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using.
+ make -k distclean
make: *** No rule to make target `distclean'.
+ true
+ /bin/rm -rf */.deps/*.P config.cache innobase/config.cache bdb/build_unix/config.cache bdb/dist/autom4te.cache autom4te.cache innobase/autom4te.cache
+ path=BUILD
+ . BUILD/autorun.sh
+ aclocal
BUILD/autorun.sh: 1: aclocal: not found
+ die Can't execute aclocal
+ echo Can't execute aclocal
Can't execute aclocal
+ exit 1

This needed automake.

$ apt-get install automake
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  liblzo1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  autoconf autotools-dev m4
Suggested packages:
  autoconf2.13 autobook autoconf-archive gnu-standards autoconf-doc
  automake1.10-doc
Recommended packages:
  automaken
The following NEW packages will be installed:
  autoconf automake autotools-dev m4
0 upgraded, 4 newly installed, 0 to remove and 24 not upgraded.
Need to get 1085kB of archives.
After unpacking 3899kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  m4 autoconf autotools-dev automake
Install these packages without verification [y/N]? y
Get:1 http://archive.ubuntu.com gutsy/main m4 1.4.10-0ubuntu2 [207kB]
Get:2 http://archive.ubuntu.com gutsy/main autoconf 2.61-4 [448kB]
Get:3 http://archive.ubuntu.com gutsy/main autotools-dev 20070306.1 [61.6kB]
Get:4 http://archive.ubuntu.com gutsy/main automake 1:1.10+nogfdl-1 [369kB]
Fetched 1085kB in 2s (515kB/s)
Selecting previously deselected package m4.
(Reading database ... 93930 files and directories currently installed.)
Unpacking m4 (from .../m4_1.4.10-0ubuntu2_i386.deb) ...
Selecting previously deselected package autoconf.
Unpacking autoconf (from .../autoconf_2.61-4_all.deb) ...
Selecting previously deselected package autotools-dev.
Unpacking autotools-dev (from .../autotools-dev_20070306.1_all.deb) ...
Selecting previously deselected package automake.
Unpacking automake (from .../automake_1%3a1.10+nogfdl-1_all.deb) ...
Setting up m4 (1.4.10-0ubuntu2) ...

Setting up autoconf (2.61-4) ...

Setting up autotools-dev (20070306.1) ...
Setting up automake (1:1.10+nogfdl-1) ...

Second error, “libtoolize: not found”.

./BUILD/compile-pentium-debug
BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using.
+ make -k distclean
make: *** No rule to make target `distclean'.
+ true
+ /bin/rm -rf */.deps/*.P config.cache innobase/config.cache bdb/build_unix/config.cache bdb/dist/autom4te.cache autom4te.cache innobase/autom4te.cache
+ path=BUILD
+ . BUILD/autorun.sh
+ aclocal
+ autoheader
+ test -f /usr/bin/glibtoolize
+ libtoolize --automake --force
BUILD/autorun.sh: 1: libtoolize: not found
+ die Can't execute libtoolize
+ echo Can't execute libtoolize
Can't execute libtoolize
+ exit 1

Using a nice Ubuntu feature, you can find the right package by typing the command.

$ libtoolize
The program 'libtoolize' is currently not installed.  You can install it by typing:
sudo apt-get install libtool
bash: libtoolize: command not found

This needed the libtool package.

$ apt-get install libtool
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  liblzo1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libc6-dev linux-libc-dev
Suggested packages:
  glibc-doc manpages-dev libtool-doc g77 fortran77-compiler gcj
Recommended packages:
  libltdl3-dev
The following NEW packages will be installed:
  libc6-dev libtool linux-libc-dev
0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded.
Need to get 4277kB of archives.
After unpacking 18.3MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  linux-libc-dev libc6-dev libtool
Install these packages without verification [y/N]? y
Get:1 http://archive.ubuntu.com gutsy-updates/main linux-libc-dev 2.6.22-14.47 [653kB]
Get:2 http://archive.ubuntu.com gutsy-proposed/main libc6-dev 2.6.1-1ubuntu10 [3287kB]
Get:3 http://archive.ubuntu.com gutsy/main libtool 1.5.24-1ubuntu1 [337kB]
Fetched 4277kB in 4s (900kB/s)
Selecting previously deselected package linux-libc-dev.
(Reading database ... 94193 files and directories currently installed.)
Unpacking linux-libc-dev (from .../linux-libc-dev_2.6.22-14.47_i386.deb) ...
Selecting previously deselected package libc6-dev.
Unpacking libc6-dev (from .../libc6-dev_2.6.1-1ubuntu10_i386.deb) ...
Selecting previously deselected package libtool.
Unpacking libtool (from .../libtool_1.5.24-1ubuntu1_i386.deb) ...
Setting up linux-libc-dev (2.6.22-14.47) ...
Setting up libc6-dev (2.6.1-1ubuntu10) ...
Setting up libtool (1.5.24-1ubuntu1) ...

Third error, “preprocessor “/lib/cpp” fails sanity check”

./BUILD/compile-pentium-debug
...
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
$ more config.log
configure:5336: gcc -c -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -
W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunus
ed-function -Wunused-label -Wunused-value -Wunused-variable -Woverloaded-virtual
 -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor  -felide-construc
tors -fno-exceptions -fno-rtti  -DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INI
T_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX    conftest.cpp >&5
gcc: error trying to exec 'cc1plus': execvp: No such file or directory

This needed the package g++.

$ apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  liblzo1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  g++-4.1 libstdc++6-4.1-dev
Suggested packages:
  g++-multilib g++-4.1-multilib gcc-4.1-doc libstdc++6-4.1-doc
The following NEW packages will be installed:
  g++ g++-4.1 libstdc++6-4.1-dev
0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded.
Need to get 3730kB of archives.
After unpacking 13.7MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  libstdc++6-4.1-dev g++-4.1 g++
Install these packages without verification [y/N]? y
Get:1 http://archive.ubuntu.com gutsy/main libstdc++6-4.1-dev 4.1.2-16ubuntu2 [1129kB]
Get:2 http://archive.ubuntu.com gutsy/main g++-4.1 4.1.2-16ubuntu2 [2600kB]
Get:3 http://archive.ubuntu.com gutsy/main g++ 4:4.1.2-9ubuntu2 [1440B]
Fetched 3730kB in 4s (871kB/s)
Selecting previously deselected package libstdc++6-4.1-dev.
(Reading database ... 95367 files and directories currently installed.)
Unpacking libstdc++6-4.1-dev (from .../libstdc++6-4.1-dev_4.1.2-16ubuntu2_i386.deb) ...
Selecting previously deselected package g++-4.1.
Unpacking g++-4.1 (from .../g++-4.1_4.1.2-16ubuntu2_i386.deb) ...
Selecting previously deselected package g++.
Unpacking g++ (from .../g++_4%3a4.1.2-9ubuntu2_i386.deb) ...
Setting up g++-4.1 (4.1.2-16ubuntu2) ...
Setting up libstdc++6-4.1-dev (4.1.2-16ubuntu2) ...
Setting up g++ (4:4.1.2-9ubuntu2) ...

Fourth error “checking for termcap functions library… configure: error: No curses/termcap library found”

This needed the package nurses-dev.

This got a successful compile. Again, should have started with the pre-requisites list. A review of the pre-requisites from previously showed gmake no longer necessary, the following is.

automake --version
autoconf --version
libtool --version
m4 --version
gcc --version
bison -version

Comments

  1. Miademora says

    Just a suggestion. IMHO including the following line would have made your post twice as useful.

    apt-get install automake libtool g++ nurses-dev

  2. Intruder says

    Actually you have to use “apt-get install automake libtool g++ ncurses-dev” (note “c” in “ncurses-dev”).