Compiling mysql 5.6.24

#See https://adrhc.go.ro/wordpress/common-commands-when-building/ for building environment, x.sh script and other things not defined here.
#Before starting declare the environment variables specified at the link above.

NEW_BUILD_NAME=mysql
#NEW_BUILD_VER=5.6.24.large
NEW_BUILD_VER=5.6.24.small+innodb
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0

cd $HOME/compile
rm -r $HOME/compile/$NEW_BUILD_NAME_AND_VER
tar -xzvf mysql-5.6.24.tar.gz
cd $HOME/compile/$NEW_BUILD_NAME_AND_VER
~/x.sh ffpg

#all params with help text
#cmake . -LAH > cmake.help.txt

#Clear/reset previously run configure & generate:
make clean
rm CMakeCache.txt

#large = embedded + archive + federated + blackhole + innodb
#cmake . -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/ffp -DFEATURE_SET=large -DMYSQL_DATADIR=/ffp/opt/srv/mysql/data -DSYSCONFDIR=/ffp/etc -DTMPDIR=/ffp/opt/srv/mysql/tmp -DWITH_DEBUG=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DHAVE_LLVM_LIBCPP=1 -DCMAKE_CXX_FLAGS_RELEASE="$BUILD_FLAGS" -DCMAKE_C_FLAGS_RELEASE="$BUILD_FLAGS" -DHAVE_GCC_ATOMIC_BUILTINS="" -LAH

#small = embedded
#below we have small + innodb
cmake . -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/ffp -DFEATURE_SET=small -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/ffp/opt/srv/mysql/data -DSYSCONFDIR=/ffp/etc -DTMPDIR=/ffp/opt/srv/mysql/tmp -DWITH_DEBUG=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DHAVE_LLVM_LIBCPP=1 -DCMAKE_CXX_FLAGS_RELEASE="$BUILD_FLAGS" -DCMAKE_C_FLAGS_RELEASE="$BUILD_FLAGS" -DHAVE_GCC_ATOMIC_BUILTINS="" -LAH

#ERROR (FEATURE_SET=large)
    /ffp/home/root/compile/mysql-5.6.24/sql/sql_table.cc:2020:7: error: 'old_part_info' was not declared in this scope
       if (old_part_info)
           ^
    make[2]: *** [sql/CMakeFiles/sql.dir/sql_table.cc.o] Error 1
#SOLUTION
    #Modify /ffp/home/root/compile/mysql-5.6.24/sql/sql_table.cc to this:
    end:
    #ifdef WITH_PARTITION_STORAGE_ENGINE
      if (old_part_info)
      {
        lpt->table->file->set_part_info(old_part_info, false);
      }
    #endif
    DBUG_RETURN(error);

nohup /ffp/bin/make -C . &
renice -11 `pidof cc1plus` -p `pidof make` -p `pidof as` -p `pidof ld` -p `pidof configure` -p `pidof cc1` -p `pidof ccmake`
tail -f nohup.out

rm -v /tmp/$NEW_BUILD_NAME-*.txz
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -q $NEW_BUILD_NAME
funpkg -i ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz

# see also CREATE SYSTEM DB (first step and mandatory before using mysql)
# search my blog for: CREATE SYSTEM DB

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.