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

multiple targets - not able to see cfe_msgids.h when building tables #727

Closed
CDKnightNASA opened this issue Jun 2, 2020 · 8 comments
Closed
Assignees

Comments

@CDKnightNASA
Copy link
Contributor

Describe the bug
When building for multiple targets, app tables fail to build, reporting "cfe_msgids.h: No such file or directory".

To Reproduce

git clone https://github.com/nasa/cFS
cd cFS
git submodule init
git submodule update
cp cfe/cmake/Makefile.sample Makefile
cp -r cfe/cmake/sample_defs .
sed -e 's/#SET(TGT2/SET(TGT2/' < .cfe/cmake/sample_defs/targets.cmake > sample_defs/targets.cmake
echo '!' > sample_defs/cpu2_cfe_es_startup.scr
cp sample_defs/cpu1_msgids.h sample_defs/cpu2_msgids.h
sed -e 's/CPU_ID 1/CPU_ID 2/' < sample_defs/cpu1_platform_cfg.h | sed -e 's/CPU_NAME "CPU1"/CPU_NAME "CPU2"/' > sample_defs/cpu2_platform_cfg.h
export SIMULATION=native
make

Expected behavior
Builds.

System observed on:
Debian 10.3 VM

Reporter Info
Christopher.D.Knight@nasa.gov

@CDKnightNASA
Copy link
Contributor Author

make output:

mkdir -p "build"
(cd "build/" && cmake  -DCMAKE_INSTALL_PREFIX=/exe -DCMAKE_BUILD_TYPE=debug "/home/user/cFS/cfe")
-- The C compiler identification is GNU 8.3.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - done
-- Mission configuration sample automatically selected
-- OMIT_DEPRECATED=false: Deprecated elements included in build
-- Module 'sample_app' found at /home/user/cFS/apps/sample_app
-- Module 'sample_lib' found at /home/user/cFS/apps/sample_lib
-- Module 'ci_lab' found at /home/user/cFS/apps/ci_lab
-- Module 'to_lab' found at /home/user/cFS/apps/to_lab
-- Module 'sch_lab' found at /home/user/cFS/apps/sch_lab
-- Module 'cfe-core' found at /home/user/cFS/cfe/fsw/cfe-core
-- Module 'osal' found at /home/user/cFS/osal
-- Configuring for system arch: native
-- The C compiler identification is GNU 8.3.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - done
-- OMIT_DEPRECATED=false: Deprecated elements included in build
-- BSP Selection: pc-linux at /home/user/cFS/osal/src/bsp/pc-linux
-- OSAL Compile Definitions: SIMULATION=native;_LINUX_OS_;_XOPEN_SOURCE=600
-- OSAL Selection: posix at /home/user/cFS/osal/src/os/posix
-- PSP Selection: pc-linux
-- Building App: sample_app install=cpu1;cpu2
NOTE: Selected /home/user/cFS/apps/sample_app/fsw/src/sample_table.c as source for sample_table
NOTE: Selected /home/user/cFS/apps/sample_app/fsw/src/sample_table.c as source for sample_table
-- Building App: sample_lib install=cpu1
-- Building App: ci_lab install=cpu1;cpu2
-- Building App: to_lab install=cpu1;cpu2
-- Building App: sch_lab install=cpu1;cpu2
NOTE: Selected /home/user/cFS/apps/sch_lab/fsw/src/sch_lab_table.c as source for sch_lab_table
NOTE: Selected /home/user/cFS/apps/sch_lab/fsw/src/sch_lab_table.c as source for sch_lab_table
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/cFS/build/native
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/cFS/build
echo " -DCMAKE_INSTALL_PREFIX=/exe -DCMAKE_BUILD_TYPE=debug" > "build/.prep"
make --no-print-directory -C "build" mission-all
Scanning dependencies of target elf2cfetbl
[ 50%] Building C object tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/elf2cfetbl.c.o
[100%] Linking C executable elf2cfetbl
[100%] Built target elf2cfetbl
Scanning dependencies of target mission-version
[100%] Built target mission-version
Scanning dependencies of target mission-prebuild
[100%] Built target mission-prebuild
Scanning dependencies of target native-all
Scanning dependencies of target osal_posix_impl
[  1%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-binsem.c.o
[  1%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-common.c.o
[  2%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-console.c.o
[  3%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-countsem.c.o
[  3%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-dirs.c.o
[  4%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-errors.c.o
[  4%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-files.c.o
[  5%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-filesys.c.o
[  5%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-heap.c.o
[  6%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-idmap.c.o
[  7%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-mutex.c.o
[  7%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-queues.c.o
[  8%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-tasks.c.o
[  8%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-timebase.c.o
[  9%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-fpu.c.o
[  9%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-interrupts.c.o
[ 10%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-posix-gettime.c.o
[ 11%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-console-bsp.c.o
[ 11%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-bsd-select.c.o
[ 12%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-posix-io.c.o
[ 12%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-posix-files.c.o
[ 13%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-posix-dirs.c.o
[ 13%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-no-shell.c.o
[ 14%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/src/os-impl-loader.c.o
[ 14%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-posix-dl-loader.c.o
[ 15%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-posix-dl-symtab.c.o
[ 16%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-bsd-sockets.c.o
[ 16%] Building C object osal/posix_impl/CMakeFiles/osal_posix_impl.dir/__/portable/os-impl-posix-network.c.o
[ 16%] Built target osal_posix_impl
Scanning dependencies of target osal_pc-linux_impl
[ 17%] Building C object osal/pc-linux_impl/CMakeFiles/osal_pc-linux_impl.dir/src/bsp_start.c.o
[ 17%] Building C object osal/pc-linux_impl/CMakeFiles/osal_pc-linux_impl.dir/src/bsp_console.c.o
[ 17%] Built target osal_pc-linux_impl
Scanning dependencies of target osal_bsp
[ 17%] Building C object osal/CMakeFiles/osal_bsp.dir/src/bsp/shared/src/osapi-bsp.c.o
[ 18%] Building C object osal/CMakeFiles/osal_bsp.dir/src/bsp/shared/src/bsp_default_app_run.c.o
[ 19%] Building C object osal/CMakeFiles/osal_bsp.dir/src/bsp/shared/src/bsp_default_app_startup.c.o
[ 19%] Building C object osal/CMakeFiles/osal_bsp.dir/src/bsp/shared/src/bsp_default_symtab.c.o
[ 20%] Building C object osal/CMakeFiles/osal_bsp.dir/src/bsp/shared/src/bsp_default_voltab.c.o
[ 20%] Linking C static library libosal_bsp.a
[ 20%] Built target osal_bsp
Scanning dependencies of target osal
[ 20%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-binsem.c.o
[ 21%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-clock.c.o
[ 21%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-common.c.o
[ 22%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-countsem.c.o
[ 23%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-dir.c.o
[ 23%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-errors.c.o
[ 25%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-file.c.o
[ 25%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-filesys.c.o
[ 26%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-heap.c.o
[ 26%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-idmap.c.o
[ 27%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-module.c.o
[ 27%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-mutex.c.o
[ 28%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-network.c.o
[ 29%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-printf.c.o
[ 29%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-queue.c.o
[ 30%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-select.c.o
[ 30%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-shell.c.o
[ 31%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-sockets.c.o
[ 31%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-task.c.o
[ 32%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-timebase.c.o
[ 33%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-time.c.o
[ 33%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-debug.c.o
[ 34%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-fpu.c.o
[ 34%] Building C object osal/CMakeFiles/osal.dir/src/os/shared/src/osapi-interrupts.c.o
[ 35%] Linking C static library libosal.a
[ 35%] Built target osal
Scanning dependencies of target psp-pc-linux-impl
[ 36%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_exception.c.o
[ 36%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_memory.c.o
[ 37%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_memtab.c.o
[ 38%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_ssr.c.o
[ 38%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_start.c.o
[ 39%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_support.c.o
[ 39%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_timer.c.o
[ 40%] Building C object psp/pc-linux/pc-linux/CMakeFiles/psp-pc-linux-impl.dir/src/cfe_psp_watchdog.c.o
[ 40%] Built target psp-pc-linux-impl
Scanning dependencies of target psp-pc-linux
[ 41%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_configdata.c.o
[ 41%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_eeprom.c.o
[ 42%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_exceptionstorage.c.o
[ 42%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_memrange.c.o
[ 43%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_memutils.c.o
[ 44%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_module.c.o
[ 44%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_port.c.o
[ 45%] Building C object psp/pc-linux/CMakeFiles/psp-pc-linux.dir/fsw/shared/cfe_psp_ram.c.o
[ 45%] Linking C static library libpsp-pc-linux.a
[ 45%] Built target psp-pc-linux
Scanning dependencies of target sampleTable_tables
[ 45%] Generating tables_cpu1/sample_table.tbl
[ 46%] Generating tables_cpu2/sample_table.tbl
[ 46%] Built target sampleTable_tables
Scanning dependencies of target sample_app
[ 46%] Building C object apps/sample_app/CMakeFiles/sample_app.dir/fsw/src/sample_app.c.o
[ 47%] Linking C shared module sample_app.so
[ 47%] Built target sample_app
Scanning dependencies of target sample_lib
[ 48%] Building C object apps/sample_lib/CMakeFiles/sample_lib.dir/fsw/src/sample_lib.c.o
[ 48%] Linking C shared module sample_lib.so
[ 48%] Built target sample_lib
Scanning dependencies of target ci_lab
[ 50%] Building C object apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_app.c.o
[ 50%] Linking C shared module ci_lab.so
[ 50%] Built target ci_lab
Scanning dependencies of target to_lab
[ 51%] Building C object apps/to_lab/CMakeFiles/to_lab.dir/fsw/src/to_lab_app.c.o
In file included from /home/user/cFS/apps/to_lab/fsw/src/to_lab_app.c:73:
/home/user/cFS/apps/to_lab/fsw/platform_inc/to_lab_sub_table.h:33:10: fatal error: cfe_msgids.h: No such file or directory
 #include "cfe_msgids.h"
          ^~~~~~~~~~~~~~
compilation terminated.
make[7]: *** [apps/to_lab/CMakeFiles/to_lab.dir/build.make:63: apps/to_lab/CMakeFiles/to_lab.dir/fsw/src/to_lab_app.c.o] Error 1
make[6]: *** [CMakeFiles/Makefile2:670: apps/to_lab/CMakeFiles/to_lab.dir/all] Error 2
make[5]: *** [Makefile:141: all] Error 2
make[4]: *** [CMakeFiles/native-all.dir/build.make:57: CMakeFiles/native-all] Error 2
make[3]: *** [CMakeFiles/Makefile2:330: CMakeFiles/native-all.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:144: CMakeFiles/mission-all.dir/rule] Error 2
make[1]: *** [Makefile:201: mission-all] Error 2
make: *** [Makefile:120: all] Error 2

@jphickey
Copy link
Contributor

jphickey commented Jun 2, 2020

This is actually a duplicate of issue #724 -- specifically you are seeing the third issue in my comment here: #724 (comment)

The "quirk" is that once you move to two cpus that share a platform (native) you no longer have access to the cfe config, and the cfe_msgid.h file is part of that (same as cfe_platform_cfg.h).

@jphickey
Copy link
Contributor

jphickey commented Jun 2, 2020

Note in this case its also because to_lab violates the rules and it doesn't actually build its subscription list as a table. I believe the that the actual table build process would have had access to this file OK. But this compiles the table as a regular source file.

@astrogeco
Copy link
Contributor

I hesitate to call this a duplicate. Would it make sense to split up #724 which seems to be fairly big right now? Or can this multiple cpu issue be addressed without the overhauls proposed in #724 ?

@jphickey
Copy link
Contributor

jphickey commented Jun 2, 2020

It's different symptoms of one problem. There is already an issue about the way to_lab does its non-table (see nasa/to_lab#32). If that issue were fixed and it became a real table, it would probably mask/hide this issue.

I actually have a set of changes I was already assembling into a PR - it should resolve this. It basically makes it so each CPU is treated as a different build by default unless you specify TGTx_PLATFORM in your targets.cmake file. It's a bit of a back-step as far as modularity goes but most likely we can't go fullly toward reusable app binaries until we have EDS or something like it. The existing paradigm of compiling-in your msg IDs which are different for each CPU kinda breaks it.

@CDKnightNASA
Copy link
Contributor Author

ok I'll consider this closed and look to fix to_lab (which could use some TLC anyways. :) )

@jphickey
Copy link
Contributor

jphickey commented Jun 2, 2020

@CDKnightNASA -- See PR #728. Can you pull this into your build and see if it behaves more like you expected?

@CDKnightNASA
Copy link
Contributor Author

@CDKnightNASA -- See PR #728. Can you pull this into your build and see if it behaves more like you expected?

Yes that PR fixes the problem, thanks and looking forward to approving it for merge into master.

@skliper skliper added duplicate and removed bug labels Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants