From 8807cd513c41eab4df234e2f3a352d63ce04e3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Sat, 28 Jun 2025 11:06:16 +0200 Subject: [PATCH] Continue conan integration --- CMakeLists.txt | 1 + CMakeUserPresets.json | 9 +++++++++ Makefile | 4 ++-- conanfile.py | 5 +++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 CMakeUserPresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f8fc06..14375ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ project(Folding ) find_package(Torch REQUIRED) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") if (POLICY CMP0135) cmake_policy(SET CMP0135 NEW) diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json new file mode 100644 index 0000000..0c93e81 --- /dev/null +++ b/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build_Debug/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index 64ae8fd..fd684f9 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,8 @@ build: ## Build a debug version of the project @echo ">>> Building Debug Folding..."; @if [ -d ./$(f_debug) ]; then rm -rf ./$(f_debug); fi @mkdir $(f_debug); - @conan install . --output-folder=$(f_debug) --build=missing - @cmake -S . -B $(f_debug) -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTING=ON + @conan install . --output-folder=$(f_debug) --build=missing --profile:build=default --profile:host=default + @cmake -S . -B $(f_debug) -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTING=ON -D CMAKE_TOOLCHAIN_FILE=$(f_debug)/conan_toolchain.cmake @echo ">>> Done"; opt = "" diff --git a/conanfile.py b/conanfile.py index 5d3d0a3..2b84ada 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,6 +1,7 @@ import re from conan import ConanFile from conan.tools.files import copy +from conan.tools.cmake import CMakeToolchain class FoldingConan(ConanFile): @@ -26,6 +27,10 @@ class FoldingConan(ConanFile): self.test_requires("arff-files/1.2.0") self.test_requires("fimdlp/2.0.1") + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + def init(self): # Read the CMakeLists.txt file to get the version with open("folding.hpp", "r") as f: