-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fortan Mangling error on Windows when compiler flags are set #23
Comments
Jordan, Can you create a branch off of github/master and then point to it here or do a pull request? Call the branch something like fix_fortran_managling_23. I should be able to get to this today or tomorrow. |
Jordan, Assuming that you have not created a branch for this, I will apply the patch and push to the TriBITS master branches on github and casl-dev. |
There is an issue with the config_tests/FortranMangling.cmake. The issues stems from Windows variety of system libraries. One can use /MD[d] /MT[d] /LD[d] for linking their different libraries MSVCRT.lib, MSVCRTD.lib, LIBCMT.lib, LIBCMTD.lib. CMake typically defaults to /MD for release and /MDd for debug. If one needs a static build overriding all compiler flags with /MT[d] is necessary. The FortranMangling.cmake doesn't pass the build type compiler flags through which usually results in duplicate defined symbols, because C/C++ will link against LIBCMT and Fortran will link agains MSVCRT. This patch resolves the issue.
To make consistent with the outer TriBITS project build-type, here I have made general for all CMAKE_BUILD_TYPE, not just CMAKE_BUILD_TYPE=RELEASE. Build/Test Cases Summary Enabled Packages: Enabled all Packages 0) MPI_DEBUG => passed: passed=652,notpassed=0 (39.98 min) 1) SERIAL_RELEASE => passed: passed=560,notpassed=0 (6.21 min) Other local commits for this build/test group: edcd8e5, 07fe96f, e475583, a955807
I just pushed your commit and a commit I made to generalize this for any CMAKE_BUILD_TYPE. This has been pushed to github/master (as you can see in this Issue ticket) and to the TriBITS git repo on casl-dev. Please give this a try and let me know if it fixes your issues. |
I have pushed these changes to pass the Fortran flags to the name managning determination code back to Trilinos proper in the below snapshot of TriBITS into Trilinos. Hopefully this will fix this issue for users of Trilinos on this platform on the next Trilinos release that is about to be frozen. Jordan, I will assume this is complete until I hear from you.
|
There is an issue with the config_tests/FortranMangling.cmake. The issues stems from Windows variety of system libraries. One can use /MD[d] /MT[d] /LD[d] for linking their different libraries MSVCRT.lib, MSVCRTD.lib, LIBCMT.lib, LIBCMTD.lib. CMake typically defaults to /MD for release and /MDd for debug. If one needs a static build overriding all compiler flags with /MT[d] is necessary. The FortranMangling.cmake doesn't pass the build type compiler flags through which usually results in duplicate defined symbols, because C/C++ will link against LIBCMT and Fortran will link agains MSVCRT. This patch resolves the issue.
To make consistent with the outer TriBITS project build-type, here I have made general for all CMAKE_BUILD_TYPE, not just CMAKE_BUILD_TYPE=RELEASE. Build/Test Cases Summary Enabled Packages: Enabled all Packages 0) MPI_DEBUG => passed: passed=652,notpassed=0 (39.98 min) 1) SERIAL_RELEASE => passed: passed=560,notpassed=0 (6.21 min) Other local commits for this build/test group: edcd8e5, 07fe96f, e475583, a955807
Jordan (@lefebvre), Can you confirm that this issue has been resolved on your side? |
@lefebvre. I am going to assume this is fixed given there was no response since July. |
There is an issue with the config_tests/FortranMangling.cmake.
The issues stems from Windows variety of system libraries.
One can use /MD[d] /MT[d] /LD[d] for linking their different libraries MSVCRT.lib, MSVCRTD.lib, LIBCMT.lib, LIBCMTD.lib.
CMake typically defaults to /MD for release and /MDd for debug.
If one needs a static build overriding all compiler flags with /MT[d] is necessary.
The FortranMangling.cmake doesn't pass the build type compiler flags through which usually results in duplicate defined symbols, because C/C++ will link against LIBCMT and Fortran will link agains MSVCRT.
This patch resolves the issue.
The text was updated successfully, but these errors were encountered: