Skip to content

Commit a06925d

Browse files
committed
fix: Allow include directory to be found
Use a broader env var to find qulacs and use both the include and the lib directory.
1 parent ef952e2 commit a06925d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ use std::env;
22
use std::path::PathBuf;
33

44
fn main() {
5-
let qulacs_path = PathBuf::from(env::var("LIBQULACS_PATH").unwrap());
5+
let qulacs_path = PathBuf::from(env::var("QULACS_PATH").unwrap());
6+
let mut qulacs_lib = qulacs_path.clone();
7+
qulacs_lib.push("/lib");
8+
9+
let mut qulacs_include = qulacs_path.clone();
10+
qulacs_include.push("/include");
611
println!(
712
"cargo:rustc-link-search={}",
813
qulacs_path
@@ -18,6 +23,7 @@ fn main() {
1823
let eigen = pkg_config::probe_library("eigen3").unwrap();
1924
cxx_build::bridge("src/lib.rs")
2025
.file("src/qulacs-bridge.cc")
26+
.include(qulacs_include)
2127
.includes(eigen.include_paths)
2228
.flag("-fext-numeric-literals")
2329
.flag("-fopenmp") // todo: better way to do this?

devenv.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let
33
qulacs = pkgs.callPackage ./nix/qulacs.nix {};
44
in {
55
env = {
6-
LIBQULACS_PATH = "${qulacs}/lib";
6+
QULACS_PATH = "${qulacs}";
77
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
88
};
99

0 commit comments

Comments
 (0)