mjbogusz / wiringPi

Up-to-date WiringPi library with Odroid boards support and CMake building.
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Odroid C1+ - missing pthreads #2

Open mjbogusz opened 7 years ago

mjbogusz commented 7 years ago

Hi, Sorry to miss use this project, but i could not find a issues option in your wiringPi project.

I have odroid C1+ and i want to connect a VL6180X Time-of-Flight Distance sensor. I was very pleased to find your project. The odroid has Ubuntu OS. I downloaden the wiringPI and want to compile it but i get an error. It misses pthreads if i understand correctly, could you help me ?

Regard, Peter

Copied from mjbogusz/rapp-elektron-cupholder issue#1 by @Bodata

mjbogusz commented 7 years ago

Can you post complete compilation log here? (Just remember to put it in triple backticks). And, just to make things clearer, paste also results of following commands: cmake --version gcc --version lsb_release -a

Also a quick search through the internet suggest that to install pthreads on Ubuntu you could try the following command: apt-get install libpthread-stubs0-dev but I'd be honestly surprised if you didn't have that package already.

Bodata commented 7 years ago

Hi,

In reponse of you the following:

  1. when i run "cmake .." i get:

/build$ cmake .. CMake Error at CMakeCPack.cmake:42 (message): Unrecognized processor architecture! Want it added? Create a pull request. Call Stack (most recent call first): CMakeLists.txt:21 (include)

-- Configuring incomplete, errors occurred! See also "/home/odroid/wiringPi-master/build/CMakeFiles/CMakeOutput.log". See also "/home/odroid/wiringPi-master/build/CMakeFiles/CMakeError.log".

  1. When i look into the /home/odroid/wiringPi-master/build/CMakeFiles/CMakeError.log

/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec359680296.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec359680296.dir/CheckFunctionExists.c.o -o cmTryCompileExec359680296 -rdynamic -lpthreads /usr/bin/ld.bfd.real: cannot find -lpthreads collect2: error: ld returned 1 exit status make[1]: Leaving directory `/home/odroid/wiringPi-master/build/CMakeFiles/CMakeTmp' make[1]: [cmTryCompileExec359680296] Error 1 make: [cmTryCompileExec359680296/fast] Error 2

Only copied the end of this file

  1. versions

cmake version 2.8.12.2

gcc-4.9.real (Ubuntu/Linaro 4.9.2-0ubuntu1~14.04) 4.9.2 Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty

Does this explain the problem ?

Regards, Peter

mjbogusz commented 7 years ago

The real error is the one printed by cmake in the beggining:

CMake Error at CMakeCPack.cmake:42 (message):
Unrecognized processor architecture! Want it added? Create a pull request.

The processor is recognized by running uname -m and for Odroid C1+ it should be armhf, but it seems it is not. Could you paste results of running uname -m?

The pthreads error is, as far as I understand, just cmake checking which implementation is available.

PS. When including logs, code etc it's best to put it into backticks or triple backticks for better readability.

Bodata commented 7 years ago

Hi,

uname -m gives armv7l

mjbogusz commented 7 years ago

Okay, I've fixed the bug in architecture recognition. Seems that uname -m can report various things for the same architecture, in this case it was the difference between armhf and arm7l.

Try building the git version now.

mjbogusz commented 7 years ago

Did it build properly? If so I'll push a new version with that fix.

Bodata commented 7 years ago

Sorry yesterday kingsday... so we have a day off.

I removed the directory wiringPi-master, downloaded the the zip file, extraced it. Still get the exactly the same error.

I see you edited but you made arm7l should be armv7l (you missed the "v")

Regards, Peter

mjbogusz commented 7 years ago

Indeed, should be fixed now. Unfortunately, I have no ARMv7 board to test the code...

Try cloning the repo to your computer with git clone https://github.com/mjbogusz/wiringPi.git (it will automatically create wiringPi directory), this way to update you have just to do git pull instead of re-downloading whole thing.

Bodata commented 7 years ago

Ok it is working. With the installation i got an other problem

sudo dpkg -i wiringpi-odroid-*.deb

dpkg: error processing archive wiringpi-odroid-2.42.2-armhf.deb (--install):
 trying to overwrite '/usr/lib/libwiringPi.so', which is also in package wiringpi 20150113-c34db11-9

So i did a

sudo apt-get purge wiringpi

It removed the old wiringpi then i could install your wiringpi.

mjbogusz commented 7 years ago

It would mean that package conflickts are not parsed properly too, my fork conflicts with original wiringPi but dpkg should tell that explicitly. I'll look into that.

Bodata commented 7 years ago

It is no problem for me, the C1+ is out of the box, i did not install the wiringPi as far is i know. Do you expect any problems because of the removal of the original wiringPi ?

mjbogusz commented 7 years ago

No, this one replaces and extends it only. However I'm not sure what was the version of wiringPi was installed originally - I'd presume it was Hardkernel's version which was around 2.0, while my fork is at 2.42. It shouldn't introduce any breaking changes though.

Bodata commented 7 years ago

Hi, Did not want to make an new issue in your vl5310x but i have the same problem

vl53l0x-linux-master/build$ cmake ..
-- Using system WiringPi library
CMake Error at cmake_modules/CPack.cmake:39 (message):
  Unrecognized processor architecture! Want it added? Create a pull request.

Perhaps you could fix this too.

mjbogusz commented 7 years ago

Right, fix should be online now. However, in the original issue you've written that you want to use VL6180X sensor? I'm not sure if the API is the same.