Module for Tarantool, build error - c

I try write my module for tarantool:
https://github.com/agent-0007/mrasender
When i try compile it, i get error message:
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- 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
-- 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
-- Found TARANTOOL: /usr/include (found version "1.6.8-611-g944d005")
-- Tarantool LUADIR is share/tarantool
-- Tarantool LIBDIR is lib64/tarantool
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find MsgPuck (missing: MSGPUCK_INCLUDE_DIR MSGPUCK_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
FindMsgPuck.cmake:13 (find_package_handle_standard_args)
CMakeLists.txt:18 (find_package)
What's wrong ?

Related

MinGW CMake make googletest with make error but no hit

I's m trying to compile gtest and gmock on windows10 with MinGW and Cmake;
Tools:
cmake --version
cmake version 3.21.1
gcc -v
gcc version 8.1.0
mingw32-make.exe -v
GNU Make 4.2.1
Built for x86_64-w64-mingw32
Build command as followed:
(base) PS D:\WorkSpace\Codes\GTest_GMock\googletest-master\build> cmake .. -G "MinGW Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++11
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/gcc.exe - 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: D:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: D:/ProgramData/Miniconda3/python.exe (found version "3.9.5") found components: Interpreter
-- Configuring done
-- Generating done
-- Build files have been written to: D:/WorkSpace/Codes/GTest_GMock/googletest-master/build
(base) PS D:\WorkSpace\Codes\GTest_GMock\googletest-master\build> mingw32-make.exe
[ 12%] Building CXX object googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj
系统找不到指定的路径。(cannot find path)
mingw32-make[2]: *** [googletest\CMakeFiles\gtest.dir\build.make:76: googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj] Error 1
mingw32-make[2]: *** Deleting file 'googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj'
mingw32-make[1]: *** [CMakeFiles\Makefile2:171: googletest/CMakeFiles/gtest.dir/all] Error 2
mingw32-make: *** [Makefile:145: all] Error 2
(base) PS D:\WorkSpace\Codes\GTest_GMock\googletest-master\build>

CMake Produces Makefile that Linker Doesn't Like

I'm trying to modernize a build system with CMake. When I try to compile the program with make I get this output
$ cmake -DCMAKE_TOOLCHAIN_FILE="../armgcc.cmake" .. && make
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc -- 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/arm-none-eabi-g++
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: ~/cmake_test/build
Scanning dependencies of target testproj
[ 50%] Building C object CMakeFiles/testproj.dir/main.c.obj
[100%] Linking C executable testproj
arm-none-eabi-gcc: fatal error: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/nosys.specs: attempt to rename spec 'link_gcc_c_sequence' to already defined spec 'nosys_link_gcc_c_sequence'
compilation terminated.
make[2]: *** [CMakeFiles/testproj.dir/build.make:84: testproj] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/testproj.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
With CMakeLists.txt
cmake_minimum_required(VERSION 3.0.0)
project(testproj VERSION 0.1.0)
add_executable(testproj main.c)
and armgcc.cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --specs=nosys.specs")
What are link_gcc_sequence and nosys_link_gcc_sequence, and how should I structure my CMakeLists to avoid renaming them?

Cmake add library to a custom gcc compiler

I'm trying to compile a small program written in c with additional libraries zlib and libpng for an arm processor using using gcc-linaro-arm-linux.
In some .c file:
#include <bzlib.h>
If I compile with an ordinary gcc, everything is working fine, but with a gcc-linaro-arm-linux compiler it could not find libraries:
cmake:
$cmake -D CMAKE_C_COMPILER="${HOME}/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin/arm-linux-gnueabihf-gcc" -D CMAKE_CXX_COMPILER="${HOME}/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin/arm-linux-gnueabihf-g++" CMakeLists.txt
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /home/alex/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /home/alex/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/alex/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /home/alex/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.8")
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindPNG.cmake:105 (find_package_handle_standard_args)
src/CMakeLists.txt:3 (find_package)
You need to tell CMake where to find your target sysroot. Check out CMAKE_FIND_ROOT_PATH.

building portmidi

I've been tring to build portmidi on OSX 10.8.2
http://sourceforge.net/apps/trac/portmedia/wiki/Installing%20portmidi%20on%20Mac
Anyway, the README tells me to first use the command:
make -f pm_mac/Makefile.osx
but bash returns the following error message:
[~/Desktop/portmedia/portmidi]
DanMoore -> make -f pm_mac/Makefile.osx
rm -f CMakeCache.txt
mkdir -p Release
cd Release; cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is Clang 4.0.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- 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 - failed
-- SYSROOT: /Developer/SDKs/MacOSX10.5.sdk
-- DEFAULT_DEBUG_FLAGS not nil: -g
-- SYSROOT: /Developer/SDKs/MacOSX10.5.sdk
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/DanMoore/Desktop/portmedia/portmidi/Release
cd Release; make
Scanning dependencies of target pmjni
[ 3%] Building C object pm_common/CMakeFiles/pmjni.dir/__/pm_mac/pmmacosxcm.c.o
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/y4/p_kjk8692z73xy4nhwx6h_100000gn/T//cc73yejt.out
make[3]: *** [pm_common/CMakeFiles/pmjni.dir/__/pm_mac/pmmacosxcm.c.o] Error 255
make[2]: *** [pm_common/CMakeFiles/pmjni.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
I wasn't expecting an easy build, but these errors look foreign to me.
Can anyone explain whats going on??
I'm trying to render a library file for simple C programs. (.a or .la)
Thanks in advance to anyone who takes a look!!

cmake doesn't display display message

Fedora 15
cmake version 2.8.4
I am using the following CMakeLists.txt. However the status message doesn't display when I run cmake .
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(proj2 C)
IF(CMAKE_COMPILER_IS_GNUCXX)
MESSAGE(STATUS "==== GCC detected - Adding compiler flags")
SET(CMAKE_C_FLAGS "-pthread -ggdb -Wextra -Wall")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ADD_EXECUTABLE(crypto_app main.c)
TARGET_LINK_LIBRARIES(crypto_app crypt)
All I get is the following:
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/projects/proj1/
Many thanks for any suggestions about this.
You're telling cmake that it's a C project, and then checking for a CXX (i.e. C++) compiler. CMAKE_COMPILER_IS_GNUCXX will never be true in this case. That's why.

Resources