KomodoOcean icon indicating copy to clipboard operation
KomodoOcean copied to clipboard

MacOS cross-compile: the C compiler is not able to compile a simple test program error

Open DeckerSU opened this issue 1 year ago • 1 comments

Cross-compilation for MacOS on the following system:

Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy

Could lead to the following error:

CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/home/decker/KomodoOcean/depends/x86_64-apple-darwin19/native/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/decker/KomodoOcean/depends/work/build/x86_64-apple-darwin19/native_libtapi/664b8414f89612f2dfd35a9b679c345aa5389026-8a16f55cbed/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_de3a4/fast && gmake[1]: Entering directory '/home/decker/KomodoOcean/depends/work/build/x86_64-apple-darwin19/native_libtapi/664b8414f89612f2dfd35a9b679c345aa5389026-8a16f55cbed/build/CMakeFiles/CMakeTmp'
    /usr/bin/gmake  -f CMakeFiles/cmTC_de3a4.dir/build.make CMakeFiles/cmTC_de3a4.dir/build
    gmake[2]: Entering directory '/home/decker/KomodoOcean/depends/work/build/x86_64-apple-darwin19/native_libtapi/664b8414f89612f2dfd35a9b679c345aa5389026-8a16f55cbed/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_de3a4.dir/testCCompiler.c.o
    /home/decker/KomodoOcean/depends/x86_64-apple-darwin19/native/bin/clang    -o CMakeFiles/cmTC_de3a4.dir/testCCompiler.c.o -c /home/decker/KomodoOcean/depends/work/build/x86_64-apple-darwin19/native_libtapi/664b8414f89612f2dfd35a9b679c345aa5389026-8a16f55cbed/build/CMakeFiles/CMakeTmp/testCCompiler.c
    /home/decker/KomodoOcean/depends/x86_64-apple-darwin19/native/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
    gmake[2]: *** [CMakeFiles/cmTC_de3a4.dir/build.make:78: CMakeFiles/cmTC_de3a4.dir/testCCompiler.c.o] Error 127
    gmake[2]: Leaving directory '/home/decker/KomodoOcean/depends/work/build/x86_64-apple-darwin19/native_libtapi/664b8414f89612f2dfd35a9b679c345aa5389026-8a16f55cbed/build/CMakeFiles/CMakeTmp'
    gmake[1]: *** [Makefile:127: cmTC_de3a4/fast] Error 2
    gmake[1]: Leaving directory '/home/decker/KomodoOcean/depends/work/build/x86_64-apple-darwin19/native_libtapi/664b8414f89612f2dfd35a9b679c345aa5389026-8a16f55cbed/build/CMakeFiles/CMakeTmp'

The solution is:

sudo apt install libtinfo5 

DeckerSU avatar Mar 17 '23 01:03 DeckerSU

sudo apt install libcap-dev libbz2-dev

Also this may be useful when cross compiling under Ubuntu 22.04.2 LTS for MacOS and build native_cdrkit.

DeckerSU avatar Mar 17 '23 02:03 DeckerSU