lolow / gdxtools

manipulate GDX files in R
Eclipse Public License 1.0
16 stars 4 forks source link

Use gams transfert if installed #14

Open lolow opened 1 year ago

lolow commented 1 year ago

https://www.gams.com/42/docs/API_R_GAMSTRANSFER.html

Samu372 commented 6 months ago

I write this code

library(tidyverse)
library(gdxtools)
igdx(dirname(Sys.which('gams'))) 
mygdx <- gdx('results.gdx')
mygdx

but it gives me this error Error loading the GDX API from gamsSysDir= Could not load shared library /Applications/GAMS Studio 46.app/libgdxdclib64.dylib: dlopen(/Applications/GAMS Studio 46.app/libgdxdclib64.dylib, 0x0002): tried: '/Applications/GAMS Studio 46.app/libgdxdclib64.dylib' (no such file), '/System/Volumes/Preboo Environment variable R_GAMS_SYSDIR not set: no GDX API there Error loading the GDX API via the default shared library search mechanism Could not load shared library libgdxdclib64.dylib: dlopen(libgdxdclib64.dylib, 0x0002): tried: 'libgdxdclib64.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibgdxdclib64.dylib' (no such file), '/usr/lib/libgdxdclib64.dylib' (no such file, no DYLD_LIBRARY_PATH is not set! The GDX library has not been loaded how can i fix (i'm from mac)?

lolow commented 6 months ago

Hi @Samu372, thanks for your question. It seems that you don't have gams in your PATH, so the command igdx fails. Please use one of this path "/Library/Application Support/GAMS" or "/Users/username/Library/Application Support/GAMS" when you call the command igdx, or add the path in your PATH variable. Unfortunately, I don't have much experience with the MacOS GAMS version. You might find more information at https://www.gams.com/latest/docs/UG_MAC_INSTALL.html