StochSS / GillesPy2

Modeling toolkit for biochemical simulation
http://gillespy2.readthedocs.io/
GNU General Public License v3.0
73 stars 32 forks source link

Problem installing gillespy2 #935

Closed lilt3ddy closed 1 year ago

lilt3ddy commented 1 year ago

I have created a local environment using venv. I have then installed gillespy2. When I'm running my code I get the following:

"2023-04-03 16:28:55,562 - GillesPy2 - WARNING - Unable to use C++ optimized solvers due to one or more missing dependencies: ['g++']. The performance of this package can be significantly increased if you install/configure these on your machine."

What I've tried to do to fix this is the following:

1: Install C++ to vscode 2: Download Mingw-w64 and try to add a path to Mingw-w64 bin folder to the Windows PATH environment variable (don't really know what this means, I just followed the steps on https://code.visualstudio.com/docs/cpp/config-mingw).

However I don't really know what I'm doing and if I'm approaching the problem correctly. Any advice on how I should move forward would be much appreciated.

(I'm coding in Python with VS Code).

jtcooper10 commented 1 year ago

Hello! It sounds like you're generally on the right track. Ultimately, the goal is for whatever environment you're using GillesPy2 from to be able to access the g++ program. The usual process for this is to install MinGW locally and add the bin/ folder from this installation to your PATH.

This depends on your environment rather than your editor; I'm unsure what is being referred to when you say you installed C++ to VSCode. Regardless, your PATH is a list of folders for your system to check for executables. For example, if a program depends on g++.exe, the assumption is that one of the folders in your PATH is a folder that contains g++.exe. There are a few things you can check here.

  1. Ensure that your MinGW bin folder is available from the same context as your Python code. As a sanity check, you can run this Python code:
    
    # check for the g++ executable
    import shutil
    print(shutil.which("g++")) # will print None if it's not found

check your Path environment variable

returns a list; if configured correctly, one of the folders in the list will be your MinGW bin path

if your bin folder is not in this list, then your environment is not configured properly

import os print(os.environ.get("PATH")).split(";")


2. Ensure that `g++.exe` is actually present. Some MSYS2/MinGW installations prefix their build tool commands, for example `g++` will actually be called `mingw32-g++.exe` or something like that. If `g++` is not present but one of the prefixed versions are, you can copy/rename this executable to `g++.exe` so it is discoverable by any software that requires `g++`. You can check this by opening a terminal (PowerShell, cmd, Git bash, etc.) and running the command `g++ --version`.

If both of these seem okay outside of your editor, it may be an issue with the configuration of your editor/environment. I'm unfortunately not particularly familiar with VSCode's Python integration. In this case, I would consult your editor's documentation for setting up your environment.
briandrawert commented 1 year ago

If you have any further questions, please re-open this issue.