I am Compiling on a Beagleboard-Xm, Kernel:
root#beagleboard:~# uname -a
Linux beagleboard 2.6.32 #3 PREEMPT Tue Jul 26 10:56:56 CEST 2011 armv7l unknown
I now try to compile a static library with CMake, and everything is working fine, until it comes to linking of the library:
root#beagleboard:/usr/src/build/beaglebuild# make
Scanning dependencies of target phoenix_base
[ 2%] Building CXX object 00_phoenix_base/CMakeFiles/phoenix_base.dir/src/exec_buffer.cpp.o
[ 5%] Building CXX object 00_phoenix_base/CMakeFiles/phoenix_base.dir/src/func_buffer.cpp.o
[ 8%] Building CXX object 00_phoenix_base/CMakeFiles/phoenix_base.dir/src/worker.cpp.o
[ 11%] Building CXX object 00_phoenix_base/CMakeFiles/phoenix_base.dir/src/workermanager.cpp.o
[ 14%] Building CXX object 00_phoenix_base/CMakeFiles/phoenix_base.dir/src/command.cpp.o
[ 17%] Building CXX object 00_phoenix_base/CMakeFiles/phoenix_base.dir/src/logger.cpp.o
[ 20%] Building CXX object 00_phoenix_base/CMakeFiles/phoenix_base.dir/src/signal.cpp.o
Linking CXX static library libphoenix_base.a
BusyBox v1.13.2 (2011-02-25 16:46:47 CET) multi-call binary
Usage: ar [-o] [-v] [-p] [-t] [-x] ARCHIVE FILES
Extract or list FILES from an ar archive
Options:
-o Preserve original dates
-p Extract to stdout
-t List
-x Extract
-v Verbose
make[2]: *** [00_phoenix_base/libphoenix_base.a] Error 1
make[1]: *** [00_phoenix_base/CMakeFiles/phoenix_base.dir/all] Error 2
make: *** [all] Error 2
In my the "ar --help" prints the same stuff.
Is there a way to get linking running on the board?
What may be the Issue?
Some other System Versions:
root#beagleboard:~# cmake --version
cmake version 2.8.2
root#beagleboard:~# g++ --version
g++ (GCC) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
After much trouble I cross-compiled a fully up-to-date version of ar (i thing the one on the board was outdated) and I got rid of BusyBox.
Now everything works as I expected.
Related
I'm trying to build LUAGLM (from https://github.com/gottfriedleibniz/lua) to bind GLM library to give access in Lua using cmake. When i build, the building completes ok but the linker does not giving error:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [glm.so] Error 1
make[1]: *** [CMakeFiles/glm.dir/all] Error 2
make: *** [all] Error 2
Above these lines there is a very long list starting with:
[ 10%] Building CXX object CMakeFiles/liblua.dir/onelua.c.o
[ 20%] Linking CXX shared library liblua54.dylib
[ 20%] Built target liblua
[ 30%] Building CXX object CMakeFiles/liblua_static.dir/onelua.c.o
[ 40%] Linking CXX static library liblua54_static.a
[ 40%] Built target liblua_static
[ 50%] Building C object CMakeFiles/lua.dir/lua.c.o
[ 60%] Linking CXX executable lua
[ 60%] Built target lua
[ 70%] Building CXX object CMakeFiles/luac.dir/onelua.c.o
[ 80%] Linking CXX executable luac
[ 80%] Built target luac
[ 90%] Building CXX object CMakeFiles/glm.dir/libs/glm_binding/lglmlib.cpp.o
[100%] Linking CXX shared module glm.so
Undefined symbols for architecture x86_64:
"glm_pushmat(lua_State*, glmMatrix const&)", referenced from:
glm_mat_add(lua_State*) in lglmlib.cpp.o
glm_mat_sub(lua_State*) in lglmlib.cpp.o
glm_mat_mul(lua_State*) in lglmlib.cpp.o
glm_mat_negate(lua_State*) in lglmlib.cpp.o
glm_mix(lua_State*) in lglmlib.cpp.o
glm_saturation(lua_State*) in lglmlib.cpp.o
glm_orthonormalize(lua_State*) in lglmlib.cpp.o
...
I'm on MacOS Intel (i386-apple-darwin11.3.0)
Not sure where to go next, do I need to edit the CMakeList somehow?
Any help much appreciated
EDIT:
The cmake error log contains the following :
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc Build flags: Id flags:
The output was: 1 ld: library not found for -lSystem clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ Build flags: Id flags:
The output was: 1 ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is actually a bug in the CMakeList.txt because the library-list for the glm.so module does not contain the liblua.
If you apply the following patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8cf8a1a6..6eda2a17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
## -940,7 +940,7 ## ENDIF()
ADD_LIBRARY(glm MODULE ${SRC_LIBGLM})
TARGET_INCLUDE_DIRECTORIES(glm PRIVATE ${INCLUDE_DIRECTORIES})
-TARGET_LINK_LIBRARIES(glm PRIVATE ${LIBS})
+TARGET_LINK_LIBRARIES(glm PRIVATE ${LIBS} liblua_static)
IF( LUA_BUILD_AS_DLL )
TARGET_LINK_LIBRARIES(glm PUBLIC ${interpretor_target})
TARGET_COMPILE_DEFINITIONS(glm PRIVATE LUA_BUILD_AS_DLL)
to the freshly cloned repository and then do (inside the cloned repository):
git submodule update --init
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DONE_LUA=ON ..
make
you should find the files glm.so, lua and luac in your build directory. At least that worked on my Intel MacBook.
Using liblua_static in the CMakeList.txt for the library glm makes sure, that the resulting glm.so does not need the liblua dynamic library but contains the required code statically. That avoids problems when loading glm.so and the liblua library not being in the library path.
I opened an issue in the GitHub repository for it. So hopefully it will get fixed for everybody soon.
Usually it'll be something like -lYourLibrary not found, if -lSystem for example is not found, try adding it to your CMakeLists.
Are you still having the issue?
In Ubuntu20.04.
I want to insatll easy3d, but I can not make install it successfully.
make
[ 83%] Building CXX object CMakeFiles/easy3d.dir/surface_mesh_io_obj.cpp.o
[ 87%] Building CXX object CMakeFiles/easy3d.dir/surface_mesh_io_off.cpp.o
[ 91%] Building CXX object CMakeFiles/easy3d.dir/surface_mesh_io_ply.cpp.o
[ 95%] Building CXX object CMakeFiles/easy3d.dir/transform.cpp.o
[100%] Linking CXX static library libeasy3d.a
[100%] Built target easy3d
And the build have files:
CMakeCache.txt CMakeFiles Makefile cmake_install.cmake libeasy3d.a
Then I excute the command make install, I got
make: *** No rule to make target 'install'. Stop.
How could I fix it
I made a big mistake that is nothing to install.
I am new to Docker container and kubenetes cluster. I am trying to run following section of command using buildah
##install cmake
USER root
RUN apt-get update && apt-get -y install cmake
USER ${user}
WORKDIR $HOME
## bustools_dev
RUN git clone https://github.com/Yenaled/bustools.git && \
cd bustools && \
mkdir build && \
cd build
RUN cmake ../
RUN make
RUN cd src
RUN mv bustools bustools_dev
RUN ENV PATH=$HOME/bustools/build/src/:${PATH}
but get the following error. What am I missing here?
STEP 17: WORKDIR $HOME
WARN[0002] SHELL is not supported for OCI image format, [/bin/bash -o pipefail -c] will be ignored. Must use `docker` format
--> 770a1b90326
STEP 18: RUN git clone https://github.com/Yenaled/bustools.git && cd bustools && mkdir build && cd build
Cloning into 'bustools'...
WARN[0005] SHELL is not supported for OCI image format, [/bin/bash -o pipefail -c] will be ignored. Must use `docker` format
--> 2b87555e927
STEP 19: RUN cmake ../
CMake Error: The source directory "/home" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
error building at STEP "RUN cmake ../": error while running runtime: exit status 1
ERRO[0111] exit status 1
I'd simplify the Dockerfile to avoid the issues with the WORKDIR setup that I think are the cause of the problem:
FROM debian:11
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends --quiet \
ca-certificates \
cmake \
git \
g++ \
make \
libzip-dev \
&& apt-get clean all
WORKDIR /usr/local/src
RUN git clone https://github.com/Yenaled/bustools.git
RUN mkdir -p /usr/local/src/bustools/build
RUN cd /usr/local/src/bustools/build \
&& cmake .. \
&& make
[...]
Output
[...]
STEP 3/6: WORKDIR /usr/local/src
--> ffb056fd5b3
STEP 4/6: RUN git clone https://github.com/Yenaled/bustools.git
Cloning into 'bustools'...
--> 83afa44c5c8
STEP 5/6: RUN mkdir -p /usr/local/src/bustools/build
--> 2e6ed328088
STEP 6/6: RUN cd /usr/local/src/bustools/build && cmake .. && make
-- 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
release mode
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/bustools/build
Scanning dependencies of target bustools_core
[ 4%] Building CXX object src/CMakeFiles/bustools_core.dir/BUSData.cpp.o
[ 8%] Building CXX object src/CMakeFiles/bustools_core.dir/Common.cpp.o
[ 13%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_capture.cpp.o
[ 17%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_clusterhist.cpp.o
[ 21%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_collapse.cpp.o
[ 26%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_correct.cpp.o
[ 30%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_count.cpp.o
[ 34%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_extract.cpp.o
[ 39%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_inspect.cpp.o
[ 43%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_linker.cpp.o
[ 47%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_main.cpp.o
[ 52%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_mash.cpp.o
[ 56%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_merge.cpp.o
[ 60%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_predict.cpp.o
[ 65%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_project.cpp.o
[ 69%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_sort.cpp.o
[ 73%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_text.cpp.o
[ 78%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_umicorrect.cpp.o
[ 82%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o
[ 86%] Building C object src/CMakeFiles/bustools_core.dir/roaring.c.o
[ 91%] Linking CXX static library libbustools_core.a
[ 91%] Built target bustools_core
Scanning dependencies of target bustools
[ 95%] Building CXX object src/CMakeFiles/bustools.dir/bustools_main.cpp.o
[100%] Linking CXX executable bustools
[100%] Built target bustools
--> b08bc457b5f
Good morning!
I'm rewriting this question because, after a lot of reading and try-fails, I go further on that but I get staked again.
What I'm trying to accomplice here is: Use Conan as a Package manager for the embedded device "Raspberry PICO" from my Mac (with CLion)
The change from the previous question is that now I'm creating a package and I do not use only the "standalone" packages manager.
This "package" is on github.com. To install and try to compile it, you will need also the Pico SDK.
Some facts:
The new c++ project without Conan but with SDK is compiling and working on an embedded device.
The Conan project without Pico SDK is compiling correctly.
I really tried every possible configuration on the profile file and there are two mainly configuration profiles that brings to two different errors during build:
The first one is without any environments. This is because on CLion I'm not adding any environment and the project itself (without conan, but oblivious with SDK for pico) is builder correctly.
[settings]
os_build=Macos
arch_build=x86_64
os=Linux
arch=armv7
# os=Macos
# arch=x86_64
# compiler=apple-clang
compiler=gcc
# compiler.version=12.0
compiler.version=9.2
# compiler.libcxx=libc++
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
ps. The commented lines are additional tests that resolve on the same result after conan build ..
The error is this:
jure.prah#MacBook-Pro-di-Jure conan-blink-mosfet % conan build .
Using lockfile: '/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/conan.lock'
Using cached profile from lockfile
conanfile.py (blink/0.1): Calling build()
conanfile.py (blink/0.1): CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/package" "/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/src"
Using PICO_SDK_PATH from environment ('/Users/jure.prah/CLionProjects/pico-sdk')
PICO_SDK_PATH is /Users/jure.prah/CLionProjects/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
-- Defaulting build type to 'Release' since not specified.
Using Conan toolchain through /Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/generators/conan_toolchain.cmake.
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: Setting BUILD_SHARED_LIBS= OFF
-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- The ASM compiler identification is Clang
-- Found assembler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Detecting C compiler ABI info
Using Conan toolchain through .
-- 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
Using Conan toolchain through .
-- 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
Defaulting PICO target board to pico since not specified.
Using board configuration from /Users/jure.prah/CLionProjects/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: /usr/local/Frameworks/Python.framework/Versions/3.9/bin/python3.9 (found version "3.9.6") found components: Interpreter
TinyUSB available at /Users/jure.prah/CLionProjects/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/Release
conanfile.py (blink/0.1): CMake command: cmake --build '/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/Release'
[ 25%] Building CXX object CMakeFiles/blink.dir/blink.cpp.o
[ 50%] Linking CXX static library libblink.a
[ 50%] Built target blink
Scanning dependencies of target bs2_default
[ 75%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.o
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:89:1: error: unknown directive
.syntax unified
^
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:90:1: error: unknown directive
.cpu cortex-m0plus
^
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:91:1: error: unknown directive
.thumb
^
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:93:15: error: unexpected token in '.section' directive
.section .text
^
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:101:1: error: unknown directive
.type _stage2_boot,%function
^
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:102:1: error: unknown directive
.thumb_func
^
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:104:11: error: unknown token in expression
push {lr}
^
[...]
^
/Users/jure.prah/CLionProjects/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:285:1: error: unknown directive
.ltorg
^
make[2]: *** [pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.o] Error 1
make[1]: *** [pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/all] Error 2
make: *** [all] Error 2
ERROR: conanfile.py (blink/0.1): Error in build() method, line 40
cmake.build()
ConanException: Error 2 while executing cmake --build '/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/Release'
The second profile configuration is based on the example from conan.com (thanks to #uilianres) and sets the environments.:
toolchain_path=/usr/local/bin
toolchain=arm-none-eabi
[settings]
os_build=Macos
arch_build=x86_64
#os=Macos
#arch=x86_64
os=Linux
arch=armv7
compiler=apple-clang
# compiler=gcc
compiler.version=12.0
# compiler.version=9.2
compiler.libcxx=libc++
# compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
CONAN_CMAKE_FIND_ROOT_PATH=$toolchain_path/
AR=$toolchain-ar
AS=$toolchain-as
CC=$toolchain-gcc
CXX=$toolchain-g++
STRIP=$toolchain-strip
Using command conan build . resolve on different error:
jure.prah#MacBook-Pro-di-Jure conan-blink-mosfet % conan build .
Using lockfile: '/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/conan.lock'
Using cached profile from lockfile
conanfile.py (blink/0.1): Calling build()
conanfile.py (blink/0.1): CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/package" "/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/src"
Using PICO_SDK_PATH from environment ('/Users/jure.prah/CLionProjects/pico-sdk')
PICO_SDK_PATH is /Users/jure.prah/CLionProjects/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
-- Defaulting build type to 'Release' since not specified.
Using Conan toolchain through /Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/generators/conan_toolchain.cmake.
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: Setting BUILD_SHARED_LIBS= OFF
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/bin/arm-none-eabi-gcc
-- 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 - no
-- Detecting C compiler ABI info
Using Conan toolchain through .
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/local/bin/arm-none-eabi-gcc
Using Conan toolchain through .
-- Check for working C compiler: /usr/local/bin/arm-none-eabi-gcc - broken
CMake Error at /usr/local/Cellar/cmake/3.21.0/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/usr/local/bin/arm-none-eabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/Release/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_69910/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_69910.dir/build.make CMakeFiles/cmTC_69910.dir/build
Building C object CMakeFiles/cmTC_69910.dir/testCCompiler.c.o
/usr/local/bin/arm-none-eabi-gcc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -o CMakeFiles/cmTC_69910.dir/testCCompiler.c.o -c /Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/Release/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_69910
/usr/local/Cellar/cmake/3.21.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_69910.dir/link.txt --verbose=1
/usr/local/bin/arm-none-eabi-gcc -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_69910.dir/testCCompiler.c.o -o cmTC_69910
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol arch_paths_first; defaulting to 0000000000008018
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2: error: ld returned 1 exit status
make[1]: *** [cmTC_69910] Error 1
make: *** [cmTC_69910/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)
-- Configuring incomplete, errors occurred!
See also "/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/Release/CMakeFiles/CMakeOutput.log".
See also "/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/Release/CMakeFiles/CMakeError.log".
ERROR: conanfile.py (blink/0.1): Error in build() method, line 39
cmake.configure()
ConanException: Error 1 while executing cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/package" "/Users/jure.prah/CLionProjects/rpi-pico/conan-blink-mosfet/src"
Also here I did all the variants and tests, but everything leads to this error. Besides, I checked the toolchain paths and there are correct.
I'm completely lost now. :(
I am having problems installing c2ffi (https://github.com/rpav/c2ffi) on both FreeBSD 12 and Debian 10. I need c2ffi in order to use some Common Lisp bindings that rely on c2ffi.
On FreeBSD 12, I have both Clang 6.0 (default) and 10.0 installed; c2ffi requires LLVM 10.0. Because cc and c++ refer to Clang 6.0 in my FreeBSD installation, I set PATH to /usr/local/llvm10/bin:$PATH, and I also set aliases to refer to clang and clang++. I have cmake version 3.17.3 installed. However, when I make it to the make phase of installing c2ffi, I run into the following error:
Scanning dependencies of target c2ffi
[ 7%] Building CXX object CMakeFiles/c2ffi.dir/src/AST.cpp.o
[ 15%] Building CXX object CMakeFiles/c2ffi.dir/src/Decl.cpp.o
[ 23%] Building CXX object CMakeFiles/c2ffi.dir/src/Expr.cpp.o
[ 30%] Building CXX object CMakeFiles/c2ffi.dir/src/OutputDriver.cpp.o
[ 38%] Building CXX object CMakeFiles/c2ffi.dir/src/Template.cpp.o
[ 46%] Building CXX object CMakeFiles/c2ffi.dir/src/Type.cpp.o
[ 53%] Building CXX object CMakeFiles/c2ffi.dir/src/c2ffi.cpp.o
[ 61%] Building CXX object CMakeFiles/c2ffi.dir/src/drivers/JSON.cpp.o
/home/michael/c2ffi/src/drivers/JSON.cpp:36:26: warning: passing an object that
undergoes default argument promotion to 'va_start' has undefined behavior
[-Wvarargs]
va_start(ap, close);
^
/home/michael/c2ffi/src/drivers/JSON.cpp:32:61: note: parameter of type 'bool'
is declared here
void write_object(const char *type, bool open, bool close, ...) {
^
1 warning generated.
[ 69%] Building CXX object CMakeFiles/c2ffi.dir/src/drivers/Null.cpp.o
[ 76%] Building CXX object CMakeFiles/c2ffi.dir/src/drivers/Sexp.cpp.o
[ 84%] Building CXX object CMakeFiles/c2ffi.dir/src/init.cpp.o
[ 92%] Building CXX object CMakeFiles/c2ffi.dir/src/options.cpp.o
[100%] Linking CXX executable bin/c2ffi
/usr/bin/ld: error: unable to find library -lclang-cpp
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
Stop.
make[2]: stopped in /usr/home/michael/c2ffi/build
*** Error code 1
Stop.
make[1]: stopped in /usr/home/michael/c2ffi/build
*** Error code 1
Stop.
make: stopped in /usr/home/michael/c2ffi/build
The file libclang-cpp.so is present in my /usr/local/llvm10/lib directory, but cmake does not detect it. I tried various other approaches, including setting the LD_LIBRARY_PATH and CMAKE_LIBRARY_PATH environment variables, but to no avail; I received the same error message as above.
I gave up installing c2ffi on FreeBSD and tried installing it on a fresh install of Debian 10 with LLVM 10.0 and cmake 3.18.1. However, when I ran make on Debian, I ended up with the following error message:
[ 7%] Building CXX object CMakeFiles/c2ffi.dir/src/AST.cpp.o
/home/michael/c2ffi/src/AST.cpp:24:10: fatal error: 'clang/AST/ASTConsumer.h' file not found
#include <clang/AST/ASTConsumer.h>
^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/c2ffi.dir/build.make:82: CMakeFiles/c2ffi.dir/src/AST.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/c2ffi.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
I am wondering how I can build c2ffi on my FreeBSD and Debian systems?
On my FreeBSD installation, in the CMakeLists.txt I replaced the line
target_link_libraries(c2ffi PUBLIC clang-cpp LLVM)
with
target_link_libraries(c2ffi PUBLIC /usr/local/llvm10/lib/libclang-cpp.so LLVM)
On my Debian installation, it turned out that I did not have one of the libclang development packages installed. After installing that package I was able to run make without any problems.
The project's CMakeLists.txt is broken, so bug upstream. Actualy, there are numerous pull requests already filed:
https://github.com/rpav/c2ffi/pull/70
https://github.com/rpav/c2ffi/pull/68/
https://github.com/rpav/c2ffi/pull/65/
You can try these, or combine them into a working solution.