diff --git a/Precompile.jl b/deps/precompile.jl similarity index 94% rename from Precompile.jl rename to deps/precompile.jl index e4f84ac30..efe6fb867 100644 --- a/Precompile.jl +++ b/deps/precompile.jl @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE -using OpticSim +using OpticSim # this will only work after the main build steps are completed @info "Running representative workload" # add stuff here # Examples.autodrawrays() diff --git a/src/Sysimage.jl b/deps/sysimage.jl similarity index 91% rename from src/Sysimage.jl rename to deps/sysimage.jl index 52301602b..6b7a6136e 100644 --- a/src/Sysimage.jl +++ b/deps/sysimage.jl @@ -20,17 +20,16 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE -module Sysimage import Pkg, Libdl, PackageCompiler function compile(sysimage_path = "JuliaSysimage.$(Libdl.dlext)") env_to_precompile = joinpath(@__DIR__, "..") - precompile_execution_file = joinpath(env_to_precompile, "Precompile.jl") + precompile_execution_file = joinpath(@__DIR__, "precompile.jl") project_filename = joinpath(env_to_precompile, "Project.toml") project = Pkg.API.read_project(project_filename) used_packages = Symbol.(collect(keys(project.deps))) # don't need these ever after building this so no need to have them in the sysimage - used_packages = filter(x -> x ∉ [:Libdl, :PackageCompiler, :Pkg], used_packages) + filter!(x -> x ∉ [:Libdl, :PackageCompiler, :Pkg], used_packages) if Libdl.dlext == "dll" @warn "Ignoring packages which use gl dlls on Windows as these cause build errors" # see https://github.com/JuliaLang/PackageCompiler.jl/issues/365 @@ -40,5 +39,3 @@ function compile(sysimage_path = "JuliaSysimage.$(Libdl.dlext)") @info "Building a custom sysimage for OpticSim.jl." PackageCompiler.create_sysimage(used_packages, sysimage_path = sysimage_path, project = env_to_precompile, precompile_execution_file = precompile_execution_file) end - -end # module Sysimage diff --git a/src/OpticSim.jl b/src/OpticSim.jl index 8002bb4d6..d2aa0ab7d 100644 --- a/src/OpticSim.jl +++ b/src/OpticSim.jl @@ -45,8 +45,6 @@ include("Visualization.jl") include("Examples.jl") include("Optimization/Optimizable.jl") -include("Sysimage.jl") - ################################################ # This can be used to track NaN, particularly in ForwardDiff gradients, causing problems