Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breakage on freebsd due to bash code in configure script #28

Open
balay opened this issue Sep 28, 2020 · 6 comments
Open

breakage on freebsd due to bash code in configure script #28

balay opened this issue Sep 28, 2020 · 6 comments

Comments

@balay
Copy link

balay commented Sep 28, 2020

This is with: ac89ea4

checking for ColPack/ColPackHeaders.h... yes
./configure: 18943: Syntax error: Bad for loop variable

workaround:

diff --git a/configure b/configure
index b929859b..81842168 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /usr/bin/env bash
 # From configure.ac Revision.
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for adolc 2.7.3-trunk.

config.log

cc: @caidao22

@awalther1
Copy link
Contributor

one question: It says "adolc 2.7.3-trunk" in your message. Is this the current version of ADOL-C in the master branch or version 2.7.2?

@balay
Copy link
Author

balay commented Oct 1, 2020

The build was using the commit mentioned above [at that time - latest master branch]

[balay@pj01 ADOL-C]$ git branch -r --contains ac89ea4
  origin/HEAD -> origin/master
  origin/master

@awalther1
Copy link
Contributor

thanks for clarifying, will look at this as soon as possible

@hcsch
Copy link

hcsch commented Jan 31, 2021

In configure.ac the string equality operator bashism ==(not POSIX) is used a lot (lines 32, 37, 285, etc.), instead of =. There is also one use of [[ (line 654) instead of [ which is also a bashism (and not POSIX). There's also one arithmetic for-loop (line 734; also not POSIX) which could be replaced with a simple for i in 5 4 3 2 1; do or similar.
I personally use dash as my /bin/sh and that really only supports POSIX syntax, so these bashisms break the configure script for me.
I'm not familiar with autoconf, but I would assume replacing the above bashisms for their POSIX equivalents and re-generating configure should fix this issue. Using a #!/usr/bin/env bash shebang like suggested by @balay as a workaround might also be an option, though I don't know if autoconf allows for that.

@hcsch
Copy link

hcsch commented Jan 31, 2021

After looking a bit into how autoconf is used, I noticed that autoconf/colpack.m4 also contains non-POSIX script elements. I tried replacing all non-POSIX constructs with POSIX compliant equivalents, the configure script generated by autoreconf (version 2.70 as currently distributed for Arch) after that is however still broken, though in a different way. There now is a broken case statement missing a parenthesis and a stray parenthesis one thousand lines later in the file. (Manually fixing those by adding a parenthesis to the case and removing the stray seemingly makes the configure script work.)
If this is helpful in fixing this issue I can create a pull-request with my POSIX-ifying changes to configure.ac and colpack.m4. I could also include the configure script as generated by autoreconf from the modified files.
I don't think I'll be able to figure out much more than this though, because how the case statement that is broken and the stray parenthesis are generated from the autoconf macros eludes me, frankly.
Please correct me if I've misunderstood something about the usage of autoconf or have made any incorrect assumptions in general.

@awalther1
Copy link
Contributor

thanks a lot for the hints, I will try to fix them as soon as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants