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: Fix OpenMP Linkage #29

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin
if errorlevel 1 exit 1

:: OpenMP flags
set "CXXFLAGS=%CXXFLAGS% -openmp"
set "LDFLAGS=%LDFLAGS% -openmp"

Choose a reason for hiding this comment

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

It does not seem to know about the -openmp flag.

Should we try something like -DCMAKE_EXE_LINKER_FLAGS="-fopenmp" suggested here, https://discourse.cmake.org/t/openmp-linking-errors-on-windows-using-ninja-and-clang/7246

Copy link
Member Author

Choose a reason for hiding this comment

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

That should end up in LDFLAGS as well though...
https://cmake.org/cmake/help/latest/variable/CMAKE_EXE_LINKER_FLAGS.html

On my laptop:

$ lld-link -openmp
lld-link: warning: ignoring unknown argument '-openmp'
lld-link: error: no input files

$ lld-link -fopenmp
lld-link: warning: ignoring unknown argument '-fopenmp'
lld-link: error: no input files


:: configure
cmake ^
-S %SRC_DIR% -B build ^
Expand Down
Loading