Posts Tagged ‘how to build mariadb on windows’

Troubleshooting Building MariaDB 5.1 on Windows

Tuesday, June 18th, 2013

This is a follow-up, troubleshooting article that goes hand-in-hand with my “Building MariaDB 5.1 on Windows Revisited” post, and covers some problems and their solutions that one might encounter when attempting to build MariaDB from source code on Microsoft Windows.

The first error I ran into was this, on my main compile step (i.e., the 2nd cmake command):

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp
Common.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
[C:\mysql\mariadb-5.1.67\bld\scripts\GenFixPrivs.vcxproj]

That in itself doesn’t tell us too much. Searching the full compile output, we find:

Generating ../../scripts/mysql_fix_privilege_tables.sql
The system cannot find the file specified.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp
Common.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
[C:\mysql\mariadb-5.1.67\bld\scripts\GenFixPrivs.vcxproj]
Done Building Project
"C:\mysql\mariadb-5.1.67\bld\scripts\GenFixPrivs.vcxproj" (default targets)
 -- FAILED.

Thus, there is a path issue. In this case, I had created a directory named “bld” within mysql-5.1.67/ and was attempting to build (and run cmake) there. After seeing this error, I deleted bld/ and just compiled in the main dir.

This helped things progress further on the next compile.

However, while it progressed further, I encountered a new set of errors:

"C:\mysql\mariadb-5.1.67\package.vcxproj" (default target) (1) ->
(PostBuildEvent target) ->
  EXEC : CPack error : Cannot find NSIS compiler makensis:
    likely it is not installed, or not in your PATH
    [C:\mysql\mariadb-5.1.67\package.vcxproj]
  EXEC : CPack error : Could not read NSIS registry value.
    This is usually caused by NSIS not being installed. Please install NSIS
    from http://nsis.sourceforge.net [C:\mysql\mariadb-5.1.67\package.vcxproj]
  EXEC : CPack error : Cannot initialize the generator NSIS
    [C:\mysql\mariadb-5.1.67\package.vcxproj]
  ...
    17 Warning(s)
    4 Error(s)

These seem related to NSIS, and so I’ll follow the note from the error message: Please install NSIS from http://nsis.sourceforge.net

Thus I downloaded NSIS and installed it (since I didn’t already have it installed). I then re-ran the 2nd cmake command, and it progressed further than before.

However, I was still not out of the woods yet. This time it produced:

  CPack: Create package using NSIS
  CPack: Install projects
  CPack: - Install project: MySql
  CPack: -   Install component: Unspecified
  CPack: -   Install component: headers
  CPack: -   Install component: mysqltest
  CPack: -   Install component: runtime
  CPack: -   Install component: scripts
  CPack: -   Install component: sqlbench
  CPack: Create package
EXEC : CPack error : Problem running NSIS command:
  "C:/Program Files (x86)/NSIS/makensis.exe"
  "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
  Please check C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/NSISOutput.log
  for errors
EXEC : CPack error : Problem compressing the directory
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
EXEC : CPack error : Error when generating package: MariaDB
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
...
Done Building Project "C:\mysql\mariadb-5.1.67\package.vcxproj" (default targets)
 -- FAILED.
Build FAILED.

    0 Warning(s)
    4 Error(s)

Upon examining the above, we see the main error is:

EXEC : CPack error : Problem running NSIS command:
  "C:/Program Files (x86)/NSIS/makensis.exe"
  "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
  Please check C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/NSISOutput.log
  for errors

I checked the log it mentions to see what is going on, and the last 2 lines of NSISOutput.log say:

!macro: macro named "RemoveSection" already found!
Error in script "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
on line 134 -- aborting creation process

Re-looked at error, which says “Problem running NSIS command …”

Thus I tried to run said command, exactly as-is, to see if it runs and/or what it reports:

C:\> "C:/Program Files (x86)/NSIS/makensis.exe" "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"

Output is basically identical to that in NSISOutput.log, aside from 2 comments at the very beginning of NSISOutput.log (which shows the command run). The last 2 lines are (shown in ‘red’ in my terminal):

!macro: macro named "RemoveSection" already found!
Error in script "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
on line 134 -- aborting creation process

So what is this “RemoveSection”? Need to check project.nsi on line 134.

Searched the file, is only there once, so not sure where else it is coming from (i.e., how it is “already found!”).

So I decided to Google: “macro named “RemoveSection” already found”

1st result, bingo! Known bug!

“0013202: CPack fails with latest prerelease NSIS”

http://public.kitware.com/Bug/view.php?id=13202

Bug says, “Fixed in Version CMake 2.8.11″, so I checked my cmake version:

C:\>cmake –version
cmake version 2.8.10.2

Thus it is an affected version of cmake, therefore I need to upgrade cmake.

I downloaded the latest cmake, 2.8.11.1, and then upgraded it:

C:\Windows\system32>cmake --version
cmake version 2.8.11.1

So now re-run cmake command again:

cmake --build . --config relwithdebinfo --target package

Worked!!!!!!!

Build succeeded.
    0 Warning(s)
    0 Error(s)

Hope this helps. :)

 

Related Build Links:

 

Building MariaDB 5.1 on Windows Revisited

Tuesday, June 18th, 2013

I previously wrote an article on Building MariaDB 5.1 on Windows, but it was about 1.5 years ago (for 5.1.60; this is for 5.1.67), so I wanted to update this a little since I’ve built it entirely from the command-line this time (as well as highlight a couple problems/solutions – which I’ll cover in a subsequent troubleshooting post). This process it quite similar to my steps for building MariaDB 5.5 and MariaDB 10.0, however it’s slightly different since 5.1 requires you run the configure.js script before running cmake. Aside from that though, things are mostly the same. :)

Here is the full procedure:

Download 5.1.67 MariaDB source and extract to C:\mysql\mariadb-5.1.67
cd C:\mysql\mariadb-5.1.67
win\configure.js
cmake .
cmake --build . --config relwithdebinfo --target package

There you have it. MariaDB-5.1.67-win32.exe is created in the main dir. Also, it, and other related files, can be found in C:\mysql\mariadb-5.1.67\_CPack_Packages\win32\NSIS as well.

And for those interested, here is my [mostly] full output (I’ll spare you the “full” build/compilation outputs):

C:\>cd C:\mysql\mariadb-5.1.67

C:\>cd C:\mysql\mariadb-5.1.67

C:\mysql\mariadb-5.1.67>win\configure.js

C:\mysql\mariadb-5.1.67>cmake .
-- Building for: Visual Studio 10
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
build CSV as static library (libcsv.lib)
build FEDERATEDX as static library (libfederatedx.lib)
build HEAP as static library (libheap_s.lib)
build MARIA as static library (libmaria_s.lib)
build MYISAM as static library (libmyisam_s.lib)
build MYISAMMRG as static library (libmyisammrg_s.lib)
build PBXT as static library (libpbxt_s.lib)
build XTRADB as static library (libxtradb.lib)
build ARCHIVE as DLL (ha_archive.dll)
build BLACKHOLE as DLL (ha_blackhole.dll)
build EXAMPLE as DLL (ha_example.dll)
build FEDERATED as DLL (ha_federated.dll)
build INNODB_PLUGIN as DLL (ha_innodb_plugin.dll)
CMake Warning at C:/Program Files (x86)/cmake/share/cmake-2.8/Modules/
InstallRequiredSystemLibraries.cmake:343 (message):
  system runtime library file does not exist:
  'MSVC10_REDIST_DIR-NOTFOUND/x86/Microsoft.VC100.CRT/msvcp100.dll'
Call Stack (most recent call first):
  CMakeLists.txt:562 (INCLUDE)

CMake Warning at C:/Program Files (x86)/cmake/share/cmake-2.8/Modules/
InstallRequiredSystemLibraries.cmake:343 (message):
  system runtime library file does not exist:
  'MSVC10_REDIST_DIR-NOTFOUND/x86/Microsoft.VC100.CRT/msvcr100.dll'
Call Stack (most recent call first):
  CMakeLists.txt:562 (INCLUDE)

-- Configuring done
-- Generating done
-- Build files have been written to: C:/mysql/mariadb-5.1.67

C:\mysql\mariadb-5.1.67>cmake --build . --config relwithdebinfo --target package
......
...... tons of output ......
......
PostBuildEvent:
  ...
  CPack: Create package using NSIS
  CPack: Install projects
  CPack: - Install project: MySql
  CPack: -   Install component: Unspecified
  CPack: -   Install component: headers
  CPack: -   Install component: mysqltest
  CPack: -   Install component: runtime
  CPack: -   Install component: scripts
  CPack: -   Install component: sqlbench
  CPack: Create package
  CPack: - package: C:/mysql/mariadb-5.1.67/MariaDB-5.1.67-win32.exe generated.
FinalizeBuildStatus:
  Deleting file "Win32\relwithdebinfo\PACKAGE\PACKAGE.unsuccessfulbuild".
  Touching "Win32\relwithdebinfo\PACKAGE\PACKAGE.lastbuildstate".
Done Building Project "C:\mysql\mariadb-5.1.67\package.vcxproj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:13:53.66

Hope this helps. :)

 

 

Building MySQL and MariaDB on Windows using Visual Studio 2012 Express versus Visual Studio 2010 Express

Friday, April 5th, 2013

I mentioned in a recent post (and another recent, related post) I was going to try Visual Studio 2012 Express (as opposed to VS 2010 Express) for building MySQL 5.6 and MariaDB 10.0. on Windows.

I followed the exact same steps, but MySQL 5.6.10 would not build without fatal errors in 2012 (whereas it worked fine with VS 2010). Unfortunately, the fail errors were not too descriptive, so not quite sure what to do yet to fix it. Here is a brief snippet for those interested:

...
Done Building Project "C:\...\bld\sql\udf_example.vcxproj" (default targets).
Done Building Project "C:\...\bld\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Done Building Project "c:\...\bld\package.vcxproj" (default targets) -- FAILED.
...
Build FAILED.
...

"c:\mysql\mysql-5.6.10\bld\package.vcxproj" (default target) (1) ->
"C:\mysql\mysql-5.6.10\bld\ALL_BUILD.vcxproj" (default target) (2) ->
"C:\mysql\mysql-5.6.10\bld\plugin\audit_null\audit_null.vcxproj" (default target) (18) ->
"C:\mysql\mysql-5.6.10\bld\sql\mysqld.vcxproj" (default target) (19) ->
(Link target) ->
  mysqld.exp : error LNK2001: unresolved external symbol
  _xmm@7fffffffffffffff7fffffffffffffff [C:\mysql\mysql-5.6.10\bld\sql\mysqld.vcxproj]
  C:\mysql\mysql-5.6.10\bld\sql\RelWithDebInfo\mysqld.exe : fatal error LNK1120:
  1 unresolved externals [C:\mysql\mysql-5.6.10\bld\sql\mysqld.vcxproj]

    6 Warning(s)
    2 Error(s)

Time Elapsed 00:01:06.67

On the plus side, MariaDB 10.0.1 compiled just fine with both Visual Studio 2012 Express and Visual Studio 2010 Express! So I was really happy about that. :)

I thought I could just keep both VSs installed, but they don’t seem to want to play nice, even when specifying the following for the MySQL 5.6 build (perhaps that’s just me though):

cmake .. -G "Visual Studio 10"

So, if you are building your own on Windows, then you may want to keep the above in mind (my tests have been on Windows 7 64-bit, fwiw).

I’ll continue to test, and post anything useful if there’s something worth mentioning.

 

 

How to Build MariaDB 10.0 on Windows from Source Code

Tuesday, March 26th, 2013

I just wanted to share my steps for building MariaDB 10.0 on Windows (10.0.1 in this case):

cd maria-10.0.1
mkdir bld
cd bld
cmake .. -G "Visual Studio 10"
cmake --build . --config relwithdebinfo --target package

That’s it! The zip file is created right there in bld/.

Hope this helps. :)

 

How to Build MariaDB 5.5 on Windows from Source Code

Friday, May 25th, 2012

I built MariaDB 5.5.24 on Windows yesterday from source, so I just wanted to share my steps.

Here is the short version:

bzr branch lp:maria/5.5 maria-5.5
cd maria-5.5
mkdir bld
cd bld
cmake .. -G "Visual Studio 10"
cmake --build . --config relwithdebinfo --target package

Done! Nice, neat zip file is created right there.

Here is the longer version with outputs for those interested:

C:\mariadb-5.5>bzr branch lp:maria/5.5 maria-5.5
Connected (version 2.0, client Twisted)
Authentication (publickey) successful!
Secsh channel 1 opened.
Branched 3418 revision(s).

C:\mariadb-5.5>cd maria-5.5

C:\mariadb-5.5\maria-5.5>mkdir bld

C:\mariadb-5.5\maria-5.5>cd bld

C:\mariadb-5.5\maria-5.5\bld>cmake .. -G "Visual Studio 10"
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- MariaDB 5.5.24
-- Check size of void *
-- Check size of void * - done
-- Packaging as: mariadb-5.5.24-win32
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - not found.
-- Found Threads: TRUE
-- Looking for pthread_attr_getguardsize
-- Looking for pthread_attr_getguardsize - not found
-- Check size of time_t
-- Check size of time_t - done
-- Could NOT find Boost
-- Cannot find wix 3, installer project will not be generated
-- Looking for MFC
-- Looking for MFC - not found
-- Configuring done
-- Generating done
-- Build files have been written to: C:/mariadb-5.5/maria-5.5/bld

C:\mariadb-5.5\maria-5.5\bld>cmake --build . --config relwithdebinfo --target package
.......
lots of output
.......
C:\mariadb-5.5\maria-5.5\bld\...
C:\mariadb-5.5\maria-5.5\bld\...
C:\mariadb-5.5\maria-5.5\bld\...

    46 Warning(s)
    0 Error(s)

Time Elapsed 00:23:18.16

Success \o/

Package is named: mariadb-5.5.24-win32.zip

Full location:

C:\mariadb-5.5\maria-5.5\bld\mariadb-5.5.24-win32.zip

C:\Users\Chris>mysql -uroot -pmysql -P3313 -e"select version()"
+----------------+
| version()      |
+----------------+
| 5.5.24-MariaDB |
+----------------+

With XtraDB+ (i.e., InnoDB plugin is not enabled), it starts fine, and uses InnoDB version 1.1.8-24.1.

If you try to enable the original InnoDB plugin, note the library is now named ha_innodb.dll (or ha_innodb.so) instead of ha_innodb_plugin.dll (or ha_innodb_plugin.so), which is what it was named in MySQL/MariaDB 5.1. I discuss this topic in more detail here, if you’re interested.

Hope this helps.

Further resources:

Full Details on CMake here:

http://forge.mysql.com/wiki/CMake

For details on building on Linux, please see here:

http://kb.askmonty.org/en/source-building-mariadb-on-centos/
..
 

Building MariaDB 5.1 on Windows

Monday, January 23rd, 2012

Recently, I found myself needing MariaDB 5.1.60 for Windows for some testing purposes. Therefore, I needed to build it from source. I ended up using what I’d call a “blend” of the commands listed in this “how-to” and the readme file INSTALL-WIN-SOURCE, so I thought I’d post those steps.

  1. Download 5.1.60 MariaDB source from here.
  2. cd C:\mariadb-5.1
  3. win\configure.js
  4. cmake .
  5. VS: File -> Open -> Solution -> MySql.sln
  6. VS: Build -> Build Solution
  7. VS: Right-click “PACKAGE” -> Build (in “Solution Explorer” View)

That’s it.

Let’s fire it up:

MariaDB> select version();
+----------------------+
| version()            |
+----------------------+
| 5.1.60-MariaDB-debug |
+----------------------+

MariaDB> show global variables like 'innodb_version';
+----------------+-------------+
| Variable_name  | Value       |
+----------------+-------------+
| innodb_version | 1.0.17-13.0 |
+----------------+-------------+

MariaDB> show engines;
+------------+---------+---------------------------...
| Engine     | Support | Comment		   ...
+------------+---------+---------------------------...
| CSV        | YES     | CSV storage engine	   ...
| InnoDB     | DEFAULT | Percona-XtraDB, Supports t...
| PBXT       | YES     | High performance, multi-ve...
| MARIA      | YES     | Crash-safe tables with MyI...
| MyISAM     | YES     | Default engine as of MySQL...
| FEDERATED  | YES     | FederatedX pluggable stora...
| MRG_MYISAM | YES     | Collection of identical My...
| MEMORY     | YES     | Hash based, stored in memo...
+------------+---------+---------------------------...

..

For reference, here are my full outputs:

C:\Users\Chris>cd ..\..\mariadb-5.1

C:\mariadb-5.1>win\configure.js

C:\mariadb-5.1>cmake .
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
build CSV as static library (libcsv.lib)
build FEDERATEDX as static library (libfederatedx.lib)
build HEAP as static library (libheap_s.lib)
build MARIA as static library (libmaria_s.lib)
build MYISAM as static library (libmyisam_s.lib)
build MYISAMMRG as static library (libmyisammrg_s.lib)
build PBXT as static library (libpbxt_s.lib)
build XTRADB as static library (libxtradb.lib)
build ARCHIVE as DLL (ha_archive.dll)
build BLACKHOLE as DLL (ha_blackhole.dll)
build EXAMPLE as DLL (ha_example.dll)
build FEDERATED as DLL (ha_federated.dll)
build INNODB_PLUGIN as DLL (ha_innodb_plugin.dll)
-- Configuring done
-- Generating done
-- Build files have been written to: C:/mariadb-5.1

Open Visual Studio -> File -> Open -> Project/Solution -> Select C:\mariadb-5.1.60\MySql.sln

Build Solution Output:

========== Build: 79 succeeded, 0 failed, 2 up-to-date, 2 skipped ==========

Package Build Output:

1>------ Build started: Project: PACKAGE, Configuration: Debug Win32 ------
1>
1>Performing Post-Build Event...
1>CPack: Create package using NSIS
1>CPack: Install projects
1>CPack: - Install project: MySql
1>CPack: -   Install component: Unspecified
1>CPack: -   Install component: headers
1>CPack: -   Install component: mysqltest
1>CPack: -   Install component: runtime
1>CPack: -   Install component: scripts
1>CPack: -   Install component: sqlbench
1>CPack: Compress package
1>CPack: Finalize package
1>CPack: Package C:/mariadb-5.1/MariaDB-5.1.60-win32.exe generated.
1>Build log was saved at "file://c:\mariadb-5.1\PACKAGE.dir\Debug\BuildLog.htm"
1>PACKAGE - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 81 up-to-date, 0 skipped ==========

 
 
..

 
 


Period Panties by Period Panteez Menstrual Underwear Menstruation PMS Panty