0

I am getting the following error, which I believe to be with nlrx, because the model will run in NetLogo now that the R extension from NetLogo issues have been worked out. The r.jar and jna-4.2.2.jar files are both there. The error is generated almost immediately when I try to start the simulation in R.

R's nlrx package is running the simulation in Netlogo which uses a nonlinear solver from GAMS in R using NetLogo's R extension to choose activities. I have successfully used the model in a linux environment, so the process works. The NetLogo model will run in NetLogo which I take to mean the R extension is properly setup.

Any ideas?

C:\Users\zejas\AppData\Roaming\NetLogo\6.1\extensions\r>ls
GPL.txt  jna-4.2.2.jar  models  r.jar  user.properties
PS C:\Users\zejas> gci env:

Name                           Value
----                           -----
ALLUSERSPROFILE                C:\ProgramData
APPDATA                        C:\Users\zejas\AppData\Roaming
CLASSPATH                      C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext
CommonProgramFiles             C:\Program Files\Common Files
CommonProgramFiles(x86)        C:\Program Files (x86)\Common Files
CommonProgramW6432             C:\Program Files\Common Files
COMPUTERNAME                   DESKTOP-HM68BSI
ComSpec                        C:\Windows\system32\cmd.exe
DriverData                     C:\Windows\System32\Drivers\DriverData
FPS_BROWSER_APP_PROFILE_STRING Internet Explorer
FPS_BROWSER_USER_PROFILE_ST... Default
HOMEDRIVE                      C:
HOMEPATH                       \Users\zejas
JAVA_HOME                      C:\Program Files\Java\jdk1.8.0_221\
LOCALAPPDATA                   C:\Users\zejas\AppData\Local
LOGONSERVER                    \\DESKTOP-HM68BSI
netlogo                        C:\Program Files\NetLogo 6.1.0\app\netlogo-6.1.0.jar
NUMBER_OF_PROCESSORS           8
OneDrive                       C:\Users\zejas\OneDrive
OS                             Windows_NT
Path                           C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java;C...
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
PROCESSOR_ARCHITECTURE         AMD64
PROCESSOR_IDENTIFIER           Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
PROCESSOR_LEVEL                6
PROCESSOR_REVISION             5e03
ProgramData                    C:\ProgramData
ProgramFiles                   C:\Program Files
ProgramFiles(x86)              C:\Program Files (x86)
ProgramW6432                   C:\Program Files
PSModulePath                   C:\Users\zejas\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell...
PUBLIC                         C:\Users\Public
R                              C:\Program Files\Microsoft\R Open\R-3.5.3\bin\x64\R.exe
R_HOME                         C:\Program Files\Microsoft\R Open\R-3.5.3
R_LIBS                         C:\Program Files\Microsoft\R Open\R-3.5.3\library
R_LIBS_USER                    C:\Users\zejas\Documents\R\win-library\3.5
RPATH                          C:\Program Files\Microsoft\R Open\R-3.5.3\bin\x64
rtools_path                    C:\Rtools\bin
SESSIONNAME                    Console
SystemDrive                    C:
SystemRoot                     C:\Windows
TEMP                           C:\Users\zejas\AppData\Local\Temp
TMP                            C:\Users\zejas\AppData\Local\Temp
USERDOMAIN                     DESKTOP-HM68BSI
USERDOMAIN_ROAMINGPROFILE      DESKTOP-HM68BSI
USERNAME                       zejas
USERPROFILE                    C:\Users\zejas
windir                         C:\Windows
> utils::sessionInfo() 
R version 3.5.3 (2019-03-11) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows 10 x64 (build 17763)  

Matrix products: default  

locale: [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252      

attached base packages: [1] stats     graphics  grDevices utils     datasets  methods   base       

other attached packages: [1] nlrx_0.2.0           RevoUtils_11.0.3     RevoUtilsMath_11.0.0  

loaded via a namespace (and not attached):  [1] Rcpp_1.0.1       XML_3.98-1.19    crayon_1.3.4     dplyr_0.8.0.1    assertthat_0.2.1 R6_2.4.0          [7] magrittr_1.5     pillar_1.3.1     miscTools_0.6-22 rlang_0.3.4      rstudioapi_0.10  tools_3.5.3      [13] readr_1.3.1      glue_1.3.1       purrr_0.3.2      hms_0.4.2        compiler_3.5.3   pkgconfig_2.0.2  [19] tidyselect_0.2.5 tibble_2.1.1
>



> results <- run_nl_one(nl, seed=1,siminputrow = 1)
Error loading native library: Unable to load library 'msvcr120': Native library (win32-x86-64/msvcr120.dll) not found in resource path ([file:/C:/Users/zejas/AppData/Roaming/NetLogo/6.1/extensions/r/r.jar, file:/C:/Users/zejas/AppData/Roaming/NetLogo/6.1/extensions/r/jna-4.2.2.jar, file:/C:/Users/zejas/AppData/Roaming/NetLogo/6.1/extensions/r/r.jar])
java.lang.UnsatisfiedLinkError: Unable to load library 'msvcr120': Native library (win32-x86-64/msvcr120.dll) not found in resource path ([file:/C:/Users/zejas/AppData/Roaming/NetLogo/6.1/extensions/r/r.jar, file:/C:/Users/zejas/AppData/Roaming/NetLogo/6.1/extensions/r/jna-4.2.2.jar, file:/C:/Users/zejas/AppData/Roaming/NetLogo/6.1/extensions/r/r.jar])
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:277)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403)
    at com.sun.jna.Library$Handler.<init>(Library.java:147)
    at com.sun.jna.Native.loadLibrary(Native.java:502)
    at com.sun.jna.Native.loadLibrary(Native.java:481)
    at org.nlogo.extension.r.Entry.<clinit>(Entry.java:100)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.nlogo.workspace.JarLoader.extensionClassManager(JarLoader.scala:48)
    at org.nlogo.workspace.ExtensionManager.$anonfun$importExtension$8(ExtensionManager.scala:159)
    at scala.Option.getOrElse(Option.scala:138)
    at org.nlogo.workspace.ExtensionManager.importExtension(ExtensionManager.scala:157)
    at org.nlogo.parse.StructureParser$.$anonfun$parsingWithExtensions$1(StructureParser.scala:74)
    at org.nlogo.parse.StructureParser$.$anonfun$parsingWithExtensions$1$adapted(StructureParser.scala:68)
    at scala.collection.immutable.List.foreach(List.scala:392)
    at org.nlogo.parse.StructureParser$.parsingWithExtensions(StructureParser.scala:68)
    at org.nlogo.parse.StructureParser$.parseSources(StructureParser.scala:33)
    at org.nlogo.parse.NetLogoParser.basicParse(NetLogoParser.scala:17)
    at org.nlogo.parse.NetLogoParser.basicParse$(NetLogoParser.scala:15)
    at org.nlogo.parse.FrontEnd$.basicParse(FrontEnd.scala:10)
    at org.nlogo.parse.FrontEndMain.frontEnd(FrontEnd.scala:26)
    at org.nlogo.parse.FrontEndMain.frontEnd$(FrontEnd.scala:25)
    at org.nlogo.parse.FrontEnd$.frontEnd(FrontEnd.scala:10)
    at org.nlogo.compile.CompilerMain$.compile(CompilerMain.scala:43)
    at org.nlogo.compile.Compiler.compileProgram(Compiler.scala:54)
    at org.nlogo.headless.HeadlessModelOpener.openFromModel(HeadlessModelOpener.scala:50)
    at org.nlogo.headless.HeadlessWorkspace.openModel(HeadlessWorkspace.scala:539)
    at org.nlogo.headless.HeadlessWorkspace.open(HeadlessWorkspace.scala:506)
    at org.nlogo.headless.Main$.newWorkspace$1(Main.scala:18)
    at org.nlogo.headless.Main$.runExperiment(Main.scala:21)
    at org.nlogo.headless.Main$.$anonfun$main$1(Main.scala:12)
    at org.nlogo.headless.Main$.$anonfun$main$1$adapted(Main.scala:12)
    at scala.Option.foreach(Option.scala:274)
    at org.nlogo.headless.Main$.main(Main.scala:12)
    at org.nlogo.headless.Main.main(Main.scala)
jjhold
  • 3
  • 1

1 Answers1

0

The error is generated almost immediately when I try to start the simulation in R.

You have failed to install the Microsoft Visual C++ 2013 Redistributable on your system. Be sure you install both the 32-bit and 64-bit versions. I should point out that Visual C++ 2013 is not binary compataible, which means you must provide the exact version of the library, that NetLogo is actually looking for.

Visual C++ Redistributable Packages for Visual Studio 2013

Update for Visual C++ 2013 and Visual C++ Redistributable Package

Ramhound
  • 41,734
  • 35
  • 103
  • 130
  • Since I cannot determine what version of msvcr120.dll NetLogo is expecting, I have linked to two different versions, you should install the one that is required. There might be more than those two versions of msvcr120.dll that exist, you will have to determine, what version of the file is required. **Based on the information provided I cannot determine that.** – Ramhound Aug 14 '19 at 17:18
  • Thank you! I will try this when I get back to the office. I had installed Microsoft Visual C++ 2015, but not 13. What information would you need to determine which version is required? – jjhold Aug 14 '19 at 18:08
  • @jjhold - I am not actually going to list every version of that particular library (it would be helpful to anyone but you). You would have to determine that yourself. The list of depencies for NetLogo would be a good start. – Ramhound Aug 14 '19 at 19:48
  • — you should read before you snark. I asked how. I wanted to know how to know in the future. I’m glad you get your jollies by making snarky demeaning comments. Good job with achieving the stature in life to troll these forums. I’ll – jjhold Aug 15 '19 at 21:43