Installation of the environment on the new host computer

6 篇文章 1 订阅

Configuration process for the new host:

  1. Install make and Cmake
    sudo apet-get install make
    sudo apt-get install cmake
    
  2. Install the environment for C++

g++ version should be 7.3 or higher

sudo apt-get install g++  # g++ version should be 7.3 or higher
  1. delete CMakeCache.txt included in /build-x86_64 and /build-arm

  2. To set up the ZMQ environment, you need to download the installation package for ZeroMQ.

    1. Here, we provide the installation package for ZMQ, and any version higher than 4.3.4 is suitable:
    tar -xzvf  libzmq-4.3.4.tar.gz .
    
    1. Then enter the directory:
    cd libzmq-4.3.4
    
    1. Start to install:
    ./autogen.sh
    
    1. Use ‘prefix’ command to specify the installation directory:
    ./configure --prefix=/path/to/where/you/want --without-libsodium
    make
    make install
    
    1. If you encounter the following issue, it is a compatibility problem between the ZMQ library version and the system environment. In simple terms, the x86-64 version is only suitable for 64-bit hosts, while what is needed on ARM is cross-compiled library files.
    	 ERROR: skipping incompatible
    

    I apply the solution:
    First, check the library linking information to confirm the assumption

    	readelf -h libxxx.so
    

    Recompile ZMQ using the cross-compilation tool. The cross-compilation tool I’m using is
    /tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++

    Therefore, in step three, modify the configure file as follows:

    ./configure --host=aarch64-linux CC=/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-gcc CXX=/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++  --prefix=/home/grand/arm_a_installed/ --without-libsodium
    

    "No need to make changes to other steps; the key point is to ensure that the compiler and library versions match. ----20230621
    ("If you don’t have Xilinx tools, please refer to the ‘Compile grand-daq’ section later in the document)

  3. **Set up the environment for yaml **

    1. Download the YAML installation package, which can be obtained from its official website, the version used is yaml-cpp-yaml-cpp-0.7.0.tar.gz.

    2. Unzip the package:

    tar -xzvf yaml-cpp-yaml-cpp-0.7.0.tar.gz 
    
    1. Compile and install
    • Enter the unzipped directory.
    cd yaml-cpp-yaml-cpp-0.7.0
    mkdir build
    
    • Modify CMakeLists.txt, and add:
    add_definitions(-w) // ignore the mistakes of dummy
    link_directories( /home/grand/pc_installed/lib ) // specify external linked libraries
    
    • Enter ./build/ and specify the installation directory
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=/home/grand/pc_installed -DBUILD_SHARED_LIBS=ON  ..
    // -DCMAKE_INSTALL_PREFIX=/path/to/where/you/want  // specify the installation directory
    // or in CMakeLists.txt add 'SET(CMAKE_INSTALL_PREFIX < install_path >)' after PROJECT(< project_name>)
    // -DBUILD_SHARED_LIBS=ON Enable dynamic library compilation, which is disabled by default
    
    • Start to compile
    make -j8
    sudo make install
    sudo ldconfig
    

    The YAML environment has been successfully set up.


  • If use yaml-cpp-release-0.5.0, you may meet followed problems:
    • cannot find boost dependency libraries
      • first you should install boost:
        sudo apt-get install libboost-all-dev
        
      • After installation, if it still doesn’t work, first check for the ‘boost_thread’ library, and then modify the CMakeLists file to specify the path where the boost library is located
        locate boost_thread
        set(BOOST_LIBRARYDIR /usr/lib) # Assuming that the location of Boost is /usr/lib/x86_64-linux-gnu/libboost_thread.a
        find_package(Boost REQUIRED COMPONENTS thread)
        
    • Boost library is present, but when calling the respective file, it displays: error: ‘next’ is not a member of ‘boost’, and the solution is:
      • Add the header file in the ‘next’ file where it is not found
      vi /home/xuxing/externalTools/DBH/yaml-cpp-release-0.5.0/include/yaml-cpp/node/detail/iterator.h
      
      #include <boost/next_prior.hpp> // Header files for Boost location
      
  • After completing the above steps, recompile (repeating the installation steps from the YAML) to display a successful installation.

  1. iperf
    Copy the iPerf tool that can be used on ARM to the ‘iperf_for_arm’ folder for future use.
  2. Configuring the C++ environment on ARM, the steps are as follows:
scp /tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/lib64/libstdc++.so.6.0.24 root@192.168.10.2:/lib/ 
scp /tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/lib64/libgcc_s.so.1 root@192.168.10.2:/lib/

ssh root@<arm-host>
cd /lib
ln -s libstdc++.so.6.0.24 libstdc++.so.6
ln -s libstdc++.so.6 libstdc++.so
ln -s libgcc_s.so.1 libgcc_s.so

See details in ‘step_for_cpp.txt,’ the content is as follows:

3. scp /tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/lib64/libstdc++.so.6.0.24 root@192.168.61.xx:/lib/
4. scp /tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/lib64/libgcc_s.so.1 root@192.168.61.xx:/lib/
5. ssh root@<arm-host>
6. cd /lib/
7. # Search for the C++ libraries and then create symbolic links.
8. ln -s libstdc++.so.6.0.24 libstdc++.so.6
9. ln -s libstdc++.so.6 libstdc++.so
10. ln -s libgcc_s.so.1 libgcc_s.so

If you change the host and the hostname is not ‘grand’

In that case, you need to perform the following steps:

1. rm ./build-arm/CMakeCache.txt
2. rm ./build-x86_64/CMakeCache.txt
3. vi CMakeLists.txt # modify set(EXTERNAL_DIR_ARM /home/duanbh/arm_a_installed) and set(EXTERNAL_DIR_PC /home/duanbh/pc_installed) to /home/user
4. vi ./package.sh # modify EXTERNAL_DIR_PC=/home/grand/pc_installed and EXTERNAL_DIR_ARM=/home/grand/arm_a_installed to /home/user
5. vi env.sh # modify all '/home/grand' to '/home/user'

Complete the entire process.


Compile grand-daq

  1. Execute the script.
	sh duantest.sh
  1. Possible problems
  • If you encounter the following issue, it’s a compatibility problem between the library version and the system environment. In simple terms, the x86-64 version is suitable for 64-bit hosts, while what is needed on ARM are cross-compiled library files.

    ERROR: skipping incompatible
    

    solutions:
    First, examine the linked library information to confirm the assumption.

    readelf -h libxxx.so
    

    Recompile the tools (ZeroMQ, YAML) using cross-compilation tools, or locate the library files within the cross-compilation tool. The cross-compilation tool I’m using is:

    1. /tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++, but this tool requires Xilinx to be downloaded in advance and is not universal
    2. Download aarch64-linux-gnu-g++ directly.
    sudo apt-get install g++-aarch64-linux-gnu
    aarch64-linux-gnu-g++ --vresion(check the version)
    
  • cannot open linker script file ****: Too many open files, the solution is the same as mentioned above

  • When packaging the software, you may encounter a situation as shown in the figure:
    在这里插入图片描述
    At this point, you should carefully check whether the library files and other components specified in the packaging script are present on the host, as shown in the following figure
    在这里插入图片描述


If there are any other issues, updates will continue.

GRAND@Dunhuang

Author: duanbohao@GRAND

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值