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
First, thank you for maintaining this library. I am using ASL with a couple libraries of external functions. In a common workflow, I send several nl files to ASL in a sequence, each with its own set of libraries for external functions, which I communicate via the -i argument in the argv array passed to getstops. When an nl file's libraries include more libraries than the previous nl file, I get a function not available error message.
I have attached two nl files that can be used to produce this error: nlfiles.zip. The following code produces the error:
// asl_issue.cpp
#include<stdio.h>
#include<assert.h>
#include"asl_pfgh.h"
#include"getstub.h"structASL_pfgh;
structOption_Info;
intinstantiate_asl(char *nlfile, char *amplfunc){
printf("Instantiating ASL with file %s and amplfunc %s\n", nlfile, amplfunc);
ASL_pfgh *asl = (ASL_pfgh *) ASL_alloc(ASL_read_pfgh);
assert(asl);
Option_Info* oi = new Option_Info;
char *argv[] = {
(char *)"program_name",
(char *)"-i",
amplfunc,
nlfile,
NULL,
};
char *stub = getstops(argv, oi);
FILE *nl = jac0dim(stub, (int)strlen(stub));
assert(nl);
int ret = pfgh_read(nl, ASL_findgroups);
delete oi;
return0;
}
intmain(){
char nlfile1[] = "file1.nl";
char amplfunc1[] = "/PATH/TO/.idaes/bin/cubic_roots.dylib";
char nlfile2[] = "file2.nl";
char amplfunc2[] = (
"/PATH/TO/.idaes/bin/cubic_roots.dylib""\n/PATH/TO/.idaes/bin/functions.dylib"
);
int ret;
ret = instantiate_asl(nlfile1, amplfunc1);
ret = instantiate_asl(nlfile2, amplfunc2);
return0;
}
Here, amplsolver.a is compiled by running $ ./configure && make CFLAGS=-fPIC in the asl/src/solvers directory.
As the above suggests, I have prepared this example using Mac with Apple silicon. However, I have noticed this behavior on Linux as well (but have not tested the above example on Linux).
When I change the above code so that the first instantiate_asl call uses both function libraries, i.e.:
int ret;
ret = instantiate_asl(nlfile1, amplfunc2);
ret = instantiate_asl(nlfile2, amplfunc2);
the program runs without error.
The nl files attached depend on libraries distributed by IDAES. They are typically downloaded by the idaes-pse Python package and put in the $HOME/.idaes/bin directory, via:
$ pip install idaes-pse
$ idaes get-extensions
Let me know if this is in fact a bug. I believe I am using the -i argument correctly.
The text was updated successfully, but these errors were encountered:
First, thank you for maintaining this library. I am using ASL with a couple libraries of external functions. In a common workflow, I send several nl files to ASL in a sequence, each with its own set of libraries for external functions, which I communicate via the
-i
argument in theargv
array passed togetstops
. When an nl file's libraries include more libraries than the previous nl file, I get afunction not available
error message.I have attached two nl files that can be used to produce this error: nlfiles.zip. The following code produces the error:
which is compiled with the following:
Here,
amplsolver.a
is compiled by running$ ./configure && make CFLAGS=-fPIC
in theasl/src/solvers
directory.As the above suggests, I have prepared this example using Mac with Apple silicon. However, I have noticed this behavior on Linux as well (but have not tested the above example on Linux).
When I change the above code so that the first
instantiate_asl
call uses both function libraries, i.e.:int ret; ret = instantiate_asl(nlfile1, amplfunc2); ret = instantiate_asl(nlfile2, amplfunc2);
the program runs without error.
The nl files attached depend on libraries distributed by IDAES. They are typically downloaded by the
idaes-pse
Python package and put in the$HOME/.idaes/bin
directory, via:Let me know if this is in fact a bug. I believe I am using the
-i
argument correctly.The text was updated successfully, but these errors were encountered: