96Boards-Sensorkit -- Install UPM library

I was following the 96Boards Sensorskit Rev.C Getting Started guide. When I tried to install UPM library, I got an error. I’m using Debian 16.09, but the same error with 16.06. Appreciate any suggestion.

linaro@linaro-alip:~/upm/build$ cmake -DBUILDSWIGNODE=OFF …
– The C compiler identification is GNU 4.9.2
– The CXX compiler identification is GNU 4.9.2
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Looking for include file pthread.h
– Looking for include file pthread.h - found
– Looking for pthread_create
– Looking for pthread_create - not found
– 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 - found
– Found Threads: TRUE
– Found PkgConfig: /usr/bin/pkg-config (found version “0.28”)
– checking for module ‘mraa>=1.1.1’
– found mraa, version 1.3.0
– checking for module ‘libbacnet’
– package ‘libbacnet’ not found
– checking for module ‘libmodbus>=3.1.2’
– package ‘libmodbus>=3.1.2’ not found
– checking for module ‘libopenzwave’
– package ‘libopenzwave’ not found
– Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find SWIG: Found unsuitable version “3.0.2”, but required is at
least “3.0.5” (found /usr/bin/swig)
Call Stack (most recent call first):
/usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:341 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.0/Modules/FindSWIG.cmake:74 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:53 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/linaro/upm/build/CMakeFiles/CMakeOutput.log”.
See also “/home/linaro/upm/build/CMakeFiles/CMakeError.log”.

I had the same problem. I saw the error:

Found unsuitable version “3.0.2”, but required is at
least “3.0.5” 

So I found on the Internet how to Install 3.0.10 of swig.
The link is here Install swig 3.0.10
Here are the steps, download the swig-3.0.10.tar.gz file to your Dragonboard.
uncompress using
uncompress swig-3.0.10.tar.gz
Then untar it using
tar xvf swig-3.0.10.tar
Then change to the swig, I cannot remember the exact name.
Then follow the instruction on the link:

./configure --prefix=/usr                      \
            --without-clisp                    \
            --without-maximum-compile-warnings &&
make

Then sudo to root

make install &&
install -v -m755 -d /usr/share/doc/swig-3.0.10 &&
cp -v -R Doc/* /usr/share/doc/swig-3.0.10

After I did this, I got the UPM library to compile. It takes about 40 minutes.
But I am having a problem when I try yo compile C++ code that says upm.h is not found.
So I am still missing some step.