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. 出错现象:
        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

 

时间: 2024-09-20 14:23:50

OK335xS canutils deal with compile error的相关文章

bwm-tools compile error resolve.

when compile bwm-tools-0.3.0.tar.gz  in rhel6 (64bit) error message shows In file included from ../include/flow.h:30,                                                                                    from ../include/autoclass.h:29,                  

caffe: compile error : undefined reference to `cv::imread(cv::String const&, int)' et al.

when I compile caffe file : .build_debug/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'.build_debug/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<u

caffe: fuck compile error again : error: a value of type &quot;const float *&quot; cannot be used to initialize an entity of type &quot;float *&quot;

wangxiao@wangxiao-GTX980:~/Downloads/caffe-master$ make -j8find: `wangxiao/bvlc_alexnet/spl': No such file or directoryfind: `caffemodel': No such file or directoryfind: `wangxiao/bvlc_alexnet/0.77': No such file or directoryfind: `caffemodel': No su

caffe: compile error: Could not open or find file your path~~/resized_data/0 and a total of 2 images .

I0219 14:48:40.965386 31108 net.cpp:76] Memory required for data: 0I0219 14:48:40.965517 31108 layer_factory.hpp:76] Creating layer dataI0219 14:48:40.965621 31108 net.cpp:110] Creating Layer dataI0219 14:48:40.965642 31108 net.cpp:433] data -> dataI

Operators and Assignments(2)

Objective 2) Determine the result of applying the boolean equals(Object) method to objects of any combination of the classes java.lang.String java.lang.Boolean and java.lang.Object. The equals method can be considered to perform a deep comparison of

java违例的限制

覆盖一个方法时,只能产生已在方法的基础类版本中定义的违例.这是一个重要的限制,因为它意味着与基础类协同工作的代码也会自动应用于从基础类衍生的任何对象(当然,这属于基本的OOP概念),其中包括违例. 下面这个例子演示了强加在违例身上的限制类型(在编译期):   //: StormyInning.java // Overridden methods may throw only the // exceptions specified in their base-class // versions,

Microsoft Visual C++ and Win32 structured exception handling

Introduction In an earlier article [1] I described some performance measurements when using exceptions in various languages on Windows. A couple of people since then have asked me questions about how the windows exception model actually works and how

.NET (C#) Internals: Struct and Class

引言 Struct与Class的异同?本是一个老生常谈话题,前几天看帖就看到了Struct 与Class辨析,其中也提到了<[你必须知道的.NET] 第四回:后来居上:class和struct>(虽然在园子里看了这个系列,但仍然买了本书看),回帖也特别热闹.我也躺下这个浑水!希望能给您带来不一样的视觉,欢迎评论.本文主题如下: 直观印象 深入分析  刨根问底(刨祖坟) 特别之处ReadOnly 浅出 一.直观印象 Struct与Class的异同,到底什么是什么呢?首先来两段代码,给个直观印象.

Declarations and Access Control (2)

access Objective 2Declare classes, inner classes, methods, instance variables static, variables and automatic (method local) variables, making appropriate use of all permitted modifiers (such as public final static abstract and so forth). State the s