← 输入框|github.com|刷新
Skip to content

integration tests fail to build with CMake 3.26 #2264

Closed

Description

@BenWibking

Hi,

I am unable to build the integration tests on macOS. Here is the full output:

(lp) ➜  integration_tests git:(main) ./run_tests.py
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-llvm
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-c
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-wasm
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-cpython
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-x86
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-wasm_x86
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-wasm_x64
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-c_py
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-c_sym
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-cpython_sym
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-llvm_sym
+ rm -rf /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-llvm_py
+ mkdir /Users/benwibking/lpython/integration_tests/_lpython-tmp-test-llvm
+ cmake -DKIND=llvm -DFAST=no -DPYTHON_LIBS_REQ=no ..
-- The C compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done


Configuration results
---------------------
C compiler      : /Library/Developer/CommandLineTools/usr/bin/cc
Build type: Debug
C compiler flags      : -g
Installation prefix: /usr/local
KIND: llvm
FAST: no
PYTHON_LIBS_REQ: no
LPYTHON: /Users/benwibking/lpython/src/bin/lpython
LPYTHON_RTLIB_DIR: /Users/benwibking/lpython/src/libasr/runtime
LPYTHON_RTLIB_LIBRARY: /Users/benwibking/lpython/src/runtime/liblpython_runtime_static.a
-- Configuring done (0.4s)
CMake Error: CMake can not determine linker language for target: import_order_01
-- Generating done (0.1s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
Command failed: cmake -DKIND=llvm -DFAST=no -DPYTHON_LIBS_REQ=no ..

Activity

  1. certik commented on Aug 10, 2023

    @certik
    Contributor

    Here is how it should look like (on Apple M1):

    (lp) lpython/integration_tests(main) $ ./run_tests.py                    
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-llvm
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-c
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-wasm
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-cpython
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-x86
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-wasm_x86
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-wasm_x64
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-c_py
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-c_sym
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-cpython_sym
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-llvm_sym
    + rm -rf /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-llvm_py
    + mkdir /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-llvm
    + cmake -DKIND=llvm -DFAST=no -DPYTHON_LIBS_REQ=no ..
    -- The C compiler identification is AppleClang 13.0.0.13000029
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    
    
    Configuration results
    ---------------------
    C compiler      : /Library/Developer/CommandLineTools/usr/bin/cc
    Build type: Debug
    C compiler flags      : -g
    Installation prefix: /usr/local
    KIND: llvm
    FAST: no
    PYTHON_LIBS_REQ: no
    LPYTHON: /Users/ondrej/repos/lpython/src/bin/lpython
    LPYTHON_RTLIB_DIR: /Users/ondrej/repos/lpython/src/libasr/runtime
    LPYTHON_RTLIB_LIBRARY: /Users/ondrej/repos/lpython/src/runtime/liblpython_runtime_static.a
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/ondrej/repos/lpython/integration_tests/_lpython-tmp-test-llvm
    + make -j8
    [  0%] Generating array_02_decl.o
    [  0%] Generating array_01_decl.o
    [  0%] Generating variable_decl_03.o
    [  0%] Generating variable_decl_02.o
    [  1%] Generating array_expr_01.o
    [  1%] Generating variable_decl_01.o
    [  1%] Generating array_expr_02.o
    [  1%] Generating array_03_decl.o
    [  1%] Linking C executable variable_decl_03
    [  1%] Linking C executable variable_decl_02
    [  1%] Built target variable_decl_03
    [  1%] Built target variable_decl_02
    [  1%] Linking C executable array_03_decl
    

    It looks quite similar. What cmake version do you have and did you install it using conda? I have "3.22.2".

    Is your clang compiler working? I use the system version:

    (lp) lpython/integration_tests(main) $ clang --version
    Apple clang version 13.0.0 (clang-1300.0.29.30)
    Target: arm64-apple-darwin21.3.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    (lp) lpython/integration_tests(main) $ which clang
    /usr/bin/clang
    

    I think we use Clang for linking (for now).

    You can also compare it against our macOS tests at the CI (which work) and see if you see any differences to your setup.

  2. BenWibking commented on Aug 10, 2023

    @BenWibking
    Author

    I am also running on an M1. I installed CMake via Conda. However, I think I'm running on both a newer macOS version, a new Clang, and a newer CMake version:

    (lp) ➜  lpython git:(main) uname -v
    Darwin Kernel Version 22.6.0: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000
    (lp) ➜  integration_tests git:(main) /Library/Developer/CommandLineTools/usr/bin/cc --version
    Apple clang version 14.0.3 (clang-1403.0.22.14.1)
    Target: arm64-apple-darwin22.6.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    (lp) ➜  integration_tests git:(main) which cmake
    /opt/homebrew/Caskroom/miniconda/base/envs/lp/bin/cmake
    (lp) ➜  integration_tests git:(main) cmake --version
    cmake version 3.26.4
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    
  3. certik commented on Aug 10, 2023

    @certik
    Contributor

    I have:

    $ uname -v
    Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
    

    It's possible that it is broken in a new version.

    We would need to debug this, I don't know what can be causing this.

  4. Smit-create commented on Aug 11, 2023

    @Smit-create
    Collaborator

    Does the fix in https://github.com/lcompilers/lpython/pull/2266/files work for you?

    Thanks for pointing this!

  5. BenWibking commented on Aug 11, 2023

    @BenWibking
    Author

    Does the fix in https://github.com/lcompilers/lpython/pull/2266/files work for you?

    Thanks for pointing this!

    Yes, that fixes this issue.

    It still fails because make is hard-coded here, but I've set CMAKE_GENERATOR=Ninja in my environment. Using cmake --build . instead would fix it.

  6. changed the title [-]integration tests fail to build on macOS[/-] [+]integration tests fail to build with CMake 3.26[/+] on Aug 11, 2023
  7. BenWibking commented on Aug 11, 2023

    @BenWibking
    Author

    This will fix the build portability issue:

    diff --git a/integration_tests/run_tests.py b/integration_tests/run_tests.py
    index c84f73cb5..543935387 100755
    --- a/integration_tests/run_tests.py
    +++ b/integration_tests/run_tests.py
    @@ -25,7 +25,7 @@ def run_test(backend):
         run_cmd(f"mkdir {BASE_DIR}/_lpython-tmp-test-{backend}", cwd=BASE_DIR)
         cwd = f"{BASE_DIR}/_lpython-tmp-test-{backend}"
         run_cmd(f"cmake -DKIND={backend} -DFAST={fast_tests} -DPYTHON_LIBS_REQ={python_libs_req} ..", cwd=cwd)
    -    run_cmd(f"make -j{DEFAULT_THREADS_TO_USE}", cwd=cwd)
    +    run_cmd(f"cmake --build . --parallel {DEFAULT_THREADS_TO_USE}", cwd=cwd)
         run_cmd(f"ctest -j{DEFAULT_THREADS_TO_USE} --output-on-failure",
                 cwd=cwd)
    
  8. BenWibking commented on Aug 11, 2023

    @BenWibking
    Author

    9 tests fail on my system (using Python 3.11).

    Edit: I've moved this to a new issue (#2267).

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