Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1771 closed defect (fixed)

libintl.h missing when compiling on OS X

Reported by: adabe588@… Owned by: somebody
Priority: high Milestone: 1.9.0
Component: Build Environment Version:
Keywords: Cc:

Description

I'm using the latest revision, 12504, and after running

make clean
./configure 'CFLAGS=-O1 -I/opt/local/include' 'LDFLAGS=-L/opt/local/lib' --with-qwt=/opt/local/include --with-paradiseo=/opt/local/include --with-omniORB=/opt/local
make omc

I get the error:

g++  -I../Compiler/ -I/opt/local/include/plain -I. -Iantlr-3.2/runtime/C -Iantlr-3.2/runtime/C/include -I../build/include/omc -I../Compiler/runtime  -c -o Parser_omc.o Parser_omc.cpp
In file included from ./ModelicaParserCommon.h:39,
                 from ./MetaModelica_Lexer.h:115,
                 from parse.c:49,
                 from Parser_omc.cpp:35:
../Compiler/runtime/systemimpl.h:45:21: error: libintl.h: No such file or directory
make[4]: *** [Parser_omc.o] Error 1

Am i missing some dependency? Should configure have caught this?

Change History (14)

comment:1 by Martin Sjölund, 12 years ago

Resolution: fixed
Status: newclosed

You are missing parts of gettext (libintl.h is in the macports gettext module; I'm adding it to the Portfile and configure.in now). Reopen this if the problem persists.

comment:2 by adabe588@…, 12 years ago

Resolution: fixed
Status: closedreopened

The problem persists. I have installed gettext and verified that /opt/local/include/libintl.h exists. after running

make clean
./configure 'CFLAGS=-O1 -I/opt/local/include' 'LDFLAGS=-L/opt/local/lib' --with-qwt=/opt/local/include --with-paradiseo=/opt/local/include --with-omniORB=/opt/local

(same as before)
configure.log contains:

configure:5140: checking gettext linking
configure:5157: gcc -o conftest -O1 -I/opt/local/include  -L/opt/local/lib conftest.c  >&5
Undefined symbols for architecture x86_64:
  "_libintl_gettext", referenced from:
      _main in ccjX7gTx.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

and trying to make omc fails after that.

comment:3 by Martin Sjölund, 12 years ago

I wonder if this has anything to do with me using the macports version of gcc (GNU libc includes gettext, so maybe they automatically link it in?). I will make some tests.

comment:4 by adabe588@…, 12 years ago

I am using the developer gcc tools in /usr/bin/gcc so that would make sense. I can try switching.

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

I got the following now; might be an issue:

checking libintl.h usability... yes
checking libintl.h presence... no
configure: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: libintl.h: proceeding with the compiler's result
checking for libintl.h... yes
checking gettext linking... in intl

What version of OSX are you running? And do you have libintl.{a,so}?

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

This works better for the configure, so it wasn't wrong before (CPPFLAGS instead of CFLAGS):

./configure 'CFLAGS=-fno-inline -O1 -m64' CPPFLAGS='-I/opt/openmodelica/include' 'LDFLAGS=-L/opt/openmodelica/lib' 'RMLHOME=/opt/openmodelica' 'MAKE=gmake' '--without-qwt'

And CPPFLAGS are not accepted everywhere in the Makefiles it seems. I will try to add them where required and see if it works properly then.

comment:7 by adabe588@…, 12 years ago

Okay, great!

I'm on 10.7.4, libintl.a is present but I can't seem to find libintl.so

comment:8 by adabe588@…, 12 years ago

By the way, I get the same issue with

> gcc --version
gcc (MacPorts gcc47 4.7.1_2) 4.7.1

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

I'm running a full recompile now :) The little Mac Mini will be screaming for an hour or so.

comment:10 by Martin Sjölund, 12 years ago

Ok, it seems to work for me, but I think I know what you need to do.

svn up
make -C Compiler/runtime clean
make -C Parser clean
make -j2 omc

comment:11 by adabe588@…, 12 years ago

Resolution: fixed
Status: reopenedclosed

Great! I added CPPFLAGS, did a make clean (not sure if that was necessary, but I had already done it), ran configure, make -j2 omc and it compiled. I was using macports gcc for this and didn't try to switch back. I don't mind, but if you'd like me to test that as well I can.

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

I tried it with XCode gcc, so it should be fine now

comment:13 by Martin Sjölund, 12 years ago

Milestone: 1.9.0

comment:14 by Martin Sjölund, 12 years ago

Component: BackendBuild Environment
Note: See TracTickets for help on using tickets.