Fixes for the Visual Studio compile
Primarily changed CMake to compile certain files with C++ when using MSVC.
This commit is contained in:
parent
ac6aa88011
commit
3d18327363
@ -777,6 +777,19 @@ set_source_files_properties (lapack/dlamch.c PROPERTIES COMPILE_FLAGS -O0)
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
# Use the C++ compiler to compile these files to get around lack of C99 support
|
||||
set_source_files_properties (utilities/hypre_hopscotch_hash.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (utilities/hypre_merge_sort.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (seq_mv/csr_matop.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_mv/par_csr_matop.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_mv/par_csr_matvec.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_ls/aux_interp.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_ls/par_coarsen.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_ls/par_cgc_coarsen.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_ls/par_jacobi_interp.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_ls/par_rap.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_ls/par_relax.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
set_source_files_properties (parcsr_ls/par_strength.c PROPERTIES COMPILE_FLAGS /TP)
|
||||
endif ()
|
||||
|
||||
if (HYPRE_USING_FEI)
|
||||
|
||||
@ -1418,7 +1418,7 @@ HYPRE_Int hypre_GenerateSendMapAndCommPkg ( MPI_Comm comm , HYPRE_Int num_sends
|
||||
/* par_relax.c */
|
||||
HYPRE_Int hypre_BoomerAMGRelax ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_type , HYPRE_Int relax_points , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real *l1_norms , hypre_ParVector *u , hypre_ParVector *Vtemp , hypre_ParVector *Ztemp );
|
||||
HYPRE_Int hypre_GaussElimSetup ( hypre_ParAMGData *amg_data , HYPRE_Int level , HYPRE_Int relax_type );
|
||||
HYPRE_Int hypre_GaussElimSolve ( void *amg_vdata , HYPRE_Int level , HYPRE_Int relax_type );
|
||||
HYPRE_Int hypre_GaussElimSolve ( hypre_ParAMGData *amg_data , HYPRE_Int level , HYPRE_Int relax_type );
|
||||
HYPRE_Int gselim ( HYPRE_Real *A , HYPRE_Real *x , HYPRE_Int n );
|
||||
|
||||
/* par_relax_interface.c */
|
||||
|
||||
@ -10,10 +10,6 @@
|
||||
* $Revision$
|
||||
***********************************************************************EHEADER*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Relaxation scheme
|
||||
@ -4285,13 +4281,12 @@ HYPRE_Int hypre_GaussElimSetup (hypre_ParAMGData *amg_data, HYPRE_Int level, HYP
|
||||
}
|
||||
|
||||
|
||||
HYPRE_Int hypre_GaussElimSolve (void *amg_vdata, HYPRE_Int level, HYPRE_Int relax_type)
|
||||
HYPRE_Int hypre_GaussElimSolve (hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int relax_type)
|
||||
{
|
||||
#ifdef HYPRE_PROFILE
|
||||
hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SOLVE] -= hypre_MPI_Wtime();
|
||||
#endif
|
||||
|
||||
hypre_ParAMGData *amg_data = amg_vdata;
|
||||
hypre_ParCSRMatrix *A = hypre_ParAMGDataAArray(amg_data)[level];
|
||||
HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A));
|
||||
HYPRE_Int error_flag = 0;
|
||||
@ -4371,10 +4366,9 @@ HYPRE_Int hypre_GaussElimSolve (void *amg_vdata, HYPRE_Int level, HYPRE_Int rela
|
||||
}
|
||||
|
||||
|
||||
HYPRE_Int gselim(A,x,n)
|
||||
HYPRE_Real *A;
|
||||
HYPRE_Real *x;
|
||||
HYPRE_Int n;
|
||||
HYPRE_Int gselim(HYPRE_Real *A,
|
||||
HYPRE_Real *x,
|
||||
HYPRE_Int n)
|
||||
{
|
||||
HYPRE_Int err_flag = 0;
|
||||
HYPRE_Int j,k,m;
|
||||
|
||||
@ -946,7 +946,7 @@ void hypre_merge_sort(HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int *
|
||||
#endif // HYPRE_USING_OPENMP
|
||||
|
||||
#ifdef HYPRE_USING_ATOMIC
|
||||
static inline HYPRE_Int hypre_compare_and_swap(HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval)
|
||||
static HYPRE_Int hypre_compare_and_swap(HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
|
||||
return __sync_val_compare_and_swap(ptr, oldval, newval);
|
||||
@ -960,7 +960,7 @@ static inline HYPRE_Int hypre_compare_and_swap(HYPRE_Int *ptr, HYPRE_Int oldval,
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline HYPRE_Int hypre_fetch_and_add(HYPRE_Int *ptr, HYPRE_Int value)
|
||||
static HYPRE_Int hypre_fetch_and_add(HYPRE_Int *ptr, HYPRE_Int value)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
|
||||
return __sync_fetch_and_add(ptr, value);
|
||||
@ -973,7 +973,7 @@ static inline HYPRE_Int hypre_fetch_and_add(HYPRE_Int *ptr, HYPRE_Int value)
|
||||
#endif
|
||||
}
|
||||
#else // !HYPRE_USING_ATOMIC
|
||||
static inline HYPRE_Int hypre_compare_and_swap(HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval)
|
||||
static HYPRE_Int hypre_compare_and_swap(HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval)
|
||||
{
|
||||
if (*ptr == oldval)
|
||||
{
|
||||
@ -983,7 +983,7 @@ static inline HYPRE_Int hypre_compare_and_swap(HYPRE_Int *ptr, HYPRE_Int oldval,
|
||||
else return *ptr;
|
||||
}
|
||||
|
||||
static inline HYPRE_Int hypre_fetch_and_add(HYPRE_Int *ptr, HYPRE_Int value)
|
||||
static HYPRE_Int hypre_fetch_and_add(HYPRE_Int *ptr, HYPRE_Int value)
|
||||
{
|
||||
HYPRE_Int oldval = *ptr;
|
||||
*ptr += value;
|
||||
@ -1063,7 +1063,7 @@ void hypre_sort_and_create_inverse_map(
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "hypre_hopscotch_hash.h"
|
||||
/*#include "hypre_hopscotch_hash.h"*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include "_hypre_utilities.h"
|
||||
#include "hypre_hopscotch_hash.h"
|
||||
#include "../seq_mv/HYPRE_seq_mv.h"
|
||||
//#define DBG_MERGE_SORT
|
||||
#ifdef DBG_MERGE_SORT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user