-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug build type #176
Comments
A friendly reminder about this. maybe we could use this other PR as a base: cc @ocefpaf |
hi everyone! a friendly reminder about this issue. additionally, it would be nice to have llvm assertion enabled. I can open an initial PR for that .. and if that is not ok to have it here .. I can proposal it as a new recipe on staged-recipe. thanks! |
I think we can publish a debug version in a dev/debug label. I'm not sure what was the verdict for the Python debug variant. |
Yeah, that shouldn't be the default install IMO. I also expect the debug builds to time out on our infrastructure (for osx, it already does about 50% of the time). You can open a PR and see if you can make it work, and if it does, I can point it to an appropriate branch. |
awesome! thank you so much @ocefpaf and @h-vetinari |
For reference, this is a patch to windows build that creates debug binaries (that don't also break ABI so I can continue to use clang from conda and link with Release MSVC runtime) of llvm-14 for me. I call conda build like diff --git a/recipe/bld.bat b/recipe/bld.bat
index 53fe8ef..fa24a36 100644
--- a/recipe/bld.bat
+++ b/recipe/bld.bat
@@ -9,9 +9,12 @@ set "CC=cl.exe"
set "CXX=cl.exe"
cmake -G "Ninja" ^
- -DCMAKE_BUILD_TYPE="Release" ^
+ -DCMAKE_BUILD_TYPE="Debug" ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^
+ -DCMAKE_CXX_FLAGS_DEBUG=/Z7 ^
+ -DLLVM_USE_CRT_DEBUG=MD ^
+ -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF ^
-DLLVM_USE_INTEL_JITEVENTS=ON ^
-DLLVM_ENABLE_LIBXML2=ON ^
-DLLVM_ENABLE_RTTI=ON ^
diff --git a/recipe/meta.yaml b/recipe/meta.yaml
index 1cb9131..508407f 100644
--- a/recipe/meta.yaml
+++ b/recipe/meta.yaml
@@ -16,7 +16,7 @@ source:
- patches/no-windows-symlinks.patch
build:
- number: 1
+ number: 2
merge_build_host: false
requirements: |
@gshimansky thank you so much for sharing. |
Adding to my previous comment, if you need a debug build of llvm, it is likely that you will still have to build it locally on your system:
|
thanks for the detailed explanation @gshimansky ! if so, maybe it could be feasible using a post-install (post-link) ... although maybe it is not a great approach .. |
It is not unfeasible to create a debug binary build of llvm but the users who install it may be disappointed because it wouldn't serve their needs. When I first started to build llvm with debug I thought that a ready binary would be great and I could debug my application without going through my own build of llvm. When I finished making changes to the build recipe I realized that even if there was a debug binary in conda-forge, I would most likely still had to modify it to make it suitable for my purpose and then had to go through a complete build process. |
got it .. makes sense! thank you so much @gshimansky for the detailed explanation! |
This is a patch for Linux build of llvm-14 to enable debug diff --git a/recipe/build.sh b/recipe/build.sh
index e009aae..8b0fe82 100644
--- a/recipe/build.sh
+++ b/recipe/build.sh
@@ -12,7 +12,7 @@ if [[ "$target_platform" == "linux-64" ]]; then
fi
if [[ "$CC_FOR_BUILD" != "" && "$CC_FOR_BUILD" != "$CC" ]]; then
- CMAKE_ARGS="${CMAKE_ARGS} -DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_C_COMPILER=$CC_FOR_BUILD;-DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD;-DCMAKE_C_FLAGS=-O2;-DCMAKE_CXX_FLAGS=-O2;-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${BUILD_PREFIX}/lib;-DCMAKE_MODULE_LINKER_FLAGS=;-DCMAKE_SHARED_LINKER_FLAGS=;-DCMAKE_STATIC_LINKER_FLAGS=;-DLLVM_INCLUDE_BENCHMARKS=OFF;"
+ CMAKE_ARGS="${CMAKE_ARGS} -DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_C_COMPILER=$CC_FOR_BUILD;-DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD;-DCMAKE_C_FLAGS=-O0;-DCMAKE_CXX_FLAGS=-O0;-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${BUILD_PREFIX}/lib;-DCMAKE_MODULE_LINKER_FLAGS=;-DCMAKE_SHARED_LINKER_FLAGS=;-DCMAKE_STATIC_LINKER_FLAGS=;-DLLVM_INCLUDE_BENCHMARKS=OFF;"
CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_HOST_TRIPLE=$(echo $HOST | sed s/conda/unknown/g) -DLLVM_DEFAULT_TARGET_TRIPLE=$(echo $HOST | sed s/conda/unknown/g)"
fi
@@ -23,7 +23,7 @@ if [[ "$target_platform" == "linux-ppc64le" ]]; then
fi
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
- -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_BUILD_TYPE=Debug \
-DHAVE_LIBEDIT=OFF \
-DLLVM_HAVE_LIBXAR=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
@@ -41,6 +41,9 @@ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DLLVM_BUILD_LLVM_DYLIB=yes \
-DLLVM_LINK_LLVM_DYLIB=yes \
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly \
+ -DLLVM_OPTIMIZE_SANITIZED_BUILDS=OFF \
+ -DCMAKE_CXX_FLAGS_DEBUG="-O0 -g" \
+ -DCMAKE_C_FLAGS_DEBUG="-O0 -g" \
${CMAKE_ARGS} \
-GNinja \
../llvm
diff --git a/recipe/meta.yaml b/recipe/meta.yaml
index 1cb9131..508407f 100644
--- a/recipe/meta.yaml
+++ b/recipe/meta.yaml
@@ -16,7 +16,7 @@ source:
- patches/no-windows-symlinks.patch
build:
- number: 1
+ number: 2
merge_build_host: false
requirements: I also had to rebuild clang, probably because when I built debug Linux version I didn't know about |
thanks for the example and for the explanation @gshimansky |
@gshimansky I didn't have too much progress on this topic .. but I started on this again today. |
Comment:
hi everyone! is there debug build type for llvm already available?
if not, I would like to know if would be possible to have a debug build type for that, maybe we could have it tagged in a different label, for example conda-forge/label/dev
thanks!
The text was updated successfully, but these errors were encountered: