Missing pthread: Cross Compile library with cmake

citrullin
Posts: 2
Joined: Thu Dec 05, 2019 12:56 am

Missing pthread: Cross Compile library with cmake

Postby citrullin » Wed Jan 29, 2020 2:21 pm

I want to create an Arduino library. The project I want to integrate uses cmake. Since the Arduino IDE also support static libraries, I thought this might be the best way to go. I compiled the most recent gcc for the ESP32. Now cmake is able to compile a simple test program. It wasn't possible with the old gcc. But I still miss pthread. So, I just wanted to know what is the proper way to link pthread?

I currently go with the following, but I am not able to compile it.

Code: Select all

export CC=xtensa-esp32-elf-gcc
export CXX=xtensa-esp32-elf-g++
cd build && cmake -DCMAKE_LIBRARY_PATH=/opt/xtensa-esp32-elf/lib -DCMAKE_INCLUDE_PATH=/home/citrullin/git/newlib-esp32/newlib/libc/include -DCMAKE_INSTALL_PREFIX=$PWD -DCCLIENT_TEST=ON ../iota
The error I get:

Code: Select all

-- Check for working CXX compiler: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++
-- Check for working CXX compiler: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Fetching iota_common
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- 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

Who is online

Users browsing this forum: No registered users and 88 guests