Skip to content

Commit

Permalink
use libcint_jll instead of deps/build.jl solution (FermiQC#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer committed Jan 6, 2022
1 parent a1ab517 commit cc80c72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 46 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
Molecules = "5de6a177-b489-40a9-b2f4-524242b9b679"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
libcint_jll = "574b78ca-bebd-517c-801d-4735c93a9686"

[compat]
Formatting = "^0.4"
Molecules = "^0.1.1"
HDF5 = "^0.15.6"
libcint_jll = "5"
Molecules = "^0.1.1"
julia = "^1.5"
46 changes: 2 additions & 44 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,45 +1,3 @@
# Fetch Libcint

try
@info "Fetching libcint library"
if Sys.ARCH == :x86_64
run(`git clone https://github.com/sunqm/qcint.git`)
mv("qcint", "libcint")
else
run(`git clone https://github.com/sunqm/libcint.git`)
end
mkdir(joinpath(@__DIR__, "libcint/build"))
cd(joinpath(@__DIR__, "libcint/build"))
catch
@error("Failed to clone libcint")
throw(SystemError)
end

try
# Compile Libcint
@info "Building Libcint"

@info " => Running CMAKE..."
run(`cmake ..`)
@info " => Running MAKE..."
run(`make`)
catch
rm(joinpath(@__DIR__, "libcint"), recursive=true, force=true)
@error("Libcint compilation failed!!")
throw(SystemError)
end

# Fetch binary
@info " => Cleaning up..."
if Sys.islinux()
run(`cp libcint.so ../../`)
elseif Sys.isapple()
run(`cp libcint.dylib ../../`)
else
@error "Could not resolve OS"
end

# Untar basis set library and Clean up
# Untar basis set library
cd(@__DIR__)
run(`tar -zxf lib.gz`)
rm(joinpath(@__DIR__, "libcint"), recursive=true, force=true)
run(`tar -zxf lib.gz`)
3 changes: 2 additions & 1 deletion src/Libcint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module Libcint
export cint1e_kin_sph!, cint1e_nuc_sph!, cint1e_ovlp_sph!, cint2c2e_sph!, cint2e_sph!, cint3c2e_sph!
export cint1e_ipkin_sph!, cint1e_ipnuc_sph!, cint1e_ipovlp_sph!, cint2e_ip1_sph!, cint1e_r_sph!

const LIBCINT = joinpath(@__DIR__, "../deps/libcint")
using libcint_jll
const LIBCINT = libcint

function CINTcgtos_spheric(bas_id, bas)
@ccall LIBCINT.CINTcgtos_spheric(bas_id::Cint, bas::Ptr{Cint})::Cint
Expand Down

0 comments on commit cc80c72

Please sign in to comment.