arvindm95 / unladen-swallow

Automatically exported from code.google.com/p/unladen-swallow
Other
0 stars 0 forks source link

Unable to build AllUnitTests target on Darwin with --enable-shared #128

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The AllUnitTests target fails to build for me.  I am using the LLVM which is
in Util/llvm.  This compile command generated by make appears to be missing
a -I:

    g++ -I. -IInclude -I. -I./Include -I/opt/local/include -I./Util/googletest/include -o AllUnitTests 
Unittests/AliasAnalysisTest.cc Unittests/DictTest.cc 
Unittests/MethodObjectTest.cc 
Unittests/PyBytecodeIteratorTest.cc Unittests/RuntimeFeedbackTest.cc 
Unittests/StatsTest.cc 
Unittests/pytest_main.cc libpython2.6.a Util/googletest/gtest.o \
            -L. -L/opt/local/lib `DYLD_LIBRARY_PATH=`pwd`: ./python.exe ./python-config --
cxxflags --ldflags --libs`

The first error is:

    i686-apple-darwin9-g++-4.0.1: pwd: No such file or directory

(dunno what that means) followed by:

    In file included from Unittests/AliasAnalysisTest.cc:1:
    ./Util/PyAliasAnalysis.h:9:23: error: llvm/Pass.h: No such file or directory

I find Pass.h in my sandbox in Util/llvm/include/llvm.  I think there is a
missing -I./Util/llvm/include arg on the g++ command line.

I added that to my Makefile to see if it helped.  Things got ever so
slightly farther:

    i686-apple-darwin9-g++-4.0.1: pwd: No such file or directory
    In file included from ./Util/llvm/include/llvm/Pass.h:32,
             from ./Util/PyAliasAnalysis.h:9,
             from Unittests/AliasAnalysisTest.cc:1:
    ./Util/llvm/include/llvm/System/DataTypes.h:45:3: error: #error "Must #define 
__STDC_LIMIT_MACROS before #including System/DataTypes.h"
    ./Util/llvm/include/llvm/System/DataTypes.h:49:3: error: #error "Must #define 
__STDC_CONSTANT_MACROS before " "#including System/DataTypes.h"
    ...

U-S was configured like so:

    ./configure --prefix=/Users/skip/unladen --enable-shared CFLAGS=-g LDFLAGS=-
L/opt/local/lib CPPFLAGS=-I/opt/local/include

I'm going to try configuring with everything above except --prefix removed.

Original issue reported on code.google.com by skip.mon...@gmail.com on 27 Jan 2010 at 2:24

GoogleCodeExporter commented 8 years ago
This is the problem:

i686-apple-darwin9-g++-4.0.1: pwd: No such file or directory

The shell isn't happy about the nested `expressions`. If you change the `pwd` 
to . (so 
that you have DYLD_LIBRARY_PATH=.), the g++ command works for me.

I'll see what I can do about addressing this.

Original comment by collinw on 27 Jan 2010 at 6:06

GoogleCodeExporter commented 8 years ago
Thanks Collin.  Would replacing `pwd` with either of $(shell pwd) or $$(pwd) 
work?  The  
former assumes GNU make, the latter bash.  Not sure which is the greater evil 
here. ;-)

Tried both.  Both seem to work in my environment.

Original comment by skip.mon...@gmail.com on 27 Jan 2010 at 8:20

GoogleCodeExporter commented 8 years ago
If you're going to require GNU Make, you might want to consider »$(abspath 
.)« as an 
alternative.

<http://www.gnu.org/software/make/manual/make.html>.

Original comment by danchr on 27 Jan 2010 at 9:16

GoogleCodeExporter commented 8 years ago
Can you try out the patch in http://codereview.appspot.com/196072/show? It 
works 
for me on Darwin and Linux.

Original comment by collinw on 30 Jan 2010 at 1:19

GoogleCodeExporter commented 8 years ago
Thanks, Collin, that worked.

Original comment by skip.mon...@gmail.com on 30 Jan 2010 at 2:15

GoogleCodeExporter commented 8 years ago

Original comment by collinw on 10 Mar 2010 at 7:28

GoogleCodeExporter commented 8 years ago
Fixed in r1131.

Original comment by collinw on 10 Mar 2010 at 9:30