-
Notifications
You must be signed in to change notification settings - Fork 125
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
Build error on manylinux_2_28_x64 with GCC 12.1.1 #69
Build error on manylinux_2_28_x64 with GCC 12.1.1 #69
Comments
I think that we want CMake to use CC for the assembler. We may need to add something like:
|
You might try adding this arg to
|
I have seen your edit just now. Adding SET(ASM_OPTIONS "-x assembler-with-cpp")
SET(CMAKE_ASM_FLAGS "${CFLAGS} ${ASM_OPTIONS}" ) before and after |
The above suggestion will do basically the same thing you attempted. Add the following code at line 193 (inside the tensorstore/tools/cmake/bazel_to_cmake/emit_cc.py Lines 187 to 192 in 5f189a8
for f in cc_srcs:
if f.endswith(".s") or f.endswith(".S"):
_builder.addtext(
f"""set_property(SOURCE {quote(f)} APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp")\n""") |
I get a brand new error during configure step when I do that:
|
Changing the offending line into |
yeah, quote is defined in cmake_builder, and so it would need to be imported. So, after that, does it build? |
Build is in progress right now: https://github.com/dzenanz/ITKIOOMEZarrNGFF/actions/runs/3624368376/jobs/6111273285. |
That still has the yasm/nasm error. |
I see that now. In updating other things I managed to regress the version of docker image. I just pushed an update. The new progress is here: https://github.com/dzenanz/ITKIOOMEZarrNGFF/actions/runs/3624503022/jobs/6111552269. |
Ok, that doesn't solve it. Perhaps try adding another line:
|
Trying it, status here: https://github.com/dzenanz/ITKIOOMEZarrNGFF/actions/runs/3624503022/jobs/6111867176. |
It may just be that we're missing the proper language target. Maybe all we need is to edit
|
But isn't the error message complaining about compiling |
The new build is in progress: https://github.com/dzenanz/ITKIOOMEZarrNGFF/actions/runs/3624767759/jobs/6112097306. |
Yeah, you're right. sorry. |
I am retrying with |
Still getting /bin/as. Another thing to try In the net_zlib workspace.bzl file, add the prefix as:
|
Trying it. The new status is here: https://github.com/dzenanz/ITKIOOMEZarrNGFF/actions/runs/3630535593/jobs/6123993672. |
It turns out I forgot a comma. Retrying: https://github.com/dzenanz/ITKIOOMEZarrNGFF/actions/runs/3631227206/jobs/6125579120. |
It still looks like the same error: https://github.com/dzenanz/ITKIOOMEZarrNGFF/actions/runs/3631227206/jobs/6125579322 |
I tried using GCC-11, and declaring language together with CMake project specification: |
What would be the best way to disable ZSTD from building? From CMake GUI I see just a few related options: Zstd_DIR, TENSORSTORE_USE_SYSTEM_ZSTD, FETCHCONTENT_SOURCE_DIR_ZSTD, FETCHCONTENT_UPDATES_DISCONNECTED_ZSTD. Is there an easy way to disable it, or do I have to modify TensorStore's build system to accomplish that? |
Use |
Looking at this again, perhaps I've been attacking the problem from the wrong angle. I think that I need to figure out how the
From your cmake build directory, is it possible to get |
Here is output from a local build:
Essentially the same as in CI. Content of set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/bazel/utils.bzl"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/__init__.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/bazel_skylib.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/bazel_tools_repo_utils.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/default.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/helpers.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/local_mirror.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/rules_cc.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/rules_nasm.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/rules_perl.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/rules_proto.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/bzl_library/third_party_http_archive.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/cmake_builder.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/cmake_target.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/emit_cc.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/evaluation.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/main.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/native_rules.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/native_rules_cc.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/native_rules_proto.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/package.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/platforms.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/__init__.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/bazel_glob.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/bazel_globals.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/bazel_target.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/common_providers.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/depset.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/ignored.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/invocation_context.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/label.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/provider.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/rule.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/select.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/starlark/struct.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/util.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/variable_substitution.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/tensorstore-src/tools/cmake/bazel_to_cmake/workspace.py"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/BUILD.bazel")
add_library(Zstd_zstdlib)
target_sources(Zstd_zstdlib PRIVATE
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/debug.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/entropy_common.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/error_private.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/fse_decompress.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/pool.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/threading.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/xxhash.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common/zstd_common.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/fse_compress.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/hist.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/huf_compress.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_compress.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_compress_literals.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_compress_sequences.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_compress_superblock.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_double_fast.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_fast.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_lazy.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_ldm.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstd_opt.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/compress/zstdmt_compress.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/decompress/huf_decompress.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/decompress/huf_decompress_amd64.S"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/decompress/zstd_ddict.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/decompress/zstd_decompress.c"
"/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/decompress/zstd_decompress_block.c")
set_property(TARGET Zstd_zstdlib PROPERTY LINKER_LANGUAGE "CXX")
set_property(SOURCE "/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/decompress/huf_decompress_amd64.S" PROPERTY LANGUAGE ASM)
set_property(SOURCE "/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/decompress/huf_decompress_amd64.S" APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp")
target_compile_definitions(Zstd_zstdlib PRIVATE "XXH_NAMESPACE=ZSTD_")
target_compile_definitions(Zstd_zstdlib PUBLIC "ZSTDLIB_VISIBLE=" "ZSTDLIB_HIDDEN=")
target_compile_options(Zstd_zstdlib PRIVATE "-I/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib/common")
target_link_libraries(Zstd_zstdlib PUBLIC
"Threads::Threads"
"m")
target_include_directories(Zstd_zstdlib PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
"$<BUILD_INTERFACE:/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-build/lib>"
"$<BUILD_INTERFACE:/work/_skbuild/linux-x86_64-3.10/cmake-build/_deps/zstd-src/lib>")
target_compile_features(Zstd_zstdlib PUBLIC cxx_std_17)
target_compile_options(Zstd_zstdlib PUBLIC "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-deprecated-declarations>" "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-sign-compare>" "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-unused-but-set-parameter>" "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-maybe-uninitialized>" "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-unknown-warning-option>" "$<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>")
add_library(Zstd::Zstd ALIAS Zstd_zstdlib) |
Thanks. The failed build still has
|
Trying to pretty-print this file so I can extract relevant part fails in Notepad++:
So I attach the whole file: bazel_to_cmake_vars.zip |
That didn't seem to give me any hints, sorry. As best as I can tell, right now the C_FLAGS are being added to the ASM build, but I'm not sure why that happens. |
Thanks for your help so far.
Do you have an answer to this question I asked above? |
Adding |
I have a new attempt, building zstd via fetch_content and then trying to plug that as "system" zstd to tensorstore. However this doesn't even build locally. Here is the complete configure log:
When I was doing an incremental build, |
Any suggestions? |
If you want to use zstd via FetchContent you should not specify It is our intention that this should work (substituting your own build of a cmake package that tensorstore depends on), but we haven't tested it. It would be great to figure out what the issue is with our zstd build, though. Probably trying to find a minimal standalone CMakeLists.txt that reproduces the issue on manylinux_2_28_x64 would be very helpful in getting to the bottom of it. |
Changing according to this advice results in:
Indeed, If I uncomment |
Is there a way to rip out just |
As for ripping out ZSTD, we don't really have a built-in option to do that; it's linked into litiff and blosc. So you could, perhaps, remove it from |
Applying the first suggestion (commit here) yields a very similar error to before:
|
Trying to build zstd during configure causes some infinite recursion:
|
@laramiel any further suggestions? |
I think it might help to compare the compile commands issued for zstd between manylinux2 and a working Linux configuration. I suspect something is going wrong with the CMake asm compiler configuration. |
Here is the failing command: and successful command: |
So you are right, that the trick is that |
The issue seems to be that in your build, CMake is detecting the assembler as "Found assembler: /opt/rh/gcc-toolset-12/root/bin//as" while for a working build it needs to use "/opt/rh/gcc-toolset-12/root/bin//cc" instead. I believe that normally CMake will attempt to use the C compiler for assembly by default, but for some reason that is not happening here. I tried to reproduce that with a very simple CMakeLists.txt running in the manylinux_2_28_x86_64 docker image, but could not --- the assembler was always detected as "/opt/rh/gcc-toolset-12/root/bin//cc". If you change your build to specify In the past I have observed unusual behavior if all of the
to your top-level CMakeLists.txt. |
@thewtex suggested that assembler choice is probably coming from toolchain being used for package building. So I tried overriding it in my code. That works, but it only produces a different error:
|
@jbms Just setting the 4 languages makes no difference, I still get |
Okay, looks like the issue is indeed the toolchain file. I think it is a bug to specify Unfortunately I think the way you are attempting to override |
Trying to unset CMAKE_ASM_COMPILER within my code does not work, with the same error as before:
Inspired by relevant CMake code, trying to set both CMAKE_ASM_COMPILER and CMAKE_ASM_COMPILER_ID does not work either, with the same error message as before:
I will try modifying the toolchain file next. |
I tried some testing today (InsightSoftwareConsortium/ITKIOOMEZarrNGFF#13). No success so far. |
Removing AS from CMake toolchain file and environment variables seems to do the trick. |
This happens with the latest version, efca7ed.
The full build log is here. This is somewhat a continuation of #65.
The text was updated successfully, but these errors were encountered: