Error: Failed to create the shared library. While Compiling Example Code

2,159 views
Skip to first unread message

florianm...@gmail.com

unread,
Sep 24, 2018, 2:04:13 PM9/24/18
to nimble-users
Hi
I am new to Nimble and was trying to run the Pump example. During the 
Cpump <- compileNimble(pump, showCompilerOutput = TRUE)

command,I get the following error message:

compiling... this may take a minute. On some systems there may be some compiler warnings that can be safely ignored.
'\\bla.myuni.no\home8\MyName\R\R-3.4.4' is not recognized as an internal or external command,
operable program or batch file.
Error: Failed to create the shared library
In addition: Warning message:
running command '//bla.myuni.no/home8/MyName/R/R-3.4.4/bin/x64/R CMD SHLIB dynamicRegistrations_09_24_19_46_52.cpp -o dynamicRegistrations_09_24_19_46_52.dll' had status 1 

I suspect there might be something wrong with my installation or the PATH environment variable. 
I am using R Studio, which is installed on a network drive that is synced with the servers of my uni (hence the unusual path). latest Rtools (3.34) is installed.

Hope someone can help. I would prefer to not reinstall everything, if possible.

/FM

Perry de Valpine

unread,
Sep 24, 2018, 3:13:49 PM9/24/18
to florianm...@gmail.com, nimble-users
This might be a case where you need to reinstall Rtools and be sure to check the box for it to modify your PATH.

--
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 post to this group, send email to nimble...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/210a94d5-330b-4fcb-b5f2-9c0c3717aaf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

florianm...@gmail.com

unread,
Sep 24, 2018, 3:39:31 PM9/24/18
to nimble-users
I made sure to do that. My Path looks like this:
PATH=C:\Users\Myname\Rtools\bin;...etc...;\\bla.myuni.no\home8\MyName\R\R-3.4.4

Perry de Valpine

unread,
Sep 24, 2018, 8:18:35 PM9/24/18
to florianm...@gmail.com, nimble-users
I'm not sure what to suggest given that I don't know your system.

Can you see try to manually locate where a command-line call to R would work, if not in '\\bla.myuni.no\home8\MyName\R\R-3.4.4' ?

florianm...@gmail.com

unread,
Sep 25, 2018, 3:30:15 AM9/25/18
to nimble-users
I am on Windows 7 64x

cmd line call only works when I set my PATH to "\\bla.myuni.no\home8\MyName\R\R-3.4.4\bin". "\\bla.myuni.no\home8\MyName\R\R-3.4.4" gives me the "r.exe is not recognized as an internal..." error in the console.

So I changed the PATH to "\\bla.myuni.no\home8\MyName\R\R-3.4.4\bin" and ran the example code in R through cmd. 

library(nimble)
pumpCode
<- nimbleCode({
 
for (i in 1:N){
 theta
[i] ~ dgamma(alpha,beta)
 
lambda[i] <- theta[i]*t[i]
 x
[i] ~ dpois(lambda[i])


 
}
 alpha
~ dexp(1.0)
 beta
~ dgamma(0.1,1.0)
})
pumpConsts
<- list(N = 10,
 t
= c(94.3, 15.7, 62.9, 126, 5.24,
 
31.4, 1.05, 1.05, 2.1, 10.5))
pumpData
<- list(x = c(5, 1, 5, 14, 3, 19, 1, 1, 4, 22))
pumpInits
<- list(alpha = 1, beta = 1,
 theta
= rep(0.1, pumpConsts$N))


pump
<- nimbleModel(code = pumpCode, name = "pump", constants = pumpConsts,
 data
= pumpData, inits = pumpInits)




Cpump <- compileNimble(pump, showCompilerOutput)


Same error as before.

> Cpump <- compileNimble(pump, showCompilerOutput)

compiling
... this may take a minute. On some systems there may be some compiler
warnings that can be safely ignored
.
'\\eir.uib.no\home8\fmu041\R\R-3.4.4' is not recognized as an internal or extern

al command
,
operable program
or batch file.
Error: Failed to create the shared library
In addition: Warning message:

running command
'//eir.uib.no/home8/fmu041/R/R-3.4.4/bin/x64/R CMD SHLIB dynamic
Registrations_09_25_09_24_09.cpp -o dynamicRegistrations_09_25_09_24_09.dll'
had
 status
1

/FM
Message has been deleted

Joseph Chipperfield

unread,
Sep 25, 2018, 4:40:53 AM9/25/18
to nimble-users
Hi Florian,

R.home() always points to base directory of the r installation and not neccessarily where the binaries are stored (i.e. where your PATH needs to point to).  What does 'R.home("bin")' return?

The later versions of R installations on Windows systems have started putting the binaries in architecture-specific subfolders of the 'bin' directory.  On my Windows system the binaries sit in 'bin/x64'.  Maybe that could be the source of your problem?

Hope that works,

Joe

P. S.  Bergen's security restrictions has often interferred with programs trying to modify the PATH variable in the past and might explain why this hasn't been set automagically.
Reply all
Reply to author
Forward
0 new messages