| 856 |
#---------------- |
#---------------- |
| 857 |
# IDA test |
# IDA test |
| 858 |
|
|
| 859 |
|
sundials_version_major_required = 2 |
| 860 |
|
sundials_version_minor_min = 2 |
| 861 |
|
sundials_version_minor_max = 3 |
| 862 |
|
|
| 863 |
|
sundials_version_text = """ |
| 864 |
|
#include <sundials/sundials_config.h> |
| 865 |
|
#include <stdio.h> |
| 866 |
|
int main(){ |
| 867 |
|
printf("%s",SUNDIALS_PACKAGE_VERSION); |
| 868 |
|
return 0; |
| 869 |
|
} |
| 870 |
|
""" |
| 871 |
|
|
| 872 |
ida_test_text = """ |
ida_test_text = """ |
| 873 |
# include <ida/ida.h> |
# include <ida/ida.h> |
| 874 |
# include <nvector/nvector_serial.h> |
# include <nvector/nvector_serial.h> |
| 892 |
|
|
| 893 |
return is_ok |
return is_ok |
| 894 |
|
|
| 895 |
|
# slightly changed calling convention (IDACalcID) in newer versions of SUNDIALS, |
| 896 |
|
# so detect the version and act accordingly. |
| 897 |
|
def CheckIDAVersion(context): |
| 898 |
|
keep = KeepContext(context,'IDA') |
| 899 |
|
context.Message("Checking SUNDIALS version... ") |
| 900 |
|
(is_ok,output) = context.TryRun(sundials_version_text,'.c') |
| 901 |
|
keep.restore(context) |
| 902 |
|
if not is_ok: |
| 903 |
|
context.Result("failed to run check") |
| 904 |
|
return 0 |
| 905 |
|
|
| 906 |
|
major,minor,patch = tuple([int(i) for i in output.split(".")]) |
| 907 |
|
context.env['SUNDIALS_VERSION_MAJOR'] = major |
| 908 |
|
context.env['SUNDIALS_VERSION_MINOR'] = minor |
| 909 |
|
if major != sundials_version_major_required \ |
| 910 |
|
or minor < sundials_version_minor_min \ |
| 911 |
|
or minor > sundials_version_minor_max: |
| 912 |
|
context.Result(output+" (bad version)") |
| 913 |
|
# bad version |
| 914 |
|
return 0 |
| 915 |
|
|
| 916 |
|
# good version |
| 917 |
|
context.Result(output+", good") |
| 918 |
|
return 1 |
| 919 |
|
|
| 920 |
#---------------- |
#---------------- |
| 921 |
# CONOPT test |
# CONOPT test |
| 922 |
|
|
| 1079 |
, 'CheckTkTable' : CheckTkTable |
, 'CheckTkTable' : CheckTkTable |
| 1080 |
, 'CheckX11' : CheckX11 |
, 'CheckX11' : CheckX11 |
| 1081 |
, 'CheckIDA' : CheckIDA |
, 'CheckIDA' : CheckIDA |
| 1082 |
|
, 'CheckIDAVersion' : CheckIDAVersion |
| 1083 |
, 'CheckCONOPT' : CheckCONOPT |
, 'CheckCONOPT' : CheckCONOPT |
| 1084 |
, 'CheckScrollkeeperConfig' : CheckScrollkeeperConfig |
, 'CheckScrollkeeperConfig' : CheckScrollkeeperConfig |
| 1085 |
# , 'CheckIsNan' : CheckIsNan |
# , 'CheckIsNan' : CheckIsNan |
| 1187 |
elif not conf.CheckIDA(): |
elif not conf.CheckIDA(): |
| 1188 |
with_ida = False |
with_ida = False |
| 1189 |
without_ida_reason = "IDA not found" |
without_ida_reason = "IDA not found" |
| 1190 |
|
elif not conf.CheckIDAVersion(): |
| 1191 |
|
with_ida = False |
| 1192 |
|
without_ida_reason = "Unsupported (or undetected) SUNDIALS version" |
| 1193 |
|
|
| 1194 |
# CONOPT |
# CONOPT |
| 1195 |
|
|