在WSL里用源码包安装openfoam失败
-
所有依赖库都安装完毕
在~/.bashrc末尾添加了
错误信息为:
ywj123450@DESKTOP-7HCQCPV:/mnt/f/OpenFOAM-5.x$ source ~/.bashrc ywj123450@DESKTOP-7HCQCPV:/mnt/f/OpenFOAM-5.x$ ./Allwmake Allwmake /mnt/f/OpenFOAM-5.x make: Nothing to be done for `all'. ======================================== Start ThirdParty Allwmake ======================================== ======================================== Build MPI libraries if required ======================================== Build Scotch decomposition library scotch_6.0.3 /mnt/f/ThirdParty-5.x/platforms/linux64GccDPInt32/scotch_6.0.3 scotch header in /mnt/f/ThirdParty-5.x/platforms/linux64GccDPInt32/scotch_6.0.3/include scotch libs in /mnt/f/ThirdParty-5.x/platforms/linux64GccDPInt32/lib ======================================== Build PTScotch decomposition library scotch_6.0.3 (uses MPI) /mnt/f/ThirdParty-5.x/platforms/linux64GccDPInt32/scotch_6.0.3 ptscotch header in /mnt/f/ThirdParty-5.x/platforms/linux64GccDPInt32/scotch_6.0.3/include/openmpi-system ptscotch libs in /mnt/f/ThirdParty-5.x/platforms/linux64GccDPInt32/lib/openmpi-system ======================================== Build Metis decomposition optional component Metis was not found ======================================== Build CGAL optional component was not found ======================================== Done ThirdParty Allwmake ======================================== Allwmake src no git description found Allwmake src/Pstream wmake dummy wclean mpi wmake mpi ....省略中间部分(这部分应该没问题)... UPstream.C: In static member function ‘static bool Foam::UPstream::finishedRequest(Foam::label)’: /usr/lib/openmpi/include/mpi.h:632:43: warning: use of old-style cast [-Wold-style-cast] #define MPI_STATUS_IGNORE ((MPI_Status *) 0) ^ UPstream.C:787:9: note: in expansion of macro ‘MPI_STATUS_IGNORE’ MPI_STATUS_IGNORE ^ g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -IlnInclude -I. -I/mnt/f/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/mnt/f/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude -fPIC -shared -Xlinker --add-needed -Xlinker --no-as-needed /mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32OptSYSTEMOPENMPI/src/Pstream/mpi/UOPwrite.o /mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32OptSYSTEMOPENMPI/src/Pstream/mpi/UIPread.o /mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32OptSYSTEMOPENMPI/src/Pstream/mpi/UPstream.o /mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32OptSYSTEMOPENMPI/src/Pstream/mpi/PstreamGlobals.o -L/mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32OptSYSTEMOPENMPI/lib \ -pthread -L/usr//lib -L/usr/lib/openmpi/lib -lmpi -ldl -lhwloc -o /mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so touch: setting times of ‘/mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32OptSYSTEMOPENMPI/src/Pstream/mpi/using:openmpi-system’: No such file or directory
求助大家!感谢!
-
@李东岳 但是blockMesh命令找不到
ywj123450@DESKTOP-7HCQCPV:/mnt/f/BaiduYunDownload$ blockMesh blockMesh: command not found
我看编译信息最后有一段
touch: setting times of ‘/mnt/f/OpenFOAM-5.x/platforms/linux64GccDPInt32OptSYSTEMOPENMPI/src/Pstream/mpi/using:openmpi-system’: No such file or directory
是不是代表缺少文件啊?
-
两个系统互相读文件就两种错误。
-
换行ASCII码不一样,windows系统用“回车”+“换行”表示光标到下一行首部。linux和mac,一个用“回车”,一个用“换行”,表示光标到下一行首部。(忘了哪个用回车那个用换行了)
所以linux的文件在windows里是一整行,不会换行。windows的文件在linux能换行,每行末会多个ASCII码。 -
编码不一样,一般linux默认utf8编码,windows默认gbk编码。所以互相读取会有乱码。
比较专业的编辑器应该都能解决这俩个问题。我用的emacs。
-
revert-buffer-with-coding-system 能用任意编码换行格式显示文件
-
universal-coding-system-argument 能用任意编码换行格式储存文件
那个文章里说不能在windows里编辑linux的文件,因为windows软件,比如记事本,的保存格式(换行ASCII码,文件结尾ASCII码之类的)不一样,在windows里用emacs编辑保存就没事。
详细配色可以在.bashrc里修改,不过太繁琐,用户名浅色,文件夹深色,所以,选个中间色当背景
screen text 第五种颜色(暗红),和debian的主题色挺接近
screen background 第八种颜色(浅灰)对颜色没兴趣的可以mv ~/.bashrc ~/.bashrc_backup; touch ~/.bashrc.
再重新登录,所有的彩色都消失。不过要在新的bashrc里输入一些常用快捷命令alias ll='ls -alF'啥的。
或者到.bashrc里搜索color,带color的代码块都#注释掉。--------------------------------------------------------分割线----------------------------------------------
那个错误前前后后看都是openmpi的问题。openfoam文件夹下的bashrc默认使用系统的openmpi。git源里指引的教程在编译完第三方软件后,要wmRefresh一下,更新环境变量就是哉source一次那个bashrc,指向如果有现编的用现编的第三方软件。
你的命令记录里应该是自己编译了openmpi的,可能中间缺个刷新环境变量的命令?
openfoam5挺新的刚发布。windows自带的ubuntu版本是14的,可能14版的源最新的openmpi对于openfoam5不够新。自己编译的又没用上,最后一条g++还在调用/usr/lib/openmpi/usr/lib/openmpi/include/mpi.h:632:43: warning: use of old-style cast [-Wold-style-cast]
这不就是说系统的openmpi有点老么:confused: 然后后面就忽略忽略(IGNORE)的,略死了。。。我猜是这样:confused:
-
-
@random_ran 生活所迫,生活所迫:sad: :sad: :sad: :sad: