casadi: drop abandoned clang_compiler interface

Co-authored-by: Luna <782440+LunNova@users.noreply.github.com>
This commit is contained in:
Guilhem Saurel
2025-10-01 09:54:19 +02:00
co-authored by Luna
parent dd4e5b4a65
commit d2d5f2d875
2 changed files with 3 additions and 50 deletions
-35
View File
@@ -1,35 +0,0 @@
diff --git a/casadi/interfaces/clang/clang_compiler.hpp b/casadi/interfaces/clang/clang_compiler.hpp
index 7f54853..9f8d4b1 100644
--- a/casadi/interfaces/clang/clang_compiler.hpp
+++ b/casadi/interfaces/clang/clang_compiler.hpp
@@ -52,7 +52,7 @@
#include "llvm/IR/LLVMContext.h"
//#include "llvm/IR/Verifier.h"
#include <llvm/Support/FileSystem.h>
-#include <llvm/Support/Host.h>
+#include <llvm/TargetParser/Host.h>
#include <llvm/Support/ManagedStatic.h>
#include <llvm/Support/Path.h>
#include <llvm/Support/TargetSelect.h>
diff --git a/cmake/FindCLANG.cmake b/cmake/FindCLANG.cmake
index 4edf60b..f23a348 100644
--- a/cmake/FindCLANG.cmake
+++ b/cmake/FindCLANG.cmake
@@ -16,7 +16,7 @@ set(CLANG_CXX_FLAGS "-fPIC -fvisibility-inlines-hidden -ffunction-sections -fdat
set(CLANG_INCLUDE_DIR ${LLVM_INSTALL_PREFIX}/include)
# All clang libraries
-set(CLANG_DEP clangFrontend clangDriver clangCodeGen clangRewriteFrontend clangSerialization clangParse clangSema clangAnalysis clangEdit clangAST clangLex clangBasic ${LLVM_DEP})
+set(CLANG_DEP clangFrontend clangDriver clangCodeGen clangRewriteFrontend clangSerialization clangParse clangSema clangAPINotes clangAnalysis clangEdit clangAST clangLex clangBasic ${LLVM_DEP})
# Get libraries
set(CLANG_LIBRARIES)
@@ -86,7 +86,7 @@ set(CLANG_INCLUDE_DIR ${CLANG_LLVM_INCLUDE_DIR})
# All clang libraries
set(CLANG_DEP clangFrontend clangDriver clangCodeGen clangRewriteFrontend clangSerialization
- clangParse clangSema clangAnalysis clangEdit clangAST clangLex clangBasic)
+ clangParse clangSema clangAPINotes clangAnalysis clangEdit clangAST clangLex clangBasic)
# Get libraries
foreach(D ${CLANG_DEP})
+3 -15
View File
@@ -48,10 +48,6 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
# update include file path and link with clangAPINotes
# https://github.com/casadi/casadi/issues/3969
./clang-19.diff
# Add missing include
# ref. https://github.com/casadi/casadi/pull/4192
(fetchpatch {
@@ -77,11 +73,6 @@ stdenv.mkDerivation (finalAttrs: {
"FATROP HPIPM" \
"FATROP hpipm"
# nix provide lib/clang headers in libclang, not in llvm.
substituteInPlace casadi/interfaces/clang/CMakeLists.txt --replace-fail \
'$'{CLANG_LLVM_LIB_DIR} \
${lib.getLib llvmPackages.libclang}/lib
# help casadi find its own libs
substituteInPlace casadi/core/casadi_os.cpp --replace-fail \
"std::vector<std::string> search_paths;" \
@@ -108,11 +99,6 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace casadi/interfaces/hpipm/hpipm_runtime.hpp --replace-fail \
"d_print_exp_tran_mat" \
"//d_print_exp_tran_mat"
# fix missing symbols
substituteInPlace cmake/FindCLANG.cmake --replace-fail \
"clangBasic)" \
"clangBasic clangASTMatchers clangSupport)"
'';
nativeBuildInputs = [
@@ -189,7 +175,9 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "WITH_TINYXML" true)
(lib.cmakeBool "WITH_BUILD_DSDP" true) # not sure where this come from
(lib.cmakeBool "WITH_DSDP" true)
(lib.cmakeBool "WITH_CLANG" true)
# "clang_compiler.cpp has basically been abandonded for several years", ref.
# https://github.com/casadi/casadi/issues/4225#issuecomment-3352552113
(lib.cmakeBool "WITH_CLANG" false)
(lib.cmakeBool "WITH_LAPACK" true)
(lib.cmakeBool "WITH_QPOASES" true)
(lib.cmakeBool "WITH_BLOCKSQP" true)