Discussion:
[Swig-devel] failed to compile from source code in Mac
Eric Wang
2016-11-03 19:48:08 UTC
Permalink
Hey guys,

I am trying to build swig from source code on Mac, I followed the instructions at http://swig.org/svn.html, I keep running into an error when run “make”, which looks like

13:59:00 ~/swig$ make

make[1]: Entering directory `/Users/Eric/swig/Source'

make all-am

make[2]: Entering directory `/Users/Eric/swig/Source'

depbase=`echo CParse/parser.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\

gcc -DHAVE_CONFIG_H -I../Source/Include -I../Source/CParse -I../Source/Include -I../Source/DOH -I../Source/CParse -I../Source/Preprocessor -I../Source/Swig -I../Source/Modules -I/usr/local/Cellar/pcre/8.39/include -g -O2 -Wall -W -ansi -pedantic -MT CParse/parser.o -MD -MP -MF $depbase.Tpo -c -o CParse/parser.o CParse/parser.c &&\

mv -f $depbase.o $depbaasse.Po

mv: rename CParse/.deps/parser.o to .Po: No such file or directory

make[2]: *** [CParse/parser.o] Error 1

make[2]: Leaving directory `/Users/Eric/swig/Source'

make[1]: *** [all] Error 2

make[1]: Leaving directory `/Users/Eric/swig/Source'

make: *** [source] Error 2



I am totally new to those command line build tools, I just follow the steps, and most of time I have no idea what exactly they are for. Can someone help me understand what was the problem here? Interesting though, when I built swig for the first time a few days ago, everything worked fine, and I do not think I changed anything except upgrading the system from Mac app store.



Thanks

Eric
Eric Wang
2016-11-03 19:52:47 UTC
Permalink
Guys,

I just realized building failed simply because the command itself is wrong. The part “mv -f $depbase.o $depbaasse.Po” should be “mv -f $depbase.Tpo $depbase.Po”.  This seems very weird, and I have no idea how this command is generated. Can someone help me fix it?



Thanks

Eric



From: Eric Wang <***@gmail.com>
Date: Thursday, November 3, 2016 at 12:48 PM
To: <swig-***@lists.sourceforge.net>
Subject: failed to compile from source code in Mac



Hey guys,

I am trying to build swig from source code on Mac, I followed the instructions at http://swig.org/svn.html, I keep running into an error when run “make”, which looks like

13:59:00 ~/swig$ make

make[1]: Entering directory `/Users/Eric/swig/Source'

make all-am

make[2]: Entering directory `/Users/Eric/swig/Source'

depbase=`echo CParse/parser.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\

gcc -DHAVE_CONFIG_H -I../Source/Include -I../Source/CParse -I../Source/Include -I../Source/DOH -I../Source/CParse -I../Source/Preprocessor -I../Source/Swig -I../Source/Modules -I/usr/local/Cellar/pcre/8.39/include -g -O2 -Wall -W -ansi -pedantic -MT CParse/parser.o -MD -MP -MF $depbase.Tpo -c -o CParse/parser.o CParse/parser.c &&\

mv -f $depbase.o $depbaasse.Po

mv: rename CParse/.deps/parser.o to .Po: No such file or directory

make[2]: *** [CParse/parser.o] Error 1

make[2]: Leaving directory `/Users/Eric/swig/Source'

make[1]: *** [all] Error 2

make[1]: Leaving directory `/Users/Eric/swig/Source'

make: *** [source] Error 2



I am totally new to those command line build tools, I just follow the steps, and most of time I have no idea what exactly they are for. Can someone help me understand what was the problem here? Interesting though, when I built swig for the first time a few days ago, everything worked fine, and I do not think I changed anything except upgrading the system from Mac app store.



Thanks

Eric
William S Fulton
2016-11-05 17:33:55 UTC
Permalink
I don't know what you've done, but this should work out the box. Have
you tried from a fresh tarball? Notice that you have to follow a lot
more instructions if building from git as opposed to building from the
tarball. If you are using Mac OSX, also consider using homebrew to
install the prebuiltin binaries unless absolutely need to modfy the
code.

William
Post by Eric Wang
Guys,
I just realized building failed simply because the command itself is wrong.
The part “mv -f $depbase.o $depbaasse.Po” should be “mv -f $depbase.Tpo
$depbase.Po”. This seems very weird, and I have no idea how this command is
generated. Can someone help me fix it?
Thanks
Eric
Date: Thursday, November 3, 2016 at 12:48 PM
Subject: failed to compile from source code in Mac
Hey guys,
I am trying to build swig from source code on Mac, I followed the
instructions at http://swig.org/svn.html, I keep running into an error when
run “make”, which looks like
13:59:00 ~/swig$ make
make[1]: Entering directory `/Users/Eric/swig/Source'
make all-am
make[2]: Entering directory `/Users/Eric/swig/Source'
depbase=`echo CParse/parser.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I../Source/Include -I../Source/CParse
-I../Source/Include -I../Source/DOH -I../Source/CParse
-I../Source/Preprocessor -I../Source/Swig -I../Source/Modules
-I/usr/local/Cellar/pcre/8.39/include -g -O2 -Wall -W -ansi -pedantic -MT
CParse/parser.o -MD -MP -MF $depbase.Tpo -c -o CParse/parser.o
CParse/parser.c &&\
mv -f $depbase.o $depbaasse.Po
mv: rename CParse/.deps/parser.o to .Po: No such file or directory
make[2]: *** [CParse/parser.o] Error 1
make[2]: Leaving directory `/Users/Eric/swig/Source'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/Users/Eric/swig/Source'
make: *** [source] Error 2
I am totally new to those command line build tools, I just follow the steps,
and most of time I have no idea what exactly they are for. Can someone help
me understand what was the problem here? Interesting though, when I built
swig for the first time a few days ago, everything worked fine, and I do not
think I changed anything except upgrading the system from Mac app store.
Thanks
Eric
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Swig-devel mailing list
https://lists.sourceforge.net/lists/listinfo/swig-devel
William S Fulton
2016-11-05 22:38:34 UTC
Permalink
There is no objective C support in the distributed tarball. Where are
you getting your tarball from? You need a good version to begin with
and you haven't stated exactly what you are using.

I'm sorry, I can't help you debug a Mac setup. If one of them is
working and another is not, you'll have to try and look for
differences and compare to see what packages are installed.

William
William,
Thanks a lot for your suggestions. I tried installing from a tarball, and got the same error. I do want to compile from source code, as I am trying to build some objective c wrapper, which is not supported by SWIG.
I also tried uninstall and reinstall all the tools like automake, autoconf, PCRE etc with brew, but the error remains. I compared the Makefile under Source folder from another Mac which has no issue, they look very similar. As I mentioned earlier, it was working, but stopped for unknown reasons. I also tried on a Windows PC, and another Mac, no issue on either of them. So, there must be some problems with my Mac. I examined the Makefile, I assume the problematic commands are generated with below templates, but I can’t figure out where and how they are being used, could you help me understand that?
Thanks
-Eric
$(am__mv) $$depbase.Tpo $$depbase.Po
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
$(am__mv) $$depbase.Tpo $$depbase.Po
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
$(am__mv) $$depbase.Tpo $$depbase.Po
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
$(am__mv) $$depbase.Tpo $$depbase.Po
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
I don't know what you've done, but this should work out the box. Have
you tried from a fresh tarball? Notice that you have to follow a lot
more instructions if building from git as opposed to building from the
tarball. If you are using Mac OSX, also consider using homebrew to
install the prebuiltin binaries unless absolutely need to modfy the
code.
William
Post by Eric Wang
Guys,
I just realized building failed simply because the command itself is wrong.
The part “mv -f $depbase.o $depbaasse.Po” should be “mv -f $depbase.Tpo
$depbase.Po”. This seems very weird, and I have no idea how this command is
generated. Can someone help me fix it?
Thanks
Eric
Date: Thursday, November 3, 2016 at 12:48 PM
Subject: failed to compile from source code in Mac
Hey guys,
I am trying to build swig from source code on Mac, I followed the
instructions at http://swig.org/svn.html, I keep running into an error when
run “make”, which looks like
13:59:00 ~/swig$ make
make[1]: Entering directory `/Users/Eric/swig/Source'
make all-am
make[2]: Entering directory `/Users/Eric/swig/Source'
depbase=`echo CParse/parser.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I../Source/Include -I../Source/CParse
-I../Source/Include -I../Source/DOH -I../Source/CParse
-I../Source/Preprocessor -I../Source/Swig -I../Source/Modules
-I/usr/local/Cellar/pcre/8.39/include -g -O2 -Wall -W -ansi -pedantic -MT
CParse/parser.o -MD -MP -MF $depbase.Tpo -c -o CParse/parser.o
CParse/parser.c &&\
mv -f $depbase.o $depbaasse.Po
mv: rename CParse/.deps/parser.o to .Po: No such file or directory
make[2]: *** [CParse/parser.o] Error 1
make[2]: Leaving directory `/Users/Eric/swig/Source'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/Users/Eric/swig/Source'
make: *** [source] Error 2
I am totally new to those command line build tools, I just follow the steps,
and most of time I have no idea what exactly they are for. Can someone help
me understand what was the problem here? Interesting though, when I built
swig for the first time a few days ago, everything worked fine, and I do not
think I changed anything except upgrading the system from Mac app store.
Thanks
Eric
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Swig-devel mailing list
https://lists.sourceforge.net/lists/listinfo/swig-devel
Loading...