-
Notifications
You must be signed in to change notification settings - Fork 0
Pr codecov #3
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
Pr codecov #3
Changes from all commits
01fcca8
16682bc
1a81848
6531cdd
eebf13c
4dc1608
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 @@ Interface to the DiagHam library. | |
| module DiagHamInterface | ||
|
|
||
| export execute_diagham_script | ||
| export install_diagham | ||
|
|
||
| export read_matrix_from_txt | ||
| export write_to_txt | ||
|
|
@@ -17,6 +18,7 @@ using Preferences | |
| include("utility/backup.jl") | ||
| include("utility/diagham_path.jl") | ||
| include("utility/execute_script.jl") | ||
| include("utility/diagham_install.jl") | ||
|
||
| include("utility/fileending.jl") | ||
| include("utility/numbers.jl") | ||
| include("utility/standards.jl") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| """ | ||
| install_diagham(; source_dir, build_dir=nothing, run_dir=nothing, configure_options=["--enable-fqhe","--enable-fti","--with-blas-libs=-lopenblas","--with-lapack-libs=","--enable-lapack"]) | ||
|
|
||
| Checkout and build DiagHam from source. Returns the path to the build directory. | ||
|
|
||
| Parameters are keyword-only and intended to be easily overridden from tests or user code. | ||
| """ | ||
| function install_diagham(; | ||
| source_dir, | ||
| build_dir = nothing, | ||
| run_dir = nothing, | ||
| configure_options = ["--enable-fqhe", "--enable-fti", "--with-blas-libs=-lopenblas", "--with-lapack-libs=", "--enable-lapack"], | ||
| ) | ||
| source_dir = expanduser(source_dir) | ||
|
|
||
| isnothing(build_dir) && (build_dir = joinpath(source_dir, "build")) | ||
| build_dir = expanduser(build_dir) | ||
| !isnothing(run_dir) && (run_dir = expanduser(run_dir)) | ||
|
|
||
| # Check if already built (look for a known executable) | ||
| exe_check = joinpath(build_dir, "FQHE", "src", "Programs", "FQHEOnTorus", "FQHETorusFermionsTwoBodyGeneric") | ||
| if isdir(build_dir) && isfile(exe_check) | ||
| @info "DiagHam already installed at $build_dir" | ||
| return build_dir | ||
| end | ||
|
|
||
| # Checkout DiagHam | ||
| if !isdir(source_dir) | ||
| @info "Checking out DiagHam from SVN repository..." | ||
| run(`svn checkout "https://www.nick-ux.org/diagham/svn/DiagHam/trunk" $source_dir`) | ||
| else | ||
| @info "DiagHam source already exists at $source_dir" | ||
| end | ||
|
|
||
| !isdir(build_dir) && mkdir(build_dir) | ||
| # Check if it uses autotools or cmake | ||
| if isfile(joinpath(source_dir, "CMakeLists.txt")) | ||
| # CMake-based build | ||
|
|
||
| @info "Configuring DiagHam with CMake..." | ||
| cd(build_dir) do | ||
| run(`cmake $source_dir -DBUILD_FQHE=ON`) | ||
| end | ||
|
|
||
| @info "Building DiagHam..." | ||
| cd(build_dir) do | ||
| nprocs = Sys.CPU_THREADS | ||
| run(`make -j$nprocs`) | ||
| end | ||
| elseif isfile(joinpath(source_dir, "configure")) | ||
| # Autotools-based build (older DiagHam versions) | ||
| @info "Configuring DiagHam with autotools..." | ||
|
|
||
| cd(build_dir) do | ||
| # Run configure from build dir pointing to source dir with FQHE and LAPACK enabled | ||
| configure_script = joinpath(source_dir, "configure") | ||
| run(`$configure_script $(configure_options...)`) | ||
|
|
||
| @info "Building DiagHam..." | ||
| nprocs = Sys.CPU_THREADS | ||
| run(`make -j$nprocs`) | ||
| end | ||
| elseif isfile(joinpath(source_dir, "configure.in")) || isfile(joinpath(source_dir, "Makefile.am")) | ||
| # Need to run autoreconf first | ||
| @info "Running autoreconf to generate configure script..." | ||
| cd(source_dir) do | ||
| run(`autoreconf -i`) | ||
| end | ||
|
|
||
| cd(build_dir) do | ||
| # Run configure from build dir pointing to source dir with FQHE and LAPACK enabled | ||
| configure_script = joinpath(source_dir, "configure") | ||
| run(`$configure_script --enable-fqhe --enable-fti --with-blas-libs=-lopenblas --with-lapack-libs= --enable-lapack`) | ||
|
|
||
| @info "Building DiagHam..." | ||
| nprocs = Sys.CPU_THREADS | ||
| run(`make -j$nprocs`) | ||
| end | ||
| else | ||
| error("Could not determine build system for DiagHam") | ||
| end | ||
|
|
||
| !isdir(run_dir) && !isnothing(run_dir) && mkdir(run_dir) | ||
|
|
||
| @info "DiagHam installed successfully at $build_dir" | ||
|
|
||
| if !@has_preference("diagham_path") | ||
| set_diagham_path(build_dir) | ||
| end | ||
|
|
||
| return build_dir | ||
| end |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,115 +9,38 @@ const DIAGHAM_SOURCE_DIR = joinpath(dirname(@__DIR__), "diagham_source") | |||||||||||
| const DIAGHAM_BUILD_DIR = joinpath(DIAGHAM_SOURCE_DIR, "build") | ||||||||||||
| const DIAGHAM_RUN_DIR = joinpath(DIAGHAM_BUILD_DIR, "run") | ||||||||||||
|
|
||||||||||||
| """ | ||||||||||||
| install_diagham() | ||||||||||||
|
|
||||||||||||
| Checkout and build DiagHam from source. Returns the path to the build directory. | ||||||||||||
| """ | ||||||||||||
| function install_diagham() | ||||||||||||
| # Check if already built | ||||||||||||
| if isdir(DIAGHAM_BUILD_DIR) && isfile(joinpath(DIAGHAM_BUILD_DIR, "FQHE", "src", "Programs", "FQHEOnTorus", "FQHETorusFermionsTwoBodyGeneric")) | ||||||||||||
| @info "DiagHam already installed at $DIAGHAM_BUILD_DIR" | ||||||||||||
| return DIAGHAM_BUILD_DIR | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| # Checkout DiagHam if not exists | ||||||||||||
| if !isdir(DIAGHAM_SOURCE_DIR) | ||||||||||||
| @info "Checking out DiagHam from SVN repository..." | ||||||||||||
| mkdir(dirname(DIAGHAM_SOURCE_DIR)) | ||||||||||||
| run(`svn checkout https://www.nick-ux.org/diagham/svn/DiagHam/trunk $DIAGHAM_SOURCE_DIR`) | ||||||||||||
| else | ||||||||||||
| @info "DiagHam source already exists at $DIAGHAM_SOURCE_DIR" | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| # Check if it uses autotools or cmake | ||||||||||||
| if isfile(joinpath(DIAGHAM_SOURCE_DIR, "CMakeLists.txt")) | ||||||||||||
| # CMake-based build | ||||||||||||
| if !isdir(DIAGHAM_BUILD_DIR) | ||||||||||||
| mkdir(DIAGHAM_BUILD_DIR) | ||||||||||||
| end | ||||||||||||
| using DiagHamInterface: install_diagham | ||||||||||||
|
||||||||||||
| using DiagHamInterface: install_diagham | |
| function install_diagham(; source_dir::AbstractString = DIAGHAM_SOURCE_DIR) | |
| error("DiagHamInterface.install_diagham is not available in this repository. " * | |
| "Please install DiagHam manually under '$(source_dir)' before running tests.") | |
| end |
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.
The function
install_diaghamis being exported but the file that should contain this function (utility/diagham_install.jl) does not exist in the repository. This export will fail and any code trying to use this function will encounter an undefined identifier error.