Skip to content

Navigation Menu

Sign in
Sign up

test: add #require flint? for the test suite. #848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
cbmarini merged 1 commit into form-dev:master from cbmarini:require-flint
Jun 22, 2026
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions check/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ The following methods are available in Ruby test programs.
`true` if FORM is the multithreaded version (TFORM), otherwise `false`.
- `mpi? → bool`
`true` if FORM is the MPI version (ParFORM), otherwise `false`.
- `flint? → bool`
`true` if FORM was built with FLINT support, otherwise `false`.
- `valgrind? → bool`
`true` if FORM is running under Valgrind, otherwise `false`.
- `wordsize → integer`
Expand Down
20 changes: 20 additions & 0 deletions check/check.rb
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ def mpi?
FormTest.cfg.mpi?
end

def flint?
FormTest.cfg.flint?
end

def valgrind?
if FormTest.cfg.fake_valgrind.nil?
!FormTest.cfg.valgrind.nil?
Expand Down Expand Up @@ -1249,6 +1253,7 @@ def initialize(form, mpirun, mpirun_opts, valgrind, valgrind_opts, fake_valgrind
@is_serial = nil
@is_threaded = nil
@is_mpi = nil
@has_flint = nil
@wordsize = wordsize
@form_cmd = nil
end
Expand All @@ -1268,6 +1273,10 @@ def mpi?
@is_mpi
end

def flint?
@has_flint
end

def check_bin(name, bin)
# Check if the executable is available.
if File.executable?(bin)
Expand Down Expand Up @@ -1326,6 +1335,17 @@ def check
system("#{form_bin} #{frmname}")
fatal("failed to get the version of '#{@form}'")
end
# Check if Flint is available.
# Use form -vv which contains either "+flint=VERSION" or "-flint".
feature_out, _status = Open3.capture2e(@form_bin, "-vv")
if feature_out =~ /(?:^|\s)\+flint(?:=|\s|$)/
@has_flint = true
elsif feature_out =~ /(?:^|\s)-flint(?:\s|$)/
@has_flint = false
else
warn("failed to determine FLINT support of '#{@form}'")
@has_flint = false
end
# Check the wordsize.
# Method 1: from the output header.
# Method 2: 2^64 = 0 (mod 2^64) => 64-bit machine => sizeof(WORD) = 4, etc.
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /