Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmocka_cloned configure error on Mac for latest master #150

Closed
JasonRuonanWang opened this issue Nov 9, 2021 · 6 comments
Closed

cmocka_cloned configure error on Mac for latest master #150

JasonRuonanWang opened this issue Nov 9, 2021 · 6 comments
Labels

Comments

@JasonRuonanWang
Copy link

macOS 11.6.1
AppleClang 13.0.0.13000029
cmake 3.21.2

[ 21%] Performing build step for 'cmocka_cloned'
CMake Error: Invalid value used with --config
Usage: cmake --build <dir>             [options] [-- [native-options]]
       cmake --build --preset <preset> [options] [-- [native-options]]
Options:
  <dir>          = Project binary directory to be built.
  --preset <preset>, --preset=<preset>
                 = Specify a build preset.
  --list-presets
                 = List available build presets.
  --parallel [<jobs>], -j [<jobs>]
                 = Build in parallel using the given number of jobs. 
                   If <jobs> is omitted the native build tool's 
                   default number is used.
                   The CMAKE_BUILD_PARALLEL_LEVEL environment variable
                   specifies a default parallel level when this option
                   is not given.
  --target <tgt>..., -t <tgt>... 
                 = Build <tgt> instead of default targets.
  --config <cfg> = For multi-configuration tools, choose <cfg>.
  --clean-first  = Build target 'clean' first, then build.
                   (To clean only, use --target 'clean'.)
  --verbose, -v  = Enable verbose output - if supported - including
                   the build commands to be executed. 
  --             = Pass remaining options to the native tool.
make[2]: *** [tests/cmocka_cloned-prefix/src/cmocka_cloned-stamp/cmocka_cloned-build] Error 1
make[1]: *** [tests/CMakeFiles/cmocka_cloned.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

@lindstro
Copy link
Member

lindstro commented Nov 9, 2021

The master branch does not make use of cmocka. I assume you meant the default develop branch.

I can reproduce this issue with CMake 3.21.2 but not with an earlier version (3.13.4). It appears that CMAKE_BUILD_TYPE is not propagated when the external cmocka project is being built (see this line). This issue is further discussed here. Let us look into how to best resolve the issue.

@lindstro lindstro added the bug label Nov 9, 2021
@JasonRuonanWang
Copy link
Author

The master branch does not make use of cmocka. I assume you meant the default develop branch.

I can reproduce this issue with CMake 3.21.2 but not with an earlier version (3.13.4). It appears that CMAKE_BUILD_TYPE is not propagated when the external cmocka project is being built (see this line). This issue is further discussed here. Let us look into how to best resolve the issue.

Yeah, the develop branch.

@lindstro
Copy link
Member

lindstro commented Nov 12, 2021

We need to spend some time on this to get it right, as it seems to be a nontrivial issue to solve in a portable manner. In the meantime, some possible workarounds include:

  • Use an older version of CMake.
  • Modify tests/CMakeLists.txt to use --config Release or exclude the --config setting on macOS.
  • Disable the tests via -DBUILD_TESTING=OFF.

@JasonRuonanWang
Copy link
Author

@lindstro Thanks. I can live with -DBUILD_TESTING=OFF for now.

@tomandersen
Copy link

tomandersen commented Dec 9, 2021

Thanks,

This worked for me on mac M1 with macOS 12.0.1

cd zfp
mkdir build
cd build
cmake -DBUILD_TESTING=OFF ..
cmake --build . --config Release
; note ctest not gonna do anything

Well it built fine! I am hoping to put it to use soon. I needed 4D arrays.

@lindstro
Copy link
Member

lindstro commented Feb 9, 2022

This issue has hopefully been resolved on develop. Please let us know if the fix does not work for you.

GarrettDMorrison added a commit that referenced this issue Feb 9, 2022
lindstro added a commit that referenced this issue Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants