2017-10-02 7 views
1

J'ai installé la pile haskell et j'essaye d'installer ghc pour la même chose. version pile estréférence non définie au symbole 'pthread_setname_np @@ GLIBC_2.12' Erreur de pile Haskell sur OpenSuse42.3

stack --version 
Version 1.5.1, Git revision 600c1f01435a10d127938709556c1682ecfd694e (4861 commits) x86_64 hpack-0.17.1 

J'ai mis à jour le ~/.stack/global-projet/stack.yaml comme ci-dessous

# This is the implicit global project's config file, which is only used when 
# 'stack' is run outside of a real project. Settings here do _not_ act as 
# defaults for all projects. To change stack's default settings, edit 
# '/home/rajkumar/.stack/config.yaml' instead. 
# 
# For more information about stack's configuration, see 
# http://docs.haskellstack.org/en/stable/yaml_configuration/ 
# 
flags: {} 
extra-package-dbs: [] 
packages: [] 
extra-deps: [] 
resolver: ghc-8.2.1 

Puis je lance la commande de configuration de pile et obtenu l'erreur ci-dessous -

stack setup 
    The GHC located at /home/rajkumar/.stack/programs/x86_64-linux/ghc-8.2.1/bin/ghc failed to compile a sanity check. Please see: 

    http://docs.haskellstack.org/en/stable/install_and_upgrade/ 

    for more information. Exception was: 
    Running /home/rajkumar/.stack/programs/x86_64-linux/ghc-8.2.1/bin/ghc /tmp/stack-sanity-check3048/Main.hs -no-user-package-db in directory /tmp/stack-sanity-check3048/ exited with ExitFailure 1 

    [1 of 1] Compiling Main    (/tmp/stack-sanity-check3048/Main.hs, /tmp/stack-sanity-check3048/Main.o) 
    Linking /tmp/stack-sanity-check3048/Main ... 

/usr/bin/ld.bfd: /home/rajkumar/.stack/programs/x86_64-linux/ghc-8.2.1/lib64/ghc-8.2.1/rts/libHSrts.a(OSThreads.o): undefined reference to symbol '[email protected]@GLIBC_2.12' 
/lib64/libpthread.so.0: error adding symbols: DSO missing from command line 
collect2: error: ld returned 1 exit status 
`gcc' failed in phase `Linker'. (Exit code: 1) 
+0

S'il vous plaît fournir la sortie de 'ldd --version' – selalerer

+0

ldd --version ldd (glibc) 2.26 Copyright (C) 2017 Free Software Foundation, Inc. Ceci est un logiciel libre; voir la source pour les conditions de copie. Il n'y a aucune garantie de ; pas même pour la QUALITÉ MARCHANDE ou l'ADAPTATION À UN USAGE PARTICULIER. Écrit par Roland McGrath et Ulrich Drepper. –

+0

Donc peut-être le problème est que vous avez besoin de 'GLIBC_2.12' installé sur votre machine et non' 2.26' – selalerer

Répondre

1

Alors peut-être le problème est que vous avez besoin GLIBC_2.12 installé sur votre machine et non 2,26

Non, c'est pas le problème. GLIBC-2.26 fournit très certainement le symbole [email protected]@GLIBC_2.12 (voir this answer pour comprendre comment le versionnage des symboles fonctionne).

Vous pouvez vérifier que le symbole est en effet disponible dans votre glibc-2.26 comme ceci:

$ readelf -Ws /lib/x86_64-linux-gnu/libpthread.so.0 | grep pthread_setname_np 
    89: 00000000000113c0 258 FUNC GLOBAL DEFAULT 13 [email protected]@GLIBC_2.12 
    704: 00000000000113c0 258 FUNC GLOBAL DEFAULT 13 pthread_setname_np 

(commande ci-dessus a été exécuté sur un système avec glibc-2.19, mais vous obtiendrez le même résultat sur un système avec GLIBC-2.26).

maintenant à ce que votre vrai problème est. libHSrts.a(OSThreads.o)référencespthread_setname_np (et probablement d'autres pthread_* symboles, mais vous n'êtes pas la liaison avec

-pthread ou -lpthread drapeau Je ne sais pas où ajouter cette drapeau GHC, mais une fois que vous trouvez que, votre problème sera résolu.

+0

J'ai créé le numéro https://github.com/ Commercialhaskell/pile/questions/3472 pour cela –

+0

Merci Employé Russion pour votre suggestion aimable.Ce problème est résolu maintenant. –