[R-SIG-Mac] Lost Library ?

Simon Urbanek simon.urbanek at r-project.org
Wed Sep 7 17:16:27 CEST 2016

> On Sep 6, 2016, at 5:34 PM, Roger Koenker <rkoenker at illinois.edu> wrote:
> This is a question about how to find a lost library needed for the gurobi R package.
> Gurobi is a optimization system with various frontends including to R.
> Even though I realize that few of you use, or may even know about, gurobi I hope
> that there may be  some generic advice — my first  dubious attempts, contrary to Simon’s
> periodic advice that use of DYLD_LIBRARY_PATH is frowned upon,  have proven futile.
> Here is the basic story:
> I've installed gurobi and its license file and this seems to work on a test problem from the command line,
> but I would like to use the R package interface and have installed the R binary package that comes with
> the gurobi download on a R 3.3.0 system on an osx 10.11.5 machine,   As far as I can see there is no
> source version of the R package available.   The package “seems to” install, but I now see in R:
>> library(gurobi)
> Loading required package: gurobi
> Loading required package: slam
> Error in dyn.load(file, DLLpath = DLLpath, ...) : 
>  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/gurobi/libs/gurobi.so':
>  dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/gurobi/libs/gurobi.so, 6): Library not loaded: libgurobi65.so
>  Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/gurobi/libs/gurobi.so
>  Reason: image not found
> the library libgurobi65.so is sitting in /usr/local/lib so I don't understand why the
> R process can't find it

Possibly because gurobi authors have no idea about OS X? The library should include its location in its ID field and also .so is not the correct extension for a OS X library - it's not Linux :). So if you still have some trust in that product, you can try 

sudo install_name_tool -id /usr/local/lib/libgurobi65.so /usr/local/lib/libgurobi65.so

and the re-compile the R package and cross your fingers that it will work. Alternatively, if you can't compile it yourself, you can manually force the correct path in the package via

install_name_tool -change libgurobi65.so /usr/local/lib/libgurobi65.so /Library/Frameworks/R.framework/Versions/3.3/Resources/library/gurobi/libs/gurobi.so

but as other said, you should really ask them to fix their product ;).


> -- this is what the R package library thinks:
> yzzy: otool -L g*
> gurobi.so:
> 	gurobi.so (compatibility version 0.0.0, current version 0.0.0)
> 	libgurobi65.so (compatibility version 6.5.0, current version 6.5.2)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
> 	/Library/Frameworks/R.framework/Versions/3.2/Resources/lib/libR.dylib (compatibility version 3.2.0, current version 3.2.2)
> 	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.17.0)
> Many thanks for your help,
> Roger
> url:    www.econ.uiuc.edu/~roger            Roger Koenker
> email    rkoenker at uiuc.edu            Department of Economics
> vox:     217-333-4558                University of Illinois
> fax:       217-244-6678                Urbana, IL 61801
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list