BYU-PRISM / GEKKO

GEKKO Python for Machine Learning and Dynamic Optimization
https://machinelearning.byu.edu
Other
595 stars 104 forks source link

remote = False not working on Mac #79

Closed dmccrea107 closed 3 years ago

dmccrea107 commented 4 years ago
Error: dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/9/libquadmath.0.dylib
  Referenced from: /Users/dawson/Documents/Repositories/GEKKO/gekko/bin/apm_mac
  Reason: image not found

I was trying to run on my mac remote = False and was receiving this error. I installed gfortran as it seemed like that may have been the problem but was still getting this error. gcc is installed but redirects to clang. Any suggestions?

APMonitor commented 4 years ago

Does this solution work? https://stackoverflow.com/questions/57207357/dyld-library-not-loaded-usr-local-gfortran-lib-libgfortran-3-dylib-reason-im

APMonitor commented 4 years ago

What is your MacOS version? You may need gcc in addition to gfortran.

dmccrea107 commented 4 years ago

I am running macOS Mojave version 10.14.6

Yes! That helped solve the problem. MacOS defaults to clang and so I had to brew install gcc to get around it. Unfortunately I am now running into

Error: dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
  Referenced from: /Users/dawson/Documents/Repositories/GEKKO/gekko/bin/apm_mac
  Expected in: /usr/lib/libSystem.B.dylib
APMonitor commented 4 years ago

Try installing gfortran with brew as well: brew install gfortran

marcosfelt commented 4 years ago

The issue for me was having gcc 8 installed instead of gcc 9. Using brew install gcc worked for me. This should install gfortran as well, though if you already have it installed you might need to run rm /usr/local/bin/gfortran and then brew link gcc so everything works correctly.

Maybe it's worth adding these instructions to the installation docs?

APMonitor commented 4 years ago

I probably just need to link any dependencies in the executable so there isn't a dependency on gfortran shared libraries. I'll try to link the .a (static) libraries on the next release. It will make the apm_mac executable larger but it will hopefully eliminate this extra step.

APMonitor commented 3 years ago

Added gcc 9+ dependency information to the documentation.