possibly undefined macro: AC_SUBST - autoconf

I am trying to build a project and it throws me an error :
autoreconf: running: /usr/bin/autoconf --force
configure.ac:19: error: possibly undefined macro: AC_SUBST
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
I am very new to build tools, thats why this error is driving me crazy.
Can someone help me figure out what I should do to resolve this issue?
EDIT : Corresponding line in configure.ac is :
Hey I still not able to figure out whats wrong with my configure.ac.
My configure.ac looks like this :
PKG_CHECK_MODULES(libcurl, libcurl)
AP_VERSION=2.2.4
AP_CHECK_APACHE([$AP_VERSION], [
LIBTOOL="`$APR_CONFIG --apr-libtool`"
AC_SUBST([LIBTOOL])
MODULE_CFLAGS="$AP_CFLAGS"
AC_SUBST([MODULE_CFLAGS])
MODULE_LDFLAGS="`$APR_CONFIG --link-libtool` `$APU_CONFIG --link-libtool`"
AC_SUBST([MODULE_LDFLAGS])
BIN_LDFLAGS="`$APR_CONFIG --link-libtool` `$APU_CONFIG --link-libtool` `$APR_CONFIG --ldflags --libs` `$APU_CONFIG --ldflags --libs`"
AC_SUBST([BIN_LDFLAGS])
prefix="$AP_PREFIX"
], AC_MSG_ERROR([*** Apache version $AP_VERSION not found!]))
It breaks at AC_SUBST([LIBTOOL]). Please help

apt install pkg-config m4 libtool automake autoconf

This is an unfortunate way autoconf tends to fail. Check for the last macro that was called before AC_SUBST, that's the real undefined one.

Related

cabal install `gcc' failed in phase `C Compiler'

I want to use parsec for a personal project. But when I invoke cabal install parsec, I get an error:
clang: error: unknown argument: '-no-pie'
gcc' failed in phase `C Compiler'. (Exit code: 1)
I am on OS X El Capitan, 10.11.6. If I have understood correctly he error message above, gcc seems to be the cause. When I check the version of gcc, I get
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
Besides, I have read this `gcc.exe' failed in phase `C Compiler'. (Exit code: 1) and after stack setup--reinstall, stack install parsec worked very well. But cabal always not. Can you help me?
I had the same problem in the same time :-)
Most answers I’ve found on stackoverflow is about to update Xcode.
But! I’ve seen that suggestions since 2013, and in that case, I can’t update Xcode, because I have old Macbook and OS X 10.11 on it, i have tried:
brew install gcc
Next step I wondering how to setup Gnu C Compler over Xcode and found right now how.
Open in terminal with your fav. editor:
mate /Library/Frameworks/GHC.framework/Versions/8.4.2-x86_64/usr/lib/ghc-8.4.2/settings
And change this:
, ("C compiler command","gcc")
, ("C compiler flags"," -fno-stack-protector")
, ("C compiler link flags"," ")
, ("C compiler supports -no-pie","YES")
, ("Haskell CPP command","gcc")
with /usr/local/bin/gcc-8 instead gcc & "NO" instead "YES»
Hope it helps <3

Cannot install accelerate-cuda in Haskell

I am on a linux box and trying to experiment with Haskell's Accelerate library but having problems installing it. I have successfully installed the accelerate package but there seems to be a dependency problem, which I have detailed below.
cabal: Error: some packages failed to install:
accelerate-cuda-0.14.0.0 depends on haskell-src-exts-1.14.0.1 which failed to
install.
cuda-0.5.1.1 failed during the configure step. The exception was:
ExitFailure 1
haskell-src-exts-1.14.0.1 failed during the configure step. The exception was:
ExitFailure 1
haskell-src-meta-0.6.0.5 depends on haskell-src-exts-1.14.0.1 which failed to
install.
language-c-quote-0.7.6 depends on haskell-src-exts-1.14.0.1 which failed to
install.
I searched SO and noticed someone else had a similiar issue installed the cuda package, and was resolved by adding the cabal bin path to the PATH; I tried this but it didn't solve this problem.
Please could someone help as I really keen to play with this fantastic library.
I wanted to check accelerate-examples and play with them and I also didn't have CUDA GPU (AMD only) and that's how I eventually installed accelerate-examples with stack:
git clone https://github.com/AccelerateHS/accelerate-examples
cd accelerate-examples
#choose version:
ln stack-8.6.yaml stack.yaml
#build without CUDA targeting:
stack build --flag accelerate-examples:-llvm-ptx --flag accelerate-fft:-llvm-ptx
Installation will build all the examples and print the info regarding where they was put.
Might also need to specify GHC libs path with something like: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/rts/
Also checked that accelerate installs as well the same way but even without specifying any flags (I guess because it doesn't build any programs yet?), but examples are what's fun :)
P.S. You can move llvm-ptx flags to stack.yaml config: change # flags: {} line to:
flags:
accelerate-fft:
llvm-ptx: false
accelerate-examples:
llvm-ptx: false

OCaml Compile Error: /usr/bin/ld: cannot find -lstr

I am trying to compile the source code of MEGAM Ocaml library on an Ubuntu 64 machine.
I have OCaml installed (v 3.12.1), using sudo apt-get install ocaml.
I am having an issue when running the "make" command in the terminal on the unzipped source code, with OCaml returning the error:
/user/bin/ld: cannot find -lstr
collect2: error: ld returned 1 exit status
The makefile is producing the following two commands:
ocamldep *.ml > .depend
No error when run
ocamlc -g -custom -o megam str.cma -cclib -lstr bigarray.cma -cclib -lbigarray unix.cma -cclib -lunix -I /usr/lib/ocaml/caml fastdot_c.c fastdot.cmo intHashtbl.cmo arry.cmo util.cmo data.cmo bitvec.cmo cg.cmo wsemlm.cmo bfgs.cmo pa.cmo perceptron.cmo radapt.cmo kernelmap.cmo abffs.cmo main.cmo
Throws the error above when run.
I've tried removing the -lstr from the compile command, it stopped throwing that particular error but started throwing another error (Reference to undefined global 'Bigarray'), which is making me thing it might all be something I missed during the OCaml installation, some kind of PATH or reference I needed to set.
Any help is really appreciated, even if its just a shot in the dark, as am really struggling to come up with anything!
The instructions given here allow me to compile with no error. It boils down to:
locate libcamlstr
which tells me that libcamlstr can be found in /usr/lib/ocaml (YMMV), so I do:
cd /usr/lib/ocaml
sudo ln -s libcamlstr.a libstr.a
Then I'm able to compile the project:
cd /usr/local/src/cil
make clean && ./configure && make
You could just change the makefile from
-lstr
to
-lcamlstr
See the last comment in this bug in the OCaml bug tracker:
Bug 5247

using mupdf ndk-build error

I am trying to use mupdf in android application.I am using windows 7 and cygwin terminal.I used make but it gave error and
make NOX11=yes
execute successfully.
then i used ndk-build and it gives this error.
SharedLibrary : libmupdf.so
c:/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libmupdfcore.a(pdf_fontfile.o)(.text.pdf_lookup_builtin_font+0x18): unresolvable R_ARM_THM_CALL relocation against symbol `strcmp'
c:/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
/cygdrive/c/android-ndk-r8b/build/core/build-binary.mk:378: recipe for target `obj/local/armeabi/libmupdf.so' failed
make: *** [obj/local/armeabi/libmupdf.so] Error 1
please help me.I am new to android ndk.
Thank you.
This seems like a known issue. Try adding the line:
NDK_TOOLCHAIN_VERSION=4.4.3
to the file ..\android\jin\Application.mk. That will at least get rid of this particular error.
EDIT: Look here http://code.google.com/p/android/issues/detail?id=35393 for more information
UPDATE:
mupdf world is a murky one. Even the version of NDK vis-a-vis the version of mupdf (http://mupdf.com/download/archive/) you use will determine what sort of errors or warnings you get. From my experience, mupdf-0.9 (+mupdf-thirdparty-2011-02-24.zip) behaves well with android-ndk-r6b, while mupdf-1.1 (+mupdf-thirdparty-2012-08-14.zip) will behave just fine with android-ndk-r8b.

Trying to install Image.Codec.DevIL under windows. Needs pthread and IL. Can't get IL to work

This is the output from cabal install codec-image-devil:
Resolving dependencies...
Configuring Codec-Image-DevIL-0.2.3...
cabal: Missing dependency on a foreign library:
* Missing C library: IL
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Error: some packages failed to install:
Codec-Image-DevIL-0.2.3 failed during the configure step. The exception was:
ExitFailure 1
I tried --extra-include-dirs and --extra-lib-dirs. but they didn't work. so I edited the .cabal in Codec-Image-DevIL-0.2.3.tar.gz. I don't know if I'm even supposed to change that. but it worked for pthread.
I added these two lines:
include-dirs: C:\Users\Rumbold\Documents\libs\IL\include, C:\Users\Rumbold\Documents\libs\pthread\include, .
extra-lib-dirs: C:\Users\Rumbold\Documents\libs\IL\lib, C:\Users\Rumbold\Documents\libs\pthread\lib, .
They are indented so they are in the Library section. I don't know if I got the format for lists right, just something i stumbled upon while googling. The libs and `header files are all in the correct place, I think.
any clue how i can get it to work?
Edit_1:
I got it to work with --extra-include-dirs and --extra-lib-dirs, so I don't need to edit the cabal anymore. but IL still doesn't work. is there a way to find out which files it's looking for?
Wdit_2:
Alright it works. I had to rename DevIL.lib and DevIL.dll to libIL.lib and libIL.dll. (not sure if I had to do both, but that's what I did. also kept them under their old names)
Edit_3:
Getting lots of errors like:
"cabal\Codec-Image-DevIL-0.2.3\ghc-6.12.3/libHSCodec-Image-DevIL-0.2.3.a(DevIL.o):fake:(.text+0x2379):
undefined reference to `ilGetInteger#4'"

Resources