iiasa / GLOBIOM-G4M-link

Automatize the link between GLOBIOM and G4M
2 stars 1 forks source link

'Set up directories and functions' chunk can't find G4M shared library #2

Closed acjbrouwer closed 3 years ago

acjbrouwer commented 3 years ago

When running the notebook for commit 147d97357ed91352c964a525e600aebc6a158252 with all the submodules, including the G4M one, cloned as per their submodule references as current in that commit, running chunk 'Set up directories and functions throws the following error.

> dyn.load(path(CD,WD_G4M,"/tableMergeForLinker/merge_files.so"))
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'E:/work/GLOBIOM/links/GLOBIOM-G4M-link/G4M/tableMergeForLinker/merge_files.so':
  LoadLibrary failure:  Access is denied.

Setting the x flag on the file via Cygwin resolved the issue. But that is kinda curious because you'd not expect it to require that on Windows, with the access being from the R runtime. @andreyaugustynczik, did you not encounter this error?

Related discussion: https://sourceforge.net/p/mingw/bugs/1475/

acjbrouwer commented 3 years ago

Issue resolved by @andreyaugustynczik through compilation in absence of merge_files.so via compile_table_merger() helper function using the Rtools4 toolchain. Apparently, being MinGW-based, this properly sets the emulated x flag on Windows:

$ ls -l merge_files.so
-rwxrwxr-x+ 1 brouwer esm 983040 Nov  3 15:05 merge_files.so