4

I am installing MySQL Server from the source distribution which I downloaded from:

http://dev.mysql.com/downloads/mysql/#downloads.

I have downloaded the file (mysql-5.5.19.tar.gz).

I am using Debian/Ubuntu Machine. I am following the instructions as given in MySQL Documentation.

After issuing cmake . at the shell I am getting the following error:

-- MySQL 5.5.19
-- Could NOT find Curses  (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (MESSAGE):
  Curses library not found.  Please install appropriate package,

      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:127 (FIND_CURSES)
  cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)
  CMakeLists.txt:257 (MYSQL_CHECK_READLINE)


-- Configuring incomplete, errors occurred!

Why am I getting this error?

2
  • Just a recommendation : You should not use source-compiled versions of MySQL because certain compiler optimizations that RPM installations provide would be your responsibility to set before compiling. In most cases, you get slower and/or more bloated mysql binaries. You should install RPM or tar versions instead. Commented Jan 6, 2012 at 17:13
  • You should probably ask yourself why you are building from source at all given the proliferation of packages available. I can't think of any reason why it would make sense to build from source unless you are actually developing MySQL. Commented Jan 23, 2012 at 21:33

3 Answers 3

5

The clue is in the error message (which I also encountered today):

  1. install the correct Curses library. If you're on Debian/Ubuntu then install libncurses5-dev ( use sudo apt-get install libncurses5-dev )
  2. then remove CMakeCache.txt and rerun cmake. i.e. just do rm -f CMakeCache.txt.
  3. Re-run cmake .
1
  • Important point for me rm -f CMakeCache.txt :) thanks Commented May 30, 2014 at 13:50
3

Your build can't find ncurses. Either you don't have it installed or it cant be found where it is installed.

If you don't have it, simply download it, build it, install it, and make sure LD_LIBRARY_PATH can find it.

If for any reason cmake still cant see it, you can pass the lib and include directories to cmake at runtime, such as:

shell> cmake -DCURSES_LIBRARY=/path/to/lib/libncurses.a -DCURSES_INCLUDE_PATH=/path/to/include/ .

Note, unlike any sane tool, you actually have to pass it the full path to the specific lib, right up to and including the library name itself.

Ignore the comments above regarding building from RPM; package managers are for hobbyists and power users, not professionals; you're doing it right.

2

This may happen due to two reasons.
1. you don't have the curses library installed. This can solved with using below command.

sudo apt-get install libncurses5-dev


2. You haven't configure cmake correctly to find the curses library.

if you have installed the library correctly using above command, use below to locate it.

locate libncurses.so

mine is /usr/lib/x86_64-linux-gnu/libncurses.so (Normally the last path.)
Now you have to locate curses.h. Use below command.

locate curses.h

This will give you several path but the all in the /usr/include So that is what we need. Now we have to configure the curses location. Find your cmake folder in there is /Modules/FindCurses.cmake open it. (Full path for cmake in mine is /usr/share/cmake-3.2/Modules/FindCurses.cmake If you can't find manually where cmake installed search for cmake on your Ubuntu partition.)

Add these top of file after comments. (with your respective locations.)

set( CMAKE_INCLUDE_PATH "/usr/include")
set( CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu/libncurses.so")

This would do your job.

2
  • 1
    locate won't find a thing if you haven't run updatedb recently
    – Philᵀᴹ
    Commented Feb 26, 2016 at 11:46
  • Mine work fine. I frequently updates it. BTW Thanks Phil :) Commented Feb 26, 2016 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.