StochSS / GillesPy2

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

Replace Makefile build back end with SConstruct #879

Closed jtcooper10 closed 1 year ago

jtcooper10 commented 2 years ago

Replacing the GNUMake-based build system with SCons, which is added as a Python dependency.

Still, only g++ is supported as the C++ compiler, which requires mingw and GNU tools on Windows and MacOS. In the future, using SCons rather than Make will allow us to support a variety of platform compilers more easily.


Changes

mdip226 commented 2 years ago

Good luck reading this. It's definitely having a permission error creating a tempfile. I think that makes sense, because it looks like it's trying to make it in C:/WINDOWS which I assume is not allowed. The only thing I can think of is that I did not use venv to install scons, so it thinks that it has administrator access. Also I'm using mingw64 if that matters. I am not sure what \r\scons is.

out.txt

mdip226 commented 2 years ago

Here's the important part: "name": "SimulationError", "message": "<class 'gillespy2.solvers.cpp.ssa_c_solver.SSACSolver'> is not a valid solver. Reason Given: Error encountered during execution of Makefile target: 'ssa'.\nReturn code: 2- stdout: scons: Entering directory `C:\Users\mdip2\AppData\Local\Temp\gillespy2_build_695gskgr'\r\nscons: Reading SConscript files ...\r\nscons: done reading SConscript files.\r\nscons: Building targets ...\r\ng++ -o gillespy2_obj\arg_parser.o -c -std=c++14 -IC:\Users\mdip2\Projects\GillesPy2\gillespy2\solvers\cpp\c_base -Igillespy2_template -IC:\Users\mdip2\Projects\GillesPy2\gillespy2\solvers\cpp\c_base\Sundials\include -IC:\Users\mdip2\Projects\GillesPy2\gillespy2\solvers\cpp\c_base\Tau C:\Users\mdip2\Projects\GillesPy2\gillespy2\solvers\cpp\c_base\arg_parser.cpp\r\nscons: building terminated because of errors.\r\n\n- stderr: Cannot create temporary file in C:\WINDOWS\: Permission denied\r\nscons: *** [gillespy2_obj\arg_parser.o] Error 3\r\n\n- make_cmd: ['C:\\Users\\mdip2\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\python.exe', '-m', 'SCons', '-CC:\\Users\\mdip2\\AppData\\Local\\Temp\\gillespy2_build_695gskgr', '-fC:\\Users\\mdip2\\Projects\\GillesPy2\\gillespy2\\solvers\\cpp\\build\\SConstruct', 'CBASE_DIR=C:\\Users\\mdip2\\Projects\\GillesPy2\\gillespy2\\solvers\\cpp\\c_base', 'OBJ_DIR=C:\\Users\\mdip2\\AppData\\Local\\Temp\\gillespy2_build_695gskgr\\gillespy2_obj', 'TEMPLATE_DIR=C:\\Users\\mdip2\\AppData\\Local\\Temp\\gillespy2_build_695gskgr\\gillespy2_template', 'SOLVER=ssa', 'OUTPUT_FILE=C:\\Users\\mdip2\\AppData\\Local\\Temp\\gillespy2_build_695gskgr\\GillesPy2_Simulation.exe']\n- os.listdir(C:\Users\mdip2\Projects\GillesPy2\gillespy2\solvers\cpp\c_base\template): ['template.cpp', 'template.h', 'template_defaults.h', 'template_definitions.h', 'template_opts.h', 'template_params.h']\n."

jtcooper10 commented 2 years ago

Good luck reading this. It's definitely having a permission error creating a tempfile. I think that makes sense, because it looks like it's trying to make it in C:/WINDOWS which I assume is not allowed. The only thing I can think of is that I did not use venv to install scons, so it thinks that it has administrator access. Also I'm using mingw64 if that matters.

I am not sure what \r\scons is.

out.txt

This doesn't really tell me anything, what's the context? This looks like it's JSONify output, I'm guessing this is related to compute?

And the \r\nscons is just a Win32-style line feed followed before the scons command

mdip226 commented 2 years ago

This was when I was trying to run StartHere.ipynb (not compute) on windows, by bad I should have included more info. Does the scons python package require the windows executable scons.exe to be installed?

On Mon, Oct 17, 2022, 08:52 Joshua Cooper @.***> wrote:

Good luck reading this. It's definitely having a permission error creating a tempfile. I think that makes sense, because it looks like it's trying to make it in C:/WINDOWS which I assume is not allowed. The only thing I can think of is that I did not use venv to install scons, so it thinks that it has administrator access. Also I'm using mingw64 if that matters.

I am not sure what \r\scons is.

out.txt https://github.com/StochSS/GillesPy2/files/9795986/out.txt

This doesn't really tell me anything, what's the context? This looks like it's JSONify output, I'm guessing this is related to compute?

And the \r\nscons is just a Win32-style line feed followed before the scons command

— Reply to this email directly, view it on GitHub https://github.com/StochSS/GillesPy2/pull/879#issuecomment-1280812864, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMIVBA7YOEDUOZKOCCOHOHLWDVDYXANCNFSM6AAAAAARAYDCTU . You are receiving this because your review was requested.Message ID: @.***>

mdip226 commented 2 years ago

Its the error message produced by Jupyter, opened in a text editor cuz the error message was big

On Mon, Oct 17, 2022, 09:46 Matt Dippel @.***> wrote:

This was when I was trying to run StartHere.ipynb (not compute) on windows, by bad I should have included more info. Does the scons python package require the windows executable scons.exe to be installed?

On Mon, Oct 17, 2022, 08:52 Joshua Cooper @.***> wrote:

Good luck reading this. It's definitely having a permission error creating a tempfile. I think that makes sense, because it looks like it's trying to make it in C:/WINDOWS which I assume is not allowed. The only thing I can think of is that I did not use venv to install scons, so it thinks that it has administrator access. Also I'm using mingw64 if that matters.

I am not sure what \r\scons is.

out.txt https://github.com/StochSS/GillesPy2/files/9795986/out.txt

This doesn't really tell me anything, what's the context? This looks like it's JSONify output, I'm guessing this is related to compute?

And the \r\nscons is just a Win32-style line feed followed before the scons command

— Reply to this email directly, view it on GitHub https://github.com/StochSS/GillesPy2/pull/879#issuecomment-1280812864, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMIVBA7YOEDUOZKOCCOHOHLWDVDYXANCNFSM6AAAAAARAYDCTU . You are receiving this because your review was requested.Message ID: @.***>

mdip226 commented 2 years ago

It was a hasty attempt that involved

  1. cloning Gillespy2 repo
  2. Installing mingw along with g++, make (I actually had a little trouble locating the correct make and I'm still not 100% sure its the correct one but I think it is. Both commands seem to run from cmd but I never tested them farther than knowing they are in the path. One thing I forgot: I was using MSYS2
  3. pip install scons
  4. Running starthere.ipynb in vscode

I could definitely have not done something