OK335xS canutils deal with compile error

简介: /************************************************************************************** * OK335xS canutils deal with compile error * 声明: * 本文主要是记录解决编译can测试工具(canutils)时遇到的一些编译错误。
/**************************************************************************************
 *                  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. 出错现象:
        Qt@zengjf:~/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. 错误现象:
        Qt@zengjf:~/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

 

目录
相关文章
|
IDE PyTorch 网络安全
|
8月前
|
Java 数据库连接 Apache
Correct the classpath of your application so that it contains compatible versions of the classes com
Correct the classpath of your application so that it contains compatible versions of the classes com
Warning: Can save best model only with val_acc available, skipping
本文解决了在使用DenseNet网络结构保存最优模型时出现的"Warning: Can save best model only with val_acc available, skipping"问题,方法是将`ModelCheckpoint`回调函数中的`monitor`参数值从`val_acc`改为`val_accuracy`。
|
编译器
[√]添加预处理的2个不同方式:target_compile_definitions / add_definitions
[√]添加预处理的2个不同方式:target_compile_definitions / add_definitions
287 0
|
数据格式
ValueError: This model has not yet been built. Build the model first by calling `build()` or calling
ValueError: This model has not yet been built. Build the model first by calling `build()` or calling
226 0
ValueError: This model has not yet been built. Build the model first by calling `build()` or calling
|
TensorFlow 算法框架/工具
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
291 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
|
iOS开发
Xcode报错Expected selector for Objective-C and Expected method body
Xcode报错Expected selector for Objective-C and Expected method body
228 0
Xcode报错Expected selector for Objective-C and Expected method body
libs/spandsp/src/floating_fudge.h:40:20: error: implicit declaration of function ‘sin’ [-Werror=impl
libs/spandsp/src/floating_fudge.h:40:20: error: implicit declaration of function ‘sin’ [-Werror=impl
122 0
Error: invalid option: --with-training-tools
Error: invalid option: --with-training-tools
180 0
Cannot find source code based button in SE24
When you are logging on to customer system for incident handling, you want to switch to source code to perform some keyword search. However, you could not find button “Source code based builder” in toolbar, with following warning message: ———————————————— 版权声明:本文为CSDN博主「汪子熙」的原创文章,遵循CC 4.0 BY-SA版权协
Cannot find source code based button in SE24