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

Instructions on how to use the example app is vague #8

Open
zoltan-dulac opened this issue Feb 14, 2025 · 5 comments
Open

Instructions on how to use the example app is vague #8

zoltan-dulac opened this issue Feb 14, 2025 · 5 comments

Comments

@zoltan-dulac
Copy link

Hello.

Very interested in trying out IRIS. I went through the README.md file and compiled everything on OSX successfully. However, it is not clear where the example app is and how to run it (I see a section where it mentioned runtime flags, but not the location of the binary and/or if there are specific command I should be running to produce the binary.

I did execute the following so far:

cmake --preset macos-release
cmake -DBUILD_EXAMPLE_APP=ON -DBUILD_TESTS=ON --preset macos-release

Can you tell me where the binary is in the file system? If I need to do another command to produce it, please let me know. I would, of course, update the README.md file with this information if I get it up and running to clarify this to the next developer if you point me in the right direction.

Thanks in advance,
Zoltan.

@blamacaz
Copy link
Collaborator

Hello! When building the project, a bin folder is created in the working directory (this is defined in the CMakePresets.json). So when running the configuration step it will be created and all the generated files from the build will be placed there. The path to the executable of the example app will be "iris_repo_path/bin/build/macos-release/example/". You should be able to find the example console app over there 😄

@zoltan-dulac
Copy link
Author

@blamacaz Thanks so much for your response. I think it's configured right, but for some reason the application is not building.

Below is the output of my command (Note that XXXXXX is obfuscating the user name on this machine). Is there something I am doing wrong or with the output of the build script? Maybe I am doing something wrong? You will see at the end, I list the files generated, but the executable doesn't seem to be in the directory you mentioned.

% pwd
/Users/XXXXXX/git/IRIS

% cmake -DBUILD_EXAMPLE_APP=ON  --preset macos-release                   
Preset CMake variables:

  CMAKE_BUILD_TYPE="Release"
  CMAKE_CXX_COMPILER="/usr/bin/clang++"
  CMAKE_C_COMPILER="/usr/bin/clang"
  CMAKE_INSTALL_PREFIX="/Users/XXXXXX/git/IRIS/bin/install/macos-release"
  CMAKE_TOOLCHAIN_FILE:FILEPATH="/Users/XXXXXX/git/vcpkg/scripts/buildsystems/vcpkg.cmake"
  WINDOWS_PIPELINE:BOOL="FALSE"

-- Running vcpkg install
Detecting compiler hash for triplet x64-osx...
Compiler found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
All requested packages are currently installed.
Total install time: 1.72 ms
The package giflib is compatible with built-in CMake targets:

    find_package(GIF REQUIRED)
    target_link_libraries(main PRIVATE GIF::GIF)

The package gtest is compatible with built-in CMake targets:

    enable_testing()
    
    find_package(GTest CONFIG REQUIRED)
    target_link_libraries(main PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main)
    
    add_test(AllTestsInMain main)

The package nlohmann-json provides CMake targets:

    find_package(nlohmann_json CONFIG REQUIRED)
    target_link_libraries(main PRIVATE nlohmann_json::nlohmann_json)

The package nlohmann-json can be configured to not provide implicit conversions via a custom triplet file:

    set(nlohmann-json_IMPLICIT_CONVERSIONS OFF)

For more information, see the docs here:
    
    https://json.nlohmann.me/api/macros/json_use_implicit_conversions/

opencv provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(OpenCV CONFIG REQUIRED)
  # note: 51 additional targets are not displayed.
  target_link_libraries(main PRIVATE opencv_ml opencv_dnn opencv_dpm opencv_hdf)

The package spdlog provides CMake targets:

    find_package(spdlog CONFIG REQUIRED)
    target_link_libraries(main PRIVATE spdlog::spdlog)

    # Or use the header-only version
    find_package(spdlog CONFIG REQUIRED)
    target_link_libraries(main PRIVATE spdlog::spdlog_header_only)

-- Running vcpkg install - done
-- Found ZLIB: optimized;/Users/XXXXXX/git/IRIS/bin/build/macos-release/vcpkg_installed/x64-osx/lib/libz.a;debug;/Users/XXXXXX/git/IRIS/bin/build/macos-release/vcpkg_installed/x64-osx/debug/lib/libz.a (found suitable version "1.3.1", minimum required is "1")
-- Found ZLIB: optimized;/Users/XXXXXX/git/IRIS/bin/build/macos-release/vcpkg_installed/x64-osx/lib/libz.a;debug;/Users/XXXXXX/git/IRIS/bin/build/macos-release/vcpkg_installed/x64-osx/debug/lib/libz.a (found version "1.3.1")
BUILD UTILS LIBRARY
Export Utils
Build Iris example app
Build tests
Export Iris
-- Configuring done (5.4s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/XXXXXX/git/IRIS/bin/build/macos-release

% ls -lR /Users/XXXXXX/git/IRIS/bin/build/macos-release/example 
total 32
drwxr-xr-x  3 XXXXXX  staff    96 14 Feb 14:25 CMakeFiles
-rw-r--r--  1 XXXXXX  staff  8262 14 Feb 14:25 appsettings.json
-rw-r--r--  1 XXXXXX  staff  1439 14 Feb 14:25 cmake_install.cmake

/Users/XXXXXX/git/IRIS/bin/build/macos-release/example/CMakeFiles:
total 0
drwxr-xr-x  2 XXXXXX  staff  64 14 Feb 14:25 IrisApp.dir

/Users/XXXXXX/git/IRIS/bin/build/macos-release/example/CMakeFiles/IrisApp.dir:
total 0
% 

@zoltan-dulac
Copy link
Author

@blamacaz Sorry ... accidentally closed this ticket, so reopened. If you could let me know if I did anything wrong above in my previous reply, I'd be in your debt. :-)

@blamacaz
Copy link
Collaborator

Absolutely! From what I see, the configuration was run correctly. Have you run afterwards cmake --build --preset macos-release? It needs to be executed to produce the build.
Let me know if you were missing that step, and if not, please paste the log from that command so I can take a look :)

@zoltan-dulac
Copy link
Author

Ahh .. it works now. I was just a little confused of how it was explained in the documentation ... my bad.

Thanks for your help!

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