Skip to content

Commit

Permalink
Repair preceding commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
petervdonovan committed Jul 21, 2022
1 parent 5509e46 commit 53f033f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ add_subdirectory(platform)
add_subdirectory(utils)

# List sources in this directory.
set(SINGLE_THREADED_SOURCES reactor.c port.c)
set(SINGLE_THREADED_SOURCES reactor.c)
list(APPEND GENERAL_SOURCES port.c)

# Determine which sources to include.
list(APPEND SOURCES ${GENERAL_SOURCES})
Expand Down

5 comments on commit 53f033f

@edwardalee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to port.c here? tag.c in the same directory plays a similar role is added nowhere.
Also, this change doesn't work for me. When I try to build reactor.c, the definitions in port.c are still missing.

@petervdonovan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag.c is imported in reactor_common.c, which is imported in reactor.c and reactor_threaded.c. CMake does not need to know about it because those imports are taken care of by the preprocessor.

I am not sure why it does not work for you. It works for me, and it seems to be working in CI. What commands are you running? Are they the same as what appears in README.md?

@petervdonovan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind what I just said -- based on CI it looks like it is broken on macOS only. I am looking into it.

@edwardalee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what I get:

EALMAC:reactor-c eal$ pwd
/Users/eal/lingua-franca-master/git/lingua-franca/org.lflang/src/lib/c/reactor-c
EALMAC:reactor-c eal$ mkdir build
EALMAC:reactor-c eal$ cd build
EALMAC:build eal$ cmake .. -UNUMBER_OF_WORKERS
-- The C compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Applying preprocessor definitions...
-- 
-- Including sources for unthreaded runtime.
-- Including the following sources: platform/lf_macos_support.c, utils/vector.c, utils/pqueue.c, utils/util.c, port.c, reactor.c
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/eal/lingua-franca-master/git/lingua-franca/org.lflang/src/lib/c/reactor-c/build
EALMAC:build eal$ cmake --build .
[  4%] Building C object core/CMakeFiles/core.dir/platform/lf_macos_support.c.o
[  9%] Building C object core/CMakeFiles/core.dir/utils/vector.c.o
[ 14%] Building C object core/CMakeFiles/core.dir/utils/pqueue.c.o
[ 19%] Building C object core/CMakeFiles/core.dir/utils/util.c.o
[ 23%] Building C object core/CMakeFiles/core.dir/port.c.o
[ 28%] Building C object core/CMakeFiles/core.dir/reactor.c.o
[ 33%] Linking C static library libcore.a
[ 33%] Built target core
[ 38%] Building C object test/CMakeFiles/test-lib.dir/src_gen_stub.c.o
[ 42%] Building C object test/CMakeFiles/test-lib.dir/rand_utils.c.o
[ 47%] Linking C static library libtest-lib.a
[ 47%] Built target test-lib
[ 52%] Building C object lib/CMakeFiles/lib.dir/schedule.c.o
[ 57%] Building C object lib/CMakeFiles/lib.dir/tag.c.o
[ 61%] Building C object lib/CMakeFiles/lib.dir/time.c.o
[ 66%] Building C object lib/CMakeFiles/lib.dir/util.c.o
[ 71%] Linking C static library liblib.a
[ 71%] Built target lib
[ 76%] Building C object CMakeFiles/general_utils_vector_test_c.dir/test/general/utils/vector_test.c.o
[ 80%] Linking C executable general_utils_vector_test_c
[ 80%] Built target general_utils_vector_test_c
[ 85%] Building C object CMakeFiles/general_utils_hashmap_test_c.dir/test/general/utils/hashmap_test.c.o
[ 90%] Linking C executable general_utils_hashmap_test_c
[ 90%] Built target general_utils_hashmap_test_c
[ 95%] Building C object CMakeFiles/general_tag_test_c.dir/test/general/tag_test.c.o
[100%] Linking C executable general_tag_test_c
Undefined symbols for architecture x86_64:
  "__lf_sparse_io_record_sizes", referenced from:
      __lf_start_time_step in libcore.a(reactor.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [CMakeFiles/general_tag_test_c.dir/build.make:100: general_tag_test_c] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:261: CMakeFiles/general_tag_test_c.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

@petervdonovan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have not figured out why AppleClang in particular does not like our build process. Unfortunately this will likely take a while for me to debug.

Please # to comment.