ston-fi / tonlib-sys

MIT License
16 stars 7 forks source link

build faile #5

Open Ljiacheng opened 1 year ago

Ljiacheng commented 1 year ago

I get error in the build output file: CMakeError.log. Is that I have incorrect environment?

Environment:

# gcc -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)

# cmake --version

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

Error output:

Performing C++ SOURCE FILE Test HAVE_CXX_FLAG_QUNUSED_ARGUMENTS failed with the following output:
Change Dir: /home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_2d0bd/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_2d0bd.dir/build.make CMakeFiles/cmTC_2d0bd.dir/build
gmake[1]: Entering directory '/home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_2d0bd.dir/src.cxx.o
/usr/bin/c++ -DHAVE_CXX_FLAG_QUNUSED_ARGUMENTS  -ffunction-sections -fdata-sections -fPIC -m64 -march=native -fno-omit-frame-pointer -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough=2 -Wpointer-arith -Wcast-qual -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Walloc-zero -Wlogical-op -Wno-tautological-compare -Wpointer-arith -Wvla -Wnon-virtual-dtor -Wno-unused-parameter -Wconversion -Wno-sign-conversion -Qunused-arguments -fPIE   -Qunused-arguments -o CMakeFiles/cmTC_2d0bd.dir/src.cxx.o -c /home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp/src.cxx
c++: error: unrecognized command-line option '-Qunused-arguments'
c++: error: unrecognized command-line option '-Qunused-arguments'
gmake[1]: *** [CMakeFiles/cmTC_2d0bd.dir/build.make:78: CMakeFiles/cmTC_2d0bd.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_2d0bd/fast] Error 2

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test HAVE_CXX_FLAG_WUNUSED_PRIVATE_FIELD failed with the following output:
Change Dir: /home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_f6e73/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_f6e73.dir/build.make CMakeFiles/cmTC_f6e73.dir/build
gmake[1]: Entering directory '/home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f6e73.dir/src.cxx.o
/usr/bin/c++ -DHAVE_CXX_FLAG_WUNUSED_PRIVATE_FIELD  -ffunction-sections -fdata-sections -fPIC -m64 -march=native -fno-omit-frame-pointer -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough=2 -Wpointer-arith -Wcast-qual -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Walloc-zero -Wlogical-op -Wno-tautological-compare -Wpointer-arith -Wvla -Wnon-virtual-dtor -Wno-unused-parameter -Wconversion -Wno-sign-conversion -Wno-unused-private-field -fPIE   -Wunused-private-field -o CMakeFiles/cmTC_f6e73.dir/src.cxx.o -c /home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp/src.cxx
c++: error: unrecognized command-line option '-Wunused-private-field'
gmake[1]: *** [CMakeFiles/cmTC_f6e73.dir/build.make:78: CMakeFiles/cmTC_f6e73.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/ton-watcher/target/release/build/tonlib-sys-0f3ee5bec6b2763d/out/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_f6e73/fast] Error 2

Source file was:
int main() { return 0; }
Momo7614mo commented 5 months ago

gcc -v

Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)

cmake --version

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

Sild commented 4 months ago

Hi @Ljiacheng

Seems tonlibjson is supposed to be built using clang compiler

https://github.com/ton-blockchain/ton/blob/master/CMakeLists.txt#L333

https://stackoverflow.com/questions/27925138/gcc-remove-unrecognized-option-qunused-arguments

Please try build it using clang instead of gcc

khalilmosavi commented 1 month ago

currently build.rs requires brew to be installed even if everything is installed and available by other means (e.g. nix)

i think it should not check for brew, and instead check for pkg-config binary in PATH and use paths provided by it, instead of relying on brew