Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows compile by MinGW 64 bit #347

Merged
merged 9 commits into from
Sep 23, 2019
Merged

Windows compile by MinGW 64 bit #347

merged 9 commits into from
Sep 23, 2019

Conversation

yhmtsai
Copy link
Member

@yhmtsai yhmtsai commented Sep 10, 2019

This PR makes MinGW, one of windows compiler, be able to compile the ginkgo library (shared/static).
It is part of #281

The requirement is git, mingw(64bit), and WSL.
WSL is used to run the bash to update the header automatically.

  1. gflags library's name is gflags_nothreads_static.lib in WINDOWS
  2. std::this_thread::sleep_for does not sleep for the duration of nanosecond. reference
    The implementation depends on the compiler/system. the clock uses system_clock not steady_clock
    Now, use Sleep(millisecond) in windows.h for testings. Moreover, change the clock of stop/time according to Monotonic and Adjustable Clocks #293. The picture in the end shows sleep_for doesn't work as we expect.
  3. update_ginkgo_header.sh can handle \r in Windows.
  4. Windows creates two files for one shared library, one is for compile and the other is for runtime.
    But windows does not have rpath for runtime library searching. I add the output in the end of cmake about the settings. Users need to add them manually for run the program.

sleep_test

sleep_for 1 ms might only sleep 0.5 ms.

@codecov
Copy link

codecov bot commented Sep 10, 2019

Codecov Report

Merging #347 into develop will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #347      +/-   ##
===========================================
- Coverage    98.28%   98.25%   -0.03%     
===========================================
  Files          250      246       -4     
  Lines        18718    18417     -301     
===========================================
- Hits         18397    18096     -301     
  Misses         321      321
Impacted Files Coverage Δ
include/ginkgo/core/stop/time.hpp 85.71% <ø> (ø) ⬆️
reference/test/stop/time.cpp 100% <100%> (ø) ⬆️
reference/test/stop/combined.cpp 100% <100%> (ø) ⬆️
include/ginkgo/core/base/math.hpp 93.1% <0%> (ø) ⬆️
reference/test/factorization/par_ilu_kernels.cpp 98.45% <0%> (ø) ⬆️
include/ginkgo/core/factorization/par_ilu.hpp 100% <0%> (ø) ⬆️
cuda/base/device_guard.hpp 100% <0%> (ø) ⬆️
cuda/test/solver/lower_trs_kernels.cpp 100% <0%> (ø) ⬆️
cuda/test/solver/upper_trs_kernels.cpp
include/ginkgo/core/preconditioner/ilu.hpp
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26b6c44...19b4de6. Read the comment docs.

@yhmtsai yhmtsai self-assigned this Sep 10, 2019
@yhmtsai yhmtsai added the reg:build This is related to the build system. label Sep 10, 2019
@pratikvn pratikvn added the plat:windows This is related to the Windows Operating system label Sep 10, 2019
Copy link
Member

@thoasm thoasm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand why you want to handle the newlines separately. The echo -e "$line", however, definitively has to be changed.

CMakeLists.txt Outdated Show resolved Hide resolved
dev_tools/scripts/update_ginkgo_header.sh Outdated Show resolved Hide resolved
dev_tools/scripts/update_ginkgo_header.sh Outdated Show resolved Hide resolved
dev_tools/scripts/update_ginkgo_header.sh Outdated Show resolved Hide resolved
dev_tools/scripts/update_ginkgo_header.sh Show resolved Hide resolved
reference/CMakeLists.txt Outdated Show resolved Hide resolved
reference/test/stop/combined.cpp Outdated Show resolved Hide resolved
reference/test/stop/combined.cpp Outdated Show resolved Hide resolved
dev_tools/scripts/update_ginkgo_header.sh Outdated Show resolved Hide resolved
@yhmtsai
Copy link
Member Author

yhmtsai commented Sep 18, 2019

I add the GINKGO_WINDOWS_SHARED_LIBRARY_RELPATH for windows shared library compilation only if build shared library and executable program (benchmark, example, or tests).

I change the directory due to the situation.

  • User builds ginkgo without CUDA and add core/device_hooks into PATH.
  • User builds ginkgo with CUDA and add cuda into PATH
  • User builds ginkgo without CUDA again and must add core/device_hooks into PATH

It leads the environment long PATH contains repeated same thing.
And make user need to modify the PATH when changing configuration of ginkgo.

Add the test for checking environment PATH.
It checks the program can load the correct library from GINKGO_WINDOWS_SHARED_LIBRARY_RELPATH even this path is the first one in PATH

Copy link
Member

@thoasm thoasm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@pratikvn pratikvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor typos, otherwise looks good.

cmake/build_helpers.cmake Outdated Show resolved Hide resolved
cmake/build_helpers.cmake Outdated Show resolved Hide resolved
cmake/build_helpers.cmake Outdated Show resolved Hide resolved
dev_tools/scripts/update_ginkgo_header.sh Outdated Show resolved Hide resolved
Copy link
Member

@tcojean tcojean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments overall, which does not change functionality.

cmake/build_helpers.cmake Outdated Show resolved Hide resolved
cmake/build_helpers.cmake Outdated Show resolved Hide resolved
reference/test/stop/combined.cpp Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@tcojean tcojean added the 1:ST:ready-for-review This PR is ready for review label Sep 20, 2019
@tcojean tcojean added 1:ST:ready-to-merge This PR is ready to merge. and removed 1:ST:ready-for-review This PR is ready for review labels Sep 23, 2019
@yhmtsai yhmtsai merged commit cde698f into develop Sep 23, 2019
@pratikvn pratikvn deleted the windows_compile branch October 20, 2019 11:40
tcojean added a commit that referenced this pull request Oct 20, 2019
The Ginkgo team is proud to announce the new minor release of Ginkgo version
1.1.0. This release brings several performance improvements, adds Windows support, 
adds support for factorizations inside Ginkgo and a new ILU preconditioner
based on ParILU algorithm, among other things. For detailed information, check the respective issue.

Supported systems and requirements:
+ For all platforms, cmake 3.9+
+ Linux and MacOS
  + gcc: 5.3+, 6.3+, 7.3+, 8.1+
  + clang: 3.9+
  + Intel compiler: 2017+
  + Apple LLVM: 8.0+
  + CUDA module: CUDA 9.0+
+ Windows
  + MinGW and CygWin: gcc 5.3+, 6.3+, 7.3+, 8.1+
  + Microsoft Visual Studio: VS 2017 15.7+
  + CUDA module: CUDA 9.0+, Microsoft Visual Studio
  + OpenMP module: MinGW or CygWin.


The current known issues can be found in the [known issues
page](https://github.com/ginkgo-project/ginkgo/wiki/Known-Issues).


Additions:
+ Upper and lower triangular solvers ([#327](#327), [#336](#336), [#341](#341), [#342](#342)) 
+ New factorization support in Ginkgo, and addition of the ParILU
  algorithm ([#305](#305), [#315](#315), [#319](#319), [#324](#324))
+ New ILU preconditioner ([#348](#348), [#353](#353))
+ Windows MinGW and Cygwin support ([#347](#347))
+ Windows Visual studio support ([#351](#351))
+ New example showing how to use ParILU as a preconditioner ([#358](#358))
+ New example on using loggers for debugging ([#360](#360))
+ Add two new 9pt and 27pt stencil examples ([#300](#300), [#306](#306))
+ Allow benchmarking CuSPARSE spmv formats through Ginkgo's benchmarks ([#303](#303))
+ New benchmark for sparse matrix format conversions ([#312](#312))
+ Add conversions between CSR and Hybrid formats ([#302](#302), [#310](#310))
+ Support for sorting rows in the CSR format by column idices ([#322](#322))
+ Addition of a CUDA COO SpMM kernel for improved performance ([#345](#345))
+ Addition of a LinOp to handle perturbations of the form (identity + scalar *
  basis * projector) ([#334](#334))
+ New sparsity matrix representation format with Reference and OpenMP
  kernels ([#349](#349), [#350](#350))

Fixes:
+ Accelerate GMRES solver for CUDA executor ([#363](#363))
+ Fix BiCGSTAB solver convergence ([#359](#359))
+ Fix CGS logging by reporting the residual for every sub iteration ([#328](#328))
+ Fix CSR,Dense->Sellp conversion's memory access violation ([#295](#295))
+ Accelerate CSR->Ell,Hybrid conversions on CUDA ([#313](#313), [#318](#318))
+ Fixed slowdown of COO SpMV on OpenMP ([#340](#340))
+ Fix gcc 6.4.0 internal compiler error ([#316](#316))
+ Fix compilation issue on Apple clang++ 10 ([#322](#322))
+ Make Ginkgo able to compile on Intel 2017 and above ([#337](#337))
+ Make the benchmarks spmv/solver use the same matrix formats ([#366](#366))
+ Fix self-written isfinite function ([#348](#348))
+ Fix Jacobi issues shown by cuda-memcheck

Tools and ecosystem:
+ Multiple improvements to the CI system and tools ([#296](#296), [#311](#311), [#365](#365))
+ Multiple improvements to the Ginkgo containers ([#328](#328), [#361](#361))
+ Add sonarqube analysis to Ginkgo ([#304](#304), [#308](#308), [#309](#309))
+ Add clang-tidy and iwyu support to Ginkgo ([#298](#298))
+ Improve Ginkgo's support of xSDK M12 policy by adding the `TPL_` arguments
  to CMake ([#300](#300))
+ Add support for the xSDK R7 policy ([#325](#325))
+ Fix examples in html documentation ([#367](#367))
tcojean added a commit that referenced this pull request Oct 21, 2019
The Ginkgo team is proud to announce the new minor release of Ginkgo version
1.1.0. This release brings several performance improvements, adds Windows support,
adds support for factorizations inside Ginkgo and a new ILU preconditioner
based on ParILU algorithm, among other things. For detailed information, check the respective issue.

Supported systems and requirements:
+ For all platforms, cmake 3.9+
+ Linux and MacOS
  + gcc: 5.3+, 6.3+, 7.3+, 8.1+
  + clang: 3.9+
  + Intel compiler: 2017+
  + Apple LLVM: 8.0+
  + CUDA module: CUDA 9.0+
+ Windows
  + MinGW and Cygwin: gcc 5.3+, 6.3+, 7.3+, 8.1+
  + Microsoft Visual Studio: VS 2017 15.7+
  + CUDA module: CUDA 9.0+, Microsoft Visual Studio
  + OpenMP module: MinGW or Cygwin.


The current known issues can be found in the [known issues
page](https://github.com/ginkgo-project/ginkgo/wiki/Known-Issues).


### Additions
+ Upper and lower triangular solvers ([#327](#327), [#336](#336), [#341](#341), [#342](#342)) 
+ New factorization support in Ginkgo, and addition of the ParILU
  algorithm ([#305](#305), [#315](#315), [#319](#319), [#324](#324))
+ New ILU preconditioner ([#348](#348), [#353](#353))
+ Windows MinGW and Cygwin support ([#347](#347))
+ Windows Visual Studio support ([#351](#351))
+ New example showing how to use ParILU as a preconditioner ([#358](#358))
+ New example on using loggers for debugging ([#360](#360))
+ Add two new 9pt and 27pt stencil examples ([#300](#300), [#306](#306))
+ Allow benchmarking CuSPARSE spmv formats through Ginkgo's benchmarks ([#303](#303))
+ New benchmark for sparse matrix format conversions ([#312](#312))
+ Add conversions between CSR and Hybrid formats ([#302](#302), [#310](#310))
+ Support for sorting rows in the CSR format by column idices ([#322](#322))
+ Addition of a CUDA COO SpMM kernel for improved performance ([#345](#345))
+ Addition of a LinOp to handle perturbations of the form (identity + scalar *
  basis * projector) ([#334](#334))
+ New sparsity matrix representation format with Reference and OpenMP
  kernels ([#349](#349), [#350](#350))

### Fixes
+ Accelerate GMRES solver for CUDA executor ([#363](#363))
+ Fix BiCGSTAB solver convergence ([#359](#359))
+ Fix CGS logging by reporting the residual for every sub iteration ([#328](#328))
+ Fix CSR,Dense->Sellp conversion's memory access violation ([#295](#295))
+ Accelerate CSR->Ell,Hybrid conversions on CUDA ([#313](#313), [#318](#318))
+ Fixed slowdown of COO SpMV on OpenMP ([#340](#340))
+ Fix gcc 6.4.0 internal compiler error ([#316](#316))
+ Fix compilation issue on Apple clang++ 10 ([#322](#322))
+ Make Ginkgo able to compile on Intel 2017 and above ([#337](#337))
+ Make the benchmarks spmv/solver use the same matrix formats ([#366](#366))
+ Fix self-written isfinite function ([#348](#348))
+ Fix Jacobi issues shown by cuda-memcheck

### Tools and ecosystem improvements
+ Multiple improvements to the CI system and tools ([#296](#296), [#311](#311), [#365](#365))
+ Multiple improvements to the Ginkgo containers ([#328](#328), [#361](#361))
+ Add sonarqube analysis to Ginkgo ([#304](#304), [#308](#308), [#309](#309))
+ Add clang-tidy and iwyu support to Ginkgo ([#298](#298))
+ Improve Ginkgo's support of xSDK M12 policy by adding the `TPL_` arguments
  to CMake ([#300](#300))
+ Add support for the xSDK R7 policy ([#325](#325))
+ Fix examples in html documentation ([#367](#367))


Related PR: #370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:ready-to-merge This PR is ready to merge. plat:windows This is related to the Windows Operating system reg:build This is related to the build system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants