1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-03 01:46:12 +02:00

Fixed configure for Nvidian compilers

This commit is contained in:
Anthony Scemama 2022-04-04 12:11:26 +02:00
parent 91811079d3
commit bac1eb33f0
2 changed files with 20 additions and 14 deletions

View File

@ -200,16 +200,22 @@ AS_IF([test "$BLAS_LIBS" == "$LAPACK_LIBS"], [BLAS_LIBS=""])
# Specific options required with some compilers # Specific options required with some compilers
case $FC in case $FC in
ifort*) *ifort*)
FCFLAGS="$FCFLAGS -nofor-main" FCFLAGS="$FCFLAGS -nofor-main"
;; ;;
#gfortran*) *nvfortran*)
# # Order is important here FCFLAGS="$FCFLAGS -fPIC -Mnomain"
# FCFLAGS="-cpp $FCFLAGS" ;;
# ;;
esac esac
case $CC in
*nvc*)
CFLAGS="$CFLAGS -fPIC"
;;
esac
# Options. # Options.
@ -358,7 +364,7 @@ CC..............: ${CC}
CPPFLAGS........: ${CPPFLAGS} CPPFLAGS........: ${CPPFLAGS}
CFLAGS..........: ${CFLAGS} CFLAGS..........: ${CFLAGS}
FC..............: ${FC} FC..............: ${FC}
FCLAGS..........: ${FCFLAGS} FCFLAGS.........: ${FCFLAGS}
LDFLAGS:........: ${LDFLAGS} LDFLAGS:........: ${LDFLAGS}
LIBS............: ${LIBS} LIBS............: ${LIBS}
USE CHAMELEON...: ${with_chameleon} USE CHAMELEON...: ${with_chameleon}

View File

@ -169,7 +169,7 @@ qmckl_context qmckl_context_check(const qmckl_context context) {
if (context == QMCKL_NULL_CONTEXT) if (context == QMCKL_NULL_CONTEXT)
return QMCKL_NULL_CONTEXT; return QMCKL_NULL_CONTEXT;
const qmckl_context_struct* const ctx = (const qmckl_context_struct* const) context; const qmckl_context_struct* const ctx = (const qmckl_context_struct*) context;
/* Try to access memory */ /* Try to access memory */
if (ctx->tag != VALID_TAG) { if (ctx->tag != VALID_TAG) {
@ -209,7 +209,7 @@ qmckl_context_touch(const qmckl_context context)
NULL); NULL);
} }
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
ctx->date += 1UL; ctx->date += 1UL;
ctx->point.date += 1UL; ctx->point.date += 1UL;
@ -234,7 +234,7 @@ qmckl_context qmckl_context_create();
qmckl_context qmckl_context_create() { qmckl_context qmckl_context_create() {
qmckl_context_struct* const ctx = qmckl_context_struct* const ctx =
(qmckl_context_struct* const) malloc (sizeof(qmckl_context_struct)); (qmckl_context_struct*) malloc (sizeof(qmckl_context_struct));
if (ctx == NULL) { if (ctx == NULL) {
return QMCKL_NULL_CONTEXT; return QMCKL_NULL_CONTEXT;
@ -350,7 +350,7 @@ void qmckl_unlock(qmckl_context context);
void qmckl_lock(qmckl_context context) { void qmckl_lock(qmckl_context context) {
if (context == QMCKL_NULL_CONTEXT) if (context == QMCKL_NULL_CONTEXT)
return ; return ;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
errno = 0; errno = 0;
int rc = pthread_mutex_lock( &(ctx->mutex) ); int rc = pthread_mutex_lock( &(ctx->mutex) );
if (rc != 0) { if (rc != 0) {
@ -362,7 +362,7 @@ void qmckl_lock(qmckl_context context) {
} }
void qmckl_unlock(const qmckl_context context) { void qmckl_unlock(const qmckl_context context) {
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
int rc = pthread_mutex_unlock( &(ctx->mutex) ); int rc = pthread_mutex_unlock( &(ctx->mutex) );
if (rc != 0) { if (rc != 0) {
fprintf(stderr, "DEBUG qmckl_unlock:%s\n", strerror(rc) ); fprintf(stderr, "DEBUG qmckl_unlock:%s\n", strerror(rc) );
@ -401,10 +401,10 @@ qmckl_context qmckl_context_copy(const qmckl_context context) {
{ {
const qmckl_context_struct* const old_ctx = const qmckl_context_struct* const old_ctx =
(qmckl_context_struct* const) checked_context; (qmckl_context_struct*) checked_context;
qmckl_context_struct* const new_ctx = qmckl_context_struct* const new_ctx =
(qmckl_context_struct* const) malloc (context, sizeof(qmckl_context_struct)); (qmckl_context_struct*) malloc (context, sizeof(qmckl_context_struct));
if (new_ctx == NULL) { if (new_ctx == NULL) {
qmckl_unlock(context); qmckl_unlock(context);
@ -467,7 +467,7 @@ qmckl_context_destroy (const qmckl_context context)
const qmckl_context checked_context = qmckl_context_check(context); const qmckl_context checked_context = qmckl_context_check(context);
if (checked_context == QMCKL_NULL_CONTEXT) return QMCKL_INVALID_CONTEXT; if (checked_context == QMCKL_NULL_CONTEXT) return QMCKL_INVALID_CONTEXT;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL); /* Shouldn't be possible because the context is valid */ assert (ctx != NULL); /* Shouldn't be possible because the context is valid */
qmckl_lock(context); qmckl_lock(context);