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

Build instructions ? #1

Closed
niallp opened this issue Jun 8, 2022 · 12 comments
Closed

Build instructions ? #1

niallp opened this issue Jun 8, 2022 · 12 comments
Assignees

Comments

@niallp
Copy link

niallp commented Jun 8, 2022

Following the build instructions in the README, I get

niall@preston:~/sandbox/qtpokit$ cmake -E make_directory tmp-build
niall@preston:~/sandbox/qtpokit$ cmake -D CMAKE_BUILD_TYPE=Release -S . -B tmp-build
CMake Error: The source directory "/home/niall/sandbox/qtpokit/tmp-build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Trying build on Ubuntu 18.04, Qt v 5.9.5 ...

@pcolby
Copy link
Owner

pcolby commented Jun 8, 2022

Hi @niallp 😄 Hmm. Curious. It works fine for me (with Qt 5.9.9 through to Qt 6.3.0).

paul@jafar:~/src/pokit-tmp$ cmake -E make_directory tmp-build
paul@jafar:~/src/pokit-tmp$ cmake -D CMAKE_BUILD_TYPE=Release -S . -B tmp-build
-- CMake version is 3.22.1
-- CMake build type is Release
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found WrapOpenGL: TRUE  
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Found WrapVulkanHeaders: /usr/include  
-- Found Qt 6.2.4
-- Found Qt Bluetooth 6.2.4
-- Found Doxygen: /home/paul/bin/doxygen (found version "1.9.4 (5d15657a55555e6181a7830a5c723af75e7577e2)") found components: doxygen dot 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/paul/src/pokit-tmp/tmp-build

What version of CMake do you have?

cmake --version

CMake Error: The source directory "/home/niall/sandbox/qtpokit/tmp-build" does not appear to contain CMakeLists.txt.

That output kind of suggests that you changed into the tmp-build directory before running the second cmake command?

Perhaps try using absolute paths instead, like:

cmake -D CMAKE_BUILD_TYPE=Release -S ~/sandbox/qtpokit -B ~/sandbox/qtpokit/tmp-build

@pcolby pcolby self-assigned this Jun 8, 2022
@niallp
Copy link
Author

niallp commented Jun 9, 2022

The 2nd cmake call was made in same folder (root of cloned git repo), directly after executing the first cmake ... (all it seems to do is make a bare folder FWIW)

An older version of cmake ... v3.10.2, as far as I'm aware the default for Ubuntu 18.04.

I'll find a more recent install and try it there.

@pcolby
Copy link
Owner

pcolby commented Jun 9, 2022

An older version of cmake ... v3.10.2

Ah, it seems -B was added in CMake 3.13:

The cmake(1) command gained the -B <build_dir> command line option to specify the location of the build directory.

So, just cd into the directory and adjust the -S accordingly. eg:

cmake -E make_directory tmp-build
cd tmp-build
cmake -D CMAKE_BUILD_TYPE=Release -S ..

Cheers.

@pcolby
Copy link
Owner

pcolby commented Jun 9, 2022

BTW, I suspect you'll need CMake 3.12 or later to build successfully, but let us know how you go.

@niallp
Copy link
Author

niallp commented Jun 9, 2022

It did get further without -B, needed a few -dev packages (qtbase-dev, qtdeclarative5-dev, qtconnectivity5-dev) but eventually died from the CMake 3.12+ requirement... definitely need something newer.

What distro are you developing on ?

@pcolby
Copy link
Owner

pcolby commented Jun 9, 2022

I'm mostly developing on Ubuntu 21.10 and 22.04, but the GitHub Actions CI builds are currently:

  • Ubuntu 20.04.4
  • macOS 11.6.6; and
  • Windows Server 2022 10.0.203

You can probably relax the cmake 3.12 requirement if you're willing to forgo the CLI application's unit tests (you can still build and run the CLI app, just not the tests). I'll put up a modified branch for you in a couple of hours if you like, to try that option out.

Cheers.

@pcolby
Copy link
Owner

pcolby commented Jun 9, 2022

can probably relax the cmake 3.12 requirement if you're willing to forgo the CLI application's unit tests

I don't have any CMake's old enough to test with, but have a go a the 1-cmake-pre-3.12 branch. It detects CMake's earlier than 3.12, and for those, it skips the CLI unit tests (since they depend on CMake's Object Libraries feature). So if you build with that branch, you should see CMake stating something like this in the initial output:

-- Skipping testAbstractCommand (needs CMake 3.12+)
-- Skipping testCalibrateCommand (needs CMake 3.12+)
-- Skipping testDeviceCommand (needs CMake 3.12+)
-- Skipping testDsoCommand (needs CMake 3.12+)
-- Skipping testFlashLedCommand (needs CMake 3.12+)
-- Skipping testInfoCommand (needs CMake 3.12+)
-- Skipping testLoggerFetchCommand (needs CMake 3.12+)
-- Skipping testLoggerStartCommand (needs CMake 3.12+)
-- Skipping testLoggerStopCommand (needs CMake 3.12+)
-- Skipping testMeterCommand (needs CMake 3.12+)
-- Skipping testScanCommand (needs CMake 3.12+)
-- Skipping testSetNameCommand (needs CMake 3.12+)
-- Skipping testStatusCommand (needs CMake 3.12+)

This shouldn't affect the code in any way, just means that some (CLI-only) unit tests will be skipped.

Let us know how it goes. Thanks 😄

@niallp
Copy link
Author

niallp commented Jun 9, 2022

Something different but not there yet:

niall@preston:~/sandbox/qtpokit/tmp-build$ cmake -D CMAKE_BUILD_TYPE=Release -S ..
-- CMake version is 3.10.2
-- CMake build type is Release
-- The CXX compiler identification is GNU 7.5.0
-- 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- QtPokit -pre
-- Found Qt 5.9.5
-- Found Qt Bluetooth 5.9.5
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.13") found components:  doxygen dot 
CMake Error at src/app/CMakeLists.txt:37 (target_link_libraries):
  Object library target "PokitApp" may not link to anything.


-- Configuring incomplete, errors occurred!
See also "/home/niall/sandbox/qtpokit/tmp-build/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

@pcolby
Copy link
Owner

pcolby commented Jun 9, 2022

Ah yes, that's another place that it need CMake 3.12+. I'll need to have a think about the best way to get around that one (or not support pre-3.12).

@niallp
Copy link
Author

niallp commented Jun 9, 2022

Yet another reason for me to move on from 18.04 I guess ... ;)

@pcolby
Copy link
Owner

pcolby commented Jun 10, 2022

Ok, I've just pushed another update to the 1-cmake-pre-3.12 branch. I've actually tested it against the same CMake version you have (3.10.2), and also as far back as CMake 3.1.3., so it should be good to go now (subject to the same unit tests limitation as before).

Note, it turns out to be really easy (on Ubuntu 21.10 at least) to use binary CMake versions from https://cmake.org/files/ - I highly recommend you download one of the latest ones, and give it a try 😉

But let us know how you go with the 1-cmake-pre-3.12 branch, and if its all good I can merge the changes into main.

Cheers.

@niallp
Copy link
Author

niallp commented Jun 10, 2022

That now builds OK, app seems to work mostly (some oddness on device naming to explore, lots to learn !)

The new cmake (v3.23.2) also works well, the original build instructions apply verbatim.

Thanks !

@niallp niallp closed this as completed Jun 10, 2022
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