From e7e1e504b3b80dda1fa833cc7bb0833d1faf288a Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 1 Mar 2024 17:41:46 +0100 Subject: [PATCH] Minor fixes for Intel oneAPI compatibility. --- guide/guide.adoc | 17 ++++++++++++----- src/dm_nml.f90 | 28 ++++++++++++++-------------- test/dmtestjson.f90 | 4 ++-- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/guide/guide.adoc b/guide/guide.adoc index a4da6d9..f84011f 100644 --- a/guide/guide.adoc +++ b/guide/guide.adoc @@ -307,20 +307,27 @@ $ cd dmpack/ $ make linux .... -In case SQLite 3 has been built from source, overwrite the variable `LIBSQLITE3` -to pass the path of shared library `libsqlite3.so`: +If the SQLite 3 library has been built from source and installed to +`/usr/local/lib`, overwrite the variable `LIBSQLITE3` to pass the path of shared +library `libsqlite3.so`: .... $ make OS=linux PREFIX=/usr LIBSQLITE3="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lsqlite3" .... -If the Intel oneAPI compilers are preferred, run instead: +For Intel oneAPI compilers, run instead: .... -$ make CC=icx FC=ifx PPFLAGS= LIBHDF5=/path/to/libhdf5.a +$ make CC=icx FC=ifx FFLAGS="-mtune=native -O2 -fpic" CFLAGS="-mtune=native -O2 -fpic" \ + LDFLAGS="-I./include -module ./include -L/usr/lib -L/opt/lib" PPFLAGS= \ + INCHDF5="-I/opt/include/hdf5/mod/shared" LDLIBS="-Wl,-rpath,/opt/lib" .... -Install the library and all programs system-wide to `/usr`: +In this case, the HDF5 libraries are installed to `/opt/lib`, and the modules +files to `/opt/include/hdf5/mod/shared`. Change the paths to the actual +locations. + +Install the DMPACK libraries and programs system-wide to `/usr`: .... $ sudo make install_linux diff --git a/src/dm_nml.f90 b/src/dm_nml.f90 index a737e52..c972815 100644 --- a/src/dm_nml.f90 +++ b/src/dm_nml.f90 @@ -105,7 +105,7 @@ integer function nml_from_beat(beat, str) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMBEAT, iostat=stat) + write (str, nml=DMBEAT, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_beat @@ -128,7 +128,7 @@ integer function nml_from_beat_alloc(beat, str, n) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMBEAT, iostat=stat) + write (str, nml=DMBEAT, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_beat_alloc @@ -146,7 +146,7 @@ integer function nml_from_log(log, str) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMLOG, iostat=stat) + write (str, nml=DMLOG, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_log @@ -169,7 +169,7 @@ integer function nml_from_log_alloc(log, str, n) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMLOG, iostat=stat) + write (str, nml=DMLOG, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_log_alloc @@ -187,7 +187,7 @@ integer function nml_from_node(node, str) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMNODE, iostat=stat) + write (str, nml=DMNODE, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_node @@ -210,7 +210,7 @@ integer function nml_from_node_alloc(node, str, n) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMNODE, iostat=stat) + write (str, nml=DMNODE, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_node_alloc @@ -228,7 +228,7 @@ integer function nml_from_observ(observ, str) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMOBSERV, iostat=stat) + write (str, nml=DMOBSERV, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_observ @@ -251,7 +251,7 @@ integer function nml_from_observ_alloc(observ, str, n) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMOBSERV, iostat=stat) + write (str, nml=DMOBSERV, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_observ_alloc @@ -269,7 +269,7 @@ integer function nml_from_sensor(sensor, str) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMSENSOR, iostat=stat) + write (str, nml=DMSENSOR, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_sensor @@ -292,7 +292,7 @@ integer function nml_from_sensor_alloc(sensor, str, n) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMSENSOR, iostat=stat) + write (str, nml=DMSENSOR, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_sensor_alloc @@ -310,7 +310,7 @@ integer function nml_from_target(target, str) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMTARGET, iostat=stat) + write (str, nml=DMTARGET, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_target @@ -333,7 +333,7 @@ integer function nml_from_target_alloc(target, str, n) result(rc) rc = E_WRITE str = ' ' - write (str, nml=DMTARGET, iostat=stat) + write (str, nml=DMTARGET, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_from_target_alloc @@ -475,7 +475,7 @@ integer function nml_write_log(log, unit) result(rc) rc = E_WRITE unit_ = stdout if (present(unit)) unit_ = unit - write (unit_, nml=DMLOG, iostat=stat) + write (unit_, nml=DMLOG, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_write_log @@ -493,7 +493,7 @@ integer function nml_write_observ(observ, unit) result(rc) rc = E_WRITE unit_ = stdout if (present(unit)) unit_ = unit - write (unit_, nml=DMOBSERV, iostat=stat) + write (unit_, nml=DMOBSERV, delim='quote', iostat=stat) if (stat /= 0) return rc = E_NONE end function nml_write_observ diff --git a/test/dmtestjson.f90 b/test/dmtestjson.f90 index 9118cee..d524740 100644 --- a/test/dmtestjson.f90 +++ b/test/dmtestjson.f90 @@ -173,7 +173,7 @@ logical function test07() result(stat) '"timestamp": "1970-01-01T00:00:00.000000+00:00", "request": "B", "response": "OK\\r\\n", "delimiter": ' // & '"\\r\\n", "pattern": "^OK", "delay": 500, "error": 1, "mode": 0, "retries": 0, "state": 0, ' // & '"timeout": 500, "nresponses": 1, "responses": [ { "name": "b", "unit": "none", "type": 0, "error": 0, ' // & - '"value": 0.990000000000 } ] } ] }' + '"value": 1.00000000000 } ] } ] }' character(len=:), allocatable :: buf integer :: rc @@ -239,7 +239,7 @@ logical function test07() result(stat) error = 1) print *, 'Adding response ...' - response = response_type('b', 'none', RESPONSE_TYPE_REAL64, E_NONE, 0.99_r8) + response = response_type('b', 'none', RESPONSE_TYPE_REAL64, E_NONE, 1.0_r8) rc = dm_request_add(request, response) if (dm_is_error(rc)) return