Skip to content

Commit

Permalink
Minor fixes for Intel oneAPI compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
interkosmos committed Mar 1, 2024
1 parent ae17d55 commit e7e1e50
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
17 changes: 12 additions & 5 deletions guide/guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions src/dm_nml.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/dmtestjson.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e7e1e50

Please sign in to comment.