Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
installation [2016/06/27 16:45] – [Windows installation with Visual Studio] smilauer | installation [2017/01/31 12:19] – smilauer |
---|
* [[https://code.google.com/p/tortoisegit/wiki/Download?tm=2|TortoiseGit]] is the most intuitive Git client for Windows. | * [[https://code.google.com/p/tortoisegit/wiki/Download?tm=2|TortoiseGit]] is the most intuitive Git client for Windows. |
* [[http://www.paraview.org/|ParaView]] is a good and free replacement for oofeg under Windows. | * [[http://www.paraview.org/|ParaView]] is a good and free replacement for oofeg under Windows. |
| |
===== Windows installation under MinGW environment ===== | ===== Windows installation under MinGW environment ===== |
* MinGW uses standard GNU g++ compiler. In a standard MinGW instalation, a few libraries included in oofem are missing (sys/resource.h, execinfo.h). These are not included during cmakeing and compilation for MinGW compilation. | * MinGW uses standard GNU g++ compiler. In a standard MinGW instalation, a few libraries included in oofem are missing (sys/resource.h, execinfo.h). These are not included during cmakeing and compilation for MinGW compilation. |
* Under Windows, install mingw, C, C++ and MSys as a terminal. Download these from [[http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/mingw-get-inst-20120426.exe/download|installator]]. | * Under Windows, install [[http://sourceforge.net/projects/mingw-w64/|mingw]] including C, C++ and MSys as a terminal. |
* You may want installing windows version of [[http://git-scm.com/download/win|Git]]. Getting the development version of oofem is through a command <code>$git.exe clone http://www.oofem.org/git/oofem.git oofem.git</code> | * You may want installing windows version of [[http://git-scm.com/download/win|Git]]. Getting the development version of oofem is through a command <code>$git.exe clone http://www.oofem.org/git/oofem.git oofem.git</code> |
* Under oofem.git directory, create a new directory, e.g. //target//. Under //target// run <code>$cmake.exe -G"MinGW Makefiles" ..</code> It is needed sometimes to run this command twice. This ensures creating makefiles for MinGW. | * Install the latest version of [[http://cmake.org/download/|cmake]]. |
* Run $mingw32-make.exe to compile. oofem.exe is created. | * Run a batch at C:\Program Files\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw-w64.bat, it sets up a PATH to mingw32-make.exe and opens a new terminal. Do not close it. |
* [[https://github.com/leethomason/tinyxml2|TinyXML2]] is required to read input files for CEMHYD3D module. TinyXML2 can be installed. For windows it needs to be compiled into a shared library libtinyxml2.dll. Proceed in a standard way for cmake files. Create a new subdirectory , e.g. //target//. Under //target// run <code>$cmake.exe -G "MinGW Makefiles" ..</code> a few times. Cmake starts to complain about a missing RC compiler. Edit CMakeCache.txt and edit line specifying RC compiler, to make e.g. CMAKE_RC_COMPILER:FILEPATH=c:/MinGW/bin/windres.exe. Run ''$mingw32-make.exe''. A shared library is created. To compile oofem with CEMHYD and TinyXML2 support, run <code>$cmake.exe -G"MinGW Makefiles" -DUSE_CEMHYD="ON" -DTINYXML2_DIR="/c/oofem/tinyxml/" ..</code> and than <code>$mingw32-make.exe</code> | * In that terminal run graphical CMake: "C:\Program Files\CMake\bin\cmake-gui". |
* If oofem.exe complains about missing libtinyxml2.dll, add the location to the system path or copy libtinyxml2.dll in the same directory as oofem.exe. | * * In CMake set up a path to your oofem.git folder (Browse Source button). |
* oofem.exe with static libraries, iml support and optimized version is build via <code>$cmake.exe -G"MinGW Makefiles" -DCMAKE_CXX_FLAGS="-O2" -DUSE_IML="ON" -DUSE_STATIC_LIB="ON" .. | * * Create a new project folder (e.g. build) and set up a path to it (Browse Build button). Put a tick in "Advanced" checkbox and then click Configure. A new window appears. Specify the generator "MinGW Makefiles" and "Use default native compilers", click Finish. |
$mingw32-make.exe | * * Select packages and modules you want to use (or just keep the default settings). Write string "RELASE" (with capitals) or "DEBUG" in CMAKE_BUILD_TYPE. Uncheck "USE_SHARED_LIB". Hit Configure again and then click Generate. |
</code>If you want a smoothless transfer of oofem.exe to another Windows computer, you need to put all *.dll from c:\MinGW\bin in the same directory as oofem.exe. | * *[[https://github.com/leethomason/tinyxml2|TinyXML2]] is required to read input files for CEMHYD3D module. TinyXML2 can be installed. For windows it needs to be compiled into a shared library libtinyxml2.dll. Proceed in a standard way for cmake files. Create a new subdirectory , e.g. //target//. Under //target// run <code>$cmake.exe -G "MinGW Makefiles" ..</code> a few times. Cmake starts to complain about a missing RC compiler. Edit CMakeCache.txt and edit line specifying RC compiler, to make e.g. CMAKE_RC_COMPILER:FILEPATH=c:/MinGW/bin/windres.exe. Run ''$mingw32-make.exe''. A shared library is created. To compile oofem with CEMHYD and TinyXML2 support, run <code>$cmake.exe -G"MinGW Makefiles" -DUSE_CEMHYD="ON" -DTINYXML2_DIR="/c/oofem/tinyxml/" ..</code> and than <code>$mingw32-make.exe</code> |
| * *If oofem.exe complains about missing libtinyxml2.dll, add the location to the system path or copy libtinyxml2.dll in the same directory as oofem.exe. |
| * Close CMake, but do not close the terminal. Open your project folder, e.g. cd C:\OOFEM\build |
| * Type mingw32-make -j3 to compile oofem using 3 cores. (Building release took approx. 15 minutes.) |
| * Run oofem tests: "make tests -j3" and benchmarks "make benchmarks -j3" |
| * The size of oofem with debug options is approx 740 MB, release 10.2 MB |
| * In order to use oofem on a different computer it is essential to transfer all *.dll's from MinGW/bin alonside oofem. Copy them in the same folder as oofem.exe (8 files, 3.5 MB) |
| |
===== Windows installation with Visual Studio ===== | ===== Windows installation with Visual Studio ===== |
* If you want to smoothless transfer oofem.exe to another windows computer, you may have to install [[http://www.microsoft.com/en-us/download/details.aspx?id=40784|VC++ 2013 redistributable package]]. | * If you want to smoothless transfer oofem.exe to another windows computer, you may have to install [[http://www.microsoft.com/en-us/download/details.aspx?id=40784|VC++ 2013 redistributable package]]. |
* For the best debugging experience in VS, please deselect ''USE_SHARED_LIB'' in CMake to generate a monolithic executable. | * For the best debugging experience in VS, please deselect ''USE_SHARED_LIB'' in CMake to generate a monolithic executable. |
| * There are different configurations for Debug and Release versions under VS->Configuration manager->Active solution configuration. Debug version is generally slower and contains debugging symbols. Users usually choose Release version which is optimized for speed. |
| |
If you plan to redistribute the OOFEM executable to Windows XP machines, you must set the property ''Visual Studio 2013 - Windows XP (v120_xp)'' in ''Configuration Properties\General\Platform Toolset'' from the ''oofem'' project settings. | If you plan to redistribute the OOFEM executable to Windows XP machines, you must set the property ''Visual Studio 2013 - Windows XP (v120_xp)'' in ''Configuration Properties\General\Platform Toolset'' from the ''oofem'' project settings. |
| |
If you're interested in **parallel version for Windows**, go [[installing_optional#[Parallel version for Windows]|here]]. | If you're interested in **parallel version for Windows**, go [[installing_optional#[Parallel version for Windows]|here]]. |