Tendis icon indicating copy to clipboard operation
Tendis copied to clipboard

Build on Mac

Open liang7878 opened this issue 5 years ago • 6 comments

cmake failed on macOS 11 when it tried to check gcc configuration. I have installed gcc-10 and cmake with homebrew. But it seems that it cannot work well when it tried to read the variable CMAKE_COMPILER_IS_GNUCC, could you please share some ideas about this error? Thanks.

$ cmake ..
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
#define TENDISPLUS_GIT_SHA1 "b4e8bbe8"
#define TENDISPLUS_GIT_DIRTY "      36"
/Library/Developer/CommandLineTools/usr/bin/c++
CMake Error at CMakeLists.txt:34 (message):
  gcc or vs2015(update 2)+ is required

liang7878 avatar Dec 23 '20 15:12 liang7878

We have never build tendis in macOS before. We would check it later.

Thanks for issue.

TendisDev avatar Dec 24 '20 02:12 TendisDev

This problem could be resolved by brew installed gcc, take a look at Build and run.

mingjliu9 avatar Dec 24 '20 05:12 mingjliu9

This problem could be resolved by brew installed gcc, take a look at Build and run.

Hi @mingjliu9 , many thanks for your quick response. Here is my environment. As you can see below, I cannot see any evidence that it doesn't meet the requirements you mentioned in the document. Thanks.

# Apple @ pingdeMacBook-Air in ~/Source/repos/tendis/build on git:master x [21:20:45]
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++-10
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin20/10.2.0/lto-wrapper
Target: x86_64-apple-darwin20
Configured with: ../configure --build=x86_64-apple-darwin20 --prefix=/usr/local/Cellar/gcc/10.2.0 --libdir=/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-10 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 10.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk SED=/usr/bin/sed
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (Homebrew GCC 10.2.0)

# Apple @ pingdeMacBook-Air in ~/Source/repos/tendis/build on git:master x [21:20:58]
$ cmake --version
cmake version 3.19.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

# Apple @ pingdeMacBook-Air in ~/Source/repos/tendis/build on git:master x [21:21:02]
$ cmake ..
#define TENDISPLUS_GIT_SHA1 "b4e8bbe8"
#define TENDISPLUS_GIT_DIRTY "      36"
/Library/Developer/CommandLineTools/usr/bin/c++
CMake Error at CMakeLists.txt:34 (message):
  gcc or vs2015(update 2)+ is required


-- Configuring incomplete, errors occurred!
See also "/Users/Apple/Source/repos/tendis/build/CMakeFiles/CMakeOutput.log".
See also "/Users/Apple/Source/repos/tendis/build/CMakeFiles/CMakeError.log".

liang7878 avatar Dec 24 '20 13:12 liang7878

You should link c++ to the path installed of g++, you can execute ln -s Path/To/g++ /Library/Developer/CommandLineTools/usr/bin/c++. We recommend that you use GCC 5.5 or GCC 7.3 version, because we tests tendis can be successfully compiled. You can refer to @mingjliu9 's suggestions, take a look at our compilation document.

jingjunLi avatar Dec 25 '20 15:12 jingjunLi

We have never build tendis in macOS before. We would check it later.

Thanks for issue.

我这边也遇到这个克服,mac 编译Tendis 现在能克服这个问题吗

yinghonghui avatar Aug 10 '21 11:08 yinghonghui

I have this error also I think it can be ignored though. I tested this on a computer I know has a proper function c and c++ compiler it still said those tasks were skipped.

kevinoli avatar Jan 26 '23 04:01 kevinoli