-
Notifications
You must be signed in to change notification settings - Fork 262
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
CHOLMOD GPU: Fix qsort #366
CHOLMOD GPU: Fix qsort #366
Conversation
I believe there should be some sort of preprocessor condition guarding that definition. |
Does it work if you apply the following change? diff --git "a/CHOLMOD/GPU/CMakeLists.txt" "b/CHOLMOD/GPU/CMakeLists.txt"
index 8c4fccc13..491ca3895 100644
--- "a/CHOLMOD/GPU/CMakeLists.txt"
+++ "b/CHOLMOD/GPU/CMakeLists.txt"
@@ -100,6 +100,19 @@ if ( SUITESPARSE_CUDA )
endif ( )
endif ( )
+include ( CheckTypeSize )
+set ( old_CMAKE_EXTRA_INCLUDE_FILES CMAKE_EXTRA_INCLUDE_FILES )
+list ( APPEND CMAKE_EXTRA_INCLUDE_FILES "stdlib.h" )
+check_type_size ( "__compar_fn_t" COMPAR_FN_T )
+set ( CMAKE_EXTRA_INCLUDE_FILES old_CMAKE_EXTRA_INCLUDE_FILES )
+
+if ( NOT HAVE_COMPAR_FN_T )
+ target_compile_definitions ( CHOLMOD_CUDA PRIVATE NCOMPAR_FN_T )
+ if ( NOT NSTATIC )
+ target_compile_definitions ( CHOLMOD_CUDA_static PRIVATE NCOMPAR_FN_T )
+ endif ( )
+endif ( )
+
#-------------------------------------------------------------------------------
# installation location
#------------------------------------------------------------------------------- And then guard the definition with |
Could you please update this PR with that change? |
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.
Please check your editor settings. It looks like you are using CRLF instead of LF for line endings.
CHOLMOD/GPU/t_cholmod_gpu.c
Outdated
@@ -188,6 +188,9 @@ int TEMPLATE2 (CHOLMOD (gpu_init)) | |||
|
|||
} | |||
|
|||
#if !defined(NCOMPAR_FN_T) |
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.
Sorry. I meant #if defined(NCOMPAR_FN_T)
.
#if !defined(NCOMPAR_FN_T) | |
#if defined(NCOMPAR_FN_T) |
Sorry, I realized now that that file isn't part of CHOLMOD_CUDA (even if it is in the Could you please revert the change in diff --git "a/CHOLMOD/CMakeLists.txt" "b/CHOLMOD/CMakeLists.txt"
index 45d623fa0..629994224 100644
--- "a/CHOLMOD/CMakeLists.txt"
+++ "b/CHOLMOD/CMakeLists.txt"
@@ -480,6 +480,20 @@ if ( SUITESPARSE_CUDA )
target_link_libraries ( CHOLMOD_static PUBLIC CUDA::nvrtc CUDA::cudart_static
CUDA::nvToolsExt CUDA::cublas )
endif ( )
+
+ include ( CheckTypeSize )
+ set ( old_CMAKE_EXTRA_INCLUDE_FILES CMAKE_EXTRA_INCLUDE_FILES )
+ list ( APPEND CMAKE_EXTRA_INCLUDE_FILES "stdlib.h" )
+ check_type_size ( "__compar_fn_t" COMPAR_FN_T )
+ set ( CMAKE_EXTRA_INCLUDE_FILES old_CMAKE_EXTRA_INCLUDE_FILES )
+
+ if ( NOT HAVE_COMPAR_FN_T )
+ target_compile_definitions ( CHOLMOD PRIVATE NCOMPAR_FN_T )
+ if ( NOT NSTATIC )
+ target_compile_definitions ( CHOLMOD_static PRIVATE NCOMPAR_FN_T )
+ endif ( )
+ endif ( )
+
endif ( )
#------------------------------------------------------------------------------- Edit: Fixed the target names in the code snippet. |
The previous version does not work. |
Please note that I fixed a copy-paste error in the target names after the original post. |
I don't understand that screenshot. But if it working for you, please update the PR. |
Done. Thanks. |
Looks good to me now, too. 👍 |
1ec38a5
into
DrTimothyAldenDavis:dev2
Thanks for the update! |
No
__compar_fn_t
defined in windows when building with msvc.