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 versus cmake3 #149

Closed
andreasscherbaum opened this issue Jun 7, 2021 · 6 comments
Closed

cmake versus cmake3 #149

andreasscherbaum opened this issue Jun 7, 2021 · 6 comments

Comments

@andreasscherbaum
Copy link
Collaborator

The autogen.sh script expects "cmake3", however it does not detect when "cmake version 3" is installed as "cmake".

This fails #140 and most likely #135.

Which distribution(s) installs "cmake" as "cmake3"? And can "autogen.sh" handle this problem internally?

@vaibhavdalvi93
Copy link

Thanks @andreasscherbaum for writing to us.

Your expectation is bit unclear to us. I want you to give more insights on this to make it clear.

Our understanding is:

1] If cmake3 is NOT present, then maybe check cmake version, if it is version 3,
then use that, else error with correct return code or with meaningfull message.

2] This problem should be handled internally by autogen.sh

3]

This fails #140 and most likely #135.

As per my understanding, the issue #135 doesn't not look relevant example of this cmake vs cmake3 because this is not the part of autogen.sh. This is MAKE we do for mongo_fdw code compilation after successful compilation of driver. Here, error itself is descriptive and able to describe the problem and halts the compilation.

@andreasscherbaum
Copy link
Collaborator Author

This came up when I was writing #151, and the Workflow could no find cmake3 on the Ubuntu systems which are used for GitHub Actions.

root@diamond:/home/ads# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
root@diamond:/home/ads# cmake --version
cmake version 3.16.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
root@diamond:/home/ads# apt-cache search cmake3
root@diamond:/home/ads# 
root@diamond:/home/ads# which cmake
/usr/bin/cmake
root@diamond:/home/ads# dpkg -S /usr/bin/cmake
cmake: /usr/bin/cmake

There is no package cmake3, the cmake package provides a cmake binary which is version 3 of cmake. That's it.
I don't know where the cmake3 originally came from, or if other distributions actually provide a cmake3 binary, but that's not the case on Debian/Ubuntu.

jeevanchalke added a commit that referenced this issue Jun 14, 2021
The autogen.sh is using cmake3 to compile the jsonc library and
mongoc driver.  However, it is observed that some of the platforms
do not have that, and thus script fails.  So, if cmake3 is not present
on the system, then fall back to cmake and use that.  Note that if the
CMake version is below the required one (i.e. 3.1), then the script
will fail.

Reported on GitHub through issues #149 by
Andreas Scherbaum (andreasscherbaum).

FDW-379, Vaibhav Dalvi, reviewed by Jeevan Ladhe,
tested by Rajkumar Raghuwanshi.
@vaibhavdalvi93
Copy link

@andreasscherbaum Can you please check if this issue is being fixed at your end or not?

It would be good to close this ticket if this is being fixed.

Thanks,
Vaibhav Dalvi

@andreasscherbaum
Copy link
Collaborator Author

Not sure that works as intended:

https://github.com/andreasscherbaum/mongo_fdw/runs/2843401419?check_suite_focus=true

In the end autogen.sh still fails with "cmake3 not found".

It could be helpful to use the CI tests proposed here.

@vaibhavdalvi93
Copy link

Through autogen.sh script, initially we check availability of cmake3 in the system, if cmake3 not present then we use cmake. If cmake also missing then system thrown error should be "cmake not found" but this is NOT happening in your case.

To troubleshoot this issue further, it would be good if you share following details:

  1. Please make sure you are on latest HEAD (ceb03dc).
  2. Please run following commands on system on which you are facing this issue:
    which cmake
    which cmake3
  3. Please provide version details of available cmake.
  4. Please provide value set for environment variable $PATH.

@andreasscherbaum
Copy link
Collaborator Author

Actually, scratch my last comment. I did update my test with a fresh copy of autogen.sh, but apparently missed he last changes.
It's working now:
https://github.com/andreasscherbaum/mongo_fdw/runs/2870857446?check_suite_focus=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants