Skip to content

cmake build failure on x86_64 macOS 14 with -DDYNAMIC_ARCH=ON and -DBUILD_STATIC_LIBS=ON #5223

@ywwry66

Description

@ywwry66

The failure was seen in Homebrew/homebrew-core#219339. It was caused by too many arguments (*.o files) being passed to ar.

Specifically, the cmake options used are

-DBUILD_SHARED_LIBS=ON
-DBUILD_STATIC_LIBS=ON
-DNUM_THREADS=64
-DTARGET=NEHALEM
-DDYNAMIC_ARCH=ON

The problematic ar call looks like

/usr/bin/ar qc lib/libopenblas.a interface/CMakeFiles/interface.dir/CMakeFiles/scopy.c.o interface/CMakeFiles/interface.dir/CMakeFiles/snrm2.c.o .......

which has over 1000000 characters, due to large amount of object files. And the error message is:

collect2: fatal error: posix_spawnp: Argument list too long

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