Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local solve (remote=False) option for Linux and ARM #48

Closed
APMonitor opened this issue Dec 31, 2018 · 1 comment
Closed

Local solve (remote=False) option for Linux and ARM #48

APMonitor opened this issue Dec 31, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@APMonitor
Copy link
Member

APMonitor commented Dec 31, 2018

The Linux (apm) and ARM (apm_arm) version of the local executable no longer requires libraries and the folder os.path.realpath(file))+'/bin/lib'. When the apm binary is missing, I get the following error when I run on Linux:

Local Solve: k2 n0
Traceback (most recent call last):
File "rosenbrock.py", line 60, in
m.solve(disp=False)
File "/home/hedengren/.local/lib/python3.5/site-packages/gekko/gekko.py", line 661, in solve
app = subprocess.Popen([apm_exe, self._model_name], stdout=subprocess.PIPE, stderr=subprocess.PIPE,cwd = self._path, env = {"PATH" : self._path, "LD_LIBRARY_PATH" : os.path.dirname(os.path.realpath(file))+'/bin/lib' }, universal_newlines=True)
File "/usr/lib/python3.5/subprocess.py", line 947, in init
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/home/hedengren/.local/lib/python3.5/site-packages/gekko/bin/apm'

I tried to resolve the issue by retrieving the apm executable and creating an empty lib directory as:

cd /home/hedengren/.local/lib/python3.5/site-packages/gekko/bin
mkdir lib
wget https://github.com/BYU-PRISM/GEKKO/tree/master/gekko/bin/apm
sudo chmod 775 apm

This resolved the issue but it would be nice to have this modified in the PyPi pip distribution.

We also need a check in the Python code to determine the architecture (Windows, Linux, ARM) and use the appropriate local executable (apm.exe, apm (linux), apm_arm (ARM)).

@APMonitor APMonitor added the bug Something isn't working label Dec 31, 2018
@APMonitor
Copy link
Member Author

Resolved with release 0.1rc1 on PyPi. GEKKO now works with local solve on Windows, Linux, and ARM Linux. There is still no local support for MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants