Cabal update fails with unix package configure error - haskell

I have a very old Cabal (1.16.0) installed from my distro's repo (Linux Mint). Today, I tried updating it and got:
cabal install cabal-install -v3
...
unix-2.7.2.2 failed during the configure step. The exception was:
ExitFailure 1
zlib-0.6.1.2 failed during the building phase. The exception was:
ExitFailure 1
I also see
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/tmp/unix-2.7.2.2-2138/unix-2.7.2.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
sh returned ExitFailure 1
After checking the config.log, I see some errors but I am not sure they are related and the configuration failed on them:
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configure:2738: $? = 0
configure:2727: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2738: $? = 4
configure:2727: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2738: $? = 4
configure:2758: checking whether the C compiler works
configure:2780: gcc -Wl,--hash-size=31 -Wl,--reduce-memory-overheads conftest.c >&5
configure:2784: $? = 0
configure:2832: result: yes
configure:2835: checking for C compiler default output file name
configure:2837: result: a.out
configure:2843: checking for suffix of executables
configure:2850: gcc -o conftest -Wl,--hash-size=31 -Wl,--reduce-memory-overheads conftest.c >&5
configure:2854: $? = 0
configure:2876: result:
configure:2898: checking whether we are cross compiling
configure:2906: gcc -o conftest -Wl,--hash-size=31 -Wl,--reduce-memory-overheads conftest.c >&5
This is weird (I tried running the gcc.. command and it was also fine). Any help with this error is welcome.

You can install the cabal-install binary for linux from the cabal homepage as well: https://www.haskell.org/cabal/download.html

Related

Running ghc fails with message about iOS simulator

I tried running ghc to compile a haskell program, and I get the following error:
$ ghc --make main
Linking main ...
ld: building for macOS, but linking in object file built for iOS Simulator, file 'main.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`clang' failed in phase `Linker'. (Exit code: 1)
Here are some details about my machine:
macOS Catalina 10.15.7
Xcode 12.2
The Xcode developer tools were installed with xcode-select --install
I installed ghc with brew install ghc
Some other output that might be relevant:
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
If I run ghc --make main -v, this is what the output looks like right before it fails (apologies for the long line, not sure how to format this better):
clang -o main -fno-common -U__PIC__ -D__PIC__ -Wl,-no_compact_unwind main.o -L/usr/local/Cellar/ghc/8.10.1_2/lib/ghc-8.10.1/base-4.14.0.0 -L/usr/local/Cellar/ghc/8.10.1_2/lib/ghc-8.10.1/integer-gmp-1.0.3.0 -L/usr/local/Cellar/ghc/8.10.1_2/libexec/integer-gmp/lib -L/usr/local/Cellar/ghc/8.10.1_2/lib/ghc-8.10.1/ghc-prim-0.6.1 -L/usr/local/Cellar/ghc/8.10.1_2/lib/ghc-8.10.1/rts /var/folders/5j/wwtlv8lx0m5fmhc3hy5w5_000000gp/T/ghc49162_0/ghc_2.o -Wl,-u,_base_GHCziTopHandler_runIO_closure -Wl,-u,_base_GHCziTopHandler_runNonIO_closure -Wl,-u,_ghczmprim_GHCziTuple_Z0T_closure -Wl,-u,_ghczmprim_GHCziTypes_True_closure -Wl,-u,_ghczmprim_GHCziTypes_False_closure -Wl,-u,_base_GHCziPack_unpackCString_closure -Wl,-u,_base_GHCziWeak_runFinalizzerBatch_closure -Wl,-u,_base_GHCziIOziException_stackOverflow_closure -Wl,-u,_base_GHCziIOziException_heapOverflow_closure -Wl,-u,_base_GHCziIOziException_allocationLimitExceeded_closure -Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -Wl,-u,_base_GHCziIOziException_cannotCompactFunction_closure -Wl,-u,_base_GHCziIOziException_cannotCompactPinned_closure -Wl,-u,_base_GHCziIOziException_cannotCompactMutable_closure -Wl,-u,_base_ControlziExceptionziBase_absentSumFieldError_closure -Wl,-u,_base_ControlziExceptionziBase_nonTermination_closure -Wl,-u,_base_ControlziExceptionziBase_nestedAtomically_closure -Wl,-u,_base_GHCziEventziThread_blockedOnBadFD_closure -Wl,-u,_base_GHCziConcziSync_runSparks_closure -Wl,-u,_base_GHCziConcziIO_ensureIOManagerIsRunning_closure -Wl,-u,_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure -Wl,-u,_base_GHCziConcziSignal_runHandlersPtr_closure -Wl,-u,_base_GHCziTopHandler_flushStdHandles_closure -Wl,-u,_base_GHCziTopHandler_runMainIO_closure -Wl,-u,_ghczmprim_GHCziTypes_Czh_con_info -Wl,-u,_ghczmprim_GHCziTypes_Izh_con_info -Wl,-u,_ghczmprim_GHCziTypes_Fzh_con_info -Wl,-u,_ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,_ghczmprim_GHCziTypes_Wzh_con_info -Wl,-u,_base_GHCziPtr_Ptr_con_info -Wl,-u,_base_GHCziPtr_FunPtr_con_info -Wl,-u,_base_GHCziInt_I8zh_con_info -Wl,-u,_base_GHCziInt_I16zh_con_info -Wl,-u,_base_GHCziInt_I32zh_con_info -Wl,-u,_base_GHCziInt_I64zh_con_info -Wl,-u,_base_GHCziWord_W8zh_con_info -Wl,-u,_base_GHCziWord_W16zh_con_info -Wl,-u,_base_GHCziWord_W32zh_con_info -Wl,-u,_base_GHCziWord_W64zh_con_info -Wl,-u,_base_GHCziStable_StablePtr_con_info -Wl,-u,_hs_atomic_add8 -Wl,-u,_hs_atomic_add16 -Wl,-u,_hs_atomic_add32 -Wl,-u,_hs_atomic_add64 -Wl,-u,_hs_atomic_sub8 -Wl,-u,_hs_atomic_sub16 -Wl,-u,_hs_atomic_sub32 -Wl,-u,_hs_atomic_sub64 -Wl,-u,_hs_atomic_and8 -Wl,-u,_hs_atomic_and16 -Wl,-u,_hs_atomic_and32 -Wl,-u,_hs_atomic_and64 -Wl,-u,_hs_atomic_nand8 -Wl,-u,_hs_atomic_nand16 -Wl,-u,_hs_atomic_nand32 -Wl,-u,_hs_atomic_nand64 -Wl,-u,_hs_atomic_or8 -Wl,-u,_hs_atomic_or16 -Wl,-u,_hs_atomic_or32 -Wl,-u,_hs_atomic_or64 -Wl,-u,_hs_atomic_xor8 -Wl,-u,_hs_atomic_xor16 -Wl,-u,_hs_atomic_xor32 -Wl,-u,_hs_atomic_xor64 -Wl,-u,_hs_cmpxchg8 -Wl,-u,_hs_cmpxchg16 -Wl,-u,_hs_cmpxchg32 -Wl,-u,_hs_cmpxchg64 -Wl,-u,_hs_atomicread8 -Wl,-u,_hs_atomicread16 -Wl,-u,_hs_atomicread32 -Wl,-u,_hs_atomicread64 -Wl,-u,_hs_atomicwrite8 -Wl,-u,_hs_atomicwrite16 -Wl,-u,_hs_atomicwrite32 -Wl,-u,_hs_atomicwrite64 -Wl,-search_paths_first -Wl,-dead_strip -lHSbase-4.14.0.0 -lHSinteger-gmp-1.0.3.0 -lHSghc-prim-0.6.1 -lHSrts -lCffi -liconv -lgmp -lm -ldl -Wl,-dead_strip_dylibs
ld: building for macOS, but linking in object file built for iOS Simulator, file 'main.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Could not determine size of CHARACTER while installing openmpi

I am trying to install openmpi on Amazon ec2 instance. I have uninstalled the openmpi installations present in the system using -
yum remove -y openmpi.x86_64 openmpi-devel.x86_64
This removes 2.1.1-1.31.amzn1 version of openmpi and openmpi devel.
I have downloaded the tar file from official openmpi site. When I try running configure, I get the following error -
checking if C and Fortran are link compatible... yes
checking to see if Fortran compiler likes the C++ exception flags... skipped (no C++ exceptions flags)
checking to see if mpifort compiler needs additional linker flags... none
checking if Fortran compiler supports CHARACTER... yes
checking size of Fortran CHARACTER... configure: WARNING: Could not determine size of CHARACTER
configure: WARNING: See config.log for details
configure: error: Cannot continue
Errors in config.log file -
configure:37098: $? = 0
configure:37111: result: yes
configure:37146: checking size of Fortran CHARACTER
configure:37214: /usr/lib/a-4.2.0-py-3.5.3-dl-gpu-full/bin/x86_64-conda_cos6-linux-gnu-cc -DNDEBUG -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -finline-functions -fno-strict-aliasing -I. -c conftest.c
configure:37221: $? = 0
configure:37231: gfortran conftestf.f90 conftest.o -o conftest -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now
/usr/bin/ld: conftest.o: unrecognized relocation (0x29) in section .text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
configure:37238: $? = 1
configure:37259: here is the Fortran program:
program fsize
I have tried with ./configure —disable-fortran as well but I am getting the same error.
Any help will be appreciated.

stack install crashes on pretty much anything

I'm trying to install tidal cycles via stack using stack install tidal.
Installation went smooth for the first couple dependencies but now I'm getting this.
04:24 ~ stack install tidal
mersenne-random-pure64-0.2.2.0: configure
mersenne-random-pure64-0.2.2.0: build
network-2.6.3.2: configure
zlib-0.6.1.2: configure
zlib-0.6.1.2: build
Progress: 3/7
-- While building custom Setup.hs for package zlib-0.6.1.2 using:
/home/mn/.stack/setup-exe-cache/x86_64-linux-tinfo6-nopie/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: /home/mn/.stack/global-project/.stack-work/logs/zlib-0.6.1.2.log
Configuring zlib-0.6.1.2...
Preprocessing library for zlib-0.6.1.2..
/usr/bin/ld.gold: error: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/Codec/Compression/Zlib/Stream_hsc_make.o: requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/Codec/Compression/Zlib/Stream_hsc_utils.o: requires dynamic R_X86_64_PC32 reloc against 'vprintf' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
linking .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/Codec/Compression/Zlib/Stream_hsc_make.o failed (exit code 1)
command was: /usr/bin/gcc .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/Codec/Compression/Zlib/Stream_hsc_make.o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/Codec/Compression/Zlib/Stream_hsc_utils.o -o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/Codec/Compression/Zlib/Stream_hsc_make -fuse-ld=gold -fno-PIE -fno-stack-protector -fuse-ld=gold -lz -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/bytestring-0.10.8.2 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/bytestring-0.10.8.2 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/deepseq-1.4.3.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/deepseq-1.4.3.0 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/array-0.5.2.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/array-0.5.2.0 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/base-4.10.1.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/base-4.10.1.0 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/integer-gmp-1.0.1.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/integer-gmp-1.0.1.0 -lgmp -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/ghc-prim-0.5.1.1 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/ghc-prim-0.5.1.1 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/rts -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/rts -lm -lrt -ldl -lpthread
-- While building custom Setup.hs for package network-2.6.3.2 using:
/tmp/stack17553/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0 configure --with-ghc=/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/bin/ghc --with-ghc-pkg=/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/pkgdb --libdir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/lib --bindir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/bin --datadir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/share --libexecdir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/libexec --sysconfdir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/etc --docdir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/doc/network-2.6.3.2 --htmldir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/doc/network-2.6.3.2 --haddockdir=/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/doc/network-2.6.3.2 --dependency=base=base-4.10.1.0 --dependency=bytestring=bytestring-0.10.8.2 --dependency=unix=unix-2.7.2.2
Process exited with code: ExitFailure 1
Logs have been written to: /home/mn/.stack/global-project/.stack-work/logs/network-2.6.3.2.log
[1 of 2] Compiling Main ( /tmp/stack17553/network-2.6.3.2/Setup.hs, /tmp/stack17553/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim ( /home/mn/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack17553/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/setup/StackSetupShim.o )
Linking /tmp/stack17553/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/setup/setup ...
Configuring network-2.6.3.2...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/tmp/stack17553/network-2.6.3.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
-- While building custom Setup.hs for package mersenne-random-pure64-0.2.2.0 using:
/home/mn/.stack/setup-exe-cache/x86_64-linux-tinfo6-nopie/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: /home/mn/.stack/global-project/.stack-work/logs/mersenne-random-pure64-0.2.2.0.log
Configuring mersenne-random-pure64-0.2.2.0...
Preprocessing library for mersenne-random-pure64-0.2.2.0..
/usr/bin/ld.gold: error: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/System/Random/Mersenne/Pure64/Base_hsc_make.o: requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/System/Random/Mersenne/Pure64/Base_hsc_utils.o: requires dynamic R_X86_64_PC32 reloc against 'vfprintf' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
linking .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/System/Random/Mersenne/Pure64/Base_hsc_make.o failed (exit code 1)
command was: /usr/bin/gcc .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/System/Random/Mersenne/Pure64/Base_hsc_make.o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/System/Random/Mersenne/Pure64/Base_hsc_utils.o -o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/System/Random/Mersenne/Pure64/Base_hsc_make -fuse-ld=gold -fno-PIE -fno-stack-protector -fuse-ld=gold -L/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/lib/x86_64-linux-ghc-8.2.2/random-1.1-LLUGZ7T9DqQ5vN0Jbcd0We -Wl,-R,/home/mn/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-10.0/8.2.2/lib/x86_64-linux-ghc-8.2.2/random-1.1-LLUGZ7T9DqQ5vN0Jbcd0We -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/time-1.8.0.2 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/time-1.8.0.2 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/deepseq-1.4.3.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/deepseq-1.4.3.0 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/array-0.5.2.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/array-0.5.2.0 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/base-4.10.1.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/base-4.10.1.0 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/integer-gmp-1.0.1.0 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/integer-gmp-1.0.1.0 -lgmp -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/ghc-prim-0.5.1.1 -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/ghc-prim-0.5.1.1 -L/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/rts -Wl,-R,/home/mn/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/lib/ghc-8.2.2/rts -lm -lrt -ldl -lpthread
✘ 04:24 ~
Googled a little and found a few things, tried a few things but none worked, I'm lost.
Any help is appreciated, thanks.
I'm guessing you're using Arch Linux.
I'm in the middle of trying to come up with a comprehensive fix for this and related problems in stack setup, but I believe the simplest course of action is to add this to your ~/.stack/config.yaml:
ghc-build: tinfo6
You may need to run stack setup --reinstall to force a re-install.

Yocto Eclipse ADT plugin fails during configure

I'm trying to use the Yocto Project Eclipse ADT plugin using the manual as a reference with a standalone pre-built toolchain created by running bitbake <recipename> -c populate_sdk, then running poky-glibc-x86_64-<recipename>-x86-toolchain-2.0.sh, specifying default locations. I've sourced the environment-setup in opt/poky/2.0. My Toolchain Root Location is pointing to /opt/poky/2.0 and my sysroot is pointing at /opt/poky/2.0/sysroots/x86-poky-linux.
I was able to compile a "Hello, world" program using this enviromnent, but with a larger project I hit errors during the Build Project step.
Here's the relevant part of my config.log:
Configured with: /home/presslertj/poky/build/tmp/work-shared/gcc-5.2.0-r0/gcc-5.2.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=i586-poky-linux --prefix=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux --sbindir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux --libexecdir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/libexec/i586-poky-linux --datadir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/lib/i586-poky-linux --includedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/presslertj/poky/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=i586-poky-linux- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/5.2.0 --with-build-time-tools=/home/presslertj/poky/build/tmp/sysroots/x86_64-linux/usr/i586-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/presslertj/poky/build/tmp/sysroots/piu --enable-targets=all --enable-poison-system-directories --with-mpfr=/home/presslertj/poky/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-mpc=/home/presslertj/poky/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --enable-nls --enable-__cxa_atexit
Thread model: posix
gcc version 5.2.0 (GCC)
configure:2971: $? = 0
configure:2960: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -V >&5
i586-poky-linux-gcc: error: unrecognized command line option '-V'
i586-poky-linux-gcc: fatal error: no input files
compilation terminated.
configure:2971: $? = 1
configure:2960: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -qversion >&5
i586-poky-linux-gcc: error: unrecognized command line option '-qversion'
i586-poky-linux-gcc: fatal error: no input files
compilation terminated.
configure:2971: $? = 1
configure:2991: checking whether the C compiler works
configure:3013: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5
configure:3017: $? = 0
configure:3065: result: yes
configure:3068: checking for C compiler default output file name
configure:3070: result: a.out
configure:3076: checking for suffix of executables
configure:3083: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5
configure:3087: $? = 0
configure:3109: result:
configure:3131: checking whether we are cross compiling
configure:3139: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5
configure:3143: $? = 0
configure:3150: ./conftest
/home/presslertj/workspace/HMM/configure: ./conftest: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
configure:3154: $? = 126
configure:3161: error: in `/home/presslertj/workspace/HMM':
configure:3163: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
I think the most important line of this might be:
/home/presslertj/workspace/HMM/configure: ./conftest: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
Which looks to me like it's looking in the wrong place for ld-linux.so.2.
Also, when running build, Eclipse's terminal spits out the following lines:
ENV key HOST_CC_ARCH is NULL
ENV key TOOLCHAIN_OPTIONS is NULL
ENV key SELECTED_OPTIMIZATION is NULL
ENV key TARGET_ARCH is NULL
ENV key OECMAKE_C_LINK_FLAGS is NULL
ENV key OECMAKE_CXX_LINK_FLAGS is NULL
ENV key STAGING_DIR_HOST is NULL
ENV key STAGING_DIR_NATIVE is NULL
ENV key CROSS_DIR is NULL
ENV key OECMAKE_EXTRA_ROOT_PATH is NULL
ENV key EXTERNAL_TOOLCHAIN is NULL
ENV key STAGING_DATADIR is NULL
I'm guessing that one of these variables needs to be specified so that ld-linux.so.2 is found but I don't know which, and I feel like I might've missed some critical step. What is causing this error? Have I misconfigured my environment?
As read in How to fix /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory:
This will happen only on 64 bit systems, the cause is the fact that 32
bit libraries are missing from the system, so you can easily fix this
issue by installing the 32 bit libraries on your system.
So if you encounter this error /lib/ld-linux.so.2: bad ELF
interpreter: No such file or directory this is how you can fix it:
To fix it:
On any RPM based distribution (CentOS/RedHat/Fedora/Suse/Mandriva):
yum -y install glibc.i686
On any DEB based distribution (Debian/Ubuntu/Mint/Crunchbang):
apt-get update
apt-get install ia32-libs

Build sqlcipher on ubuntu

Hi I'm trying to build sqlcipher on ubuntu (11.10 minimal). On Mac OS X I had no problems though.
I followed the instructions from sqlcipher.net. First step was configure. I tried to execute configure with the following command:
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
but I got the following error message: "configure: error: C compiler cannot create executables"
In the config.log some lines caught my eyes but I don't know how to fix it:
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
configure:2544: $? = 0
configure:2551: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2555: $? = 4
configure:2578: checking for C compiler default output file name
configure:2600: gcc -DSQLITE_HAS_CODEC -lcrypto conftest.c >&5
/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
Has anybody successfully build sqlcipher on ubuntu yet? Regards
You will need to install the GNU compiler toolchain in order to build from source. Execute the following command in a terminal.
$ sudo apt-get install build-essential

Resources