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

Set -DLIBOMP_FORTRAN_MODULES=ON on windows #134

Merged
merged 7 commits into from
Oct 9, 2024

Conversation

h-vetinari
Copy link
Member

If we want to build OpenBLAS with OpenMP support with flang (c.f. conda-forge/openblas-feedstock#115), we'll need to package the Fortran bits of OpenMP, otherwise we run into:

[...]
[3646/19184] Building Fortran object CMakeFiles\LAPACK_OVERRIDES.dir\lapack-netlib\SRC\ssytrd_2stage.f.obj
[3647/19184] Building Fortran object CMakeFiles\LAPACK_OVERRIDES.dir\lapack-netlib\SRC\ssytrd_sb2st.F.obj
FAILED: CMakeFiles/LAPACK_OVERRIDES.dir/lapack-netlib/SRC/ssytrd_sb2st.F.obj 
%BUILD_PREFIX%\Library\bin\flang.exe -I%SRC_DIR%\lapack-netlib\SRC -I%SRC_DIR%\lapack-netlib\LAPACKE\include -fopenmp -fopenmp -ffixed-line-length-72 -o CMakeFiles\LAPACK_OVERRIDES.dir\lapack-netlib\SRC\ssytrd_sb2st.F.obj -c CMakeFiles\LAPACK_OVERRIDES.dir\lapack-netlib\SRC\ssytrd_sb2st.F-pp.f
error: Semantic errors in CMakeFiles\LAPACK_OVERRIDES.dir\lapack-netlib\SRC\ssytrd_sb2st.F-pp.f
D:\\bld\\openblas_1719536014536\\work\\lapack-netlib\\SRC\\ssytrd_sb2st.F:237:11: error: Cannot read module file for module 'omp_lib': Source file 'omp_lib.mod' was not found
        use omp_lib
            ^^^^^^^

Flang 18 is going to be unusable to build OpenBLAS, but I'd like to open this for discussion/review already, so we can figure this out before LLVM 19 releases.

PS. This is rebased from the dev branch, with which I was able to get CI green in conda-forge/openblas-feedstock#115.

@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@h-vetinari
Copy link
Member Author

This is quite curious. We cannot build the fortran bits of OpenMP 18 with flang 18, but it works if either of the versions is bumped to 19. In this PR we bump the flang version, on the dev branch it's the other way 'round.

In any case, even if we don't merge this for OpenMP 18, I want to enable this for OpenMP 19, so I'd appreciate feedback @conda-forge/openmp

@h-vetinari
Copy link
Member Author

Gentle ping on this @conda-forge/openmp

@h-vetinari h-vetinari mentioned this pull request Jul 26, 2024
@h-vetinari h-vetinari mentioned this pull request Sep 18, 2024
3 tasks
@isuruf
Copy link
Member

isuruf commented Sep 24, 2024

Can we move the .mod file to a different output? The cycles are also there in linux if we switch _openmp_mutex.

- _openmp_mutex
ignore_run_exports_from:
- {{ compiler("cxx") }}
- {{ compiler("fortran") }}
Copy link
Member

Choose a reason for hiding this comment

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

The .mod files are specific to the gfortran version (maybe not the major version, but the soversion. not sure), so it's not possible to remove these.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found some lint.

Here's what I've got...

For recipe/meta.yaml:

  • The build section contained an unexpected subsection name. build is not a valid subsection name.
  • The build section contained an unexpected subsection name. host is not a valid subsection name.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

@h-vetinari
Copy link
Member Author

Can we move the .mod file to a different output?

@isuruf, I've rebased this PR on #144 and added the output you wanted - I think I've incorporated all the feedback so far on this here. I still want to clean up the commit history better, but the content of the changes should be OK now. As such, I'd ask you to please review this at your earliest convenience.

@h-vetinari
Copy link
Member Author

Gentle ping @isuruf

recipe/meta.yaml Outdated Show resolved Hide resolved
@h-vetinari h-vetinari marked this pull request as ready for review October 3, 2024 15:26
@h-vetinari
Copy link
Member Author

Thanks for the review; should be fixed now.

recipe/meta.yaml Outdated Show resolved Hide resolved
@h-vetinari h-vetinari changed the title Set -DLIBOMP_FORTRAN_MODULES=ON Set -DLIBOMP_FORTRAN_MODULES=ON on windows Oct 3, 2024
@h-vetinari
Copy link
Member Author

Good now?

@h-vetinari
Copy link
Member Author

I think we're close here @isuruf, can you please help me wrap this up?

@h-vetinari h-vetinari merged commit 9ff7481 into conda-forge:main Oct 9, 2024
8 checks passed
@h-vetinari h-vetinari deleted the fortran branch October 9, 2024 00:30
This was referenced Oct 15, 2024
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.

3 participants