You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve Fortran benchmark dependencies via manifest.json
- Update `compile_fortran_benchmark` script to dynamically resolve
Fortran source files (`.f` files) from `manifest.json` using the
`@stdlib/utils/library-manifest` utility, similar to how
`compile_c_benchmark` resolves C source files
- Add `resolve_source_files`, `resolve_libraries`, and
`resolve_libpaths` functions to `compile_fortran_benchmark`,
matching the structure of `compile_c_benchmark`
- Revert `blas/base/dger` Fortran benchmark `Makefile` to remove
hardcoded path to `xerbla` dependency; the build script now
resolves the dependency via `manifest.json`
Closes: stdlib-js#11333https://claude.ai/code/session_01HHx9iadyJncdYuV1ndGPsk
# Define a list of library paths (e.g., `-L /foo/bar -L /beep/boop`):
80
+
libpath="${LIBPATH}"
81
+
75
82
76
83
# FUNCTIONS #
77
84
@@ -135,7 +142,7 @@ resolve_includes() {
135
142
local script
136
143
local opts
137
144
138
-
opts="{'task':'benchmark'}"
145
+
opts="{'os':'${os}','task':'build'}"
139
146
140
147
# Generate the script for resolving `include` directories:
141
148
script='"'"var path = require('path'); var arr = require('@stdlib/utils/library-manifest')(path.join('$1','manifest.json'),${opts},{'basedir':'$1','paths':'posix'}).include; var str = ''; for (var i = 0; i < arr.length; i++){var p = path.resolve('$1', arr[i]); str += '-I '+p+' ';}; console.log(str.substring(0, str.length-1));"'"'
@@ -146,14 +153,72 @@ resolve_includes() {
146
153
echo"${includes}"
147
154
}
148
155
156
+
# Resolves Fortran source files.
157
+
#
158
+
# $1 - package directory
159
+
resolve_source_files() {
160
+
local source_files
161
+
local script
162
+
local opts
163
+
164
+
# WARNING: the following assumes knowledge of the `manifest.json` options for packages with Fortran implementations. The "build" task without a BLAS library is used to obtain Fortran source files.
165
+
opts="{'os':'${os}','task':'build'}"
166
+
167
+
# Generate the script for resolving Fortran source files (files ending in `.f`):
168
+
script='"'"var path = require('path'); var arr = require('@stdlib/utils/library-manifest')(path.join('$1','manifest.json'),${opts},{'basedir':'$1','paths':'posix'}).src; var str = ''; for (var i = 0; i < arr.length; i++){var p = path.resolve('$1', arr[i]); if (p.endsWith('.f')){str += p+' ';}}; console.log(str.substring(0, str.length-1));"'"'
0 commit comments