为了论文复现,根据依赖包准备在linux上安装python3.7。参考ubuntu安装python3.7,并更新python默认指向为python3.7-CSDN客
./configure
# 或者
./configure --prefix=/usr/local/python3.7.1
目标要装TensorFlow
一些自己常用的命令:
1.先装anaconda
如何在Linux服务器上安装Anaconda(超详细)_linux_流年若逝-华为云开发者联盟
其中遇到一个问题,我要卸载的问题Linux卸载Anaconda详解_笔记大全_设计学院
常用的打断快捷键 CTRL+C可以打断linux的进程
2.装TensorFlow
linux安装tensorflow-CSDN博客
在装TensorFlow之前先装个虚拟环境,但我遇到一个问题
Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
your ~/.bashrc file. You should manually remove the line that looks like
export PATH="/root/anaconda3/bin:$PATH"
^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^
source ~/anaconda3/etc/profile.d/conda.sh
用这个方法解决了。
紧接着开始试验怎么在上面写代码了。先试试gcc这玩意
先打开终端输入
nano my_program.c
然后在里面先写个简单代码
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
按下Ctrl + X
,然后按下Y
来确认保存,最后按下Enter
键
//生成可执行文件
gcc -o my_program my_program.c
//执行文件
./my_program
常用命令
1.生成和删除c文件
nano my_program.c
rm my_program.c
2.用gcc和g++编译c文件或者c++
gcc -o my_program my_program.c
g++ -o my_program my_program.cpp
3.查看文件列表
ls