Skip to content
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

Source build: llvmunwind should be compiled after llvm #45379

Closed
fxcoudert opened this issue May 19, 2022 · 4 comments · Fixed by #45380
Closed

Source build: llvmunwind should be compiled after llvm #45379

fxcoudert opened this issue May 19, 2022 · 4 comments · Fixed by #45380
Labels
building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries system:mac Affects only macOS

Comments

@fxcoudert
Copy link
Contributor

This was first reported in a comment in this PR: #45189 (comment)
I'm creating its own issue, now that the PR is merged.

I'm building from master source on macOS (make USE_BINARYBUILDER=0 VERBOSE=1 CFLAGS='-Wno-implicit-function-declaration'; CFLAGS is there to avoid this other bug: #45200)

I get:

mkdir -p scratch/llvmunwind-12.0.1/
cd scratch/llvmunwind-12.0.1/ && \
	cmake /private/tmp/julia/deps/srccache/llvmunwind-12.0.1/ -DCMAKE_INSTALL_PREFIX:PATH=/private/tmp/julia/usr -DCMAKE_PREFIX_PATH=/private/tmp/julia/usr -DCMAKE_INSTALL_LIBDIR=/private/tmp/julia/usr/lib -DCMAKE_INSTALL_BINDIR=/private/tmp/julia/usr/bin -DLIB_INSTALL_DIR=/private/tmp/julia/usr/lib -DCMAKE_MACOSX_RPATH=1 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_C_COMPILER="$(which clang)" -DCMAKE_C_COMPILER_ARG1="-mmacosx-version-min=11.0" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_CXX_COMPILER_ARG1="-mmacosx-version-min=11.0" -DCMAKE_LINKER="$(which ld)" -DCMAKE_AR="$(which ar)" -DCMAKE_RANLIB="$(which ranlib)" -DCMAKE_BUILD_TYPE=MinSizeRel -DLIBUNWIND_ENABLE_PEDANTIC=OFF -DLLVM_CONFIG_PATH=/private/tmp/julia/usr/tools/llvm-config
Re-run cmake no build system arguments
-- Found LLVM_CONFIG_PATH as /private/tmp/julia/usr/tools/llvm-config
-- /private/tmp/julia/usr/tools/llvm-config --includedir --prefix --src-root
CMake Error at CMakeLists.txt:39 (message):
  llvm-config failed with status No such file or directory


-- Configuring incomplete, errors occurred!
See also "/tmp/julia/deps/scratch/llvmunwind-12.0.1/CMakeFiles/CMakeOutput.log".
See also "/tmp/julia/deps/scratch/llvmunwind-12.0.1/CMakeFiles/CMakeError.log".
make[1]: *** [scratch/llvmunwind-12.0.1/build-configured] Error 1

because it's trying to build llvmunwind before it's built llvm, and therefore llvm-config cannot be found. There needs to be something in the makefiles that enforces that, and there isn't.

@fxcoudert
Copy link
Contributor Author

Solution I've tried: In deps/unwind.mk I can add to the target $(BUILDDIR)/llvmunwind-$(LLVMUNWIND_VER)/build-configured a dependency on $(LLVM_BUILDDIR_withtype)/build-compiled. I hoped this dependency would allow to install llvm before llvmunwind is configured:

ifeq ($(USE_SYSTEM_LLVM),0)
 $(BUILDDIR)/llvmunwind-$(LLVMUNWIND_VER)/build-configured: | $(LLVM_BUILDDIR_withtype)/build-compiled
 endif

but it does not work reliably: it builds llvmunwind after llvm is built, but not necessarily installed (so llvm-config is not present). Can someone suggest a way to add the dependency to installed llvm? @giordano I cannot figure it out.

@giordano giordano added building Build system, or building Julia or its dependencies system:mac Affects only macOS external dependencies Involves LLVM, OpenBLAS, or other linked libraries labels May 19, 2022
@vtjnash
Copy link
Member

vtjnash commented May 19, 2022

It should add a dependency on the manifest/llvm file

@giordano
Copy link
Contributor

yes, like this:

julia/deps/curl.mk

Lines 3 to 5 in 0f2ed77

ifeq ($(USE_SYSTEM_LIBSSH2), 0)
$(BUILDDIR)/curl-$(CURL_VER)/build-configured: | $(build_prefix)/manifest/libssh2
endif

@fxcoudert
Copy link
Contributor Author

Tested, and it works locally. PR opened at https://github.com/JuliaLang/julia/pull/45380/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries system:mac Affects only macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants