1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

Fix CMake

This commit is contained in:
Anthony Scemama 2022-04-13 10:44:58 +02:00
parent fe526ef8b9
commit cc447a4933
4 changed files with 6 additions and 9 deletions

View File

@ -8,7 +8,7 @@
#+INFOJS_OPT: toc:t mouse:underline path:org-info.js #+INFOJS_OPT: toc:t mouse:underline path:org-info.js
#+HTML_HEAD: <link rel="stylesheet" title="Standard" href="trexio.css" type="text/css" /> #+HTML_HEAD: <link rel="stylesheet" title="Standard" href="trexio.css" type="text/css" />
#+STARTUP: align fold nodlcheck hidestars oddeven lognotestate #+STARTUP: align nodlcheck hidestars oddeven lognotestate
#+AUTHOR: TREX-CoE #+AUTHOR: TREX-CoE
#+LANGUAGE: en #+LANGUAGE: en

View File

@ -864,19 +864,17 @@ trexio_open(const char* file_name, const char mode,
/* Try to determine the applicable backend if the back_end argument is TREXIO_AUTO */ /* Try to determine the applicable backend if the back_end argument is TREXIO_AUTO */
if (back_end == TREXIO_AUTO && mode == 'r') { if (back_end == TREXIO_AUTO && mode == 'r') {
#ifdef HAVE_HDF5 #ifdef HAVE_HDF5
trexio_exit_code rc_text, rc_hdf5;
/* Check if the TREXIO file exists and if it is a directory */ /* Check if the TREXIO file exists and if it is a directory */
rc_text = trexio_text_inquire(file_name); trexio_exit_code rc_text = trexio_text_inquire(file_name);
if (rc_text == TREXIO_SUCCESS) { if (rc_text == TREXIO_SUCCESS) {
back_end_local = TREXIO_TEXT; back_end_local = TREXIO_TEXT;
} else { } else {
/* If not, check if it is an HDF5 file */ /* If not, check if it is an HDF5 file */
rc_hdf5 = trexio_hdf5_inquire(file_name); trexio_exit_code rc_hdf5 = trexio_hdf5_inquire(file_name);
if (rc_hdf5 == TREXIO_SUCCESS) { if (rc_hdf5 == TREXIO_SUCCESS) {
back_end_local = TREXIO_HDF5; back_end_local = TREXIO_HDF5;
} else { } else {
/* File is neither a directory nor an HDF5 file -> return an error */ /* File is neither a directory nor an HDF5 file -> return an error */
back_end_local = -1;
if (rc_open != NULL) *rc_open = TREXIO_FILE_ERROR; if (rc_open != NULL) *rc_open = TREXIO_FILE_ERROR;
return NULL; return NULL;
} }

View File

@ -439,7 +439,7 @@ trexio_hdf5_write_$group_dset$ (trexio_t* const file,
trexio_hdf5_t* f = (trexio_hdf5_t*) file; trexio_hdf5_t* f = (trexio_hdf5_t*) file;
hid_t index_dtype; hid_t index_dtype;
void* index_p = NULL; const void* index_p;
uint64_t size_ranked = (uint64_t) size * $group_dset_rank$; uint64_t size_ranked = (uint64_t) size * $group_dset_rank$;
/* Determine the optimal type for storing indices depending on the size_max (usually mo_num or ao_num) */ /* Determine the optimal type for storing indices depending on the size_max (usually mo_num or ao_num) */
if (size_max < UINT8_MAX) { if (size_max < UINT8_MAX) {
@ -459,7 +459,7 @@ trexio_hdf5_write_$group_dset$ (trexio_t* const file,
index_p = index; index_p = index;
index_dtype = H5T_NATIVE_UINT16; index_dtype = H5T_NATIVE_UINT16;
} else { } else {
index_p = (int32_t*) index_sparse; index_p = (const int32_t*) index_sparse;
index_dtype = H5T_NATIVE_INT32; index_dtype = H5T_NATIVE_INT32;
} }

View File

@ -13,7 +13,7 @@ set(Tests_text
io_str_text io_str_text
delete_group_text delete_group_text
overwrite_all_text overwrite_all_text
pre_close.c pre_close
) )
if(ENABLE_HDF5) if(ENABLE_HDF5)
@ -29,7 +29,6 @@ if(ENABLE_HDF5)
io_str_hdf5 io_str_hdf5
delete_group_hdf5 delete_group_hdf5
overwrite_all_hdf5 overwrite_all_hdf5
pre_close
) )
# Set ${Tests} variable to the complete list of tests. # Set ${Tests} variable to the complete list of tests.