cmake problem on tutorial 1

242 views
Skip to first unread message

Tony Zhuang

unread,
Nov 28, 2019, 6:00:07 AM11/28/19
to deal.II User Group
Hi,

I have downloaded deal.ii 9.1.1 on ubuntu 19.04, and during the installation(https://www.dealii.org/9.1.1/readme.html) I found that I have to change the directory to install

from: cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/dir ../deal.II 
to: cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/dir ../dealii-9.1.1

And the make test showed the installation was complete.

However, when I get start on the tutorial and input cmake . in terminal, it showed it couldn't located deal.II. I have tried:

cmake -DDEAL_II_DIR=/path/to/installed/deal.II .
cmake -DDEAL_II_DIR=/path/to/installed/dealii-9.1.1 .

But they didn't work.(Please refer to attachment)

I also found that if I change deal.II 9.1.0 to deal.II 9.0 in CMakeLists.txt, cmake . could run but some errors occuered on the following steps.(Please refer to the 2nd screenshot) And when I open the step-1.cc with VScode, it flags that I have include errors. How to solve the cmake . problem?

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/tonyz/dealii-9.1.1/examples/step-1/step-1.cc).C/C++(1696)
cannot open source file "mpi.h" (dependency of "/home/tonyz/dealii-9.1.1/examples/step-1/step-1.cc")C/C++(1696)

Thanks a lot!
HosaH
Regards,
Zhuang
Screenshot from 2019-11-28 10-39-23.png
Screenshot from 2019-11-28 10-52-09.png
Message has been deleted

llf m

unread,
Nov 28, 2019, 8:19:04 AM11/28/19
to deal.II User Group
Dear Zhuang,

In the command
cmake -DDEAL_II_DIR=/path/to/installed/deal.II .
"/path/to/installed/deal.II" is the path you have installed dealii into, you need to change it to the path you actually installed in.
In your above comment
cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/dir ../dealii-9.1.1
if you donot change the "-DCMAKE_INSTALL_PREFIX=/path/to/install/dir" to any other path, you may need to change the DEAL_II_DIR:
cmake -DDEAL_II_DIR=/path/to/install/dir .
, and you change the dealii version in the CMakelist.txt in step-1 directly, then it will use the dealii-9.0 to configure.
You may have installed the dealii-9.0.0 before and the PATH DEAL_II_DIR may link to dealii-9.0.
And step-1 donot need mpi.h, it maybe just is a fake hints in VScode, and if you want VScode to know your code and give code complement&highlight then you should add the include path to VScode.That is another question, you may need the VScode extension "ms-vscode.cpptools " to complement code and highlight.

Best,
m.

在 2019年11月28日星期四 UTC+8下午7:00:07,Tony Zhuang写道:
Reply all
Reply to author
Forward
0 new messages