Deal.II programming environment

361 views
Skip to first unread message

Jiang Hu

unread,
Jul 21, 2021, 1:22:36 AM7/21/21
to deal.II User Group
Hello everyone,

Quite excited to find Deal.II and its potential.

I installed virtual machine with Deal.II, and run step 7 on terminal without any problem.

The question is if I want to compile bigger program with Deal.II , what is the typical working environment? 

I assume we can not with terminal for such a purpose. I saw people using Nano to run Deal.II, but want to ask the standard tool for such process.

Emacs or Vscode?  Do I need to connect them to Deal.II?

I am very new, and this could be a quite silly question.

Thanks 

Martin

Bruno Turcksin

unread,
Jul 21, 2021, 8:11:01 AM7/21/21
to deal.II User Group
Martin,

You can use whatever you like, there is no such thing as a typical environment. With that being said, we do have documentation and videos to help you setup Eclipse. See

Best,

Bruno

Wells, David

unread,
Jul 21, 2021, 11:15:10 AM7/21/21
to dea...@googlegroups.com
Hi Martin,

No, that's a very good question - it's important to set up a good development environment. You CAN use plain text editors and run CMake from the command line (in fact, with many tools you will end up still running CMake from a window inside them) but its usually better to use something more sophisticated (like an IDE that can run a debugger).

If you look on the wiki we have instructions for both Eclipse and QT creator:


a lot of people use VS code - we don't have instructions for it, and I don't use it, but since we use CMake it shouldn't be that hard to point VS code at your build directory and have it extract some information. If anyone actually uses VS code I would appreciate if they could weigh in here!

Best,
David Wells

From: dea...@googlegroups.com <dea...@googlegroups.com> on behalf of Jiang Hu <jian...@gmail.com>
Sent: Wednesday, July 21, 2021 1:22 AM
To: deal.II User Group <dea...@googlegroups.com>
Subject: [deal.II] Deal.II programming environment
 
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/164003ac-27fe-4b26-83d4-991149902416n%40googlegroups.com.

Jiang Hu

unread,
Jul 21, 2021, 9:59:41 PM7/21/21
to deal.II User Group
Hi David,

Thanks for the detailed explanation. 

I suppose below procedure should work:
1 Open Deal.II example, the cpp file,  with text editor 
2 make changes to it, and save it as another cpp file
3 Use cMake to run this new cpp file at the command line
4 if no mistake, the new cpp file will run

am I correct? 

Last, where should I install the IDE? I am using virtual box machine with deal.II package in a window system. 
can I install Eclipse in Virtual box machine? it has Ubuntu system in the virtual box. 

Thanks for your time

Martin

Jiang Hu

unread,
Jul 21, 2021, 10:02:35 PM7/21/21
to deal.II User Group
Hi Bruno,

Thanks for the link. 
The thing is, I am using a virtual box machine with Deal.II and Ubuntu. 
where should I get Eclipse installed? I guess doing it in windows should not work.

Thanks for your time.
Martin 

Jean-Paul Pelteret

unread,
Jul 22, 2021, 12:53:29 AM7/22/21
to dea...@googlegroups.com
Hi Martin,

This is the sort of case where where VSCode is really useful. It has an easy to use remote development extension, where you would open and use the editor in Windows but you’d be editing and building files on the virtual machine. Here are a couple of official links that explain the concept, and if this interests you then I think that a quick google search would be able to clear up the details on how to set it all up. 

The hardest thing is getting the initial ssh connection to the virtual machine working, because after that you can navigate the virtual machine in VSCode and set up a workspace as if it was the physical machine that you’re working on.

Best,
Jean-Paul


-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.

Jiang Hu

unread,
Jul 22, 2021, 1:23:22 AM7/22/21
to deal.II User Group
Hi  Jean-Paul,

Thanks for the suggestion, I will give it a go and find out.

In order to use  deal.II, I find we have to become an part-time computer scientist, the means defeats the goal, haha

Best regards
Martin

blais...@gmail.com

unread,
Jul 22, 2021, 6:52:57 AM7/22/21
to deal.II User Group
Hi Martin,
Multiple IDEs work very well with Deal.II. As long as your IDE has good CMAKE support, compiling deal.II with it is a joke.
Some IDEs which me and my colleagues have found work very well in the present case:
- Jetbrains CLION (this one is not free, but for a reason I don't understand it's by far the one my students prefer to use. It is super nice though with very good Cmake integration)
- QTCreator (which is free and has amazing cmake integration. It is not difficult to set-up)

And then you could use a text editor with IDE-like capacities like VSCode which, especially with the newer version of cmake extensions, works amazingly well. As long as your deal.II environment variable is set-up correctly, I have found that you can naviguate through your own code and the deal.II library in mere seconds. It is truly easy to use once set-up.

I feel that's the challenge with these tools. Once set-up, they are amazing and they improve your workflow a lot (e.g. using VSCode on your machine to code something in a WSL or a virtual machine is an amazingly productive way of working under Windows), but they are difficult to set-up :)

Good luck!
Bruno B

Jiang Hu

unread,
Jul 22, 2021, 7:00:02 PM7/22/21
to deal.II User Group
Hi Bruno,

Thanks for sharing your experience, I am very much encouraged.

I will have a play of systems you recommend, and hopefully in a few weeks time, I would be all set up.

Thanks for your time, and my question is fully answered.

Martin

Raghunandan Pratoori

unread,
Aug 3, 2021, 9:53:54 AM8/3/21
to deal.II User Group

Hi,

I recently started using VS code with deal.ii. I found it very easy to work with, especially when you have a wsl installation.
All you need to do is follow the instructions on these pages -

VS code actually looks through the files in your directory and suggests extensions you would need.

Best,
Raghunandan.

Ahmad Shahba

unread,
Aug 3, 2021, 10:53:20 AM8/3/21
to dea...@googlegroups.com
I just wanted to add that I use CLion for C++ programming. I have been developing codes (and linking to deal.ii among other libraries) in CLion for 3 years now. Given that the entry point in CLion is a CMakeList file, it was quite easy for me to load deal.ii examples and compile/run/debug/profile them in the IDE

Regards,
Ahmad

Wells, David

unread,
Aug 3, 2021, 3:41:25 PM8/3/21
to deal.II User Group
Hi Martin,

Sorry for the slow response - I have been on vacation.

If you save a source file with a new name then you will need to update your CMakeLists.txt file - it doesn't know what you intend to do with the new file. I recommend reading through


to better understand how to set up your own project with CMake.

If you have the virtual machine then it is easiest to just install either eclipse or QT creator inside the VM itself with the "apt-get install" command.

Best,
David Wells

Sent: Wednesday, July 21, 2021 9:59 PM

To: deal.II User Group <dea...@googlegroups.com>
Subject: Re: [deal.II] Deal.II programming environment
 
Reply all
Reply to author
Forward
0 new messages