haskell-crypto / cryptonite

lowlevel set of cryptographic primitives for haskell
Other
226 stars 139 forks source link

aarch64 - How to remove/override dependency on Scrypt - ubuntu aarch64 on pi4 provides its own include file and library and executable #346

Closed whosystem closed 3 years ago

whosystem commented 3 years ago

<--- Build Script for cardano-wallet for debugging purposes

!/usr/bin/bash

LST="Win32-network-0.1.0.0 byron-spec-chain-0.1.0.0 byron-spec-ledger-0.1.0.0 cardano-addresses-3.2.0 cardano-addresses-cli-3.2.0 cardano-api-1.25.1 cardano-api-test-1.24.0 cardano-binary-1.5.0 cardano-binary-test-1.3.0 cardano-cli-1.25.1 cardano-client-0.1.0.0 cardano-config-0.1.0.0 cardano-crypto-1.1.0 cardano-crypto-class-2.0.0 cardano-crypto-praos-2.0.0 cardano-crypto-test-1.3.0 cardano-crypto-tests-2.0.0 cardano-crypto-wrapper-1.3.0 cardano-ledger-0.1.0.0 cardano-ledger-shelley-ma-0.1.0.0 cardano-ledger-test-1.3.0 cardano-node-1.25.1 cardano-node-chairman-1.25.1 cardano-prelude-0.1.0.0 cardano-prelude-test-0.1.0.0 cardano-sl-x509-3.0.0 cardano-slotting-0.1.0.0 cardano-transactions-1.0.0 contra-tracer-0.1.0.0 goblins-0.2.0.0 hedgehog-extras-0.1.0.0 http-client-0.6.4.1 io-sim-0.2.0.0 io-sim-classes-0.2.0.0 iohk-monitoring-0.1.10.1 lobemo-backend-aggregation-0.1.0.0 lobemo-backend-ekg-0.1.0.1 lobemo-backend-monitoring-0.1.0.0 lobemo-backend-trace-forwarder-0.1.0.0 lobemo-scribe-systemd-0.1.0.0 network-mux-0.1.0.0 ntp-client-0.0.1 ouroboros-consensus-0.1.0.0 ouroboros-consensus-byron-0.1.0.0 ouroboros-consensus-cardano-0.1.0.0 ouroboros-consensus-mock-0.1.0.0 ouroboros-consensus-shelley-0.1.0.0 ouroboros-network-0.1.0.0 ouroboros-network-framework-0.1.0.0 shelley-spec-ledger-0.1.0.0 shelley-spec-ledger-test-0.1.0.0 shelley-spec-non-integral-0.1.0.0 small-steps-0.1.0.0 small-steps-test-0.1.0.0 tracer-transformers-0.1.0.1 typed-protocols-0.1.0.0 typed-protocols-examples-0.1.0.0" MDIR=$PWD TXT=${MDIR}/done.txt LOG=${MDIR}/msg.log rm -f $TXT $LOG for xx in $LST do echo $xx >> $TXT cd $xx ( cabal -v3 --extra-include-dirs=/usr/include --extra-lib-dirs=/usr/lib configure; cabal -v3 --extra-include-dirs=/usr/include --extra-lib-dirs=/usr/lib build all ; cabal -v3 --extra-include-dirs=/usr/include --extra-lib-dirs=/usr/lib install ; ) >> $LOG 2>&1 cd $MDIR done

---> Excerpt of build log Source component graph: component lib 494859 Configured component graph: 494860 component scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242 494861 include base-4.12.0.0 494862 include base64-bytestring-1.1.0.0-6b8a1a0dece555ae7f6c1f0c89f1a5f0d74375662c2021f6def8a4786b357204 494863 include bytestring-0.10.8.2 494864 include entropy-0.4.1.6-5e186898390c3a1579089b1f496599a789fda0c53b87fdeb6c0a7910db3a8a2b 494865 Linked component graph: 494866 unit scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242 494867 include base-4.12.0.0 494868 include base64-bytestring-1.1.0.0-6b8a1a0dece555ae7f6c1f0c89f1a5f0d74375662c2021f6def8a4786b357204 494869 include bytestring-0.10.8.2 494870 include entropy-0.4.1.6-5e186898390c3a1579089b1f496599a789fda0c53b87fdeb6c0a7910db3a8a2b 494871 Crypto.Scrypt=scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242:Crypto.Scrypt 494872 Ready component graph: 494873 definite scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242 494874 depends base-4.12.0.0 494875 depends base64-bytestring-1.1.0.0-6b8a1a0dece555ae7f6c1f0c89f1a5f0d74375662c2021f6def8a4786b357204 494876 depends bytestring-0.10.8.2 494877 depends entropy-0.4.1.6-5e186898390c3a1579089b1f496599a789fda0c53b87fdeb6c0a7910db3a8a2b 494878 Using Cabal-3.4.0.0 compiled by ghc-8.6 494879 Using compiler: ghc-8.6.5 494880 Using install prefix: 494881 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242 494882 Executables installed in: 494883 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242/bin 494884 Libraries installed in: 494885 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242/lib 494886 Dynamic Libraries installed in: 494887 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242/lib 494888 Private executables installed in: 494889 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242/libexec 494890 Data files installed in: 494891 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242/share 494892 Documentation installed in: 494893 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242/share/doc 494894 Configuration files installed in: 494895 /home/vbox/.cabal/store/ghc-8.6.5/scrypt-0.5.0-7e9bf39f0f4bfb20a46c154b252696a09e552c4c3f132678bb20bf7a8d601242 =1' '-Daarch64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Daarch64_HOST_ARCH=1' -Idist/build/autogen -Idist/build/cbits -I./cbits -I. -msse2 -I/usr/lib/ghc/unix-2.7.2.2/inclu de -I/usr/lib/ghc/time-1.8.0.2/include -I/usr/lib/ghc/bytestring-0.10.8.2/include -I/usr/lib/ghc/base-4.12.0.0/include -I/usr/lib/ghc/integer-gmp-1.0.2.0/include -I/us r/lib/ghc/include -msse2 -L/home/vbox/.cabal/store/ghc-8.6.5/entropy-0.4.1.6-5e186898390c3a1579089b1f496599a789fda0c53b87fdeb6c0a7910db3a8a2b/lib -L/usr/lib/ghc/unix-2 .7.2.2 -L/usr/lib/ghc/time-1.8.0.2 -L/home/vbox/.cabal/store/ghc-8.6.5/base64-bytestring-1.1.0.0-6b8a1a0dece555ae7f6c1f0c89f1a5f0d74375662c2021f6def8a4786b357204/lib - L/usr/lib/ghc/bytestring-0.10.8.2 -L/usr/lib/ghc/deepseq-1.4.4.0 -L/usr/lib/ghc/array-0.5.3.0 -L/usr/lib/ghc/base-4.12.0.0 -L/usr/lib/ghc/integer-gmp-1.0.2.0 -L/usr/li b/ghc/ghc-prim-0.5.3 -L/usr/lib/ghc/rts 494923 /usr/bin/aarch64-linux-gnu-gcc returned ExitFailure 1 with error message: 494924 aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse2’ 494925 aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse2’ 494926 /usr/bin/aarch64-linux-gnu-gcc -fno-stack-protector '-fuse-ld=gold' -Wl,-z,noexecstack /tmp/3284050-6.c -o /tmp/3284050-7 -L/home/vbox/.cabal/store/ghc-8.6.5/entropy-0 .4.1.6-5e186898390c3a1579089b1f496599a789fda0c53b87fdeb6c0a7910db3a8a2b/lib -L/usr/lib/ghc/unix-2.7.2.2 -L/usr/lib/ghc/time-1.8.0.2 -L/home/vbox/.cabal/store/ghc-8.6.5 /base64-bytestring-1.1.0.0-6b8a1a0dece555ae7f6c1f0c89f1a5f0d74375662c2021f6def8a4786b357204/lib -L/usr/lib/ghc/bytestring-0.10.8.2 -L/usr/lib/ghc/deepseq-1.4.4.0 -L/us r/lib/ghc/array-0.5.3.0 -L/usr/lib/ghc/base-4.12.0.0 -L/usr/lib/ghc/integer-gmp-1.0.2.0 -L/usr/lib/ghc/ghc-prim-0.5.3 -L/usr/lib/ghc/rts 494927 /usr/bin/aarch64-linux-gnu-gcc -fno-stack-protector '-fuse-ld=gold' -Wl,-z,noexecstack /tmp/3284050-8.c -o /tmp/3284050-9 -c '-DGLASGOW_HASKELL=806' '-Dlinux_BUILD _OS=1' '-Daarch64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Daarch64_HOST_ARCH=1' -Idist/build/autogen -Idist/build/cbits -I./cbits -I. -msse2 -I/usr/lib/ghc/unix-2.7.2.2/in clude -I/usr/lib/ghc/time-1.8.0.2/include -I/usr/lib/ghc/bytestring-0.10.8.2/include -I/usr/lib/ghc/base-4.12.0.0/include -I/usr/lib/ghc/integer-gmp-1.0.2.0/include -I /usr/lib/ghc/include -msse2 494928 /usr/bin/aarch64-linux-gnu-gcc returned ExitFailure 1 with error message: 494929 aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse2’ 494930 aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse2’ 494931 /usr/bin/aarch64-linux-gnu-gcc -fno-stack-protector '-fuse-ld=gold' -Wl,-z,noexecstack /tmp/3284050-10.c -o /tmp/3284050-11 -E '-DGLASGOW_HASKELL=806' '-Dlinux_BUI LD_OS=1' '-Daarch64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Daarch64_HOST_ARCH=1' -Idist/build/autogen -Idist/build/cbits -I./cbits -I. -msse2 -I/usr/lib/ghc/unix-2.7.2.2/ include -I/usr/lib/ghc/time-1.8.0.2/include -I/usr/lib/ghc/bytestring-0.10.8.2/include -I/usr/lib/ghc/base-4.12.0.0/include -I/usr/lib/ghc/integer-gmp-1.0.2.0/include -I/usr/lib/ghc/include 494932 /usr/bin/aarch64-linux-gnu-gcc returned ExitFailure 1 with error message: 494933 aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse2’ 494934 494935 cabal: Missing dependency on a foreign library: ARE INSTALLED IN /usr/include and /usr/lib 494936 * Missing (or bad) header file: crypto_scrypt.h 494937 This problem can usually be solved by installing the system package that 494938 provides this library (you may need the "-dev" version). If the library is 494939 already installed but in a non-standard location then you can use the flags 494940 --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the 494941 library file does exist, it may contain errors that are caught by the C 494942 compiler at the preprocessing stage. In this case you can re-run configure 494943 with the verbosity flag -v3 to see the error messages. 494944 If the header file does exist, it may contain errors that are caught by the C 494945 compiler at the preprocessing stage. In this case you can re-run configure 494946 with the verbosity flag -v3 to see the error messages.

ghost commented 3 years ago

Did you resolve this issue? I'm struggling getting an aarch64 build compiled as well..

vincenthz commented 3 years ago

nothing to do with cryptonite, this is Scrypt from https://hackage.haskell.org/package/scrypt that doesn't work on aarch64