Deal.II on Windows

419 views
Skip to first unread message

phillip mobley

unread,
Jul 21, 2015, 11:58:43 PM7/21/15
to deal.II User Group
Hello everyone,

I have another question. I am a huge fan of using visual studio and windows. Since visual studio is only available for windows (Visual Studio Code does not count), I am really hoping that I can find someway to work with windows.

Now, I have the .h and .cc files for deal.II. I was wondering, couldn't I include these files in a visual studio project and build and compile on windows? Or, does deal.II have operating system specific needs? I am wondering because in theory, it looks like it is possible.

If this is possible, how would this work for Trilinos and Pec

Wolfgang Bangerth

unread,
Jul 22, 2015, 12:25:05 AM7/22/15
to dea...@googlegroups.com

Philip,

> I have another question. I am a huge fan of using visual studio and windows.
> Since visual studio is only available for windows (Visual Studio Code does not
> count), I am really hoping that I can find someway to work with windows.
>
> Now, I have the .h and .cc files for deal.II. I was wondering, couldn't I
> include these files in a visual studio project and build and compile on
> windows? Or, does deal.II have operating system specific needs? I am wondering
> because in theory, it looks like it is possible.

Telling VS about the source files is only part of the story. You also need to
tell it how to compile it all, and that is much harder. Fortunately, you don't
have to: everything is described in the cmake files, and cmake can generate a
VS project. I don't have a Windows machine, so can't tell you the exact
command, but on linux if I want to create an Eclipse project, I call cmake
with the -G"Eclipse CDT4 - Unix Makefiles" flag. I imagine there is a similar
flag of the form -G"Visual Studio" that allows you to create a VS project that
you can then import into the Visual Studio IDE.


> If this is possible, how would this work for Trilinos and Pec

I don't know about PETSc, but Trilinos also uses cmake, and it should work
similarly to the method described above.


There will be at least one other person at the workshop in a couple of weeks
who is interested in running on Windows (and is, in fact, already doing so). I
think we should run a discussion session for 30 minutes or more to talk about
what is currently missing, what is already working and maybe documenting how
it works, etc. I'll put it on the list of sessions.

Best
Wolfgang


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Message has been deleted

phillip mobley

unread,
Jul 22, 2015, 12:59:12 AM7/22/15
to deal.II User Group
Hmm, ok, yeah, that is a good idea. I will be there. If this can work on VS, then that would be huge! Make a template with all of the CMAKE and includes and sources and everything and post on the website, done. 

I would imagine it is possible. If you can make Android and iOS apps on VS, then I would be very surprised if you couldn't get deal.II to compile! VS is one of the most popular IDE out there. I have used nothing but VS so I can't comment on others and how it compares but there is a reason I only used VS. I tried using eclipse but it just didn't work.

I have just imported all of the header and source files into a VS template. I will play around with it and see if I can get anything working.

Also, I have not ran into .in files for C++ before. I am currently looking these up but what precisely are these files and how would I integrate them into the IDE? I typically use C# and C. Not so much C++ so I am a but rusty.

Also, has anyone thought about re-writing the entire library for C#? I have been hearing that this could end up being the defacto language like C and C++. From my personal experience, C# has been one of the most powerful languages used.

Krzysztof Bzowski

unread,
Jul 22, 2015, 1:24:00 AM7/22/15
to dea...@googlegroups.com
Microsoft compiler can behave very strangely. Generally it sticks to C++
standard but many things works differently than GCC.

I would like see dealii working under Windows too, but there is
alternative approach. If you really like VS you can use VisualGDB
(http://visualgdb.com/). You will be able to write and debug your code
using familiar VS interface but your program will run on standalone
Linux machine or Virtual Machine (communication works over ssh).
I am currently using it to develop application based on dealii and it
works pretty well. A small disadvantage - it is not free. But it is not
so very expensive.

Best regards,
Krzysztof

On 2015-07-22 06:46, phillip mobley wrote:
> Hmm, yeah, that would be great, If this could be used in Visual Studio,
> that would be huge!
>
> I have just imported the library into the VS environment. I will have to
> modify the #include path a little bit.
>
> I would imagine that it is possible with VS 2015. I would be hugely
> surprised that it wouldn't work. So far, VS is one of the best IDE out
> there. It can even do Android and iOS app programming, If it can do
> that, I would imagine it can compile the source for deal.II!
>

Alexander

unread,
Jul 22, 2015, 3:40:30 AM7/22/15
to deal.II User Group
I would be very grateful if someone sucessfully using deal.II on Windows shared her/his experience.
Last time I tried it with VS2013 I came to the same problem as here: https://groups.google.com/forum/#!topic/dealii/vRr36ciQGMc and couldn't solve it.
It is a hindrance to tell colleagues and students that they need a Virtual machine with linux to use simulation codes.

As far as I can see, deal.II compiles with Intel compilers and the latter exist for Windows. This could be another possibility (provided CMake can build projects for this)?

FWIW, I have been using PETSc with MPI under windows few years ago. It was compiled under cygwin with Intel compilers.

Best,
Alexander

phillip mobley

unread,
Jul 22, 2015, 1:15:37 PM7/22/15
to deal.II User Group
I apologize for my ignorance but what is the purpose of the cmake script? Is there anything in there that that compiler needs to compile?

If not, then I could create a template inside VS and let the user decide what libraries they need and delete accordingly.

To me, it seems like deal.II can be treated as a code library!

phillip mobley

unread,
Jul 22, 2015, 2:29:15 PM7/22/15
to deal.II User Group
Could you re-post the link? It just takes me back to this post!

Bruno Turcksin

unread,
Jul 22, 2015, 3:19:41 PM7/22/15
to deal.II User Group
Philip,


On Wednesday, July 22, 2015 at 12:15:37 PM UTC-5, phillip mobley wrote:
I apologize for my ignorance but what is the purpose of the cmake script? Is there anything in there that that compiler needs to compile?

cmake create the Makefile used to compile deal.II

Best,

Bruno

Wolfgang Bangerth

unread,
Jul 22, 2015, 11:15:19 PM7/22/15
to dea...@googlegroups.com
On 07/22/2015 12:23 AM, Krzysztof Bzowski wrote:
> Microsoft compiler can behave very strangely. Generally it sticks to C++
> standard but many things works differently than GCC.

That is putting it very nicely. Microsoft's C++ has had a reputation of being
one of the worst C++ compilers for the past 2 decades. There are many
workarounds in the deal.II code base for cases that have worked well for 15
years with GCC and with the Intel compiler but which the Microsoft compiler
still does not get correctly. I think a more accurate way of saying it is that
the VS C++ compiler is a disaster.

That said, I believe that Lukas has largely made things work with it anyway.

Wolfgang Bangerth

unread,
Jul 22, 2015, 11:15:23 PM7/22/15
to dea...@googlegroups.com
On 07/22/2015 02:19 PM, Bruno Turcksin wrote:
> I apologize for my ignorance but what is the purpose of the cmake script?
> Is there anything in there that that compiler needs to compile?
>
>
> cmake create the Makefile used to compile deal.II

This is actually only a small part of what cmake does. In general, the purpose
of cmake scripts are these:
- Determine the properties of your system, i.e., which tools are installed,
where are they located, how can then be called, etc.
- Determine their properties, such as compiler bugs we need to work around,
etc.
- Determine which external libraries (e.g., Trilinos, PETSc, ...) are
installed
- Figure out *what* needs to be compiled, and *how* it needs to be compiled.
This includes include paths, compiler flags, linker lines, etc. It also
includes compiling tools we need as part of the build process but that
are not part of the deal.II libraries we ultimately want to have (e.g., the
script that converts the .inst.in files into the .inst files)

Once all of this has happened, cmake creates the file that describe the build
process. This can be a standard Unix Makefile, or a Visual Studio project file.

In any case, cmake does many more things that just enumerate the .cc files and
point the compiler at the location of header files. There is probably a year's
work of Matthias's time in the cmake scripts. You won't want to re-create all
of this work but rather let cmake create the MS VS project files.

Best
W.

Wolfgang Bangerth

unread,
Jul 22, 2015, 11:15:27 PM7/22/15
to dea...@googlegroups.com

> Also, I have not ran into .in files for C++ before.

There are .inst.in files for which deal.II contains a tool that converts them
into .inst files that are then #included into our .cc files. These .inst.in
are not files in a standard C++ format, but are input files for our own tool.


> Also, has anyone thought about re-writing the entire library for C#? I have
> been hearing that this could end up being the defacto language like C and C++.
> From my personal experience, C# has been one of the most powerful languages used.

But it essentially locks you into Windows and out of the scientific computing
community that has by and large settled into using C++. This includes all of
the other libraries we link with (Trilinos, PETSc, etc).

Other than that: deal.II has ~600,000 lines of code. A typical programmer
writes 100 well tested lines of code per day, i.e., 20,000 lines per year. So
it would only take ~30 man years to rewrite everything in C# ;-)

Best
W.

Alexander

unread,
Jul 23, 2015, 3:49:04 AM7/23/15
to deal.II User Group, phillip...@gmail.com

Am Mittwoch, 22. Juli 2015 20:29:15 UTC+2 schrieb phillip mobley:
Could you re-post the link? It just takes me back to this post!


Am Donnerstag, 23. Juli 2015 05:15:19 UTC+2 schrieb bangerth:
That is putting it very nicely. Microsoft's C++ has had a reputation of being
one of the worst C++ compilers for the past 2 decades. There are many
workarounds in the deal.II code base for cases that have worked well for 15
years with GCC and with the Intel compiler but which the Microsoft compiler
still does not get correctly. I think a more accurate way of saying it is that
the VS C++ compiler is a disaster.

That said, I believe that Lukas has largely made things work with it anyway.

VS2015 has just been released, claiming over 500 bug fixes in C++ compiler.

Regards,
Alexander
Reply all
Reply to author
Forward
0 new messages