BYU-PRISM / GEKKO

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

Local (remote=False) solve options #71

Closed APMonitor closed 3 years ago

APMonitor commented 4 years ago

Currently there are four options for local solutions with Gekko (no Internet) connection. With an Internet connection, all versions of Python 2 and 3 should work on any platform when remote=True. The local executables are used when option remote=False when creating the Gekko model (e.g. m = GEKKO(remote=False)). Versions of the local executable include:

Other architectures may also be needed. Add them to this thread to be added to the development list.

APMonitor commented 4 years ago

Requested addition of NVIDIA Jetson TX2 running Ubuntu on a hex-core ARMv8 64-bit CPU complex

abe-mart commented 4 years ago

Might be worth looking into some type off cross platform build service. https://www.appveyor.com/, or Travis perhaps.

On Wed, Sep 18, 2019, 12:21 AM APMonitor notifications@github.com wrote:

Requested addition of NVIDIA Jetson TX2 running Ubuntu on a hex-core ARMv8 64-bit CPU complex

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BYU-PRISM/GEKKO/issues/71?email_source=notifications&email_token=AEUJHIK7LYIL6CVNKSYBABLQKGUFZA5CNFSM4IXZADWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD66X2OA#issuecomment-532512056, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUJHIMPNAR6VOSMLPLL7D3QKGUFZANCNFSM4IXZADWA .

On Wed, Sep 18, 2019, 12:21 AM APMonitor notifications@github.com wrote:

Requested addition of NVIDIA Jetson TX2 running Ubuntu on a hex-core ARMv8 64-bit CPU complex

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BYU-PRISM/GEKKO/issues/71?email_source=notifications&email_token=AEUJHIK7LYIL6CVNKSYBABLQKGUFZA5CNFSM4IXZADWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD66X2OA#issuecomment-532512056, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUJHIMPNAR6VOSMLPLL7D3QKGUFZANCNFSM4IXZADWA .

marcosfelt commented 4 years ago

I am having trouble running locally on Mac. I get the following error:

Error: dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/9/libgfortran.5.dylib
  Referenced from: /Users/Kobi/.local/share/virtualenvs/distillation_control-9D6W6LfG/lib/python3.7/site-packages/gekko/bin/apm_mac
  Reason: image not found
APMonitor commented 4 years ago

I resolved this problem on Linux by linking static libraries. I'll get a new version to you soon.

One way around this problem is to install gcc with brew install gcc. This should give you the dynamically linked libraries.

APMonitor commented 4 years ago

@marcosfelt a new MacOS binary is available that is linked with a static gcc-gfortran library. It will be available with the next release of Gekko (v0.2.6) or you can get it and place it in your gekko/bin folder of your gekko installation in site-packages: https://github.com/BYU-PRISM/GEKKO/blob/master/gekko/bin/apm_mac

marcosfelt commented 4 years ago

Thanks!

APMonitor commented 4 years ago

@marcosfelt it looks like this helped. Let me know if you have any more issues with the MacOS version. Gekko (v0.2.6) is now available. To get the latest local options use pip install gekko --upgrade or you may also need the --user option if you don't have admin privilege.

Hiyorimi commented 3 years ago

@marcosfelt a new MacOS binary is available that is linked with a static gcc-gfortran library. It will be available with the next release of Gekko (v0.2.6) or you can get it and place it in your gekko/bin folder of your gekko installation in site-packages: https://github.com/BYU-PRISM/GEKKO/blob/master/gekko/bin/apm_mac

it fails under 10.14 Mojave, any chance you can update binary ?

Hiyorimi commented 3 years ago

As a temporary fix, I did following:

brew unlink gcc
cd /usr/local/opt/gcc/lib/gcc/9
ln -s  /usr/local/opt/gcc@9/lib/gcc/9/libquadmath.0.dylib
/path/to/your/apm_mac/site-packages/gekko/bin/apm_mac
 ----------------------------------------------------------------
 APMonitor, Version 0.9.2
 APMonitor Optimization Suite
 ----------------------------------------------------------------

 @error: Model File Not Found
 Model file does not exist: model.apm
 STOPPING...
APMonitor commented 3 years ago

Thanks for the suggestion. It sounds like it is a gcc 9 issue, not a 10.14 Mojave issue. I have a MacOS just for compiling Gekko. I'll see if I can upgrade gcc and recompile for the next release. Thanks for also suggesting the work-around.

danielsoroban commented 3 years ago

still not working on latest Mac, too bad, really wanted to use this package locally. Sending remote requests is not really an option.

the single binary for mac (downloaded separately ) is not allowed to start by Catalina. with sudo it is allowed to run but still references an old gcc version:

dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/9/libquadmath.0.dylib

With the suggestion from @Hiyorimi I am not getting other 2 errors and still not working:

Error: dyld: lazy symbol binding failed: Symbol not found: _emutls_getaddress dyld: Symbol not found: emutls_get_address

I installed the latest gcc but still same issue.

anything else to try ? or just give up and use another package ? thanks

Hiyorimi commented 3 years ago

@danielsoroban I ended up running it on Linux

APMonitor commented 3 years ago

I just got the new Macbook Air with the M1 Processor. I suppose that there will be a new complication with the Mac version now that there is an Intel and an ARM processor. Linux may be the best option until the compatibility issues are resolved. You can also create a local Linux or Windows server and run on the Intranet with m = GEKKO(remote=True,server='http://10.0.0.10') or whatever the local version of your server happens to be. There is more information on installing a local server.

APMonitor commented 3 years ago

New version 1.0.0 released today resolves the library dependency issue with local solve.