Closed sshort325 closed 2 years ago
I keep getting this issue and I'm not sure how to fix it.
You did not install COMETS and Gurobi properly. The COMETS_HOME variable tells matlab where comets was installed. In Windows you go to setting->advanced->set ENV variables. In Linux/Mac you should have a line in your .bashrc or .cshrc files:
export COMETS_HOME=
where
Oh my gosh thank you so much! I am really new to this and not very good at this point honestly. How do I find my path on a Mac? Also, if I find my path and do the export does that fix it? Or do I need to completely redownload?
Oh no, you don't need to do any of that, just use the installer from runcomets.org
Also, detailed instruction can be found here: https://www.nature.com/articles/s41596-021-00593-3
specific details are in this section: https://www.nature.com/articles/s41596-021-00593-3#Sec24
In MacOS, the line
export GUROBI_HOME=/Library/gurobi902/mac64/
should be included in the .bash_profile file in older versions of MacOS, or .zshrc in the latest version of MacOS. The version name and number in gurobi902 should be set to the one installed. It is important to source these files before attempting to run COMETS. The easiest way to do that is to close the terminal and open another one.
Also, the COMETS installer will add lines:
export COMETS_HOME=/home/username/comets export PATH=$PATH:$COMETS_HOME export GUROBI_COMETS_HOME=$(echo $(ls -d /usr/gurobi/gurobi*/linux64)|awk {‘print $NF’}) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GUROBI_COMETS_HOME/lib/
in the.bashrc file in Linux, and
export COMETS_HOME=/Applications/COMETS export PATH=$PATH:$COMETS_HOME export GUROBI_COMETS_HOME=$(echo $(ls -d /Library/gurobi*/mac64)|awk {‘print $NF’}) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GUROBI_COMETS_HOME/lib/
in the .bash_profile file in older versions of MacOS, and .zshrc in the latest version of MacOS, where username is replaced with the specific one for the user. This should make Gurobi libraries available to COMETS. More information can be found in the Troubleshooting table.
I do have those instructions, I have been following along with them as best as I can. On page 5042, I was following adding those lines in. However, it wasn't working well. I did download the COMETS through the link you posted. I am just really confused on this part.
All this is supposed to be done automatically during installation. Can you look at your .zshrc file? Open a terminal and do: cat .zshrc
Actually, let's go back a bit. Did you use the installer for Mac from runcomets.org?
Honestly, I started this process a few weeks ago and Im not 100% sure. But none of that information has come up automatically for me.
OK get the installer from here: https://www.runcomets.org/installation for Mac, and just run it. Let me know hoe it goes.
I did, that's how COMETS looks.
And that's what I got in my terminal
OK that's good
So the problem is when you try to run the matlab toolbox, right?
Did you add the paths to comets and cobra in matlab?
Would you try the cometspy toolbox in pyhton, it is easier to setup.
Oh sorry, I missed one of the warnings. Seems like you don't have gurobi installed. Did you try to install gurobi?
Yes thats correct. When I do testComets() it comes up with the environment variable output from above.
I was actually working in python when I had this happen. And that's why I switched to Matlab.
Let's try to make it work in python.
Open a terminal, do:
cd cat .zshrc
Let's see if you have GUROBI_HOME properly installed.
This is surprising. Do:
cat .bash_profile
OK let's see where is Gurobi installed. Do: echo $GUROBI_COMETS_HOME
and then: echo $GUROBI_HOME
aha, this is it, gurobi is not installed where it is supposed to be They could have changed the default installation for gurobi
Please note that as of Gurobi 9.5.0 the install directory on Macs has changed: /Library/gurobi950/macos_universal2
Ah, that's it.
OK so in the .bash_profile file you should make that change.
How do I change it?
export GUROBI_COMETS_HOME=/Library/gurobi950/macos_universal2/ export GUROBI_HOME=/Library/gurobi950/macos_universal2/
Edit your .bash_profile file and replace those two lines.
Do you know how to do it?
I googled it just now. This is what it looks like now, I highlighted it to make it easier to see.
OK good, now you need to restart your Mac in principle. Can you do that?
(If you don't want to restart there is a way around it)
I think Ill be okay to restart it. Ill be right back
OK
Alright, all restarted now
OK let's try the echoes again
echo $GUROBI_COMETS_HOME
I think you have a line with GUROBI_COMETS_HOME still present in your .bash_profile file.
the old one
Oh crap yes I didnt delete that
You have to comment it out