Fix guile environment variable on linux #551
Open
+4
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The commit message explains more.
Part of the issue here though is that we have slightly different logic when running in the build directory and when running when installed. Other projects (GNU Guix, mumi, etc...) get around this by defining a "pre-inst-env" shell script that sets environment variables.
So for example we could have a shell script that looks like this (untested):
Then to run the program out of the build directory the command would be "./pre-inst-env Studio".
This would simplify the following things:
We could remove the guile_load_path and guile_load_compiled_path stuff from these parts of the code:
./libfive/test/guile.cpp:36
./studio/src/guile/interpreter.cpp:86
./studio/src/guile/interpreter.cpp:94
./doc/guide.md:207
We could remove the python load path stuff from here (I think. Not sure how python environment variable stuff works):
./studio/src/python/interpreter.cpp:214
We could add the library binary to system paths which would simplify:
./libfive/bind/guile/libfive/lib.scm:30 to 61
./libfive/bind/python/libfive/ffi.py:37:
./studio/src/app.cpp:32
Let me know what you think. I'm not really sure how to integrate this pre-inst-env idea with cmake stuff so any help on that front would be nice.