pooler/cpuminer

./configure errors out

OscBacon opened this issue · 10 comments

From running ./configure CFLAGS="-O3", I get:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
./configure: line 3426: Some: command not found
./configure: line 4010: syntax error near unexpected token `('
./configure: line 4010: `case "(($ac_try" in'

Note, I'm using Ubuntu on WSL2.

It seems that ./configure is not generated properly, since some comments aren't commented out.

image

I've attached my ./configure file as a txt.
configure.txt

Any idea what to do?
Commenting out the comments just created more errors further down;

./configure CFLAGS="-O3"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
./configure: line 3454: syntax error near unexpected token `newline'
./configure: line 3454: `    '''

You must be trying to build from the git repo, as that configure file is not the one in the tarball. Did autogen.sh output anything when you run it?

Hi @pooler, sorry for the late reply!
I am indeed trying to build from the repo.
Here's the output I get from autogen.sh:

configure.ac:13: warning: AC_PROG_CC_C99 is obsolete; use AC_PROG_CC
configure.ac:16: warning: ac_ext=c
configure.ac:16: ac_cpp='$CPP $CPPFLAGS'
configure.ac:16: ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
configure.ac:16: ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
configure.ac:16: ac_compiler_gnu=$ac_cv_c_compiler_gnu
configure.ac:16:
configure.ac:16: Some influential environment variables:
configure.ac:16:
configure.ac:16: Use these variables to override the choices made by `configure' or to help
configure.ac:16: it to find libraries and programs with nonstandard names/locations.
configure.ac:16:   CC          C compiler command
configure.ac:16:   CFLAGS      C compiler flags
configure.ac:16:   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
configure.ac:16:               nonstandard directory <lib dir>
configure.ac:16:   LIBS        libraries to pass to the linker, e.g. -l<library>
configure.ac:16:   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
configure.ac:16:               you have headers in a nonstandard directory <include dir>
configure.ac:16: if test -n "$ac_tool_prefix"; then
configure.ac:16:   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
configure.ac:16: set dummy ${ac_tool_prefix}gcc; ac_word=$2
configure.ac:16: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
configure.ac:16: printf %s "checking for $ac_word... " >&6; }
configure.ac:16: if test ${ac_cv_prog_CC+y}
configure.ac:16: then :
configure.ac:16:   printf %s "(cached) " >&6
configure.ac:16: else $as_nop
configure.ac:16:   if test -n "$CC"; then
configure.ac:16:   ac_cv_prog_CC="$CC" # Let the user override the test.
configure.ac:16: else
configure.ac:16: as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
configure.ac:16: for as_dir in $PATH
configure.ac:16: do
configure.ac:16:   IFS=$as_save_IFS
configure.ac:16:   case $as_dir in #(((
configure.ac:16:     '' is m4_require'd but not m4_defun'd
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/programs.m4:41: _AC_CHECK_PROG is expanded from...
./lib/autoconf/programs.m4:101: AC_CHECK_PROG is expanded from...
./lib/autoconf/programs.m4:221: AC_CHECK_TOOL is expanded from...
./lib/autoconf/c.m4:452: AC_PROG_CC is expanded from...
configure.ac:16: the top level
configure.ac:23: warning: The preprocessor macro `STDC_HEADERS' is obsolete.
configure.ac:23:   Except in unusual embedded environments, you can safely include all
configure.ac:23:   ISO C90 headers unconditionally.

Note, I'm using Ubuntu on WSL2.

I'm unable to reproduce your issue under a fresh installation of Ubuntu on WSL2.

# Generated by GNU Autoconf 2.71 for cpuminer 2.5.1.

Something about your setup seems off. The latest Ubuntu still comes with autoconf 2.69, so where does version 2.71 come from?

I installed it from Homebrew

It seems likely that the issue lies with your software environment rather than with cpuminer. I've not encountered any problems building cpuminer on any version of Ubuntu, under WSL or otherwise. I've also had no problems with autoconf 2.71 on other distros.
If you want to get to the bottom of this, I would suggest you try rebuilding your environment from scratch, documenting all the steps along the way.

Hey, so oddly enough, using the apt version of autoconf, rather than the linuxbrew worked for me

Same Error how did you fixed it ?

Sjors commented

Getting the same "Some: command not found" error when running configure. Some time has passed and it seems autoconf is now at version 2.71 in Ubuntu 22.10 (see https://manpages.ubuntu.com/manpages/kinetic/man1/autoconf.1.html).

I just tried building again for a few hours and kind of went full circle and am back to getting the syntax error from the broken comment in the configure file. I tried removing that block with the syntax error but that cascades into creating more errors

I was getting a page fault also trying to build with the "CFLAGS="-O3"" optimization flag but dropping that flag fixed the page fault issue. I am on a slower computer but can build Bitcoin core and other larger projects without problems, so there may be some kind of cyclical inclusion happening that bloats the executable until it crashes the OS.

Additionally I get an error that the 'libjansson' library is not being provided with a version number which minerd requires, and I believe the fix to that part is that the libjansson version in the build script must not be lower than the version installed on the OS, so using the latest version of libjansson stops my build from completing also.

I tried uninstalling and re-installing autoconf, automake, autotools, libtools, autotools-dev, re-downloaded the source a couple of times so I was building with a clean slate, tried running autoupdate as it suggests in the build warning but could not find a path that worked.

Here are the errors I am getting below in case they are of some help ( I was able to see the second error by building without optimizations flags but the program terminates itself right after the error is shown ) -

./configure: line 3449: Some: command not found
./configure: line 4033: syntax error near unexpected token `('
./configure: line 4033: `case "(($ac_try" in'
make: *** [Makefile:459: config.status] Error 2
 ./minerd
./minerd: /usr/local/lib/libjansson.so.4: no version information available (required by ./minerd)

I have tried on Ubuntu 20.04.5 LTS and on MX linux bookworm ( I also got an error regarding incompatibility with 386x CPUs but both of my computers are 64 bit CPUs )