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

Clarify which build instructions to look at for C++ vs C at the top of the README. #45

Open
SeppeG opened this issue May 6, 2022 · 8 comments

Comments

@SeppeG
Copy link

SeppeG commented May 6, 2022

Hi PointOne

While trying out the Septentrio example, I found out that the CMakelist is not quite right. If you follow the instructions, not all examples are built.

I did get it working with the Raspberry Pi and the Septentrio mosaicHAT, and am impressed with the accuracy!

@adamshapiro0
Copy link
Contributor

Hi Seppe,

Do you know which examples were not built for you? I just ran the C++ cmake instructions and I believe all of the examples were built correctly.

Were you able to move or change one of the CMakeLists.txt file in a way that helped?

@SeppeG
Copy link
Author

SeppeG commented May 9, 2022

According to the readme, i should make a build directory in polaris/c and run cmake .. and make, when I do that only 3 examples are build:

[ 42%] Built target polaris_client
[ 71%] Built target connection_retry
[100%] Built target simple_polaris_client

to build the septentrio examples you have to cd to polaris/examples and run cmake .. and make but i dont see it in the readme.

@adamshapiro0
Copy link
Contributor

Ah, I believe you may have followed the instructions in the "Polaris C Client" section for building the C language library in polaris/c/ (https://github.com/PointOneNav/polaris#polaris-c-client). That builds only the C library and the C examples (polaris/c/examples/).

The top-level directory (polaris/) contains the C++ library. The files in polaris/examples/ are all C++ applications. The instructions to build them are in the "Polaris C++ Client" section here: https://github.com/PointOneNav/polaris#polaris-c-client-1 (ignore the fact that it says "c-client-1" in the URL, Github markdown ignores the ++ in the section title).

Let me know if that works a little better.

@SeppeG
Copy link
Author

SeppeG commented May 9, 2022

I got it working, but it wasn't that clear at first 🙃

@adamshapiro0
Copy link
Contributor

Gotcha. We'll see if we can make that a little more clear up front in the README.

Just to be 100% clear though, you should be able to just do the following to build the C++ library and examples:

cd polaris
mkdir build
cd build
cmake ..
make

You shouldn't really need to build inside polaris/examples/ yourself ever.

@adamshapiro0 adamshapiro0 changed the title Incorrect placement of CMakelist for examples Clarify which build instructions to look at for C++ vs C at the top of the README. May 9, 2022
@SeppeG
Copy link
Author

SeppeG commented May 12, 2022

cd polaris
mkdir build
cd build
cmake ..
make

This gives me:

seppe:~/Documents$ git clone [email protected]:PointOneNav/polaris.git
Cloning into 'polaris'...
seppe:~/Documents$ cd polaris/
seppe:~/Documents/polaris(master)$ mkdir build
seppe:~/Documents/polaris(master)$ cd build
seppe:~/Documents/polaris/build(master)$ cmake ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- 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: /usr/lib/ccache/c++
-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/FindGflags.cmake:121 (message):
  Failed to find gflags - Could not find gflags include directory, set
  GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
Call Stack (most recent call first):
  cmake/FindGflags.cmake:464 (gflags_report_not_found)
  CMakeLists.txt:28 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/seppe/Documents/polaris/build/CMakeFiles/CMakeOutput.log".

@adamshapiro0
Copy link
Contributor

Did you install the requirements in the C++ instructions (https://github.com/PointOneNav/polaris#cmake-1)?

sudo apt install libssl-dev libgflags-dev libgoogle-glog-dev libboost-all-dev

Note that this is different than the C library, which only requires libssl-dev.

@SeppeG
Copy link
Author

SeppeG commented May 12, 2022

Oh yes, my mistake

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

2 participants