-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make GAP.jl usable as a Julia module with precompilation #249
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ authors = ["Thomas Breuer <[email protected]>", "Sebastian Gutsche <gutsch | |
version = "0.1.0" | ||
|
||
[deps] | ||
GAPTypes = "cd4130c4-8d21-11e9-2a29-61e008680c2d" | ||
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,23 @@ if install_gap | |
## TODO: We currently use the GAP master branch. | ||
## Once all issues of using GAP with the julia | ||
## GC are resolved, we switch to a stable version. | ||
run(`git clone https://github.com/gap-system/gap`) | ||
run(`git clone --depth=1 https://github.com/gap-system/gap`) | ||
cd("gap") | ||
run(`./autogen.sh`) | ||
run(`./configure --with-gc=julia --with-julia=$(julia_binary)`) | ||
run(`make -j$(Sys.CPU_THREADS)`) | ||
## FIXME: Hack to make GAPTypes available in the global package environment: | ||
## For a moment, we set the Julia load path to the actual depot, i.e., | ||
## the env GAP.jl is installed to, to install GAPTypes.jl globally. | ||
## Since the package manager usually sets the load paths, | ||
## JULIA_LOAD_PATH should always be set when this script is | ||
## executed. However, just setting this environment variable | ||
## just for the configure currently does not work. | ||
julia_load_path_save = ENV["JULIA_LOAD_PATH"] | ||
pop!( ENV, "JULIA_LOAD_PATH" ) | ||
julia_executable = joinpath(julia_binary, "julia") | ||
run(`$(julia_executable) -e 'import Pkg; Pkg.add("GAPTypes")'`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, that is a gross hack. I am also not quite sure why it is needed? Surely, GAP's But I also wonder (very naively, so there is probably an easy answer why this won't work): couldn't we make the code in GAP more flexible, and ask it to first check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I am painfully aware that this is gross, and should not be done this way. On the other hand, the Julia package manager sets this environment variable, too, which is also not very nice of it. Actually, patching GAP this way would be possible, although not for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will leave one more comment. The problem is that for the configure script, this somehow failed to give me the right responses when we asked for flags. I have no real idea why yet. This solution is merely the result of a lot of try-and-error. |
||
ENV["JULIA_LOAD_PATH"] = julia_load_path_save | ||
gap_install_packages = get(ENV, "GAP_INSTALL_PACKAGES", "yes") | ||
if gap_install_packages == "yes" | ||
run(`make bootstrap-pkg-full`) | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
ENV["JULIA_LOAD_PATH"]
guaranteed (by documentation / specification) to be set at this point? If it is not, then this line could throw an exception.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this build script is (or better should, nobody is keeping you from shooting yourself in the foot) only executed by the package manager, yes, I am sure this is always set.