Shared library issue on Windows

48 views
Skip to first unread message

Lawson, Andrew B.

unread,
Oct 12, 2019, 2:06:07 PM10/12/19
to nimble-users
Hi Guys
I believe that some new potential windows users have some problems with
administrator privileges when trying to compile nimble code. I found this during
a one day Nimble course I have been presenting at the GEOVET 2019 conference.
 
when compileNimble is used they get the following error:
Error: failed to create the shared library.
 
I believe this has been mentioned before on the group.
It seems to be to do with administrator privilages not being available.
They all installed Rtools prior to Nimble installation.
 
CAn you say if there is currently a solution?
 
best
Andrew
 
 
 
Division of Biostatistics and Bioinformatics
Department of Public Health Sciences
Medical University of South Carolina
Charleston
29425
South Carolina
USA
 
 
new 3rd edition of BDM book:
 
 
Handbook of Spatial Epidemiology:
 
 
 
 
 

Daniel Turek

unread,
Oct 13, 2019, 4:40:03 AM10/13/19
to Lawson, Andrew B., nimble-users
Andrew, is it possible for you to provide the full output from the compilation problem, that is, the output from:

compileNimble(..., showCompilerOutput = TRUE)



--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/BL0PR11MB293140C72A95BE5C3BD39951A3960%40BL0PR11MB2931.namprd11.prod.outlook.com.

Lawson, Andrew B.

unread,
Oct 13, 2019, 11:14:49 AM10/13/19
to Daniel Turek, nimble-users

Hi Daniel

I didn’t get this error and am reporting other people's problem. The course has finished now but I

will contact the people who got the error and get details for you.

 

Thanks

Andrew

 

 

Division of Biostatistics and Bioinformatics

Department of Public Health Sciences

Medical University of South Carolina

Charleston

29425

South Carolina

USA

ph: 843-876-1865

 

 

new 3rd edition of BDM book:

 

www.crcpress.com/9781138575424

 

Handbook of Spatial Epidemiology:

 

www.crcpress.com/9781482253016

 

 

From: nimble...@googlegroups.com <nimble...@googlegroups.com> On Behalf Of Daniel Turek
Sent: Sunday, October 13, 2019 4:39 AM
To: Lawson, Andrew B. <laws...@musc.edu>
Cc: nimble-users <nimble...@googlegroups.com>
Subject: Re: Shared library issue on Windows

 

CAUTION: External

Erin Rees

unread,
Oct 15, 2019, 8:48:49 AM10/15/19
to Lawson, Andrew B., Daniel Turek, nimble-users
Hi Daniel,

Here is the error:

> CLN<-compileNimble(LN)
compiling... this may take a minute. Use 'showCompilerOutput = TRUE' to see C++ compilation details.
Error: Failed to create the shared library.

And so you see the process before:


R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from ~/.RData]

> setwd("F:/PHAC/Conferences/2019/GeoVet/workshop/GEOVET_Participant_files")
> ### log normal UH model SC congenital data 1990 ######
> library(nimble)
nimble version 0.8.0 is loaded.
For more information on NIMBLE and a User Manual,
please visit http://R-nimble.org.

Attaching package: ‘nimble’

The following object is masked from ‘package:stats’:

    simulate

> LNCode<-nimbleCode({
+     for(i in 1:N){
+         log(theta[i])<-a0+v[i]
+         lambda[i]<-theta[i]*texp[i]
+         y[i]~dpois(lambda[i])
+         v[i]~dnorm(0,tauv)
+     }
+     a0~dnorm(0,tau0)
+     tauv~dgamma(2,0.5)
+     tau0~dgamma(2,0.5)
+ })
>
>
>
>
> LNConsts<-list(N=46,texp=c(1.0807,6.3775,0.622,6.6854,0.9142,1.0744,5.6518,
+                            8.1682,0.5749,18.0989,2.174,1.6619,1.9321,1.6148,1.6713,3.0819,1.7562,4.9952,
+                            0.9362,1.2001,6.1293,2.5604,15.8589,2.9437,1.0399,7.276,0.9739,2.064,2.7206,2.8275,
+                            0.9425,8.828,0.3644,1.775,1.5111,1.5111,2.5321,
+                            4.5836,3.9647,15.0264,0.732,10.8292,5.9848,1.4357,1.9949,6.9807),
+                pov=c(13.6,13.8,32.3,11,24.2,19.9,12.3,13.3,17,15.4,14.1,15.7,18,24.3,21.8,
+                      20.2,24.9,12,17.4,18.1,18.7,17.5,10.6,13.8,22.8,13.7,21,12.6,14,14,26.9,
+                      9.4,17.8,23.1,23.1,14.4,10.8,22.1,10.1,13.6,15.9,11.2,18.3,14,26.4,10.6),
+                inc=c(36.786,38.534,20.727,37.205,24.3,27.607,45.822,40.161,32.247,38.458,
+                      33.232,31.715,29.505,25.896,28.919,30.776,25.552,42.886,34.297,29.96,34.009,
+                      35.008,41.658,34.109,27.65,34.654,27.117,39.04,33.698,32.32,25.144,45.14,
+                      29.805,25.008,25.993,32.231,36.912,28.624,37.054,39.587,31.324,37.092,
+                      31.948,30.801,23.748,44.619))
> LNData<-list(y=c(0,7,1,5,1,1,5,16,0,17,4,0,0,1,1,7,1,3,0,0,8,2,13,7,0,8,0,3,2,4,1,11,0,1,2,3,3,8,6,14,3,11,6,0,1,5))
> LNInits<-list(a0=0.1,tauv=0.1,tau0=0.1,v=rep(0.0,LNConsts$N))
>
> LN<-nimbleModel(code=LNCode,name="LN",constants=LNConsts,
+                 data=LNData,inits=LNInits)
defining model...
building model...
setting data and initial values...
running calculate on model (any error reports that follow may simply reflect missing values in model variables) ...
checking model sizes and dimensions...
model building finished.
>
>
>
> CLN<-compileNimble(LN)
compiling... this may take a minute. Use 'showCompilerOutput = TRUE' to see C++ compilation details.
Error: Failed to create the shared library.


Thanks for your help.

Erin





--
Everything in moderation, including moderation ~Oscar Wilde

Daniel Turek

unread,
Oct 15, 2019, 8:59:50 AM10/15/19
to Erin Rees, Lawson, Andrew B., nimble-users
Thank you, Erin.  We'll see if we can take a look.

Were you able to just recreate this on your computer?

Erin Rees

unread,
Oct 15, 2019, 9:08:40 AM10/15/19
to Daniel Turek, Lawson, Andrew B., nimble-users
Yes, I just did it now. It may be an issue of permissions? I am using a government machine and I do not have administrative results. This error also occurred for another person in our workshop, who is a student at UC Davis, and also does not have administrative results to his machine given the internet network protocols at the university.

Best,
Erin

Daniel Turek

unread,
Oct 15, 2019, 9:28:28 AM10/15/19
to Erin Rees, Lawson, Andrew B., nimble-users
Erin, is it possible for you to provide the full output from the compilation problem, that is, the output from:

compileNimble(..., showCompilerOutput = TRUE)


Erin Rees

unread,
Oct 15, 2019, 9:45:35 AM10/15/19
to Daniel Turek, Lawson, Andrew B., nimble-users
Here you go:

> CLN<-compileNimble(LN, showCompilerOutput = TRUE)
compiling... this may take a minute. On some systems there may be some compiler warnings that can be safely ignored.
Warning message:
In system(cmd) : 'make' not found

Error: Failed to create the shared library.

Erin Rees

unread,
Oct 15, 2019, 10:15:15 AM10/15/19
to Daniel Turek, Lawson, Andrew B., nimble-users, dibak...@gmail.com
The solution from Dr. Khan - thank you!! 

The path needs reset. This is what we did in Rstan to get it to work. 
 
You will need to change the names to be consistent with your system
 
#-------------------------------------
Path0 = Sys.getenv('PATH')
Pathrtools = paste( "C:\\Rtools\\bin;C:\\Rtools\\mingw_64\\bin;",Path0 ,sep="" )
Sys.setenv( PATH = Pathrtools) 
#----------------------------------------------
Please paste and run this in your R program before running anything. My system now compiled successfully.

Dr. Devita Khan

unread,
Oct 15, 2019, 10:18:49 AM10/15/19
to Erin Rees, Daniel Turek, Lawson, Andrew B., nimble-users
No problem Erin! I repeatedly got this shared library error in RSTAN as well. The above commands solved STAN and NIMBLe both. 

Regards,
Diba

Sent from my iPhone

Perry de Valpine

unread,
Oct 15, 2019, 3:20:30 PM10/15/19
to Dr. Devita Khan, Erin Rees, Daniel Turek, Lawson, Andrew B., nimble-users
Great to see this solution.

I'd like to pull together suggestions for OS-specific configuration problems.  Windows problems seem to be most common, and unfortunately we (nimble development team) have limited Windows expertise.  Here are cases / suggestions I've seen.  If we can refine these points, we could put the in the user manual and the web site.

Windows:
1. Be sure to check box to set PATH when installing Rtools.exe.  Atlernatively, set PATH manually using Diba's tip.
2. Be sure Rtools.exe version matches R version.
3. We have seen some problems resolved by re-installing Rtools followed by re-installing nimble.
4. Sometimes R might need to be run as administrator to have appropriate permissions.  (Does anyone have any insight into when this is relevant for nimble?)
5. If there are filesystem or permissions issues, it is possible to install nimble in a local directory.
6. At some point in the past, Windows users reported problems if their file system involved a space in a directory name in the path to RHOME.  I think we have this resolved, so we would be interested if anyone has experience on this.
7. At some point in the past, perhaps for same reason as #6, Windows users reported problems if R is installed on a network drive.  Does anyone have recent experience with this?
8. If problems arise from generating and compiling C++ files in R's tempdir(), one can use the dirName argument to compileNimble to put such files elsewhere, such as in a local work directory.  I think this shouldn't be necessary since tempdir() should be somewhere with write permission, but does anyone know more about this on Windows?

OS X:
1. Newly installed Xcode or command line tools may need to be started once manually to provide a one-time permission before they will work from nimble.
2. If multiple C++ compilers are present on a system, be sure the PATH will find the right one.

Does anyone have any refinements or additions?

Perry
 

Reply all
Reply to author
Forward
0 new messages