OK335xS canutils deal with compile error

/**************************************************************************************
 *                  OK335xS canutils deal with compile error
 * 声明:
 *     本文主要是记录解决编译can测试工具(canutils)时遇到的一些编译错误。
 *
 *                                          2015-9-4 晴 深圳 南山平山村 曾剑锋
 *************************************************************************************/

                \\\\\\\\\\\\\\\\\\\\\-*- 目录 -*-////////////////////
                |      一、参考文章:
                |      二、编译后简略的3层文件结构(tree -L 3):
                |      三、libsocketcan make install 问题:
                |      四、canutils 找不到 libsocketcan 问题:
                |      五、canutils 安装权限不足:
                \\\\\\\\\\\\\\\\\\\\\\\\\\\//////////////////////////

一、参考文章:
    1. 有谁编译过canutils-4.0.6的吗?
        http://bbs.csdn.net/topics/390465516
    2. AM335X DCAN Driver Guide
        http://processors.wiki.ti.com/index.php/AM335X_DCAN_Driver_Guide#CAN_Utilities
    3. AM335x DCAN driver compile issues
        https://e2e.ti.com/support/embedded/linux/f/354/t/270303

二、最后编译出来简略的3层文件结构(tree -L 3):
    .
    ├── canutils-4.0.6
    │   ├── aclocal.m4
    │   ├── AUTHORS
    │   ├── autogen.sh
    │   ├── ChangeLog
    │   ├── config
    │   ├── config.log
    │   ├── config.status
    │   ├── configure
    │   ├── configure.ac
    │   ├── COPYING
    │   ├── GNUmakefile
    │   ├── GNUmakefile.am
    │   ├── GNUmakefile.in
    │   ├── include
    │   ├── install
    │   │   ├── bin
    │   │   ├── lib
    │   │   ├── sbin
    │   │   └── share
    │   ├── libtool
    │   ├── man
    │   ├── remake.sh
    │   └── src
    ├── canutils-4.0.6.tar.bz2
    ├── libsocketcan-0.0.8
    │   ├── aclocal.m4
    │   ├── autogen.sh
    │   ├── config
    │   ├── config.log
    │   ├── config.status
    │   ├── configure
    │   ├── configure.ac
    │   ├── GNUmakefile
    │   ├── GNUmakefile.am
    │   ├── GNUmakefile.in
    │   ├── include
    │   ├── install
    │   │   ├── include
    │   │   ├── lib
    │   │   └── share
    │   ├── INSTALL
    │   ├── libtool
    │   ├── README
    │   ├── remake.sh
    │   ├── src
    │   └── tests
    └── libsocketcan-0.0.8.tar.bz2

三、libsocketcan make install 问题:
    1. 出错现象:
        [email protected]:~/practice/c/canTest/libsocketcan-0.0.8$ make install
        Making install in include
        make[1]: Entering directory `/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include‘
        make[2]: Entering directory `/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include‘
        make[2]: Nothing to be done for `install-exec-am‘.
        test -z "/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include" || /bin/mkdir -p
            "/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include"
        /usr/bin/install -c -m 644  libsocketcan.h can_netlink.h
            ‘/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include/.‘
        /usr/bin/install: `libsocketcan.h‘ and
            `/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include/./libsocketcan.h‘ are the same file
        /usr/bin/install: `can_netlink.h‘ and
            `/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include/./can_netlink.h‘ are the same file
        make[2]: *** [install-nobase_includeHEADERS] Error 1
        make[2]: Leaving directory `/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include‘
        make[1]: *** [install-am] Error 2
        make[1]: Leaving directory `/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include‘
        make: *** [install-recursive] Error 1
    2. 解决方法:
        export GNUEABI=arm-linux-gnueabihf
        export CC=$GNUEABI-gcc
        export LD=$GNUEABI-ld
        export NM=$GNUEABI-nm
        export AR=$GNUEABI-ar
        export RANLIB=$GNUEABI-ranlib
        export CXX=$GNUEABI-c++filt
        export INSTALL_PATH=$PWD
        export PREFIX=$INSTALL_PATH/
        export CROSS_COMPILE_PREFIX=$PREFIX
        export PATH=$TOOL_CHAIN_PATH/bin:$PATH

        #./configure --host=arm-linux --prefix=$PREFIX --enable-debug
        # 官网给出的安装目录出错导致的,给出合适的安装路径
        ./configure --host=arm-arago-linux --prefix=$PREFIX/install --enable-debug

四、canutils 找不到 libsocketcan 问题:
    1. 错误现象:
        checking for pkg-config... /home/Qt/ti-processor-sdk-linux-am335x-evm-01.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/pkg-config
        checking pkg-config is at least version 0.9.0... yes
        checking for libsocketcan... no
        configure: error: *** libsocketcan version above 0.0.8 not found on your system
    2. 解决方法:
        export GNUEABI=arm-linux-gnueabihf
        export CC=$GNUEABI-gcc
        export LD=$GNUEABI-ld
        export NM=$GNUEABI-nm
        export AR=$GNUEABI-ar
        export RANLIB=$GNUEABI-ranlib
        export CXX=$GNUEABI-c++
        export PREFIX=$FILESYS_PATH/usr
        export CROSS_COMPILE_PREFIX=$PREFIX
        export PATH=$TOOL_CHAIN_PATH/bin:$PATH
        export LIBSOCKETCAN_INSTALL_DIR=$LIBSOCKETCAN_PATH/install
        export PKG_CONFIG_PATH=$LIBSOCKETCAN_PATH/config
        export LD_LIBRARY_PATH=${LIBDIR}:${LD_LIBRARY_PATH}
        export LD_RAN_PATH=${LIBDIR}:${LD_RAN_PATH}:/home/Qt/practice/c/canTest/libsocketcan-0.0.8/src/.libs
        export LDFLAGS="-Wl,--rpath -Wl,$LIBSOCKETCAN_INSTALL_DIR/lib"
        export INCLUDES="-I$LIBSOCKETCAN_INSTALL_DIR/include"

        #./configure --host=arm-arago-linux --prefix=$PREFIX --enable-debug
        # 加上libsocketcan库的位置
        ./configure --host=arm-linux --prefix=$PREFIX/install --enable-debug libsocketcan_LIBS=-lsocketcan LDFLAGS="-L$PWD/../libsocketcan-0.0.8/install/lib" libsocketcan_CFLAGS=-I$PWD/../libsocketcan-0.0.8/install/include

五、canutils 安装权限不足:
    1. 错误现象:
        [email protected]:~/practice/c/canTest/canutils-4.0.6$ make install
        Making install in include
        make[1]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0.6/include‘
        make[2]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0.6/include‘
        make[2]: Nothing to be done for `install-exec-am‘.
        make[2]: Nothing to be done for `install-data-am‘.
        make[2]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0.6/include‘
        make[1]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0.6/include‘
        Making install in config
        make[1]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0.6/config‘
        make[2]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0.6/config‘
        make[2]: Nothing to be done for `install-exec-am‘.
        test -z "/usr/install/lib/pkgconfig" || /bin/mkdir -p "/usr/install/lib/pkgconfig"
        /bin/mkdir: cannot create directory `/usr/install‘: Permission denied
        make[2]: *** [install-pkgconfigDATA] Error 1
        make[2]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0.6/config‘
        make[1]: *** [install-am] Error 2
        make[1]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0.6/config‘
        make: *** [install-recursive] Error 1
    2. 解决方法:
        export GNUEABI=arm-linux-gnueabihf
        export CC=$GNUEABI-gcc
        export LD=$GNUEABI-ld
        export NM=$GNUEABI-nm
        export AR=$GNUEABI-ar
        export RANLIB=$GNUEABI-ranlib
        export CXX=$GNUEABI-c++
        #export PREFIX=$FILESYS_PATH/usr        # 换一个有权限的路径
        export PREFIX=$PWD
        export CROSS_COMPILE_PREFIX=$PREFIX
        export PATH=$TOOL_CHAIN_PATH/bin:$PATH
        export LIBSOCKETCAN_INSTALL_DIR=$LIBSOCKETCAN_PATH/install
        export PKG_CONFIG_PATH=$LIBSOCKETCAN_PATH/config
        export LD_LIBRARY_PATH=${LIBDIR}:${LD_LIBRARY_PATH}
        export LD_RAN_PATH=${LIBDIR}:${LD_RAN_PATH}:/home/Qt/practice/c/canTest/libsocketcan-0.0.8/src/.libs
        export LDFLAGS="-Wl,--rpath -Wl,$LIBSOCKETCAN_INSTALL_DIR/lib"
        export INCLUDES="-I$LIBSOCKETCAN_INSTALL_DIR/include"

        #./configure --host=arm-arago-linux --prefix=$PREFIX --enable-debug
        ./configure --host=arm-linux --prefix=$PREFIX/install --enable-debug libsocketcan_LIBS=-lsocketcan LDFLAGS="-L$PWD/../libsocketcan-0.0.8/install/lib" libsocketcan_CFLAGS=-I$PWD/../libsocketcan-0.0.8/install/include
时间: 2024-10-08 05:00:27

OK335xS canutils deal with compile error的相关文章

Android source code compile error: “Try increasing heap size with java option '-Xmx<size>'”

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g" ./prebuilts/sdk/tools/jack-admin kill-server ./prebuilts/sdk/tools/jack-admin start-server Android source code compile error: "Try increasing heap size wi

VBA Excel WideCharToMultiByte Compile error on 64-bit System

Compile Error: The code in this project must be updated for use on64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute. 1.问题: 32-bit的VBA程序,在64-bit系统上运行时,出现该编译错误. 环境:Office2010 Excel 64-bit, 64-bit

IOS 编译错误,iOS compile error: no visible @interface for 'CDVCommandDelegateImpl' declares the selector

把Cordova 升级到 3.6.3 版本后,在变异的使用出现了如下问题 The error: /Volumes/local.uhmuhm.net/projectxxx/htdocs/phonegap/src/Projectxxx/platforms/ios/Projectxxx/Classes/MainViewController.m:154:19: error: no visible @interface for 'CDVCommandDelegateImpl' declares the s

the java.lang.UnsatisfiedLinkError: JD-Eclipse compile error

Start looking decompile tool that determines JD-Eclipse intends to use the online upgrade, sad destroy the machine does not , and led directly to enter the online update address can not find what plug-ins can be updated to the following, had to jdecl

Thinking in Java,Fourth Edition(Java 编程思想,第四版)学习笔记(十二)之Error Handling with Exceptions

The ideal time to catch an error is at compile time, before you even try to run the program. However, not all errors can be detected at compile time. To create a robust system, each component must be robust. By providing a consistent error-reporting

Nexus 7 Cyanogenmod OS Compile and errors

Nexus 7 Hardware information The Nexus 7 comes with several types, genaration I and II,  sales in 2012 and 2013. The Gen1 and Gen2 have different Processor, one is the NVIDIA Tegra, another with QCT APQ8064.  These two type of devices, have different

[symonfy] An error occurred when executing the "'cache:clear --no-warmup'"

Symfony Version: 3.4.* 当运行 composer update 会出现 [RuntimeException] An error occurred when executing the "'cache:clear --no-warmup'" command: PHP Fatal error: require_once(): Failed opening required '/srv/www/htdocs/sfs/vendor/doctrine/common/lib/

error WINDOWS H already included错误解释

分享一下我老师大神的人工智能教程吧.零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!http://www.captainbed.net compile error: c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #in

Thinking in Java from Chapter 11

From Thinking in Java 4th Edition 持有对象 // Simple container example (produces compiler warnings.) // {ThrowsException} import java.util.*; class Apple { private static long counter; private final long id = counter++; public long id() { return id;} } c