-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[OpenMP] Link against libm on OpenBSD #70614
Conversation
@@ -140,7 +140,7 @@ function(libomp_get_libflags libflags) | |||
if(LIBOMP_HAVE_SHM_OPEN_WITH_LRT) | |||
libomp_append(libflags_local -lrt) | |||
endif() | |||
if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly|FreeBSD") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OS lists like this are bad, can you use check_library_exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think check_library_exists
is not for the purpose of this case. For example, libm
exists on a lot of systems, but we only want to link against it with proper linker flag when OS is BSD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why, you can do any kind of try_compile test
@shiltian So can I commit this? |
Ping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good for now. We definitely want to try to revise it later based on what @arsenm suggested.
Oh for sure. Even if you did want to use something like |
Needed for some math functions in libomp.
Needed for some math functions in libomp.