Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
installation [2017/01/31 12:19] – smilauer | installation [2017/06/21 17:25] – [Windows installation under MinGW environment] edita |
---|
* 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. | * 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. |
* In that terminal run graphical CMake: "C:\Program Files\CMake\bin\cmake-gui". | * In that terminal run graphical CMake: "C:\Program Files\CMake\bin\cmake-gui". |
* * In CMake set up a path to your oofem.git folder (Browse Source button). | * In CMake set up a path to your oofem.git folder (Browse Source button). |
* * 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. | * 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. |
* * 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. | * 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. |
* *[[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> | * [[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. | * 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 | * 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.) | * 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" | * In case of error caused by multiple definition of 'vsnprintf' add -D__USE_MINGW_ANSI_STDIO=0 in CMAKE_CXX_FLAGS and regenerate makefiles. |
| * Run oofem tests: "mingw32-make tests -j3" and benchmarks "mingw32-make benchmarks -j3" |
* The size of oofem with debug options is approx 740 MB, release 10.2 MB | * 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) | * 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) |