Opened 10 years ago

Closed 9 years ago

#3361 closed defect (fixed)

Build on OS X fails

Reported by: Henning Kiel Owned by: Martin Sjölund
Priority: high Milestone:
Component: Build Environment Version: trunk
Keywords: Cc: Martin Sjölund, dersh@…

Description

Right out of the box compilation (as advertised) did never work for my machine. However, I could get it to compile successfully with some PATH magic etc.

Since the moving of the repo to GIT it keeps failing whatever I do.

I start this ticket to get the compilation up and running again.
Target is with plain commands (from git), NOT via macports package.

Change History (8)

comment:1 by Henning Kiel, 10 years ago

OMCompiler/3rdParty/ModelicaExternalC is configured with --disable-shared, but afterwards .dylib is expected:

(cd "3rdParty/ModelicaExternalC/BuildProjects/autotools" && (test -f Makefile || (./configure  "--host=x86_64-apple-darwin13.4.0" --libdir="/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/" CC="clang" CFLAGS="-g -O2 -fno-stack-protector" CPPFLAGS="" LDFLAGS="" --disable-hdf5 --enable-static-zlib --enable-static --disable-shared && gmake clean)))
...
/bin/sh ./libtool  --tag=CC   --mode=link clang  -g -O2 -fno-stack-protector -O0 -g   -o libModelicaExternalC.la -rpath /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc ../../C-Sources/ModelicaInternal.lo ../../C-Sources/ModelicaStrings.lo  -lz 
libtool: link: ar cru .libs/libModelicaExternalC.a  ../../C-Sources/ModelicaInternal.o ../../C-Sources/ModelicaStrings.o
libtool: link: ranlib .libs/libModelicaExternalC.a
...
gmake[4]: Entering directory '/Users/henning/src/OpenModelica/OMCompiler/3rdParty/ModelicaExternalC/BuildProjects/autotools'
 ./install-sh -c -d '/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   libModelicaExternalC.la libModelicaStandardTables.la '/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc'
libtool: install: /usr/bin/install -c .libs/libModelicaExternalC.lai /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaExternalC.la
libtool: install: /usr/bin/install -c .libs/libModelicaStandardTables.lai /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaStandardTables.la
libtool: install: /usr/bin/install -c .libs/libModelicaExternalC.a /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaExternalC.a
libtool: install: chmod 644 /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaExternalC.a
libtool: install: ranlib /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaExternalC.a
libtool: install: /usr/bin/install -c .libs/libModelicaStandardTables.a /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaStandardTables.a
libtool: install: chmod 644 /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaStandardTables.a
libtool: install: ranlib /Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaStandardTables.a
gmake[4]: Nothing to be done for 'install-data-am'.
gmake[4]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler/3rdParty/ModelicaExternalC/BuildProjects/autotools'
gmake[3]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler/3rdParty/ModelicaExternalC/BuildProjects/autotools'
Makefile.common:399: recipe for target '/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaExternalC.dylib' failed
gmake[2]: *** [/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libModelicaExternalC.dylib] Error 1
gmake[2]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler'
Makefile:79: recipe for target 'omc-bootstrapped' failed
gmake[1]: *** [omc-bootstrapped] Error 2
gmake[1]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler'
Makefile:6: recipe for target 'omc' failed
gmake: *** [omc] Error 2

I changed to --enable-shared to make it work.

comment:2 by Henning Kiel, 10 years ago

This is my build environment:

$ clang --version
clang version 3.5.2 (tags/RELEASE_352/final)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

$ autoconf ; ./configure CC=clang CXX=clang++ NO_IPOPT=yes ; gmake omc

comment:3 by Henning Kiel, 10 years ago

I'm wondering why Ipopt is compiled, though I disabled it with NO_IPOPT=yes at configure.
Also, the version number 0.0.0 seems odd (though it is even ;-) )

Anyway, Ipopt does not link because of these errors:

clang++ -dynamiclib -single_module  -o .libs/libipopt.0.0.0.dylib .libs/libipopt.0.0.0.dylib-master.o  -L/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc -L/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.4 -L/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.4/../../.. /Users/henning/src/OpenModelica/OMCompiler/3rdParty/Ipopt/ThirdParty/Mumps/.libs/libcoinmumps.dylib /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.4/../../../libgfortran.dylib /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.4/../../../libquadmath.dylib -lgfortran -lSystem -lquadmath -llapack -lblas -lm -ldl  -install_name  /Users/henning/src/OpenModelica/OMCompiler/3rdParty/Ipopt/lib/libipopt.0.dylib -compatibility_version 1 -current_version 1.0
Undefined symbols for architecture x86_64:
  "std::string::rfind(char const*, unsigned long, unsigned long) const", referenced from:
      Ipopt::RegisteredOptions::GetOption(std::string const&) in libipopt.0.0.0.dylib-master.o
[... more errors of same type ...]
  "vtable for std::basic_streambuf<char, std::char_traits<char> >", referenced from:
      Ipopt::IpoptApplication::Initialize(std::string) in libipopt.0.0.0.dylib-master.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:478: recipe for target 'libipopt.la' failed
gmake[5]: *** [libipopt.la] Error 1
gmake[5]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler/3rdParty/Ipopt/Ipopt/src/Interfaces'
Makefile:673: recipe for target 'all-recursive' failed
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler/3rdParty/Ipopt/Ipopt'
Makefile:323: recipe for target 'all-recursive' failed
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler/3rdParty/Ipopt'
Makefile.common:118: recipe for target '/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libipopt.la' failed
gmake[2]: *** [/Users/henning/src/OpenModelica/build/lib/x86_64-darwin13.4.0/omc/libipopt.la] Error 2
gmake[2]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler'
Makefile:79: recipe for target 'omc-bootstrapped' failed
gmake[1]: *** [omc-bootstrapped] Error 2
gmake[1]: Leaving directory '/Users/henning/src/OpenModelica/OMCompiler'
Makefile:6: recipe for target 'omc' failed
gmake: *** [omc] Error 2

Anyone got some ideas on how to fix this?

comment:4 by Adam Dershowitz, 10 years ago

Cc: dersh@… added

comment:5 by grant@…, 9 years ago

I have the same issue. I tried to compile on omc-bootstrapped and got a similar error

comment:6 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:7 by Henning Kiel, 9 years ago

OM seems to compile fine on OS X again. Time to close this issue?

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

Milestone: 1.9.4
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.