-
Notifications
You must be signed in to change notification settings - Fork 707
Windows
Windows 10 has gained a compatibility layer for running Linux binaries natively on Windows. You can find more information on the Wikipedia page.
In the following section a detailed HowTo is given to install the subsystem and a Linux distribution on top of it. Our choice at hand is Debian GNU/Linux because it already contains the latest deal.II release in binary form. (Note: The same is true for the Ubuntu distribution.)
Have a look at the excellent documentation about the Linux subsystem on the Windows help pages
-
(As described in detail on the Windows help pages, we first have to install the subsystem. For this, locate the Windows PowerShell in your Start menu (
Start
->Windows PowerShell
), right click onWindows PowerShell
->More
->Run as administrator
-
Install the subsystem by using the following command
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
and restart
-
Open the Windows Store and search for "Debian", and install "Get Debian GNU/Linux". When finished start the application. You will be prompted to enter a user name and password.
-
Switch to the "root" account by running
user@computer% sudo -s
Enter the password that you used in step 3.
-
Edit the package manager configuration by using nano (or an editor of your choice):
root@computer# nano /etc/apt/sources.list
You should see three lines. If they contain the release name
stretch
, remove all three lines and replace them with a single line:deb http://deb.debian.org/debian buster main contrib non-free
(TODO: replace with
testing
) -
Now update/upgrade the system by running
root@computer# apt update [...] root@computer# apt dist-upgrade [...] Do you want to continue? [Y/n] <Enter> [...] root@computer# apt autoremove [...] Do you want to continue? [Y/n] <Enter> [...]
We continue the installation process by installing the deal.II library with
development headers and documentation. The packages in Debian (or Ubuntu)
are called libdeal.ii-dev
and libdeal.ii-doc
:
-
As root user (see above) run:
root@computer# apt install libdeal.ii-dev libdeal.ii-doc [... long list ...] 0 upgraded, 443 newly installed, 0 to remove and 0 not upgraded. Need to get 441 MB of archives. After this operation, 2,016 MB of additional disk space will be used. Do you want to continue? [Y/n] <Enter>
Now, exit the root account:
root@computer# exit user@computer$
-
Do a quick "smoke test" whether everything installed fine by compiling and running the first example step:
(TODO: explain how to install tools )
(TODO: Explain workflow )
For an overview of different ways to use deal.II on Windows have a look at the corresponding FAQ entry.
Warning: please be aware that the following is experimental and you will likely encounter bugs in compilers and deal.II itself. Only continue if you are willing to experiment.
Since deal.II 8.4.0 we have experimental support for the newer Visual Studio C++ compilers (2017 or newer), but this is still work in progress. You can check the current development status here
Installation instructions:
-
Download and install Visual Studio 2017: https://www.visualstudio.com/vs/ and make sure you select the C++ compiler
-
Install cmake from https://cmake.org/download/ (pick the windows installer)
-
Extract deal.II to a folder, for example c:\dealii (or clone the git development version)
-
Configure using cmake by opening the 64bit command line shortcut and run:
set PreferredToolArchitecture=x64 cd c:\dealii mkdir build cd c:\dealii\build cmake -G "Visual Studio 15 2017 Win64" ..
Note: Setting the tool architecture to 64 bit works around problems of the compiler or linker running out of memory and leads to much quicker compile times. Note: Use generator
"Visual Studio 15 2017 Win64"
for Visual Studio 2017. -
Compile and install the library by opening
deal.II.sln
in c:\dealii\build, pick the install target and compile. Note: you need to either compile in the same terminal as above (usingcmake --build .
) or opendevenv.exe
from the same terminal, to use the 64 bit tool architecture. -
in cmd go to one of the examples in c:\dealii\examples\step-xy:
cmake -D DEAL_II_DIR=c:\dealii\build -G "Visual Studio 15 2017 Win64" .
-
Open the newly created solution (step-xy.sln) in that directory and compile/run/debug.
Install git and mingw (for perl etc). Then create a .bat file:
git pull origin master
rmdir /Q /S buildtest17
mkdir buildtest17
cd buildtest17
ctest -C Debug -DMAKEOPTS="/m:1" -DCTEST_CMAKE_GENERATOR="Visual Studio 15 2017" -S ../tests/run_buildtest.cmake -V
cd ..
Cygwin and forks such as MinGW and MinGW-64 are unsupported due to multiple unresolved miscompilation issues.
We haven't had much success with any other compiler on Windows (Intel, Borland, ...).