reasons for "failed to create shared library"

6 views
Skip to first unread message

Quresh Latif

unread,
May 31, 2024, 4:51:17 PMMay 31
to nimble-users
There are lots of posts about this dreaded message. I am getting at the moment for a particular model. Other models run just fine, so it appears to be a problem with how I've specified my model or specified the inputs to the model (i.e., data or constants). I am trying to run a trimmed down version of my model so that I can troubleshoot which part is causing the error. In the meantime, I was wondering if there exists anywhere or if it would be possible to compile a list of major causes for this error. So far from glancing through a few posts, I see at least two:

1. software (e.g., Nimble or C++ compiler) needs to be updated
2. There is a mismatch between the format of a node and how it is referenced (e.g., a scalar is referenced as a vector or matrix).

For my case, I think I've ruled out 1 since I am not getting the error universally. I am not sure about 2, and I am wondering if there are others that can be added to this list.

Quresh Latif

unread,
May 31, 2024, 5:24:14 PMMay 31
to nimble-users
Forgot about my previous post when I got this error. Looked back at that and I can add one more to the list:

1. software (e.g., Nimble or C++ compiler) needs to be updated
2. There is a mismatch between the format of a node and how it is referenced (e.g., a scalar is referenced as a vector or matrix).
3. The name of a node conflicts with the internal Nimble machinery (e.g., "int" should not be the name of any nodes).

Quresh Latif

unread,
May 31, 2024, 6:06:57 PMMay 31
to nimble-users
Figured out my problem, and so I can add to the list of potential causes of the "failed to compile shared library" error:

1. software (e.g., Nimble or C++ compiler) needs to be updated
2. There is a mismatch between the format of a node and how it is referenced (e.g., a scalar is referenced as a vector or matrix).
3. The name of a node conflicts with the internal Nimble machinery (e.g., "int" should not be the name of any nodes).
4. Use of `inprod` on objects with matrices with only one column.

Not sure if I am describing 4 in the most general manner, but in my case I had in my model:

log(a[s, j]) <- zeta0[s] + inprod(zetaVec[s, 1:n.Xpp], X.pp[j, 1:n.Xpp])

for which n.Xpp = 1. My fix is:

if(n.Xpp > 1) {
          log(a[s, j]) <- zeta0[s] + inprod(zetaVec[s, 1:n.Xpp], X.pp[j, 1:n.Xpp])
        }
        if(n.Xpp == 1) {
          log(a[s, j]) <- zeta0[s] + zetaVec[s, 1] * X.pp[j, 1]
        }

Reply all
Reply to author
Forward
0 new messages