Open edwardalee opened 2 years ago
I think this might have something to do with the fact that the code generator is assuming that the remote machines are Linux, but the code is being compiled on MacOS.
Was this error thrown during the compilation of Destination or Source?
The error occurs while compiling the Destination, which is supposed to run on the local Mac. So this looks like a bug in the platform support. It is assuming Linux for all federates. The full compile output is below:
-- Generating done
-- Build files have been written to: /Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/build
--- Current working directory: /Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/build
--- Executing command: bash --login -c cmake --build . --target install --parallel 16 --config Release
[ 33%] Building C object CMakeFiles/Composition_d.dir/core/platform/lf_macos_support.c.o
[ 33%] Building C object CMakeFiles/Composition_d.dir/Composition_d.c.o
[ 50%] Building C object CMakeFiles/Composition_d.dir/ctarget.c.o
[ 66%] Building C object CMakeFiles/Composition_d.dir/core/mixed_radix.c.o
[ 83%] Building C object CMakeFiles/Composition_d.dir/core/platform/lf_linux_support.c.o
/Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/core/platform/lf_linux_support.c:57:12: error: implicit declaration of function 'clock_nanosleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return clock_nanosleep(_LF_CLOCK, 0, (const struct timespec*)&tp, (struct timespec*)&remaining);
^
/Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/core/platform/lf_linux_support.c:57:12: note: did you mean 'lf_nanosleep'?
/Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/core/platform/lf_linux_support.c:54:5: note: 'lf_nanosleep' declared here
int lf_nanosleep(instant_t requested_time) {
^
1 error generated.
gmake[2]: *** [CMakeFiles/Composition_d.dir/build.make:132: CMakeFiles/Composition_d.dir/core/platform/lf_linux_support.c.o] Error 1
gmake[2]: *** Se espera a que terminen otras tareas....
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/Composition_d.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
ERROR: /Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/core/platform/lf_linux_support.c:57:12: error: implicit declaration of function 'clock_nanosleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return clock_nanosleep(_LF_CLOCK, 0, (const struct timespec*)&tp, (struct timespec*)&remaining);
^
/Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/core/platform/lf_linux_support.c:57:12: note: did you mean 'lf_nanosleep'?
/Users/eal/lingua-franca-master/git/lingua-franca/test/C/src-gen/Composition/d/core/platform/lf_linux_support.c:54:5: note: 'lf_nanosleep' declared here
int lf_nanosleep(instant_t requested_time) {
^
1 error generated.
gmake[2]: *** [CMakeFiles/Composition_d.dir/build.make:132: CMakeFiles/Composition_d.dir/core/platform/lf_linux_support.c.o] Error 1
gmake[2]: *** Se espera a que terminen otras tareas....
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/Composition_d.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
Okay, thank you for the additional details.
In case someone else gets to fixing this issue before I do, I would like to point out that the platform files are added automatically by CMake. This is done in this file. It is not yet clear to me why CMake thinks that the platform is "Linux" when it is clearly "Darwin".
Using the
at
keyword to deploy federates currently gives a compile error. Example:Code generator yields this: