Skip to content

CMake configuration failures (Linux/gcc)  #404

Closed

Description

@sdh4

The cmake configuration phases of both the main repository and example/ap203min fail on Linux/gcc (Fedora 32) in the current master branch (2021-01-09), but there are easy fixes/workarounds.

Main configuration: Multiply defined symbols: ALG_fl, FUNC_fl, RULE_fl, PROC_fl, and WHERE_fl seem to be defined both in src/express/alg.c and src/express/memory.c causing a linking error during cmake configuration. Workaround/probable fix: change the declarations in alg.c to be extern

example/ap203min: cmake fails trying to read include/sc_cf.h.in Workaround: make a symbolic link at example/ap203min/include that points at ../../include
Probable fix: in the configure_file() call in cmake/SC_Config_Headers.cmake the ${CMAKE_SOURCE_DIR} should probably be ${SC_SOURCE_DIR}

Activity

  1. added a commit that references this issue on Jan 10, 2021
  2. starseeker commented on Jan 10, 2021

    @starseeker
    Member

    Can you tell me which version of GCC you're using? On Ubuntu I'm not seeing the issue with alg.c vs. memory.c, and since only alg.c in master has ALG_fl I'm not quite sure where memory.c is pulling the definition from.

    I think the above commit should handle the example - thanks for catching that. Looking at that, I should probably look at making that example work with an installed stepcode rather than depending on the stepcode build dir...

  3. wdconinc commented on Apr 1, 2021

    @wdconinc

    This is an issue with gcc-10, see e.g. https://gcc.gnu.org/gcc-10/porting_to.html, likely the default to -fno-common. Adding extern in alg.c seems to do the job.

  4. hoijui commented on Jun 9, 2021

    @hoijui
    $ gcc --version
    gcc (Debian 10.2.1-6) 10.2.1 20210110
    

    I did a fresh clone of the repo, and my HEAD is now on your fix commit. I get that same error:

      /usr/bin/ld:
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/memory.c.o:/home/user/src/stepcode/src/express/memory.c:29:
      multiple definition of `FUNC_fl';
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/alg.c.o:/home/user/src/stepcode/src/express/alg.c:46:
      first defined here
    
      /usr/bin/ld:
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/memory.c.o:/home/user/src/stepcode/src/express/memory.c:30:
      multiple definition of `RULE_fl';
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/alg.c.o:/home/user/src/stepcode/src/express/alg.c:47:
      first defined here
    
      /usr/bin/ld:
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/memory.c.o:/home/user/src/stepcode/src/express/memory.c:31:
      multiple definition of `PROC_fl';
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/alg.c.o:/home/user/src/stepcode/src/express/alg.c:48:
      first defined here
    
      /usr/bin/ld:
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/memory.c.o:/home/user/src/stepcode/src/express/memory.c:32:
      multiple definition of `WHERE_fl';
      CMakeFiles/schema_scanner.dir/home/user/src/stepcode/src/express/alg.c.o:/home/user/src/stepcode/src/express/alg.c:49:
      first defined here
    
      collect2: error: ld returned 1 exit status
    
      gmake[2]: *** [CMakeFiles/schema_scanner.dir/build.make:538:
      /home/user/src/stepcode/build/bin/schema_scanner] Error 1
    
      gmake[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/schema_scanner.dir/all]
      Error 2
    
      gmake: *** [Makefile:103: all] Error 2
    
    Call Stack (most recent call first):
      data/CMakeLists.txt:14 (include)
    
    
    -- Configuring incomplete, errors occurred!
    
  5. hoijui commented on Jun 9, 2021

    @hoijui

    looking at the error logs file, strangely, I got other/more errors:

    Determining if the include file ndir.h exists failed with the following output:
    Change Dir: /home/user/src/stepcode/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake cmTC_fd3e9/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_fd3e9.dir/build.make CMakeFiles/cmTC_fd3e9.dir/build
    gmake[1]: Entering directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_fd3e9.dir/CheckIncludeFile.c.o
    /usr/bin/cc   -std=c11 -o CMakeFiles/cmTC_fd3e9.dir/CheckIncludeFile.c.o -c /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
    /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: ndir.h: No such file or directory
        1 | #include <ndir.h>
          |          ^~~~~~~~
    compilation terminated.
    gmake[1]: *** [CMakeFiles/cmTC_fd3e9.dir/build.make:85: CMakeFiles/cmTC_fd3e9.dir/CheckIncludeFile.c.o] Error 1
    gmake[1]: Leaving directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:140: cmTC_fd3e9/fast] Error 2
    
    
    
    Determining if the include file sysent.h exists failed with the following output:
    Change Dir: /home/user/src/stepcode/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake cmTC_ae4d3/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_ae4d3.dir/build.make CMakeFiles/cmTC_ae4d3.dir/build
    gmake[1]: Entering directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_ae4d3.dir/CheckIncludeFile.c.o
    /usr/bin/cc   -std=c11 -o CMakeFiles/cmTC_ae4d3.dir/CheckIncludeFile.c.o -c /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
    /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: sysent.h: No such file or directory
        1 | #include <sysent.h>
          |          ^~~~~~~~~~
    compilation terminated.
    gmake[1]: *** [CMakeFiles/cmTC_ae4d3.dir/build.make:85: CMakeFiles/cmTC_ae4d3.dir/CheckIncludeFile.c.o] Error 1
    gmake[1]: Leaving directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:140: cmTC_ae4d3/fast] Error 2
    
    
    
    Determining if the include file process.h exists failed with the following output:
    Change Dir: /home/user/src/stepcode/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake cmTC_72d5b/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_72d5b.dir/build.make CMakeFiles/cmTC_72d5b.dir/build
    gmake[1]: Entering directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_72d5b.dir/CheckIncludeFile.c.o
    /usr/bin/cc   -std=c11 -o CMakeFiles/cmTC_72d5b.dir/CheckIncludeFile.c.o -c /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
    /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: process.h: No such file or directory
        1 | #include <process.h>
          |          ^~~~~~~~~~~
    compilation terminated.
    gmake[1]: *** [CMakeFiles/cmTC_72d5b.dir/build.make:85: CMakeFiles/cmTC_72d5b.dir/CheckIncludeFile.c.o] Error 1
    gmake[1]: Leaving directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:140: cmTC_72d5b/fast] Error 2
    
    
    
    Determining if the include file io.h exists failed with the following output:
    Change Dir: /home/user/src/stepcode/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake cmTC_645ef/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_645ef.dir/build.make CMakeFiles/cmTC_645ef.dir/build
    gmake[1]: Entering directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_645ef.dir/CheckIncludeFile.c.o
    /usr/bin/cc   -std=c11 -o CMakeFiles/cmTC_645ef.dir/CheckIncludeFile.c.o -c /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
    /home/user/src/stepcode/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: io.h: No such file or directory
        1 | #include <io.h>
          |          ^~~~~~
    compilation terminated.
    gmake[1]: *** [CMakeFiles/cmTC_645ef.dir/build.make:85: CMakeFiles/cmTC_645ef.dir/CheckIncludeFile.c.o] Error 1
    gmake[1]: Leaving directory '/home/user/src/stepcode/build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:140: cmTC_645ef/fast] Error 2
  6. added a commit that references this issue on Aug 3, 2021
    fa87ef1
  7. added a commit that references this issue on Nov 20, 2021
  8. added 3 commits that reference this issue on Jun 8, 2022
  9. added a commit that references this issue on Mar 24, 2024
    8dc5dce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions