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

fprime-util install fails for libSvc_LinuxTime #1

Open
brinkap opened this issue Nov 1, 2020 · 3 comments
Open

fprime-util install fails for libSvc_LinuxTime #1

brinkap opened this issue Nov 1, 2020 · 3 comments

Comments

@brinkap
Copy link

brinkap commented Nov 1, 2020

Issue

I'm able to successfully fprime-util generate and fprime-util build the application. When I attempt to run fprime-util install I get the following CMake error:

CMake Error at F-Prime/Svc/LinuxTime/cmake_install.cmake:36 (file):
  file INSTALL cannot find
  "/home/dev/oosfprime/fprime-arduino/ArduinoBlink/build-fprime-automatic-Teensyduino/lib/Teensyduino/libSvc_LinuxTime.a":
  No such file or directory.
Call Stack (most recent call first):
  F-Prime/Svc/cmake_install.cmake:60 (include)
  cmake_install.cmake:39 (include)

Workaround

I have a work around to go into the fprime/Svc/CmakeLists.txt and fprime/Drv/CmakeLists.txt and comment out the offending components like so:

# in fprime/Svc/CmakeLists.txt
...
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/GroundInterface/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Health/")
# add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxTime/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxTimer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PassiveConsoleTextLogger/")
...
# in fprime/Drv/CmakeLists.txt
...
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxSpiDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxI2cDriver/")
# add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SocketIpDriver/")

Then the application builds as expected.

More Info

Upon closer inspection, this is the first of two fprime libraries excluded by the application in fprime-arduino.cmake

set_target_properties(
    Svc_LinuxTime
    Drv_SocketIpDriver
    PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)

It appears the target propery is being correctly set and the static libraries are in fact properly excluded from the build. However, the install step is still looking for the library and is not properly excluded from the build so to speak.

The fprime-util generate step invokes the generate_library CMake macro (defined in cmake/support/Module.cmake)

function(generate_library MODULE_NAME SOURCE_FILES_INPUT DEPS_INPUT)
  # ... (code omitted)
  # Install the executable, if not excluded and not testing
  get_target_property(IS_EXCLUDE_FROM_ALL "${MODULE_NAME}" "EXCLUDE_FROM_ALL")
  if ("${IS_EXCLUDE_FROM_ALL}" STREQUAL "IS_EXCLUDE_FROM_ALL-NOTFOUND" AND
      NOT CMAKE_BUILD_TYPE STREQUAL "TESTING") 
      install(TARGETS "${MODULE_NAME}"
          RUNTIME DESTINATION "bin/${PLATFORM}"
          LIBRARY DESTINATION "lib/${PLATFORM}"
          ARCHIVE DESTINATION "lib/static/${PLATFORM}"
      )
  endif()
  # ... (code omitted)
endfunction(generate_library)

But the target property cannot be set before invoking this support macro since it does not yet exist.

I imagine with the new out-of-source build in Fprime 1.5.1 that a proper solution would be to not modify the source fprime code in any way. Perhaps there could be a new fprime_* macro that could be used to properly exclude default Svc and Drv components or perhaps the execution order of the fprime-util could be modified so the the install logic checking for the EXCLUDE_FROM_ALL property would occur after the application had a chance to set that property (likely in a second pass after the generate_library macro is called.)

Great work on the out-of-source build and user documentation! Great work!

@Joshua-Anderson
Copy link

Joshua-Anderson commented Nov 2, 2020

@brinkap Thanks so much for investigating this! This writeup was super awesome and helpful. We rebuilt the cmake install target in our internal repo because we wanted to avoid building unnecessary libraries, but I didn't consider the implications for building excluded libraries, so that's a good find.

I think our install target refactor should resolve this issue, and I'll make sure to double check against this arduino example.

@brinkap
Copy link
Author

brinkap commented Nov 13, 2020

@Joshua-Anderson Thanks for response. Do you have a FPrime target release for that target refactor that should fix this issue? I'm interested in this feature not just for a this Arduino example but for a TI Hercules cortex-R5 board I've been working on in support of a JPL application. If internal development branches implement this change, I test it out for you too.

@Joshua-Anderson
Copy link

The last part of the changes were merged in here. It'll be released in the next fprime release, but you can test it on the devel branch now.

I haven't tested the changes against this arduino project yet since I don't have toolchain setup (it'll get tested sometime before the offical release), but I'm pretty sure the issue is resolved now.

LeStarch pushed a commit that referenced this issue Aug 6, 2023
* featherM0 cmake & HardwareRateDriver

* Add basic timer, support for featherM0
LeStarch pushed a commit that referenced this issue Aug 12, 2023
* featherM0 cmake & HardwareRateDriver

* Add basic timer, support for featherM0

update basic timer

commit 01dc1ccb5034822ace8c6c6477b0e964dc5ebdbc
Author: Ethan Chee <[email protected]>
Date:   Tue Jul 18 15:37:08 2023 -0700

    Move setup_arduino_libraries call for i2c linking

commit 98ada04b3903b5fb61ac5ce28e5bbf7f0da0a42e
Author: Ethan Chee <[email protected]>
Date:   Mon Jul 17 22:41:54 2023 -0700

    Fix I2cDriver Wire.h linking error

commit 2f35207ff70904782ab98d034404b550757f736c
Author: Ethan Chee <[email protected]>
Date:   Fri Jun 23 10:20:25 2023 -0700

    teensy32 cmake compile options

commit 91d43b0456ba9b560a0af0abf63befc5ea86aa10
Author: Ethan Chee <[email protected]>
Date:   Tue Jun 20 09:46:21 2023 -0700

    I2C Driver requires Wire library

commit cd6aa4cca01d6492d8cd1dd10e0927ca6be80a76
Author: Ethan Chee <[email protected]>
Date:   Thu Jun 15 17:39:42 2023 -0700

    Restrict platform ArduinoFw

commit 625a6f488c4b432c5fd81457c80d9411c8c0e459
Author: Ethan Chee <[email protected]>
Date:   Mon Jun 12 14:14:22 2023 -0700

    cleanup

commit 59273b4f89274a9c5b66668a7edd90ad61e5ed18
Author: Ethan Chee <[email protected]>
Date:   Thu Jun 8 08:53:28 2023 -0700

    Add I2cDriver.close() / Wire.end()

commit 2cb7fca1c57ec5a886c98c75f176875ca797397d
Author: Ethan Chee <[email protected]>
Date:   Wed Jun 7 17:30:16 2023 -0700

    Arduino I2cDriver

commit 91ac63cd11ae2d13f2dfbf636e5d3a9478c4871e
Author: Ethan Chee <[email protected]>
Date:   Wed May 31 15:30:11 2023 -0700

    compile bug fixes for featherM0 and teensy41

commit 8d77126e8df261223b3d3eb190718013f31f7ffe
Merge: 068d725 36588d2
Author: Ethan Chee <[email protected]>
Date:   Wed May 31 15:20:47 2023 -0700

    Merge pull request #2 from SterlingPeet/mbed-work

    Mbed work

commit 36588d25ebb26375f05d6d47ea46d82f6898004d
Author: M Starch <[email protected]>
Date:   Wed May 31 12:31:27 2023 -0700

    Fixing multiple target definitions when using multiple deployments

commit e58ed092cec5c98d047aa7d21d7f2b53c5ab37b0
Author: M Starch <[email protected]>
Date:   Wed May 31 12:12:27 2023 -0700

    Bug fixes for stream driver work

commit e3c5ca4fa4504451cb10fed6896c0dc3450a5d51
Author: M Starch <[email protected]>
Date:   Sun May 28 14:37:20 2023 -0700

    Adding featherrp20404rfm

commit 91f7d214d839a5f2c35d5eaa03cf760287d41e83
Author: M Starch <[email protected]>
Date:   Sun May 28 14:36:45 2023 -0700

    Changing serial driver to stream driver

commit cb6a9a211234427440074953eeb9603d04bc47c5
Author: M Starch <[email protected]>
Date:   Thu May 25 09:46:03 2023 -0700

    Working rp2040 builds

commit 109f23748726f2e91ddbc15aae37edacda3c4b6e
Merge: b498ed3 068d725
Author: M Starch <[email protected]>
Date:   Wed May 24 18:48:10 2023 -0700

    Merge pull request #7 from ethancheez/mbed++

    support for feather

commit 068d725ae3f56c15662faada6f2b4a73d936489d
Author: Ethan Chee <[email protected]>
Date:   Wed May 24 17:54:29 2023 -0700

    support for feather

commit b498ed378676fb10644a070f0fd63eb357850966
Author: M Starch <[email protected]>
Date:   Thu May 18 13:16:22 2023 -0700

    Fixing rate driver to drive

commit fb7e074ba1fd5c92a9a3107628422d7ab18679b4
Author: M Starch <[email protected]>
Date:   Wed May 17 11:11:08 2023 -0700

    Minor fixes to post-command and C++ improvements

commit b5e93fc8afd788445c487940b7bcef9bbd71b010
Author: M Starch <[email protected]>
Date:   Fri May 12 20:10:04 2023 -0700

    Initial work with external script

commit 8c22756077c51e4a103718823694bc07e5ccb9a2
Author: M Starch <[email protected]>
Date:   Sat Feb 25 00:07:40 2023 -0800

    initial mbed work

commit b833e631bae74d352e6ac0006f3474eca1828b23
Author: M Starch <[email protected]>
Date:   Fri Dec 16 17:29:17 2022 -0800

    cleaned up arduino library support

commit 1caa5310d72f15f01343a206b22eb757ad4f17b6
Author: M Starch <[email protected]>
Date:   Fri Dec 16 15:57:31 2022 -0800

    library support working for teensy41

commit 36cdc56c628641670df680abdc47732b2baba042
Author: M Starch <[email protected]>
Date:   Wed Dec 14 12:00:36 2022 -0800

    adding SPI.h

commit af11d22d449b37f939d7a7c542858c86b6679738
Author: M Starch <[email protected]>
Date:   Wed Dec 14 02:22:47 2022 -0800

    fixing .hex copy

commit 0c16693ace157ca3f9ecfe71f87698584b2664cd
Author: M Starch <[email protected]>
Date:   Wed Dec 14 02:02:43 2022 -0800

    adding .hex file to install

commit 69cfe2edd6f157762c48e8557e3f09e53b34c8bf
Author: M Starch <[email protected]>
Date:   Wed Dec 14 01:51:01 2022 -0800

    updating to handle archiving and ranlib

commit 2bf1ba487197fa9cd6ea4d61bed923e7396fb12e
Author: M Starch <[email protected]>
Date:   Tue Dec 13 23:23:13 2022 -0800

    adding wire library

commit 63ad8f163d0633d44922c386c5c64e34b88beb98
Author: M Starch <[email protected]>
Date:   Tue Dec 13 11:07:03 2022 -0800

    fixing serial driver to report ready

commit b4ff7fb685e9135f10b1db8be086fea2d0a370c0
Author: M Starch <[email protected]>
Date:   Tue Dec 13 09:11:49 2022 -0800

    fixing serial driver, gpio driver, stream log

commit 207fa6e42e27f19acab5240bed1a1e3da64d7bb5
Author: M Starch <[email protected]>
Date:   Wed Dec 7 21:27:43 2022 -0800

    lestarch: working on teensy32

commit 7421568bad4cd0ceb02662db22c8a6df66286985
Author: M Starch <[email protected]>
Date:   Wed Dec 7 19:18:29 2022 -0800

    removing old arduino support

commit 2c891be4e95cb373974d8f1702061ebcba175288
Author: M Starch <[email protected]>
Date:   Wed Dec 7 19:04:44 2022 -0800

    lestarch: adding teensy 4 toolchains

commit 106e2fe22618e8da22ffda61b5399514b2a7cd3e
Author: M Starch <[email protected]>
Date:   Sun Oct 16 13:07:10 2022 -0700

    lestarch: cleaning up linking command

commit 3b8720b7319be4166d947a0e44f226743452a18c
Author: M Starch <[email protected]>
Date:   Sun Oct 16 12:37:37 2022 -0700

    lestarch: updating components for fprime 3, fixing linking

commit 042e0a745e850dd253c4e0a24f148d11f78dcf4c
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 16 11:13:45 2022 -0500

    WIP: Kludge to update HardwareRateDriver without config

commit d97e366966d5a09b82d8c11188247a76fec6421a
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 16 10:52:55 2022 -0500

    Kludge to remove configuration from Serial Driver that is not accessible

commit 4d919fab594cacadf52bdf250b94f235dafa9e3d
Author: Sterling Peet <[email protected]>
Date:   Sat Oct 15 12:10:31 2022 -0500

    Add kludgy support for TimerOne library, to be generalized later...

commit 824115ef41668d8787e0482b103fd68e1519b437
Author: M Starch <[email protected]>
Date:   Fri Oct 14 13:24:32 2022 -0700

    lestarch: more AVR fixes

commit 8ff13c4a81998532b3d4a13696fcda4894f6431c
Author: Sterling Peet <[email protected]>
Date:   Fri Oct 14 14:30:47 2022 -0400

    Add new header for OS tasks

commit dea454604830a1724b2d53d50a3ac788425be625
Author: Sterling Peet <[email protected]>
Date:   Fri Oct 14 14:16:19 2022 -0400

    First pass at ATmega128 support

commit 054dae63d75e6bf7d14c91deffea398a55b87d32
Author: M Starch <[email protected]>
Date:   Thu Oct 13 09:01:00 2022 -0700

    lestarch: gpio driver rework

commit c85d1831b2ad4b938a3be073746a6ba20e512b23
Author: M Starch <[email protected]>
Date:   Fri Oct 7 16:45:25 2022 -0700

    lestarch: adding gpio driver and refactoring types

commit d9b932cff4a1f58be42565901c6cd953db3e3393
Author: M Starch <[email protected]>
Date:   Fri Oct 7 13:46:28 2022 -0700

    lestarch: refactoring standard components

commit cafcad69a53f9fea8c817ddb29dc38a604d3f6ac
Author: M Starch <[email protected]>
Date:   Sat Oct 1 09:33:22 2022 -0700

    lestarch: arduino package WIP

commit b95919382c4f627f27b2d099f9f37b8f7a28bd7f
Author: M Starch <[email protected]>
Date:   Mon Sep 26 17:53:01 2022 -0700

    lestarch: rearranging former Arduino packages

commit 72e5a5e6c0d01708aa0801a501e495ad22d1507b
Author: M Starch <[email protected]>
Date:   Mon Sep 26 17:44:35 2022 -0700

    lestarch: arduino-cli passes cmake compile checks

commit 379c1ff8110fc06a32179ddd914f29a776b39e6e
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 16:16:07 2021 -0500

    missed slashes

commit 99cdf44b8a110f8f3ecbc8c5c5f37c04c5813e2a
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 16:14:22 2021 -0500

    fix file paths

commit 7191510d58ed51e2cddd31c2a53788a7877ca6ea
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 16:12:09 2021 -0500

    dont print all that

commit 04d4288c2847f9fa9c7938edfcd86308ae414d44
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 14:24:09 2021 -0500

    Fix missing definitions

commit fba21d0319626bd985dfd7b68b1556da2cfe24d6
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 08:55:19 2021 -0500

    add init to HardwareRateDriver and fix path to TimerOne library

commit f7cc6e19c6687a35527e6f4cd2be0673d9a36dae
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 00:49:58 2021 -0500

    fix HardwareRateDriver paths

commit fc28e79069316afb481138eb6c9eb3366992b341
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 00:08:46 2021 -0500

    Update paths in AssertReset

commit 29bb59b03ffb8b5c597427e34d823297d1ef20b4
Author: Sterling Peet <[email protected]>
Date:   Tue Nov 9 23:55:36 2021 -0500

    ATmega Types

commit 88b334ee22c03cb88f343e721a36c2cba7b5041f
Author: Sterling Peet <[email protected]>
Date:   Tue Nov 9 23:44:07 2021 -0500

    cmake generation works, not building yet

commit b0f7e63d46c3ce3f6098c82047badb327125de76
Author: Sterling Peet <[email protected]>
Date:   Tue Nov 9 22:41:18 2021 -0500

    Add ATmega folders and components

commit 08eefead00fdb7028ab2daa88d17199f0333a357
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 24 21:49:38 2021 -0400

    Add starting point for toolchain and platform files

commit b80102df98e466c9c4d30dac6761d0d943e34dd2
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 24 20:07:52 2021 -0400

    add some things to get started

merge esp32

merge rpipicow

merge spi-driver

cleanup and bug fixes

Fix bug causing use of -isystem instead of -I

ATmega128 support (#3)

* ATmega128 builds

* Update basic types for ATmega missing dependencies

fix ATmega128 TimerOne include (#4)

* ATmega128 builds

* Update basic types for ATmega missing dependencies

* use basic timer instead of TimerOne (ATmega128)

add pico

Minor renaming and adjustments

Minor fixes to hqardware rate driver

Adding missing files from previous implementation
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