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

Impossible to compile under Linux LTS distributions #519

Closed
ghost opened this issue Dec 1, 2019 · 9 comments
Closed

Impossible to compile under Linux LTS distributions #519

ghost opened this issue Dec 1, 2019 · 9 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 1, 2019

System information

  • SolveSpace version: 3.0~0472b9e
  • Operating system: Ubuntu 18.04 Bionic ; Debian 9.x stretch (x86_64)

Expected behavior

SolveSpace should keep support to build (at least) on Linux LTS distros.

Actual behavior

SolveSpace could not be compiled under Linux LTS distros, as master actually require CMake 3.11 dependency.

FTR, As non-trivial solution, user should try to compile CMake 3.11 manually before build SolveSpace 3.x.

Additional information

For bugs, please attach a savefile that shows the problematic behavior.
You can attach .slvs files by archiving them into a .zip first.

@whitequark
Copy link
Contributor

whitequark commented Dec 1, 2019

What is the exact error you are getting from CMake? The required CMake version is 3.2, not 3.11, or at least it should be according to our CMakeLists.txt.

@ghost
Copy link
Author

ghost commented Dec 1, 2019

Think, @AlexanderP could provide more error details

@AlexanderP
Copy link

Hi.
Ubuntu bionic
Cmake 3.10.2

dh_auto_configure -- -DCMAKE_LIBRARY_PATH=x86_64-linux-gnu -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=OFF
	cd obj-x86_64-linux-gnu && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_LIBRARY_PATH=x86_64-linux-gnu -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=OFF
CMake Error at CMakeLists.txt:11 (cmake_policy):
  An attempt was made to set the policy version of CMake to "3.11" which is
  greater than this version of CMake.  This is not allowed because the
  greater version may have new policies not known to this CMake.  You may
  need a newer CMake version to build this project.


-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAS_FILE_PREFIX_MAP
-- Performing Test HAS_FILE_PREFIX_MAP - Failed
-- Using in-tree libdxfrw
-- Using in-tree flatbuffers
-- Looking for strtof_l
-- Looking for strtof_l - found
-- Using in-tree q3d
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34") 
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.8.1") 
-- Checking for module 'cairo'
--   Found cairo, version 1.15.10
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found SPACEWARE: /usr/lib/libspnav.so  
-- Checking for module 'fontconfig'
--   Found fontconfig, version 2.12.6
-- Checking for module 'json-c'
--   Found json-c, version 0.12.1
-- Checking for modules 'gtkmm-3.0>=3.18;pangomm-1.4;x11'
--   Found gtkmm-3.0, version 3.22.2
--   Found pangomm-1.4, version 2.40.1
--   Found x11, version 1.6.4
-- Configuring incomplete, errors occurred!
See also "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeOutput.log".
See also "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeError.log".
	cd obj-x86_64-linux-gnu && tail -v -n \+0 CMakeCache.txt`

https://launchpadlibrarian.net/453851114/buildlog_ubuntu-bionic-amd64.solvespace_3.0.0~git1446-0472b9e-1ppa1~bionic1_BUILDING.txt.gz

@whitequark whitequark added bug and removed question labels Dec 1, 2019
@whitequark
Copy link
Contributor

Ok, the CMake behavior around cmake_policy(VERSION) doesn't make a lot of sense. Does this patch help?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bfd04d0..9bede12c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,10 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
             "    mkdir build && cd build && cmake ..")
 endif()
 
-cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
-cmake_policy(VERSION 3.11)
+cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
+if(NOT CMAKE_VERSION VERSION_LESS 3.11.0)
+    cmake_policy(VERSION 3.11.0)
+endif()
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
     "${CMAKE_SOURCE_DIR}/cmake/")
 set(CMAKE_CXX_STANDARD 11)

@ghost
Copy link
Author

ghost commented Dec 1, 2019

+cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

FTR, Debian 9.x stretch has only CMake 3.7.2

@AlexanderP
Copy link

Ok, the CMake behavior around cmake_policy(VERSION) doesn't make a lot of sense. Does this patch help?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bfd04d0..9bede12c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,10 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
             "    mkdir build && cd build && cmake ..")
 endif()
 
-cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
-cmake_policy(VERSION 3.11)
+cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
+if(NOT CMAKE_VERSION VERSION_LESS 3.11.0)
+    cmake_policy(VERSION 3.11.0)
+endif()
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
     "${CMAKE_SOURCE_DIR}/cmake/")
 set(CMAKE_CXX_STANDARD 11)

Ubuntu Bionic. Build was successful

@ghost
Copy link
Author

ghost commented Dec 2, 2019

Ubuntu Bionic. Build was successful

What about Debian stretch?

@AlexanderP
Copy link

What about Debian stretch?
Build was successful:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bfd04d0..9bede12c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,10 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
             "    mkdir build && cd build && cmake ..")
 endif()
 
-cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
-cmake_policy(VERSION 3.11)
+cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR)
+if(NOT CMAKE_VERSION VERSION_LESS 3.11.0)
+    cmake_policy(VERSION 3.11.0)
+endif()
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
     "${CMAKE_SOURCE_DIR}/cmake/")
 set(CMAKE_CXX_STANDARD 11)

@whitequark
Copy link
Contributor

Fixed in 0b786e6.

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

2 participants