• salt一键部署gcc-c++


    1.准备工作

    2.salt关于gcc-c++的部署脚本:

    gcc-mkdir:
      cmd.run:
       - name: 'cd /opt && mkdir gcc'
    
    gcc-file:
      file.managed:
       - source: salt://gcc/gcc-5.2.0.tar.gz
       - name: /opt/gcc/gcc-5.2.0.tar.gz
       - user: root
       - group: root
       
    
    gcc-install:
      cmd.run:
       - name: 'cd /opt/gcc && tar -xf gcc-5.2.0.tar.gz && cd gcc-5.2.0 && tar -xf gmp-4.3.2.tar.bz2 && tar -xf isl-0.14.tar.bz2 && tar -xf mpfr-2.4.2.tar.bz2  && tar -xf mpc-0.8.1.tar.gz && ./contrib/download_prerequisites && ./configure --prefix=/usr/local --enable-checking=release --enable-languages=c,c++  --disable-multilib && make -j23 &&  make install && rm -r /usr/lib64/libstdc++.so.6 && ln -s /usr/local/lib64/libstdc++.so.6.0.21 /usr/lib64/libstdc++.so.6 && rm -r /usr/local/lib64/libstdc++.so && ln -s /usr/local/lib64/libstdc++.so.6.0.21 /usr/local/lib64/libstdc++.so && rm -r /usr/local/lib64/libstdc++.so.6 && ln -s  /usr/local/lib64/libstdc++.so.6.0.21 /usr/local/lib64/libstdc++.so.6'
       - unless: 'test -d /opt/gcc/gcc-5.2.0'
       - require:
         - file: gcc-file
     
    gcc-rmtgz:
      file.absent:
        - name: /opt/gcc/gcc-5.2.0.tar.gz
    	- require:
          - cmd: gcc-install
    	  
    /etc/profile:
      file.append:
        - text:
          - export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
    	- require:
         - file: gcc-rmtgz
    	 
    source-profile:
       cmd.run:
        - name: 'source /etc/profile'
    	- require:
          - file: /etc/profile
    

      

      3.其余的操作步骤和之前jdk,python类似这里就不写啦。

  • 相关阅读:
    final详解
    静态与非静态
    静态内部类详解
    iso-----genisoimage/md5sum命令用法
    Docker-----版本选择
    Docker-----deepin系统下docker安装registry
    shell高级-----正则表达式
    kolla-ansible-----rally模块
    shell高级-----创建函数
    jenkins入门-----(1)安装、配置
  • 原文地址:https://www.cnblogs.com/wyl9527/p/6859747.html
Copyright © 2020-2023  润新知