1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2025-01-03 10:06:09 +01:00

Fix Clang build

This commit is contained in:
Anthony Scemama 2022-02-25 13:57:13 +01:00
parent 1a5b76157b
commit ff526a18cb
3 changed files with 22 additions and 17 deletions

View File

@ -5062,8 +5062,8 @@ for (int32_t ldl=3 ; ldl<=5 ; ++ldl) {
for (int32_t k=0 ; k<5 ; ++k) {
for (int32_t l=0 ; l<n ; ++l) {
printf("VGL[%d][%d] = %e %e\n", k, l, VGL0[k][l], VGL1[k][l]);
assert( VGL0[k][l] == VGL1[k][l] );
printf("VGL[%d][%d] = %e %e %e\n", k, l, VGL0[k][l], VGL1[k][l], VGL0[k][l]-VGL1[k][l]);
assert( fabs(1.-(VGL0[k][l]+1.e-100)/(VGL1[k][l]+1.e-100)) < 1.e-15 );
}
}
}

View File

@ -46,7 +46,8 @@
#+begin_src c :comments link :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "assert.h"
#include <stdio.h>
#include <assert.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -1256,7 +1257,6 @@ print(C.T)
rc = qmckl_double_of_matrix(context, C, cnew, 15);
assert(rc == QMCKL_SUCCESS);
#include <stdio.h>
for (int i=0 ; i<15 ; ++i) {
printf("%f %f\n", cnew[i], c[i]);
assert (c[i] == cnew[i]);

View File

@ -62,6 +62,7 @@ int main() {
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include "qmckl.h"
#include "qmckl_context_private_type.h"
@ -69,6 +70,8 @@ int main() {
#+end_src
* Context handling
The context variable is a handle for the state of the library,
@ -250,7 +253,9 @@ qmckl_context qmckl_context_create() {
rc = pthread_mutexattr_init(&attr);
assert (rc == 0);
#ifdef PTHREAD_MUTEX_RECURSIVE
(void) pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#endif
rc = pthread_mutex_init ( &(ctx->mutex), &attr);
assert (rc == 0);