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

CMake warning: Policy CMP0068 is not set #1188

Closed
zekailin00 opened this issue May 23, 2022 · 7 comments · Fixed by #1523
Closed

CMake warning: Policy CMP0068 is not set #1188

zekailin00 opened this issue May 23, 2022 · 7 comments · Fixed by #1523
Assignees
Labels
cmake cpp Related to C++ target mac Related to the Apple MacOS platform

Comments

@zekailin00
Copy link
Collaborator

CMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   reactor-cpp-default

This warning is for project developers.  Use -Wno-dev to suppress it.

MacOS Big Sur 11.6, using IntelliJ, following the instructions in the documentation to compile CarBrake.lf.
There is a CMake Warning saying Policy CMP0068 is not set.

runLfc --args '../examples-lingua-franca-main/Cpp/src/CarBrake/CarBrake.lf'
@zekailin00 zekailin00 added mac Related to the Apple MacOS platform cmake labels May 23, 2022
@cmnrd cmnrd added the cpp Related to C++ target label Jun 21, 2022
@cmnrd cmnrd self-assigned this Jun 21, 2022
@cmnrd
Copy link
Collaborator

cmnrd commented Jun 22, 2022

Thanks for reporting this. Unfortunately, I don't have access to a MacOS device for reproducing the behaviour and testing fixes. Could you check if #1242 fixes the issue and compilation still works as expected and that you can execute the resulting binary without errors?

@lhstrh
Copy link
Member

lhstrh commented Aug 26, 2022

@zekailin00: would you be able to check whether the fix proposed in #1242 works? If so, we can merge it and close this issue.

@zekailin00
Copy link
Collaborator Author

I cloned the fix-cmake-warning branch and tried it again. It seems I am getting a new error, but it is still related to reactor-cpp-default.

The executing command is --- Executing command: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/Users/lin/Github/examples-lingua-franca/Cpp -DCMAKE_INSTALL_BINDIR=bin -DREACTOR_CPP_VALIDATE=ON -DREACTOR_CPP_TRACE=OFF -DREACTOR_CPP_LOG_LEVEL=3 -DLF_SRC_PKG_PATH=/Users/lin/Github/examples-lingua-franca/Cpp /Users/lin/Github/examples-lingua-franca/Cpp/src-gen
Screen Shot 2022-08-26 at 6 39 58 PM
.

@cmnrd
Copy link
Collaborator

cmnrd commented Sep 6, 2022

@zekailin00 Did you also update all submodules? And do you still have any build artifacts from your earlier tries? You can use lfc -c ... to clean all build artifacts before compiling the LF program.

@zekailin00
Copy link
Collaborator Author

I realized that the error I had above was because the folder name I have is examples-lingua-franca, but I had examples-lingua-franca-main in the compiler path, but after I changed the path, I still got the original cmake CMP0068 warning.

The commands I ran were:

 1049  git submodule update --init --recursive
 1050  ./gradlew buildLfc
 1051  cd bin
 1052  ./lfc -c ./../../examples-lingua-franca/Cpp/src/CarBrake/CarBrake.lf

And I checked with git branch that the branch I cloned is the #1242 branch.
I also checked my cmake version, which is 3.22. I saw your fix specifies cmake 3.9 as the minimum requirement. I am not sure if this is the cause of me still having this warning.

@zekailin00
Copy link
Collaborator Author

And it seems homebrew on mac has 3.24 as the highest version I can upgrade cmake to.

(base) lin@lins-MacBook-Pro bin % brew upgrade cmake 
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
Warning: cmake 3.24.0 already installed

@cmnrd
Copy link
Collaborator

cmnrd commented Nov 28, 2022

I lost track of this issue and stumbled across it today. I made another attempt at fixing it in #1242. Could you check if this solves the issue and the resulting binaries still work, even when calling from different locations?

A newer cmake version should be fine, I only modified the minimum required version because my changes are not expected to work with older versions.

cmnrd added a commit that referenced this issue Jan 4, 2023
This fixes #1188 by updating reactor-cpp
cmnrd added a commit that referenced this issue Jan 4, 2023
This fixes #1188 by updating reactor-cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake cpp Related to C++ target mac Related to the Apple MacOS platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants