Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4326 closed defect (fixed)

Syntax error from configure script when trying to compile OpenModelica

Reported by: nils.henkel@… Owned by: Martin Sjölund
Priority: high Milestone: 1.12.0
Component: Build Environment Version:
Keywords: Cc:

Description

I am trying to compile OpenModelica on RedHat 6.7

Procedure:
1.) Clone from GitHub:
$ git clone --recursive https://github.com/OpenModelica/OpenModelica.git

2.) Compilation according to README.md:
$ autoconf
$ ./configure CC=clang CXX=clang++
[...]
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
./configure: line 4162: syntax error near unexpected token `fi'
./configure: line 4162: `fi'
configure: error: ./configure failed for OMCompiler

Since the full output is long, I am attaching 'openmodelica-compilation.txt' which contains my full output.

Thanks,
Nils
checking whether gfortran accepts -g... yes
./configure: line 4162: syntax error near unexpected token `fi'
./configure: line 4162: `fi'
configure: error: ./configure failed for OMCompiler

Attachments (2)

configure (127.2 KB ) - added by nils.henkel@… 8 years ago.
configure script created by autoconf
configure.2 (324.0 KB ) - added by nils.henkel@… 8 years ago.
OMCompiler configure script

Download all attachments as: .zip

Change History (12)

comment:1 by nils.henkel@…, 8 years ago

Note: I got an error when trying to attach my file. So here is the full output:

$ autoconf
$ ./configure CC=clang CXX=clang++
checking for gcc... clang
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
ln: creating symbolic link `.git/hooks/pre-commit': File exists
configure: OpenModelica commit-msg hook has been installed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
build_short: x86_64-linux-gnu
host_short: x86_64-linux-gnu
checking if cppruntime is requested... no
checking for omlibrary target... core
checking for libraries directory... yes
checking for CORBA... none
configure: creating ./config.status
config.status: creating Makefile
=== configuring in OMCompiler (/appl/tools/openmodelica/nils-git2/OpenModelica/OMCompiler)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/appl/tools/openmodelica/nils-git2/OpenModelica/build'  'CC=clang' 'CXX=clang++' '--with-ombuilddir=/appl/tools/openmodelica/nils-git2/OpenModelica/build' --cache-file=/dev/null --srcdir=.
ln: creating symbolic link `.git/hooks/pre-commit': File exists
configure: OpenModelica commit-msg hook has been installed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
build_short: x86_64-linux-gnu
host_short: x86_64-linux-gnu
checking for gcc... clang
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C preprocessor... clang -E
checking whether make sets $(MAKE)... yes
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
./configure: line 4162: syntax error near unexpected token `fi'
./configure: line 4162: `fi'
configure: error: ./configure failed for OMCompiler

comment:2 by Martin Sjölund, 8 years ago

You need to use a non-German locale to attach files to a Trac system. I would need the OMCompiler/configure file to see which line is wrong (it is generated by your system's autoconf).

comment:3 by nils.henkel@…, 8 years ago

Thanks. I am attempting now to attach the generated configure script.

by nils.henkel@…, 8 years ago

Attachment: configure added

configure script created by autoconf

comment:4 by nils.henkel@…, 8 years ago

Hi,

if anyone could help, it would be much appreciated.

Regards,
Nils

comment:5 by Martin Sjölund, 8 years ago

This is the configure file for OpenModelica, not OMCompiler.

comment:6 by nils.henkel@…, 8 years ago

Right. Turns out that was why I did not understand the error myself. I am attaching the correct configure script. In that one, the syntax error is obvious. After I fixed that manually, I could run the configuration.

by nils.henkel@…, 8 years ago

Attachment: configure.2 added

OMCompiler configure script

comment:7 by Martin Sjölund, 8 years ago

So it's an old autoconf that likes to emit bad code. Newer autoconf handles empty statements fine :)

I suppose the following should make it work fine and avoid the manual tweaking of configure:

  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index e983bb1..1808849 100644
    a b AC_ARG_WITH(msys, [ --with-msys[=no] Point to an msys installation  
    163163    CPPFLAGS="$CPPFLAGS -I$withval/$MINGWNUM/include -I$withval/$MINGWNUM/include/tre"
    164164    LDFLAGS="$LDFLAGS -L$withval/$MINGWNUM/lib"
    165165    echo "Got: $CPPFLAGS"
    166   ],
    167   [
    168166  ]
    169167)

comment:8 by Martin Sjölund, 8 years ago

Milestone: Future1.12.0
Resolution: fixed
Status: newclosed

comment:10 by nils.henkel@…, 8 years ago

Thanks a lot, that solved this problem!

Note: See TracTickets for help on using tickets.