Opened 15 years ago

Closed 13 years ago

#22766 closed defect (wontfix)

octave-database-1.0.4 fails to compile because gcc43 doesn't understand command line option "-arch"

Reported by: earcar@… Owned by: anddam (Andrea D'Amore)
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: swig Cc: macports@…, rjbailey@…
Port: octave-database

Description (last modified by anddam (Andrea D'Amore))

Other strange things happens in octave related packages:

checking for gcc... /usr/bin/gcc-4.2
checking whether /usr/bin/gcc-4.2 accepts -g... yes
checking for /usr/bin/gcc-4.2 option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/bin/gcc-4.2 -E
[cut]
/opt/local/bin/g++-mp-4.3 -c -I/opt/local/include -I/opt/local/include -fPIC \
-I/opt/local/include/octave-3.2.3 -I/opt/local/include/octave-3.2.3/octave \
-I/opt/local/include -mieee-fp -I/opt/local/include/freetype2 -I/opt/local/include \
-pipe -arch x86_64 -DHAVE_OCTAVE_32 sqlite3_wrap.cpp -o sqlite3_wrap.o
cc1plus: error: unrecognized command line option "-arch"

This happens because the configure script at first tests for the default compiler (the apple one in my case) and then uses the compiler that built octave (gcc43).

The worst part is that it seems to use MacPorts' default CXXFLAGS:

-pipe -O2 -arch x86_64

in combination with the compiler that built octave:

$ mkoctfile -p CXX     
/opt/local/bin/g++-mp-4.3

The Makeconf file is in fact hilarious about this:

# Most octave programs will be compiled with $(MKOCTFILE).  Those which
# cannot use mkoctfile directly can request the flags that mkoctfile 
# would use as follows:
#    FLAG = $(shell $(MKOCTFILE) -p FLAG)
# The following flags are for compiling programs that are independent
# of Octave.  How confusing.

Yeah, how confusing.

Attachments (2)

octave-database.log (6.1 KB) - added by earcar@… 15 years ago.
octave database build log
different-build-error.txt (8.7 KB) - added by anddam (Andrea D'Amore) 13 years ago.

Download all attachments as: .zip

Change History (15)

Changed 15 years ago by earcar@…

Attachment: octave-database.log added

octave database build log

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Cc: alakazam@… added
Owner: changed from macports-tickets@… to and.damore@…

comment:2 Changed 15 years ago by anddam (Andrea D'Amore)

Status: newassigned

The build script from octave-forge packages uses mkoctfile that is in turn a script created from octave so the dual compiler behavior is not that weird. Two mkoctfile jobs are launched and both break with errors complaining for -arch being not recognized, I'm assuming your macports joblevel is 2.

I just checked man page for g++-mp-4.3 and it has got a -arch options, still not g++-mp-4.3 nor g++-mp-4.2 are not able to understand it, maybe this is an issue of macports' gcc ports, try filing a ticket for those.

comment:3 Changed 15 years ago by alakazam@…

Cc: alakazam@… removed

comment:4 Changed 14 years ago by jmroot (Joshua Root)

Might just need to set configure.compiler?

comment:5 in reply to:  4 Changed 14 years ago by anddam (Andrea D'Amore)

Replying to jmr@…:

Might just need to set configure.compiler?

Do you mean to set configure.compiler to the output of "mkoctave -p CXX"?

comment:6 Changed 14 years ago by anddam (Andrea D'Amore)

Keywords: swig added
Version: 1.8.11.9.1

I tried configure.compiler macports-gcc-4.4 and built with a single build job, I get different errors from the SWIG generated interface files.

Apparently the package is broken mainstream, so apart committing the small fix for compiler I can't do much for now.

I'm attaching output using same compiler of octave, mp-gcc-4.4 in my case.

comment:7 Changed 14 years ago by anddam (Andrea D'Amore)

comment:8 Changed 14 years ago by anddam (Andrea D'Amore)

earcar, can you reproduce the error?

comment:9 Changed 13 years ago by macports@…

Same error here, and there seems to have been no action on this ticket for quite a while. Anyone come up with a fix?

comment:10 Changed 13 years ago by anddam (Andrea D'Amore)

As I already wrote I don't have the compiler issue that the port submitter has.

I'm using

configure.compiler  macports-gcc-4.4
use_parallel_build  no

and I get

CXXFLAGS="-pipe -m64" mkoctfile -DHAVE_OCTAVE_32 -v -o sqlite3.oct -lsqlite3 sqlite3_wrap.cpp
/opt/local/bin/g++-mp-4.4 -c -I/opt/local/include -I/opt/local/include -fPIC -I/opt/local/include/octave-3.2.4 -I/opt/local/include/octave-3.2.4/octave -I/opt/local/include -mieee-fp -I/opt/local/include/freetype2 -I/opt/local/include -pipe -m64 -DHAVE_OCTAVE_32 sqlite3_wrap.cpp -o sqlite3_wrap.o
sqlite3_wrap.cpp: In member function 'void octave_swig_type::install_global()':
sqlite3_wrap.cpp:1197: error: 'curr_sym_tab' was not declared in this scope
sqlite3_wrap.cpp:1197: error: 'link_to_global_variable' was not declared in this scope
sqlite3_wrap.cpp:1204: error: 'symbol_record' was not declared in this scope
sqlite3_wrap.cpp:1204: error: 'sr' was not declared in this scope
sqlite3_wrap.cpp:1204: error: 'global_sym_tab' was not declared in this scope
sqlite3_wrap.cpp: In function 'void SWIG_Octave_SetModule(void*, swig_module_info*)':
sqlite3_wrap.cpp:2110: error: 'curr_sym_tab' was not declared in this scope
sqlite3_wrap.cpp:2110: error: 'link_to_global_variable' was not declared in this scope
sqlite3_wrap.cpp: In function 'octave_value_list _wrap_sqlite3_vmprintf(const octave_value_list&, int)':
sqlite3_wrap.cpp:3029: error: invalid array assignment
sqlite3_wrap.cpp: In function 'octave_value_list Fsqlite3(const octave_value_list&, int)':
sqlite3_wrap.cpp:10430: error: 'curr_sym_tab' was not declared in this scope
sqlite3_wrap.cpp:10430: error: 'link_to_global_variable' was not declared in this scope
make[1]: *** [sqlite3.oct] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_math_octave-database/octave-database/work/database-1.0.4/src'
make: *** [build] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_math_octave-database/octave-database/work/database-1.0.4'
shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_math_octave-database/octave-database/work/database-1.0.4" && /usr/bin/make -w all " returned error 2
Error: Target org.macports.build returned: shell command failed (see log for details)

This seems to be related to this issue that dates back to July '09. Swig's release notes talks about fix and enhancements for Octave in 2.0.4 version that is from May '11 but even with latest swig and swig-octave I have the upward issue.

I've asked the package author for comments.

Changed 13 years ago by anddam (Andrea D'Amore)

Attachment: different-build-error.txt added

comment:11 Changed 13 years ago by anddam (Andrea D'Amore)

Cc: macports@… rjbailey@… added
Resolution: worksforme
Status: assignedclosed

I'm closing this ticket as worksforme.

If someone can reproduce after the latest octave upgrades then reopen it.

comment:12 Changed 13 years ago by macports@…

Resolution: worksforme
Status: closedreopened

I can reproduce the error after the latest octave upgrades.

comment:13 Changed 13 years ago by anddam (Andrea D'Amore)

Description: modified (diff)
Resolution: wontfix
Status: reopenedclosed

The '-march' option is easily corrected in r91251 but the package is broken upstream, cf. 1 and 2 because it has not been upgraded for working with new octave's API.

I'm closing the ticket, I suggest to ask the upstream package author to update the package for octave 3.2.x

Note: See TracTickets for help on using tickets.