he4rt / scylladb-php-driver

PHP Driver for ScyllaDB/Apache Cassandra
Other
106 stars 25 forks source link

cmake Release build fails on Debian 11 #93

Closed ciaran-moore closed 10 months ago

ciaran-moore commented 10 months ago

cmake -DCMAKE_BUILD_TYPE=Release -DPHP_SCYLLADB_OPTIMISE_FOR_CURRENT_MACHINE=ON && cd out/Release && sudo ninja install

Command specified in README Fails to build prompting that out/Release does not exist

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Downloading CPM.cmake to /path/to/scylladb-php-driver/cmake/CPM_0.36.0.cmake
-- Searching php-config PHP-VERSION: 8.3
-- Found php-config: /usr/bin/php-config
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'libuv'
--   Found libuv, version 1.40.0
-- Checking for module 'scylla-cpp-driver'
--   Found scylla-cpp-driver, version 2.16.2
-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  ZendCPP/String/CMakeLists.txt:10 (scylladb_php_library)

-- Performing Test SUPPORT_MARCH_NATIVE
-- Performing Test SUPPORT_MARCH_NATIVE - Success
-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  ZendCPP/CMakeLists.txt:7 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  util/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/Cluster/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/DateTime/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/Database/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/Numbers/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/Exception/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/RetryPolicy/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/SSLOptions/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/TimestampGenerator/CMakeLists.txt:3 (scylladb_php_library)

-- LTO is supported and enabled
CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  src/Type/CMakeLists.txt:4 (scylladb_php_library)

CMake Warning at cmake/TargetOptimizations.cmake:19 (message):
  Be careful when using `-march=native`, it may cause problems when running
  on different CPUs
Call Stack (most recent call first):
  cmake/TargetOptimizations.cmake:43 (scylladb_php_target_optimization_flags)
  cmake/ScyllaDBPHPLibrary.cmake:52 (scylladb_php_target_optimize)
  CMakeLists.txt:77 (scylladb_php_library)

-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Configuring done (9.4s)
-- Generating done (0.1s)
-- Build files have been written to: /path/to/scylladb-php-driver
bash: cd: out/Release: No such file or directory

Creating the directory manually and re-running also fails as build.ninja is not written to that directory

-- Configuring done (7.2s)
-- Generating done (0.1s)
-- Build files have been written to: /path/to/scylladb-php-driver
ninja: error: loading 'build.ninja': No such file or directory
CodeLieutenant commented 10 months ago

It works fine, it looks like you forgot -G Ninja on CMake flags By default CMake uses Makefiles, so if you want Ninja Build use -G Ninja, if you don't want Ninja Build, just use the command make install

In README file there is a --preset flag which sets Ninja Build as default build system

ciaran-moore commented 10 months ago

I was following the Debian / Ubuntu instructions for Compiling Optimized Build in the README. After running the commands individually it worked fine, but each time I used the && commands it gives the error. bash: cd: out/Release: No such file or directory

Replacing the logical AND with ; also works for me.

cmake --preset Release -DPHP_SCYLLADB_OPTIMISE_FOR_CURRENT_MACHINE=ON; cd out/Release; sudo ninja install