[CMake] Cross Compile MySQL Connector/C for Linux/PowerPC architecture using CMake

Neo studywireless at gmail.com
Tue Mar 19 17:27:10 EDT 2013


Hi All,
      I am cross compiling MySQL Connector/C for Linux/PowerPC architecture.
When I run cmake I get the below errors and build process stops.

Command:
Step 1: Setup my toolchain for PowerPC
Step 2: Cmake

cmake -G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX=~/NewDataBaseStuff/mysqlclient_c/lib
-DCMAKE_C_COMPILER="ppc_4xx-gcc" -DCMAKE_CXX_COMPILER="ppc_4xx-g++"
-DCMAKE_C_FLAGS="-c -g -static -I. -I/opt/ELDK/4.2/ppc_4xx/usr/include/"
--debug-trycompile

debug trycompile on
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-gcc
-- Check for working C compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-gcc -- works
-- Detecting C compiler ABI info
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:31
(TRY_COMPILE):
  Cannot copy output executable

    ''

  to destination specified by COPY_FILE:

   
'DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeDetermineCompilerABI_C.bin'

  Unable to find the executable at any of:

   
DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeTmp/cmTryCompileExec
   
DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec
   
DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeTmp/Development/cmTryCompileExec

Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:71
(CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:21 (PROJECT)


-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-g++
-- Check for working CXX compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
.
.
.
.
-- Check size of unsigned long - done
CMake Error at /usr/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  CMakePlatformTests.txt:200 (TEST_BIG_ENDIAN)
  CMakeLists.txt:267 (INCLUDE)


-- Configuring incomplete, errors occurred!

Basically there are two errors

1. Detecting C compiler ABI info: I checked online for solving this error but
couldn't solve it.
2. Testing Big Endian: Again I checked online and one person who had the similar
problem prevented endianess check which resolved his build issue. I too tried
it. I commented the endianess check in CMakePlatformTests.txt, but my build
still failed because of the first issue. Below is the log.

PS: The same command is run

debug trycompile on
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-gcc
-- Check for working C compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-gcc -- works
-- Detecting C compiler ABI info
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:31
(TRY_COMPILE):
  Cannot copy output executable

    ''

  to destination specified by COPY_FILE:

   
'DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeDetermineCompilerABI_C.bin'

  Unable to find the executable at any of:

   
DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeTmp/cmTryCompileExec
   
DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec
   
DIR/mysql-connector-c-6.0.2/CMakeFiles/CMakeTmp/Development/cmTryCompileExec

Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:71
(CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:21 (PROJECT)


-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-g++
-- Check for working CXX compiler: /opt/ELDK/4.2/usr/bin/ppc_4xx-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
.
.
.
-- Check size of int8
-- Check size of int8 - failed
-- Check size of uint8
-- Check size of uint8 - failed
-- Check size of int16
-- Check size of int16 - failed
-- Check size of uint16
-- Check size of uint16 - failed
-- Check size of int32
-- Check size of int32 - failed
-- Check size of uint32
-- Check size of uint32 - failed
-- Check size of u_int32_t
-- Check size of u_int32_t - done
-- Check size of int64
-- Check size of int64 - failed
-- Check size of uint64
-- Check size of uint64 - failed
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Performing Test HAVE_TIMESPEC_TS_SEC
-- Performing Test HAVE_TIMESPEC_TS_SEC - Failed
-- Performing Test QSORT_TYPE_IS_VOID
-- Performing Test QSORT_TYPE_IS_VOID - Success
-- Performing Test SIGNAL_RETURN_TYPE_IS_VOID
-- Performing Test SIGNAL_RETURN_TYPE_IS_VOID - Success
-- Performing Test HAVE_ISNAN
-- Performing Test HAVE_ISNAN - Success
-- Performing Test HAVE_RINT
-- Performing Test HAVE_RINT - Success
-- Performing Test C_HAS_inline
-- Performing Test C_HAS_inline - Success
-- Configuring incomplete, errors occurred!

CMAKE version used is 2.8.7



More information about the CMake mailing list