spack: Installation of pocl fails

Summary

Installation of the package gearshifft fails due to issue in dependency pocl.

Issue

I tried installing the package using spack and I get this error :

  >> 69    /usr/bin/ld: final link failed: Bad value
  >> 70    collect2: error: ld returned 1 exit status
  >> 71    gmake[1]: *** [cmTC_77038] Error 1
     72    gmake[1]: Leaving directory `/tmp/sajid/spack-stage/spack-stage-adwwsb95/pocl-0.14/spack-build/CMakeFiles/CMakeTmp'
  >> 73    gmake: *** [cmTC_77038/fast] Error 2
     74
  >> 75    CMake Error at cmake/LLVM.cmake:643 (message):
     76      LLVM link test FAILED.  This mostly happens when your LLVM installation
     77      does not have all dependencies installed.
     78    Call Stack (most recent call first):
     79      CMakeLists.txt:225 (include)
     80
     81

Here is the relevant file : spack_build_output.txt

When I tried to install pocl as a stand alone package, I got this error :

==> Error: An unsatisfiable version constraint has been detected for spec:

    llvm@5.0.1%gcc@7.3.0+all_targets build_type=Release +clang+compiler-rt+gold+internal_unwind+libcxx~link_dylib+lld+lldb+polly~python~shared_libs arch=linux-centos7-x86_64


while trying to concretize the partial spec:

    pocl@0.14%gcc@7.3.0 build_type=RelWithDebInfo ~distro~icd arch=linux-centos7-x86_64
        ^cmake@3.10.2%gcc@7.3.0~doc+ncurses+openssl+ownlibs~qt arch=linux-centos7-x86_64
            ^ncurses@6.0%gcc@7.3.0~symlinks~termlib arch=linux-centos7-x86_64
                ^pkgconf@1.4.0%gcc@7.3.0 arch=linux-centos7-x86_64
            ^openssl@1.0.2n%gcc@7.3.0 arch=linux-centos7-x86_64
                ^zlib@1.2.11%gcc@7.3.0+optimize+pic+shared arch=linux-centos7-x86_64
        ^hwloc@1.11.8%gcc@7.3.0~cuda+libxml2+pci+shared arch=linux-centos7-x86_64
            ^libpciaccess
                ^libtool@2.4.6%gcc@7.3.0 arch=linux-centos7-x86_64
                    ^m4@1.4.18%gcc@7.3.0+sigsegv arch=linux-centos7-x86_64
                        ^libsigsegv
                ^util-macros
            ^libxml2
                ^xz


pocl requires llvm version 3.7:4.0, but spec asked for 5.0.1

Steps to reproduce the issue

$ ./spack install gearshifft (fist issue)
$ ./spack install pocl (second issue)

Information

  1. Platform : Linux x86-64, OS : CentOS 7.4
  2. I’ve been trying to do this in an isolated conda environment and don’t know if that’s causing an issue.

Tagging maintainer of the gearshifft package : @ax3l

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 18 (18 by maintainers)

Most upvoted comments

I think this issue can be closed (as pocl@1.4 builds) and discussion of current bugs can move to https://github.com/spack/spack/issues/17049 and https://github.com/spack/spack/issues/17048

pocl@1.4 installs just fine llvm@9.0.1 and gcc@8.3.0.

Regarding https://github.com/spack/spack/issues/7460#issuecomment-374507803:

packages:
  opencl:
    paths:
      opencl@2.0%gcc@7.3.0 arch=linux-centos7-x86_64: /usr
    buildable: False

Spack doesn’t actually accept ~packages.yaml entries for~ virtual packages specified as externals (edit for clarity). A quick workaround would be if the system-provided opencl was in fact pocl:

packages:
  pocl:
    paths:
      pocl@...: /usr
    buildable: False

(EDIT: added) you can go the route of the Spack opengl package, which is intended to represent system installations of gl (and is always supposed to be handled by specifying an external).

To clarify, the pthreads linkage is with gearshifft, not pocl. I should have a PR later today to update pocl and set appropriate dependencies on hwloc and llvm.

So, I discussed this issue with @wscullin this afternoon and he pointed out that there was an error with the CLang installer and that spack wasn’t installing the latest version of pocl@1.1 but was installing the old 0.14 version.

After fixing these issues, there still remains an issue of pthreads being wrongly linked and a temporary patch was unable to override this.

After updating spack, this is the error I get when i try to install pocl :

5 errors found in build log:
     63    Building CXX object CMakeFiles/cmTC_cf188.dir/llvm_link_test_qienB.cc.o
     64    /home/sajid/packages/spack/lib/spack/env/gcc/g++  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  -fPIE   -I/home/sajid/packages/spack/opt/spack/linux-ce
           ntos7-x86_64/gcc-7.3.0/llvm-4.0.1-ey2q4oattbvdzqkqsuk3dx6ddd5dzsnc/include -std=c++11 -fPIC -fvisibility-inlines-hidden -std=c++11 -ffunction-sections -fdata-sections -O3 -fno-exceptions -o CMakeFile
           s/cmTC_cf188.dir/llvm_link_test_qienB.cc.o -c /tmp/sajid/spack-stage/spack-stage-75lrgi75/pocl-0.14/spack-build/llvm_link_test_qienB.cc
     65    Linking CXX executable cmTC_cf188
     66    /home/sajid/packages/spack/opt/spack/linux-centos7-x86_64/gcc-7.3.0/cmake-3.10.2-jeyewb75k7xx5rghjbyez56jsfu24b6j/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cf188.dir/link.txt --verbose=1
     67    /home/sajid/packages/spack/lib/spack/env/gcc/g++       -rdynamic CMakeFiles/cmTC_cf188.dir/llvm_link_test_qienB.cc.o  -o cmTC_cf188  -L/home/sajid/packages/spack/opt/spack/linux-centos7-x86_64/gcc-7.
           3.0/llvm-4.0.1-ey2q4oattbvdzqkqsuk3dx6ddd5dzsnc/lib -Wl,-rpath,/home/sajid/packages/spack/opt/spack/linux-centos7-x86_64/gcc-7.3.0/llvm-4.0.1-ey2q4oattbvdzqkqsuk3dx6ddd5dzsnc/lib -L/home/sajid/packag
           es/spack/opt/spack/linux-centos7-x86_64/gcc-7.3.0/llvm-4.0.1-ey2q4oattbvdzqkqsuk3dx6ddd5dzsnc/lib -lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMMIRParser -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDeb
           ugInfoDWARF -lLLVMCoverage -lLLVMTableGen -lLLVMOrcJIT -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen 
           -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSystemZAsmPrinter -lLLVMSparcDisassembler -lLLVMSparcCodeGen -lLLVMSparcAsmParser -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMSparcAsmPrinte
           r -lLLVMRISCVDesc -lLLVMRISCVCodeGen -lLLVMRISCVInfo -lLLVMPowerPCDisassembler -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMNVPTXCodeG
           en -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLL
           VMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen -lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiInstPrinter -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMH
           exagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFCodeGen -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMBPFAsmPrinter -lLLVMARMDisassembler -lLLVMARMCodeGen 
           -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMAMDGPUDisassembler -lLLVMAMDGPUCodeGen -lLLVMAMDGPUAsmParser -lLLVMAMDGPUDesc -lLLVMAMDGPUInfo -lLLVMAMDGPUAsmPrinter -lLLVMAM
           DGPUUtils -lLLVMAArch64Disassembler -lLLVMAArch64CodeGen -lLLVMAArch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMAArch64Utils -lLLVMObjectYAML -lLLVMLibDriver -lLLVMO
           ption -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMX86Desc -lLLVMMCDisassembler -lLL
           VMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMLineEditor -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMTarget -lLLVMCoroutines -lLLVMipo -lLLVMInstrum
           entation -lLLVMVectorize -lLLVMScalarOpts -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVM
           BitReader -lLLVMProfileData -lLLVMCore -lLLVMSupport -lLLVMDemangle -lrt -ldl -ltinfo -lpthread -lz -lm
     68    /usr/bin/ld: /home/sajid/packages/spack/opt/spack/linux-centos7-x86_64/gcc-7.3.0/llvm-4.0.1-ey2q4oattbvdzqkqsuk3dx6ddd5dzsnc/lib/libLLVMBitReader.a(BitcodeReader.cpp.o): unrecognized relocation (0x2a
           ) in section `.text._ZN4llvm18GlobalValueSummaryD2Ev[_ZN4llvm18GlobalValueSummaryD5Ev]'
  >> 69    /usr/bin/ld: final link failed: Bad value
  >> 70    collect2: error: ld returned 1 exit status
  >> 71    gmake[1]: *** [cmTC_cf188] Error 1
     72    gmake[1]: Leaving directory `/tmp/sajid/spack-stage/spack-stage-75lrgi75/pocl-0.14/spack-build/CMakeFiles/CMakeTmp'
  >> 73    gmake: *** [cmTC_cf188/fast] Error 2
     74    
  >> 75    CMake Error at cmake/LLVM.cmake:643 (message):
     76      LLVM link test FAILED.  This mostly happens when your LLVM installation
     77      does not have all dependencies installed.
     78    Call Stack (most recent call first):
     79      CMakeLists.txt:225 (include)
     80    
     81    

Here is the new error log spack-build.txt

@sajid-ali-nu can you try again (after updating spack) and report which errors still persist?

@sajid-ali-nu #7461 has been merged now. This should fix the second bug you reported, but not the original bug.