CMU15-445 Lab0 - C++ Primer

这篇博客详细介绍了CMU15-445实验0的内容,涵盖C++ Primer,包括代码下载、GDB调试、C++特性如智能指针(unique_ptr, shared_ptr, weak_ptr)、统一初始化、多线程和编程风格。还提供了实验指导,要求实现矩阵运算类并强调了测试与格式检查的重要性。" 81478050,7463364,Keras常用层与模型详解,"['深度学习', '神经网络', 'Keras库', '模型构建', '序列模型']
摘要由CSDN通过智能技术生成

Lab0- C++ Primer

个人笔记

代码下载

  1. 按照项目下的文档步骤:

    // 1. 新建一个仓库 bustub-private
    // 2. clone cmu db 远程代码到本地
    git clone --bare https://github.com/cmu-db/bustub.git bustub-public
    cd bustub-public
    // 3. mirror到自己刚创建的远程仓库
    git push --mirror git@github.com:sunshinejiali/bustub-private.git
    // 4. 删除 cmu db 的本地副本
    cd ..
    rm -rf bustub-public
    // 5. 拉取自己的远程仓库代码
    git clone git@github.com:sunshinejiali/bustub-private.git
    // 6. 添加 cmu-db 作为自己的第二远程仓库
    cd bustub-private
    git remote add public https://github.com/cmu-db/bustub.git
    // 7. 验证是否已经添加
    git remote -v
    // result:
    // origin  git@github.com:sunshinejiali/bustub-private.git (fetch)
    // origin  git@github.com:sunshinejiali/bustub-private.git (push)
    // public  https://github.com/cmu-db/bustub.git (fetch)
    // public  https://github.com/cmu-db/bustub.git (push)
    // 8. 提取 cmu-db 中的更改
    git pull public master
    
  2. 使用 2020 年的版本,因此需要回退到之前提交的某一版本。

    // 将代码回退到某一版本,head 指向当前的目标版本,删除之后的所有版本
    git reset --hard 444765a
    // 检查一下是否回退到正确的版本
    git log
    // (强制)提交更改
    git push -f
    
  3. 报错

    • 如果安装工具的时候报这个错误 ,这可能是因为在 windows 下编写好 .sh 文件后,在Linux 下运行报错。

      // 报错
      build_support/packages.sh: line 2: $'\r': command not found
      build_support/packages.sh: line 13: $'\r': command not found
      build_support/packages.sh: line 14: syntax error near unexpected token `$'{\r''
      'uild_support/packages.sh: line 14: `main() {
             
      
      //解决
      // 使用 vim 打开文件
      vim packages.sh
      // 转换格式
      :set ff=unix
      // 保存文件
      :wq
      
    • make format 报错

      // make format 报错
      /usr/bin/env: ‘python’: No such file or directory
      make[3]: *** [CMakeFiles/format.dir/build.make:57: CMakeFiles/format] Error 127
      make[2]: *** [CMakeFiles/Makefile2:287: CMakeFiles/format.dir/all
  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值