Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DeckerSU opened this issue Mar 17, 2023 · 1 comment

Comments

@DeckerSU
Copy link
Owner

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
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant