Skip to content

Update CMake files to support Windows platform#1003

Closed
kaadam wants to merge 1 commit into
flang-compiler:masterfrom
kaadam:cmake_win
Closed

Update CMake files to support Windows platform#1003
kaadam wants to merge 1 commit into
flang-compiler:masterfrom
kaadam:cmake_win

Conversation

@kaadam

@kaadam kaadam commented Feb 24, 2021

Copy link
Copy Markdown
Collaborator

This PR aims to enable the build for Windows x64. Windows port of Flang is not ready yet, but it would be nice if anybody could run a build and check the current status.
This PR is created based on #464, since there is no any activity on that that's why I opened a new one.

@xoviat

xoviat commented Feb 24, 2021

Copy link
Copy Markdown
Collaborator

Note: I had planned to submit a PR to update the CMake files after the current PRs are merged. I'd like to wait until the runtime and pgmath PRs are merged, then I can see where we are.

@isuruf

isuruf commented Feb 24, 2021

Copy link
Copy Markdown
Collaborator

On windows if you are building with clang with MSVC ABI MSVC is still true. the only case where WIN32 is true and MSVC is not is if you are using MinGW/MSYS. In that case, the libraries are more like unix with libm also available.

@kaadam

kaadam commented Feb 24, 2021

Copy link
Copy Markdown
Collaborator Author

On windows if you are building with clang with MSVC ABI MSVC is still true. the only case where WIN32 is true and MSVC is not is if you are using MinGW/MSYS. In that case, the libraries are more like unix with libm also available.

Yes, you're right. I tested with clang for windows. It seems It was a side effect of my built clang (I don't know why). I dropped that change. Thanks for the comment.

@kaadam

kaadam commented Feb 24, 2021

Copy link
Copy Markdown
Collaborator Author

Note: I had planned to submit a PR to update the CMake files after the current PRs are merged. I'd like to wait until the runtime and pgmath PRs are merged, then I can see where we are.

@xoviat sorry, I think it would be nice to enable the basic build, maybe it makes the review process easier. In my opinion it could be merge independently of the other Windows changes, of course if you and others agree with that.

Comment thread CMakeLists.txt
SET(CMAKE_Fortran_COMPILER_WORKS 1)
SET(CMAKE_Fortran_ABI_COMPILED 0)
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
SET(CMAKE_Fortran_MODDIR_FLAG "-J ")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you run CMake with -DCMAKE_Fortran_COMPILER_ID=Flang? That should set CMAKE_Fortran_MODDIR_FLAG correctly.

Comment thread CMakeLists.txt
Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include-static
)
if (MSVC)
set_property(TARGET flang_static PROPERTY OUTPUT_NAME libflang)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please indent.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Line 489 as well.

@isuruf

isuruf commented Jun 22, 2021

Copy link
Copy Markdown
Collaborator

@bryanpkc, can you review #464 as that PR has the commits with authors correctly?

@@ -1,3 +1,4 @@

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Spurious blank line.


add_flang_library(ompstub_static ${OMPSTUB_SRC})
if (MSVC)
set_property(TARGET ompstub_static PROPERTY OUTPUT_NAME libompstub)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please indent this line and line 13.

@kaadam kaadam closed this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants