This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2PXEVM: Using CMake with gcc 4.9

Part Number: TDA2PXEVM
Other Parts Discussed in Thread: SYSBIOS

Hi,

I am trying to initialize CMAKE to work with gcc 4.9 for the TI-RTOS with the VSDK.

I created a CMAKE configuration file and run the CMAKE to configure everything. In my code pthread library is a must so CMAKE is looking for it but fails as follows:

cmake .. -DCMAKE_BUILD_TYPE=Release ... -DCMAKE_TOOLCHAIN_FILE="../build_tools/cmake/arm32-toolchain.cmake"
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: ../PROCESSOR_SDK_VISION_03_08_00_00/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc
-- Check for working C compiler: ../PROCESSOR_SDK_VISION_03_08_00_00/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: ../PROCESSOR_SDK_VISION_03_08_00_00/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-g++
-- Check for working CXX compiler: ../PROCESSOR_SDK_VISION_03_08_00_00/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Code Coverage NOT found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindThreads.cmake:220 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:213 (find_package)

It seems that the compiler does not support pthread: "-- Check if compiler accepts -pthread - no"

The compiler I am version is as follows, as you can see it says --disable-threads:

gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=/home/eyesight/PROCESSOR_SDK_VISION_03_08_00_00/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/home/eyesight/PROCESSOR_SDK_VISION_03_08_00_00/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/lto-wrapper
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-9-build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC-4-9-build/install-native --libexecdir=/home/build/work/GCC-4-9-build/install-native/lib --infodir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-9-build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-isl=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,cortex-m7,armv7-r
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977] (GNU Tools for ARM Embedded Processors)

When I search for pthread in both the GCC and the SDK I cannot find any libraries or shared object though I do find a source code

CMAKE version used: 3.16.3

How can I solve this issue?

Is this the wrong compiler that I am using?

Thanks.

  • Hi,

    Why don't you use the gmake or make build configuration instead of cmake?

    Thanks

    Gaviraju

  • Hi Gaviraju,

    Thanks for the suggestion, however we do not have the make files, CMAKE creates them after I configure it.

    Thanks.

  • Hi,

    For SYSBIOS RTOS the pthread support is given by XDC bios-tools.

    PROCESSOR_SDK_VISION_xx_xx_00_00\ti_components\os_tools\bios_x_xx_xx_00\packages\ti\sysbios\posix\pthread.h

    C:\PROCESSOR_SDK_VISION_xx_xx_00_00\ti_components\os_tools\bios_x_xx_xx_00\packages\ti\sysbios\posix\pthread.c

    Add the below changes in .cfg file to support posix pthread support in RTOS. (ex: vision_sdk/links_fw/src/rtos/bios_app_common/tda2xx/a15_0/a15_0.cfg)

    var Settings = xdc.useModule('ti.sysbios.posix.Settings');
    Settings.supportsMutexPriority = true;

     

     


    Thanks

    Gaviraju

  • Hi Gaviraju,

    Thanks for the answer.

    I have done the changes in the configuration file as you indicated.

    CMAKE does not compile the "pthread.c" code it only searches for the pthread library.

    How do I "tell" the SDK to build the pthread library? I think that I need to run a configuration utility that will use the new configuration file and build the pthread library. I search the Internet but could not find how to do this.

    Thanks.

  • Hi,

    The TI SYS-BIOS  RTOS compiler do not have pthread library support.

    In order use pthread API in our code we are adding the below changes in the .cfg files.

    var Settings = xdc.useModule('ti.sysbios.posix.Settings');
    Settings.supportsMutexPriority = true;

     


    After adding the above changes we are running the below commands to build the pthread.c source file as a part of RTOS binary.

    cd $INSTALL_DIR/vision_sdk/build

    gmake -s -j

    Sample build log:

    Thanks

    Gaviraju

     

     

  • Hi Gaviraju,

    thanks for the answer.

    in addition to what you wrote above i need to change the location of the compiler to match what I have on my machine; this was done in the file~/PROCESSOR_SDK_VISION_03_08_00_00/vision_sdk/build/tools_path.mk

    after doing the change (and using make instead of gmake) the build process started.

    how ever I have a lot of build errors (the following are a sample):

    algorithmLink_cfg.c", line 79: fatal error: cannot open source file "system_cfg.h"
    1 catastrophic error detected in the compilation of "algorithmLink_cfg.c".
    Compilation terminated.

    "system_initDeinitLinks.c", line 130: fatal error: cannot open source file "linksInclude_c66xdsp_2.h"
    1 catastrophic error detected in the compilation of "system_initDeinitLinks.c".
    Compilation terminated.

    And so on. should I change something more?

    Thanks,

  • Hi,

    We no need to change the file "tools_path.mk" . Please refer the user-guide to build the vision SDK code.

    File: vision_sdk/docs/UserGuides/

    Thanks

    Gaviraju