From d8c382f0d0364a77d15a09a1598cf4130b354007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Milit=C3=A3o?= <61480539+MilitaoLucas@users.noreply.github.com> Date: Sat, 6 Dec 2025 14:24:50 -0300 Subject: [PATCH 01/10] Add workflow_dispatch trigger to build_test.yml --- .github/workflows/build_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 94621c9ca..a42cf57c5 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -6,6 +6,7 @@ on: pull_request: branches: ["main"] tags: "v*" + workflow_dispatch: env: BUILD_TYPE: Release CPM_SOURCE_CACHE: ${{github.workspace}}/cache/cpm From 78a22859918beb02aeecc768bd73760af7f4ac37 Mon Sep 17 00:00:00 2001 From: LucasMilitao Date: Sun, 25 Jan 2026 19:08:02 -0300 Subject: [PATCH 02/10] Building main binary --- 3rdparty/CMakeLists.txt | 4 ++ 3rdparty/nix/dftd4.nix | 94 ++++++++++++++++++++++++++++++ 3rdparty/nix/scnlib.nix | 53 +++++++++++++++++ cmake/CPM.cmake | 29 +++++----- flake.lock | 27 +++++++++ flake.nix | 125 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 318 insertions(+), 14 deletions(-) create mode 100644 3rdparty/nix/dftd4.nix create mode 100644 3rdparty/nix/scnlib.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index f8f7a9bb1..d32a74ff2 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -152,6 +152,10 @@ CPMAddPackage( ${LIBCINT_BUILD_TYPE} VERSION "6.1.2" ) +if (libcint_ADDED AND NOT NIX_BUILD) + file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) + message(WARNING "ADDED LIBCINT") +endif () # Apply the flags to the target after it's created if(TARGET cint) diff --git a/3rdparty/nix/dftd4.nix b/3rdparty/nix/dftd4.nix new file mode 100644 index 000000000..20fb597f1 --- /dev/null +++ b/3rdparty/nix/dftd4.nix @@ -0,0 +1,94 @@ +{ + stdenv, + lib, + fetchFromGitHub, + gfortran, + buildType ? "cmake", + cmake, + meson, + ninja, + pkg-config, + python3, + blas, + lapack, + mctc-lib, + mstore, + multicharge, + eigen, +}: + +assert !blas.isILP64 && !lapack.isILP64; +assert ( + builtins.elem buildType [ + "meson" + "cmake" + ] +); + +stdenv.mkDerivation rec { + pname = "dftd4"; + version = "2.2.0"; + src = fetchFromGitHub { + owner = "peterspackman"; + repo = "cpp-d4"; + rev = "main"; + hash = "sha256-aBWw9DGt0s5nGvmHQZzuZDPTWRGCsaKCrp4NylHOzqw="; + }; + + nativeBuildInputs = [ + gfortran + pkg-config + python3 + ] + ++ lib.optionals (buildType == "meson") [ + meson + ninja + ] + ++ lib.optional (buildType == "cmake") cmake; + + buildInputs = [ + blas + lapack + eigen + ]; + + propagatedBuildInputs = [ + mctc-lib + mstore + multicharge + ]; + + cmakeFlags = [ + (lib.strings.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + "-DDFTD4_USE_EIGEN=ON" + "-DBUILD_SHARED_LIBS=OFF" + ]; + outputs = [ + "out" + "dev" + ]; + + doCheck = true; + + postPatch = '' + patchShebangs --build \ + config/install-mod.py \ + app/tester.py + ''; + + preCheck = '' + export OMP_NUM_THREADS=2 + ''; + + meta = { + description = "Generally Applicable Atomic-Charge Dependent London Dispersion Correction"; + mainProgram = "dftd4"; + license = with lib.licenses; [ + lgpl3Plus + gpl3Plus + ]; + homepage = "https://github.com/grimme-lab/dftd4"; + platforms = lib.platforms.linux; + maintainers = [ lib.maintainers.sheepforce ]; + }; +} diff --git a/3rdparty/nix/scnlib.nix b/3rdparty/nix/scnlib.nix new file mode 100644 index 000000000..778447108 --- /dev/null +++ b/3rdparty/nix/scnlib.nix @@ -0,0 +1,53 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + fast-float, + enableShared ? !stdenv.hostPlatform.isStatic, +}: +# Coppied from https://github.com/nix-community/nur-combined/tree/main/repos/foolnotion +stdenv.mkDerivation rec { + pname = "scnlib"; + version = "4.0.1"; + + src = fetchFromGitHub { + owner = "eliaskosunen"; + repo = "scnlib"; + rev = "v${version}"; + sha256 = "sha256-qEZAWhtvhKMkh7fk1yD17ErWGCpztEs0seV4AkBOy1I="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ fast-float ]; + postPatch = '' + substituteInPlace src/scn/impl.cpp \ + --replace "fast_float::scientific" "fast_float::chars_format::scientific" \ + --replace "fast_float::fixed" "fast_float::chars_format::fixed" \ + --replace "fast_float::general" "fast_float::chars_format::general" \ + --replace "fast_float::hex" "fast_float::chars_format::hex" + ''; + + cmakeFlags = [ + "-DSCN_TESTS=OFF" + "-DSCN_EXAMPLES=OFF" + "-DSCN_BENCHMARKS=OFF" + "-DSCN_BENCHMARKS_BUILDTIME=OFF" + "-DSCN_BENCHMARKS_BINARYSIZE=OFF" + "-DSCN_USE_EXTERNAL_BENCHMARK=ON" + "-DSCN_USE_EXTERNAL_FAST_FLOAT=ON" + "-DENABLE_FULL=OFF" + "-DSCN_INSTALL=ON" + "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" + ]; + # postInstall = '' + # ln -s $out/lib/cmake/scn/scn-config.cmake $out/lib/cmake/scn/scnlibConfig.cmake + # ''; + meta = with lib; { + description = "Modern C++ library for replacing scanf and std::istream"; + homepage = "https://scnlib.readthedocs.io/"; + license = licenses.asl20; + platforms = platforms.all; + #maintainers = with maintainers; [ foolnotion ]; + }; +} diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index 47e2e872a..c272e953f 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -4,21 +4,22 @@ set(CPM_DOWNLOAD_VERSION 0.40.5) set(CPM_HASH_SUM "c46b876ae3b9f994b4f05a4c15553e0485636862064f1fcc9d8b4f832086bc5d") +if (NOT NIX_BUILD) + if(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") + elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") + else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") + endif() + # Expand relative path. This is important if the provided path contains a tilde (~) + get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) -if(CPM_SOURCE_CACHE) - set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") -elseif(DEFINED ENV{CPM_SOURCE_CACHE}) - set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") -else() - set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") -endif() + file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} + ) +endif () -# Expand relative path. This is important if the provided path contains a tilde (~) -get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) - -file(DOWNLOAD - https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake - ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} -) include(${CPM_DOWNLOAD_LOCATION}) diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..0c6ae9864 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1769170682, + "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c5296fdd05cfa2c187990dd909864da9658df755", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..1ac671616 --- /dev/null +++ b/flake.nix @@ -0,0 +1,125 @@ +{ + description = "Open Computational Chemestry"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + outputs = + { + self, + nixpkgs, + }: + let + fast-float-6_1_6 = pkgs.fast-float.overrideAttrs (old: rec { + version = "6.1.6"; + src = pkgs.fetchFromGitHub { + owner = "fastfloat"; + repo = "fast_float"; + rev = "v${version}"; + hash = "sha256-MEJMPQZZZhOFiKlPAKIi0zVzaJBvjAlbSyg3wLOQ1fg="; + }; + }); + cli11-src = pkgs.fetchFromGitHub { + owner = "CLIUtils"; + repo = "CLI11"; + rev = "v2.4.2"; + hash = "sha256-73dfpZDnKl0cADM4LTP3/eDFhwCdiHbEaGRF7ZyWsdQ="; + }; + gemmi = pkgs.gemmi.overrideAttrs (old: rec { + version = "0.6.5"; + src = pkgs.fetchFromGitHub { + owner = "project-gemmi"; + repo = "gemmi"; + tag = "v${version}"; + hash = "sha256-JJ6YBsdL3J+d0ihuJ2Nowp40c7FkDdfTqBhDrxWgSFw="; + }; + + }); + dftd4 = pkgs.callPackage ./3rdparty/nix/dftd4.nix { }; + scnlib = pkgs.callPackage ./3rdparty/nix/scnlib.nix { + fast-float = fast-float-6_1_6; + }; + # libcint = pkgs.callPackage ./3rdparty/nix/libcint.nix { }; + libcint_src = pkgs.fetchFromGitHub { + owner = "peterspackman"; + repo = "libcint"; + rev = "master"; + hash = "sha256-JWk1B+Fz5nHxnGI5WlSynNqvkqIRvkbba8Nx3I5Tziw="; + }; + lbfgspp-src = pkgs.fetchFromGitHub { + owner = "yixuan"; + repo = "LBFGSpp"; + rev = "master"; + hash = "sha256-PUzZ2jUVgHq1LJDWIWW93KnV7vBBEdZlspOrE5TcYBc="; + }; + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + + in + { + # 1. The Build Artifact (nix build) + packages.${system} = { + default = pkgs.stdenv.mkDerivation { + name = "occ"; + src = ./.; + buildInputs = [ + pkgs.cmake + # Project dependencies installed with cpm.cmake + pkgs.cpm-cmake + pkgs.pkg-config + pkgs.spdlog + pkgs.onetbb + pkgs.tomlplusplus + pkgs.unordered_dense + pkgs.fmt + pkgs.nlohmann_json + pkgs.eigen_3_4_0 + pkgs.libxc + scnlib + ]; + nativeBuildInputs = [ + pkgs.cmake + pkgs.ninja + pkgs.pkg-config + ]; + cmakeFlags = [ + "-GNinja" + "-DCPM_DOWNLOAD_LOCATION=${pkgs.cpm-cmake}/share/cpm/CPM.cmake" + "-DCPM_USE_LOCAL_PACKAGES=ON" + "-DCPM_spdlog_SOURCE=${pkgs.spdlog.src}" + "-DCPM_oneTBB_SOURCE=${pkgs.onetbb.src}" + "-DCPM_scnlib_SOURCE=${scnlib.src}" + "-DCPM_eigen3_SOURCE=${pkgs.eigen_3_4_0.src}" + "-DCPM_gemmi_SOURCE=${gemmi.src}" + "-DCPM_CLI11_SOURCE=${cli11-src}" + "-DCPM_fmt_SOURCE=${pkgs.fmt.src}" + "-DCPM_nlohmann_json_SOURCE=${pkgs.nlohmann_json.src}" + "-DCPM_Libxc_SOURCE=${pkgs.libxc.src}" + "-DCPM_libcint_SOURCE=${libcint_src}" + "-DCPM_unordered_dense_SOURCE=${pkgs.unordered_dense.src}" + "-DCPM_tomlplusplus_SOURCE=${pkgs.tomlplusplus.src}" + "-DCPM_dftd4_cpp_SOURCE=${dftd4.src}" + "-DCPM_LBFGSpp_SOURCE=${lbfgspp-src}" + "-DFETCHCONTENT_SOURCE_DIR_FAST_FLOAT=${fast-float-6_1_6.src}" + "-DNIX_BUILD=ON" + ]; + }; + dftd4 = dftd4; + }; + + # 2. The Development Environment (nix develop) + devShells.${system}.default = pkgs.mkShell { + packages = with pkgs; [ + cmake + cargo + gcc + clang-tools + gdb + ]; + + # Environment variables for the shell + shellHook = '' + exec zsh + ''; + }; + }; +} From 34c6d0de60e628627dbd466747a97540c900398f Mon Sep 17 00:00:00 2001 From: LucasMilitao Date: Sun, 25 Jan 2026 21:29:49 -0300 Subject: [PATCH 03/10] Improved on building each library as its own package for caching --- 3rdparty/CMakeLists.txt | 15 +++++++++++---- 3rdparty/nix/dftd4.nix | 16 ++++++++++++---- 3rdparty/nix/lbfgspp.nix | 35 +++++++++++++++++++++++++++++++++++ CMakeLists.txt | 15 +++++++++++++++ flake.nix | 25 +++++++++++++------------ 5 files changed, 86 insertions(+), 20 deletions(-) create mode 100644 3rdparty/nix/lbfgspp.nix diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index d32a74ff2..c80c07684 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -1,5 +1,6 @@ set(CMAKE_UNITY_BUILD OFF) +if (NOT NIX_BUILD) CPMAddPackage( NAME fmt GITHUB_REPOSITORY "fmtlib/fmt" @@ -14,6 +15,8 @@ CPMAddPackage( VERSION "1.x" ) +endif () + if(NOT "${USE_SYSTEM_TBB}") set(TBB_OPTIONS "") @@ -30,7 +33,7 @@ endif() if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") list(APPEND TBB_OPTIONS "CMAKE_CXX_FLAGS=-O2 -fno-stack-clash-protection -fno-fcf-protection") endif() - +if (NOT NIX_BUILD) CPMAddPackage( NAME oneTBB GITHUB_REPOSITORY "uxlfoundation/oneTBB" @@ -38,7 +41,9 @@ CPMAddPackage( OPTIONS ${TBB_OPTIONS} ) endif() +endif() +if (NOT NIX_BUILD) CPMAddPackage( NAME unordered_dense GITHUB_REPOSITORY "martinus/unordered_dense" @@ -59,6 +64,7 @@ CPMAddPackage( VERSION "2.4.2" ) +endif() if("${USE_MLX}") CPMAddPackage( NAME mlx @@ -66,12 +72,13 @@ CPMAddPackage( VERSION "0.6.0" ) else() +if (NOT NIX_BUILD) CPMAddPackage( NAME "nlohmann_json" GITHUB_REPOSITORY "nlohmann/json" VERSION "3.11.3" ) - +endif() endif() if(NOT "${USE_SYSTEM_EIGEN}") @@ -88,7 +95,7 @@ if("${eigen3_ADDED}") endif() endif() - +if (NOT NIX_BUILD) CPMAddPackage( NAME gemmi GITHUB_REPOSITORY project-gemmi/gemmi @@ -122,7 +129,7 @@ if("${LBFGSpp_ADDED}") add_library(LBFGSpp::LBFGSpp INTERFACE IMPORTED GLOBAL) target_include_directories(LBFGSpp::LBFGSpp INTERFACE "${LBFGSpp_SOURCE_DIR}/include") endif() - +endif() if("${USE_QCINT}") set(LIBCINT_REPOSITORY "sunqm/qcint") else() diff --git a/3rdparty/nix/dftd4.nix b/3rdparty/nix/dftd4.nix index 20fb597f1..4ac49d313 100644 --- a/3rdparty/nix/dftd4.nix +++ b/3rdparty/nix/dftd4.nix @@ -63,10 +63,6 @@ stdenv.mkDerivation rec { "-DDFTD4_USE_EIGEN=ON" "-DBUILD_SHARED_LIBS=OFF" ]; - outputs = [ - "out" - "dev" - ]; doCheck = true; @@ -79,7 +75,19 @@ stdenv.mkDerivation rec { preCheck = '' export OMP_NUM_THREADS=2 ''; + postInstall = '' + # 3. SIMPLIFIED: Everything is already in $out. + # Just fix the missing Config file in place. + + TARGET_DIR="$out/lib/cmake/dftd4" + # Ensure the directory exists (just in case) + mkdir -p "$TARGET_DIR" + + cat > "$TARGET_DIR/dftd4Config.cmake" <<'EOF' + include(''${CMAKE_CURRENT_LIST_DIR}/dftd4Targets.cmake) + EOF + ''; meta = { description = "Generally Applicable Atomic-Charge Dependent London Dispersion Correction"; mainProgram = "dftd4"; diff --git a/3rdparty/nix/lbfgspp.nix b/3rdparty/nix/lbfgspp.nix new file mode 100644 index 000000000..ad49239a2 --- /dev/null +++ b/3rdparty/nix/lbfgspp.nix @@ -0,0 +1,35 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + eigen, +}: + +stdenv.mkDerivation rec { + pname = "lbfgspp"; + version = "0.4.0"; # Check GitHub for the latest release + + src = fetchFromGitHub { + owner = "yixuan"; + repo = "LBFGSpp"; + rev = "v${version}"; + hash = "sha256-PUzZ2jUVgHq1LJDWIWW93KnV7vBBEdZlspOrE5TcYBc="; + }; + + nativeBuildInputs = [ cmake ]; + + propagatedBuildInputs = [ eigen ]; + + cmakeFlags = [ + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ]; + + meta = with lib; { + description = "A header-only C++ library for L-BFGS and L-BFGS-B algorithms"; + homepage = "https://github.com/yixuan/LBFGSpp"; + license = licenses.mit; + platforms = platforms.all; + maintainers = [ ]; + }; +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 41bb1cdd5..47738751b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,21 @@ endif() include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPM.cmake") # don't use install commands from third party +if (NIX_BUILD) +find_package(fmt REQUIRED) +find_package(spdlog REQUIRED) +add_library(spdlog::spdlog ALIAS spdlog::spdlog_header_only) +find_package(TBB REQUIRED) +find_package(scn REQUIRED) +find_package(unordered_dense REQUIRED) +find_package(CLI11 REQUIRED) +find_package(nlohmann_json REQUIRED) +find_package(gemmi REQUIRED) +add_library(gemmi::gemmi ALIAS gemmi::gemmi_cpp) +find_package(dftd4 REQUIRED) +find_package(lbfgspp REQUIRED) +add_library(LBFGSpp::LBFGSpp ALIAS lbfgspp) +endif () add_subdirectory(3rdparty EXCLUDE_FROM_ALL) add_subdirectory(include) add_subdirectory(src) diff --git a/flake.nix b/flake.nix index 1ac671616..1cfbc9171 100644 --- a/flake.nix +++ b/flake.nix @@ -35,6 +35,8 @@ }); dftd4 = pkgs.callPackage ./3rdparty/nix/dftd4.nix { }; + + lbfgspp = pkgs.callPackage ./3rdparty/nix/lbfgspp.nix { }; scnlib = pkgs.callPackage ./3rdparty/nix/scnlib.nix { fast-float = fast-float-6_1_6; }; @@ -74,7 +76,13 @@ pkgs.nlohmann_json pkgs.eigen_3_4_0 pkgs.libxc + pkgs.cli11 + pkgs.gemmi + pkgs.zlib scnlib + dftd4 + lbfgspp + fast-float-6_1_6 ]; nativeBuildInputs = [ pkgs.cmake @@ -84,20 +92,13 @@ cmakeFlags = [ "-GNinja" "-DCPM_DOWNLOAD_LOCATION=${pkgs.cpm-cmake}/share/cpm/CPM.cmake" + "-DUSE_SYSTEM_EIGEN=ON" "-DCPM_USE_LOCAL_PACKAGES=ON" - "-DCPM_spdlog_SOURCE=${pkgs.spdlog.src}" - "-DCPM_oneTBB_SOURCE=${pkgs.onetbb.src}" - "-DCPM_scnlib_SOURCE=${scnlib.src}" - "-DCPM_eigen3_SOURCE=${pkgs.eigen_3_4_0.src}" "-DCPM_gemmi_SOURCE=${gemmi.src}" - "-DCPM_CLI11_SOURCE=${cli11-src}" - "-DCPM_fmt_SOURCE=${pkgs.fmt.src}" "-DCPM_nlohmann_json_SOURCE=${pkgs.nlohmann_json.src}" "-DCPM_Libxc_SOURCE=${pkgs.libxc.src}" "-DCPM_libcint_SOURCE=${libcint_src}" - "-DCPM_unordered_dense_SOURCE=${pkgs.unordered_dense.src}" "-DCPM_tomlplusplus_SOURCE=${pkgs.tomlplusplus.src}" - "-DCPM_dftd4_cpp_SOURCE=${dftd4.src}" "-DCPM_LBFGSpp_SOURCE=${lbfgspp-src}" "-DFETCHCONTENT_SOURCE_DIR_FAST_FLOAT=${fast-float-6_1_6.src}" "-DNIX_BUILD=ON" @@ -113,13 +114,13 @@ cargo gcc clang-tools + spdlog + lbfgspp gdb + dftd4.dev + pkg-config ]; - # Environment variables for the shell - shellHook = '' - exec zsh - ''; }; }; } From 2898e3c4f6d6848bb34809b809f058e3080e4e69 Mon Sep 17 00:00:00 2001 From: LucasMilitao Date: Sun, 25 Jan 2026 22:04:10 -0300 Subject: [PATCH 04/10] I have to solve some includes, but the dependencies seen fine. --- .gitignore | 2 ++ 3rdparty/CMakeLists.txt | 8 ++--- 3rdparty/nix/libcint.nix | 71 ++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 ++ flake.nix | 43 +++--------------------- 5 files changed, 84 insertions(+), 42 deletions(-) create mode 100644 3rdparty/nix/libcint.nix diff --git a/.gitignore b/.gitignore index 57b9e1e6e..f909ee667 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,5 @@ coverage/ *.cube *.pgrid *.ply +.direnv +.envrc diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index c80c07684..6072f6d95 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -142,7 +142,7 @@ endif () # Add compiler flags to fix the implicit function declaration error set(LIBCINT_C_FLAGS "-Wno-implicit-function-declaration -Wno-deprecated-non-prototype -D_GNU_SOURCE") - +if (NOT NIX_BUILD) CPMAddPackage( NAME libcint GITHUB_REPOSITORY "${LIBCINT_REPOSITORY}" @@ -159,6 +159,7 @@ CPMAddPackage( ${LIBCINT_BUILD_TYPE} VERSION "6.1.2" ) +endif() if (libcint_ADDED AND NOT NIX_BUILD) file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) message(WARNING "ADDED LIBCINT") @@ -171,7 +172,7 @@ if(TARGET cint) -Wno-deprecated-non-prototype ) endif() - +if (NOT NIX_BUILD) add_library(libcint::libcint INTERFACE IMPORTED GLOBAL) target_link_libraries(libcint::libcint INTERFACE cint) target_include_directories( @@ -180,7 +181,7 @@ target_include_directories( "${libcint_SOURCE_DIR}/src" "${libcint_BINARY_DIR}/include" ) - +endif() if(NOT "${USE_SYSTEM_LIBXC}") CPMAddPackage( NAME Libxc @@ -199,7 +200,6 @@ target_include_directories( "${Libxc_BINARY_DIR}/src" "${Libxc_BINARY_DIR}" ) - endif() diff --git a/3rdparty/nix/libcint.nix b/3rdparty/nix/libcint.nix new file mode 100644 index 000000000..e6431400e --- /dev/null +++ b/3rdparty/nix/libcint.nix @@ -0,0 +1,71 @@ +{ + stdenv, + lib, + fetchFromGitHub, + cmake, + blas, + # Check Inputs + python3, +}: + +stdenv.mkDerivation rec { + pname = "libcint"; + version = "6.1.2"; + + src = fetchFromGitHub { + owner = "peterspackman"; + repo = "libcint"; + rev = "master"; + hash = "sha256-JWk1B+Fz5nHxnGI5WlSynNqvkqIRvkbba8Nx3I5Tziw="; + }; + + postPatch = '' + sed -i 's/libcint.so/libcint${stdenv.hostPlatform.extensions.sharedLibrary}/g' testsuite/*.py + mkdir -p $out/lib/cmake/libcint + cat > $out/lib/cmake/libcint/libcintConfig.cmake < Date: Sun, 1 Feb 2026 16:35:26 -0300 Subject: [PATCH 05/10] Fixed nix build --- 3rdparty/CMakeLists.txt | 1 - 3rdparty/nix/dftd4.nix | 13 ++++++------- 3rdparty/nix/gemmi.nix | 29 +++++++++++++++++++++++++++++ CMakeLists.txt | 1 - flake.lock | 6 +++--- flake.nix | 23 +++++++++++++++++++---- 6 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 3rdparty/nix/gemmi.nix diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 6072f6d95..d98d9d57e 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -162,7 +162,6 @@ CPMAddPackage( endif() if (libcint_ADDED AND NOT NIX_BUILD) file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) - message(WARNING "ADDED LIBCINT") endif () # Apply the flags to the target after it's created diff --git a/3rdparty/nix/dftd4.nix b/3rdparty/nix/dftd4.nix index 4ac49d313..16f6d4315 100644 --- a/3rdparty/nix/dftd4.nix +++ b/3rdparty/nix/dftd4.nix @@ -76,16 +76,15 @@ stdenv.mkDerivation rec { export OMP_NUM_THREADS=2 ''; postInstall = '' - # 3. SIMPLIFIED: Everything is already in $out. - # Just fix the missing Config file in place. - TARGET_DIR="$out/lib/cmake/dftd4" + mkdir -p "$TARGET_DIR" - # Ensure the directory exists (just in case) - mkdir -p "$TARGET_DIR" + cat > "$TARGET_DIR/dftd4Config.cmake" < "$TARGET_DIR/dftd4Config.cmake" <<'EOF' - include(''${CMAKE_CURRENT_LIST_DIR}/dftd4Targets.cmake) + set_target_properties(dftd4::dftd4 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "\''${CMAKE_CURRENT_LIST_DIR}/../../../include/dftd4" + ) EOF ''; meta = { diff --git a/3rdparty/nix/gemmi.nix b/3rdparty/nix/gemmi.nix new file mode 100644 index 000000000..b11fb2342 --- /dev/null +++ b/3rdparty/nix/gemmi.nix @@ -0,0 +1,29 @@ +{ pkgs, stdenv, ... }: +stdenv.mkDerivation rec { + pname = "gemmi"; + version = "0.6.5"; + src = pkgs.fetchFromGitHub { + owner = "project-gemmi"; + repo = "gemmi"; + tag = "v${version}"; + hash = "sha256-JJ6YBsdL3J+d0ihuJ2Nowp40c7FkDdfTqBhDrxWgSFw="; + }; + dontBuild = true; + dontConfigure = true; + + installPhase = '' + mkdir -p $out/include + cp -r include/* $out/include/ + TARGET_DIR="$out/lib/cmake/gemmi" + mkdir -p "$TARGET_DIR" + cat > "$TARGET_DIR/gemmiConfig.cmake" < Date: Fri, 6 Feb 2026 23:27:17 -0300 Subject: [PATCH 06/10] Moved src version logic to flake.nix to centralize it --- 3rdparty/nix/dftd4.nix | 54 ++++++++++-------------- 3rdparty/nix/lbfgspp.nix | 16 +++----- 3rdparty/nix/libcint.nix | 13 ++---- flake.lock | 89 ++++++++++++++++++++++++++++++++++++++++ flake.nix | 62 ++++++++++++++++++++-------- 5 files changed, 165 insertions(+), 69 deletions(-) diff --git a/3rdparty/nix/dftd4.nix b/3rdparty/nix/dftd4.nix index 16f6d4315..4944c11ef 100644 --- a/3rdparty/nix/dftd4.nix +++ b/3rdparty/nix/dftd4.nix @@ -2,22 +2,13 @@ stdenv, lib, fetchFromGitHub, - gfortran, buildType ? "cmake", - cmake, - meson, - ninja, - pkg-config, - python3, - blas, - lapack, - mctc-lib, - mstore, - multicharge, - eigen, + pkgs, + src, + version, }: -assert !blas.isILP64 && !lapack.isILP64; +assert !pkgs.blas.isILP64 && !pkgs.lapack.isILP64; assert ( builtins.elem buildType [ "meson" @@ -25,34 +16,31 @@ assert ( ] ); -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "dftd4"; - version = "2.2.0"; - src = fetchFromGitHub { - owner = "peterspackman"; - repo = "cpp-d4"; - rev = "main"; - hash = "sha256-aBWw9DGt0s5nGvmHQZzuZDPTWRGCsaKCrp4NylHOzqw="; - }; + inherit version; + inherit src; - nativeBuildInputs = [ - gfortran - pkg-config - python3 - ] - ++ lib.optionals (buildType == "meson") [ - meson - ninja - ] - ++ lib.optional (buildType == "cmake") cmake; + nativeBuildInputs = + with pkgs; + [ + gfortran + pkg-config + python3 + ] + ++ lib.optionals (buildType == "meson") [ + meson + ninja + ] + ++ lib.optional (buildType == "cmake") cmake; - buildInputs = [ + buildInputs = with pkgs; [ blas lapack eigen ]; - propagatedBuildInputs = [ + propagatedBuildInputs = with pkgs; [ mctc-lib mstore multicharge diff --git a/3rdparty/nix/lbfgspp.nix b/3rdparty/nix/lbfgspp.nix index ad49239a2..34f51f4ee 100644 --- a/3rdparty/nix/lbfgspp.nix +++ b/3rdparty/nix/lbfgspp.nix @@ -1,22 +1,16 @@ { lib, stdenv, - fetchFromGitHub, cmake, eigen, + version, + src, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "lbfgspp"; - version = "0.4.0"; # Check GitHub for the latest release - - src = fetchFromGitHub { - owner = "yixuan"; - repo = "LBFGSpp"; - rev = "v${version}"; - hash = "sha256-PUzZ2jUVgHq1LJDWIWW93KnV7vBBEdZlspOrE5TcYBc="; - }; - + inherit src; + inherit version; nativeBuildInputs = [ cmake ]; propagatedBuildInputs = [ eigen ]; diff --git a/3rdparty/nix/libcint.nix b/3rdparty/nix/libcint.nix index e6431400e..7a6993f03 100644 --- a/3rdparty/nix/libcint.nix +++ b/3rdparty/nix/libcint.nix @@ -4,20 +4,15 @@ fetchFromGitHub, cmake, blas, - # Check Inputs python3, + src, + version, }: stdenv.mkDerivation rec { pname = "libcint"; - version = "6.1.2"; - - src = fetchFromGitHub { - owner = "peterspackman"; - repo = "libcint"; - rev = "master"; - hash = "sha256-JWk1B+Fz5nHxnGI5WlSynNqvkqIRvkbba8Nx3I5Tziw="; - }; + inherit version; + inherit src; postPatch = '' sed -i 's/libcint.so/libcint${stdenv.hostPlatform.extensions.sharedLibrary}/g' testsuite/*.py diff --git a/flake.lock b/flake.lock index 5effec3dc..efad62c9f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,89 @@ { "nodes": { + "dftd4-src": { + "flake": false, + "locked": { + "lastModified": 1741937608, + "narHash": "sha256-aBWw9DGt0s5nGvmHQZzuZDPTWRGCsaKCrp4NylHOzqw=", + "owner": "peterspackman", + "repo": "cpp-d4", + "rev": "792e97c45699faf96813dd1df654fea79ab4fdcc", + "type": "github" + }, + "original": { + "owner": "peterspackman", + "ref": "main", + "repo": "cpp-d4", + "type": "github" + } + }, + "fast-float-src": { + "flake": false, + "locked": { + "lastModified": 1725816977, + "narHash": "sha256-MEJMPQZZZhOFiKlPAKIi0zVzaJBvjAlbSyg3wLOQ1fg=", + "owner": "fastfloat", + "repo": "fast_float", + "rev": "00c8c7b0d5c722d2212568d915a39ea73b08b973", + "type": "github" + }, + "original": { + "owner": "fastfloat", + "ref": "v6.1.6", + "repo": "fast_float", + "type": "github" + } + }, + "gemmi-src": { + "flake": false, + "locked": { + "lastModified": 1708169757, + "narHash": "sha256-JJ6YBsdL3J+d0ihuJ2Nowp40c7FkDdfTqBhDrxWgSFw=", + "owner": "project-gemmi", + "repo": "gemmi", + "rev": "e471b13704c3bb0a6fc53c70b838df0dfa2088e1", + "type": "github" + }, + "original": { + "owner": "project-gemmi", + "ref": "v0.6.5", + "repo": "gemmi", + "type": "github" + } + }, + "lbfgspp-src": { + "flake": false, + "locked": { + "lastModified": 1745147553, + "narHash": "sha256-PUzZ2jUVgHq1LJDWIWW93KnV7vBBEdZlspOrE5TcYBc=", + "owner": "yixuan", + "repo": "LBFGSpp", + "rev": "c524a407fb85b74807f53de5a3ca2ddbcc164e54", + "type": "github" + }, + "original": { + "owner": "yixuan", + "ref": "v0.4.0", + "repo": "LBFGSpp", + "type": "github" + } + }, + "libcint-src": { + "flake": false, + "locked": { + "lastModified": 1752539348, + "narHash": "sha256-JWk1B+Fz5nHxnGI5WlSynNqvkqIRvkbba8Nx3I5Tziw=", + "owner": "peterspackman", + "repo": "libcint", + "rev": "644c68c695ac4f20fb5838391a01931e9484650b", + "type": "github" + }, + "original": { + "owner": "peterspackman", + "repo": "libcint", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1769789167, @@ -18,6 +102,11 @@ }, "root": { "inputs": { + "dftd4-src": "dftd4-src", + "fast-float-src": "fast-float-src", + "gemmi-src": "gemmi-src", + "lbfgspp-src": "lbfgspp-src", + "libcint-src": "libcint-src", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 92528bac7..746f0c768 100644 --- a/flake.nix +++ b/flake.nix @@ -2,32 +2,63 @@ description = "Open Computational Chemestry"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + fast-float-src = { + url = "github:fastfloat/fast_float?ref=v6.1.6"; + flake = false; + }; + dftd4-src = { + url = "github:peterspackman/cpp-d4?ref=main"; + flake = false; + }; + lbfgspp-src = { + url = "github:yixuan/LBFGSpp?ref=v0.4.0"; + flake = false; + }; + libcint-src = { + url = "github:peterspackman/libcint"; + flake = false; + }; + gemmi-src = { + url = "github:project-gemmi/gemmi?ref=v0.6.5"; + flake = false; + }; }; outputs = { self, nixpkgs, + fast-float-src, + dftd4-src, + lbfgspp-src, + libcint-src, + gemmi-src, }: let - fast-float-6_1_6 = pkgs.fast-float.overrideAttrs (old: rec { + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + fast-float-6_1_6 = pkgs.fast-float.overrideAttrs { + src = fast-float-src; version = "6.1.6"; - src = pkgs.fetchFromGitHub { - owner = "fastfloat"; - repo = "fast_float"; - rev = "v${version}"; - hash = "sha256-MEJMPQZZZhOFiKlPAKIi0zVzaJBvjAlbSyg3wLOQ1fg="; - }; - }); - dftd4 = pkgs.callPackage ./3rdparty/nix/dftd4.nix { }; - lbfgspp = pkgs.callPackage ./3rdparty/nix/lbfgspp.nix { }; - libcint = pkgs.callPackage ./3rdparty/nix/libcint.nix { }; + }; scnlib = pkgs.callPackage ./3rdparty/nix/scnlib.nix { fast-float = fast-float-6_1_6; }; - gemmi = pkgs.callPackage ./3rdparty/nix/gemmi.nix { }; - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - + dftd4 = pkgs.callPackage ./3rdparty/nix/dftd4.nix { + src = dftd4-src; + version = "main"; + }; + lbfgspp = pkgs.callPackage ./3rdparty/nix/lbfgspp.nix { + src = lbfgspp-src; + version = "0.4.0"; + }; + libcint = pkgs.callPackage ./3rdparty/nix/libcint.nix { + version = "6.1.2"; + src = libcint-src; + }; + gemmi = pkgs.callPackage ./3rdparty/nix/gemmi.nix { + version = "0.6.5"; + src = gemmi-src; + }; in { # 1. The Build Artifact (nix build) @@ -102,7 +133,6 @@ libcint pkg-config ]; - }; }; } From 4b78e3d44140f0787c54c6388a94b6355d1ea321 Mon Sep 17 00:00:00 2001 From: LucasMilitao Date: Mon, 23 Feb 2026 19:11:38 -0300 Subject: [PATCH 07/10] temp --- 3rdparty/CMakeLists.txt | 4 +- CMakeLists.txt | 1 + flake.nix | 97 ++++++++++++++++++++++++--------- pyproject.toml | 9 ++- src/occpy.cpp | 2 +- src/python/crystal_bindings.cpp | 1 + 6 files changed, 85 insertions(+), 29 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index d98d9d57e..66362dc1f 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -161,7 +161,7 @@ CPMAddPackage( ) endif() if (libcint_ADDED AND NOT NIX_BUILD) - file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) +# file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) endif () # Apply the flags to the target after it's created @@ -202,7 +202,7 @@ target_include_directories( endif() -if("${WITH_PYTHON_BINDINGS}") +if("${WITH_PYTHON_BINDINGS}" AND NOT NIX_BUILD) CPMAddPackage( NAME nanobind GITHUB_REPOSITORY "wjakob/nanobind" diff --git a/CMakeLists.txt b/CMakeLists.txt index 28e72c585..739d604bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,6 +145,7 @@ find_package(lbfgspp REQUIRED) add_library(LBFGSpp::LBFGSpp ALIAS lbfgspp) find_package(libcint REQUIRED) find_package(Libxc REQUIRED) +find_package(nanobind REQUIRED) endif () add_subdirectory(3rdparty EXCLUDE_FROM_ALL) add_subdirectory(include) diff --git a/flake.nix b/flake.nix index 746f0c768..7dadd2c29 100644 --- a/flake.nix +++ b/flake.nix @@ -59,34 +59,37 @@ version = "0.6.5"; src = gemmi-src; }; + python = pkgs.python314.withPackages (ps: [ ps.nanobind ]); + CMAKE_PREFIX_PATH = "${python}/${python.sitePackages}"; in { # 1. The Build Artifact (nix build) packages.${system} = { + python = python; default = pkgs.stdenv.mkDerivation { name = "occ"; src = ./.; postPatch = '' rm cmake/FindLibxc.cmake ''; - buildInputs = [ - pkgs.cmake - # Project dependencies installed with cpm.cmake - pkgs.cpm-cmake - pkgs.pkg-config - pkgs.spdlog - pkgs.onetbb - pkgs.tomlplusplus - pkgs.unordered_dense - pkgs.fmt - pkgs.nlohmann_json - pkgs.eigen_3_4_0 - pkgs.libxc.dev - pkgs.cli11 + buildInputs = with pkgs; [ + cmake + python + cpm-cmake + pkg-config + spdlog + onetbb + tomlplusplus + unordered_dense + fmt + nlohmann_json + eigen_3_4_0 + libxc.dev + cli11 gemmi - pkgs.ccache - pkgs.gfortran.cc.lib - pkgs.zlib + ccache + gfortran.cc.lib + zlib scnlib dftd4 libcint @@ -103,6 +106,7 @@ CCACHE_DIR = "/var/cache/ccache"; CCACHE_BASEDIR = "$NIX_BUILD_TOP"; CCACHE_SLOPPINESS = "locale,time_macros"; + CMAKE_PREFIX_PATH = "${CMAKE_PREFIX_PATH}"; }; cmakeFlags = [ "-GNinja" @@ -113,6 +117,7 @@ "-DCMAKE_C_COMPILER_LAUNCHER=${pkgs.ccache}/bin/ccache" "-DCMAKE_CXX_COMPILER_LAUNCHER=${pkgs.ccache}/bin/ccache" "-DNIX_BUILD=ON" + "-DWITH_PYTHON_BINDINGS=ON" ]; NIX_LDFLAGS = "-lquadmath"; }; @@ -122,17 +127,59 @@ # 2. The Development Environment (nix develop) devShells.${system}.default = pkgs.mkShell { - packages = with pkgs; [ - cmake - cargo + inputsFrom = [ self.packages.${system}.default ]; + + # Extra development-only tools + nativeBuildInputs = with pkgs; [ + llvm gcc - clang-tools - spdlog - lbfgspp gdb - libcint - pkg-config + ninja + clang-tools + lld ]; + + shellHook = + let + # List all dependencies that CMake needs to find + deps = [ + pkgs.spdlog + pkgs.onetbb + pkgs.tomlplusplus + pkgs.unordered_dense + pkgs.fmt + pkgs.nlohmann_json + pkgs.eigen_3_4_0 + pkgs.libxc + pkgs.cli11 + gemmi + scnlib + dftd4 + libcint + lbfgspp + fast-float-6_1_6 + ]; + runtimeLibs = with pkgs; [ + stdenv.cc.cc.lib + zlib + glib + ]; + buildInputs = with pkgs; [ + uv + ]; + in + '' + # Construct CMAKE_PREFIX_PATH by joining the store paths with semicolons + export CMAKE_PREFIX_PATH="${ + pkgs.lib.makeSearchPathOutput "dev" "" deps + }:${pkgs.lib.makeBinPath deps}" + + # Also export PKG_CONFIG_PATH just in case some libs don't have CMake configs + export PKG_CONFIG_PATH="${pkgs.lib.makeSearchPathOutput "dev" "lib/pkgconfig" deps}:./cmake" + + export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath runtimeLibs}" + ''; + }; }; } diff --git a/pyproject.toml b/pyproject.toml index 0376c79e3..7b32f1f5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,4 +52,11 @@ MACOSX_DEPLOYMENT_TARGET = "10.15" # Pyodide doesn't support C++ exceptions - disable them and abort on throw [tool.cibuildwheel.pyodide.environment] -CMAKE_ARGS = "-DCMAKE_CXX_FLAGS=-fno-exceptions" +CMAKE_ARGS = "-DCMAKE_CXX_FLAGS=-fno-exceptions -DWITH_PYTHON_BINDINGS=ON" + +[tool.uv.workspace] +members = [ + "tests-py", + ".", + ".", +] diff --git a/src/occpy.cpp b/src/occpy.cpp index 9b1a2a262..274bff1ce 100644 --- a/src/occpy.cpp +++ b/src/occpy.cpp @@ -23,7 +23,7 @@ namespace nb = nanobind; -NB_MODULE(_occpy, m) { +__attribute__ ((visibility ("default"))) NB_MODULE(_occpy, m) { // Register core submodule auto core = register_core_bindings(m); auto cg = register_cg_bindings(m); diff --git a/src/python/crystal_bindings.cpp b/src/python/crystal_bindings.cpp index f36d89653..b891ca187 100644 --- a/src/python/crystal_bindings.cpp +++ b/src/python/crystal_bindings.cpp @@ -121,6 +121,7 @@ nb::module_ register_crystal_bindings(nb::module_ &m) { const UnitCell &>()) .def("symmetry_unique_molecules", &Crystal::symmetry_unique_molecules) .def("symmetry_unique_dimers", &Crystal::symmetry_unique_dimers) + .def("symmetry_operations", &Crystal::symmetry_operations) .def("unit_cell", &Crystal::unit_cell) .def("unit_cell_molecules", &Crystal::unit_cell_molecules) .def("unit_cell_atoms", &Crystal::unit_cell_atoms) From 1703b71ecfe7f92ea25c08a0cca2342827e57efe Mon Sep 17 00:00:00 2001 From: LucasMilitao Date: Mon, 23 Feb 2026 19:12:00 -0300 Subject: [PATCH 08/10] .clangd --- .clangd | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .clangd diff --git a/.clangd b/.clangd new file mode 100644 index 000000000..c7c821813 --- /dev/null +++ b/.clangd @@ -0,0 +1,3 @@ +CompileFlags: # Tweak the parse settings, example directory given to show format + Add: + - "-I./include" From 94ab8ece4cbe1c8c5a298f06d245ace882cc4ccf Mon Sep 17 00:00:00 2001 From: LucasMilitao Date: Mon, 23 Feb 2026 19:15:49 -0300 Subject: [PATCH 09/10] I reverted this because I think it is a leftover of other branch --- 3rdparty/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 66362dc1f..740086837 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -161,7 +161,7 @@ CPMAddPackage( ) endif() if (libcint_ADDED AND NOT NIX_BUILD) -# file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) + file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) endif () # Apply the flags to the target after it's created From c94081b21026d498909c78cc7dbfd5cee54862d3 Mon Sep 17 00:00:00 2001 From: LucasMilitao Date: Mon, 23 Feb 2026 19:40:53 -0300 Subject: [PATCH 10/10] I think it is now right --- 3rdparty/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 740086837..5d1093751 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -160,10 +160,6 @@ CPMAddPackage( VERSION "6.1.2" ) endif() -if (libcint_ADDED AND NOT NIX_BUILD) - file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/FindQUADMATH.cmake ${libcint_SOURCE_DIR}/cmake/FindQUADMATH.cmake) -endif () - # Apply the flags to the target after it's created if(TARGET cint) target_compile_options(cint PRIVATE