Opened 14 years ago

Closed 12 years ago

#23320 closed defect (fixed)

fail to install wxWidgets-devel +universal on snow leopard

Reported by: klebermagno@… Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: mww@…, domiman@…, usami-k@…, gerald@…, piotr1212@…, bfulgham@…
Port: wxWidgets-devel

Description

When I try install wxwidgets-devel on snow leopard I got this message.

DEBUG: Executing org.macports.build (wxWidgets-devel)
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.6'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.0/build" && /usr/bin/make -j2'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.0/build/bk-make-pch ./.pch/wxprec_monodll/wx/wxprec.h.gch wx/wxprec.h /usr/bin/g++-4.2 -mmacosx-version-min=10.6 -I./.pch/wxprec_monodll -D__WXOSX_COCOA__     -DWXBUILDING      -I../src/regex  -DwxUSE_BASE=1 -DWXMAKINGDLL -I../src/stc/scintilla/include -I../src/stc/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -dynamic -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.0/build/lib/wx/include/osx_cocoa-unicode-release-2.9 -I../include -I/opt/local/include -I/opt/local/include -DWX_PRECOMP -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -O2 -arch x86_64 -arch i386 -fno-common -fvisibility=hidden -fvisibility-inlines-hidden
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.0/build/bk-make-pch ./.pch/wxprec_gldll/wx/wxprec.h.gch wx/wxprec.h /usr/bin/g++-4.2 -mmacosx-version-min=10.6 -I./.pch/wxprec_gldll -D__WXOSX_COCOA__     -DWXBUILDING      -I../src/regex  -DWXUSINGDLL -DWXMAKINGDLL_GL -dynamic -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.0/build/lib/wx/include/osx_cocoa-unicode-release-2.9 -I../include -I/opt/local/include -I/opt/local/include -DWX_PRECOMP -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -O2 -arch x86_64 -arch i386 -fno-common -fvisibility=hidden -fvisibility-inlines-hidden
g++-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
make: *** [.pch/wxprec_monodll/wx/wxprec.h.gch] Error 1
make: *** Waiting for unfinished jobs....
g++-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
make: *** [.pch/wxprec_gldll/wx/wxprec.h.gch] Error 1
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.0/build" && /usr/bin/make -j2 " returned error 2
DEBUG: Backtrace: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.0/build" && /usr/bin/make -j2 " returned error 2
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 9)
    invoked from within
"$procedure $targetname"
Warning: the following items did not execute (for wxWidgets-devel): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Change History (14)

comment:1 Changed 14 years ago by mf2k (Frank Schima)

Cc: mww@… added
Keywords: build fail wxwidgets-devel removed
Milestone: MacPorts 1.8.3
Owner: changed from macports-tickets@… to jwa@…

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

Port: wxWidgets-devel added; wxwidgets-devel removed
Summary: fail to install wxwidgets-devel on snow leopardfail to install wxWidgets-devel +universal on snow leopard

comment:3 Changed 14 years ago by domiman@…

Cc: domiman@… added

Cc Me!

comment:4 Changed 14 years ago by domiman@…

see ticket #21530 for a proposed portfile that builds universal. I'm trying this now :)

comment:5 Changed 14 years ago by usami-k@…

Cc: usami-k@… added

Cc Me!

comment:6 in reply to:  4 ; Changed 14 years ago by ruud@…

Replying to domiman@…:

see ticket #21530 for a proposed portfile that builds universal. I'm trying this now :)

As stated in that ticket, this problem could/should be solved now.

comment:7 in reply to:  6 Changed 14 years ago by wpdster@…

Replying to ruud@…:

Replying to domiman@…:

see ticket #21530 for a proposed portfile that builds universal. I'm trying this now :)

As stated in that ticket, this problem could/should be solved now.

I just tried:

$ sudo port install wxwidgets-devel +universal

and it failed. A pertinent portion of the log file appears to be:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-
2.9.1/build/bk-make-pch ./.pch/wxprec_monodll/wx/wxprec.h.gch wx/wxprec.h /usr/bin/g++-4.2 -mmacosx-version-
min=10.6 -I./.pch/wxprec_monodll -D__WXOSX_COCOA__      -DWXBUILDING      -I../src/regex  -DwxUSE_BASE=1
 -DWXMAKINGDLL -I../src/stc/scintilla/include -I../src/stc/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS
 -dynamic -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual
 -Wno-deprecated-declarations -D_FILE_OFFSET_BITS=64 -I/opt/local/var/macports/build
/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-
2.9.1/build/lib/wx/include/osx_cocoa-unicode-2.9 -I../include -I/opt/local/include -I/opt/local/include
 -DWX_PRECOMP -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -O2 -arch x86_64 -arch i386 -fno-common
 -fvisibility=hidden -fvisibility-inlines-hidden
:info:build g++-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags

comment:8 Changed 13 years ago by gerald@…

Cc: gerald@… added

Cc Me!

comment:9 Changed 13 years ago by cdavis@…

All right, I've worked through this, and there are three distinct issues here:

  1. Using dependency options and compiling PCH files

You can't do either of those with multiple arch flags. Even if you remove the dependency options, when gcc tries to precompile a header into a PCH given multiple arch flags, it will instead try to compile a regular ol' program instead. (ld will complain that '_main' is undefined.)

I fixed it locally by the port belong to the muniversal group.

  1. OBJCXXFLAGS isn't set

OK, you got past the first problem, and wxWidgets is building just fine. Suddenly, the build stops with an error message. Looking at the log file reveals a bunch of 'file is not of the architecture being linked' messages from ld.

Inspecting the files that were compiled wrong reveals something telling: They're all Objective-C++ files! For some reason, wx's build system uses the OBJCXXFLAGS variable instead of the CXXFLAGS variable when compiling an Objective-C++ file. Since the Portfile didn't set OBJCXXFLAGS, no Objective-C++ sources get built for the right architecture. I fixed it by manually playing with the top-level makefile, but the right way to fix this is to set OBJCXXFLAGS in the Portfile during the configure stage.

  1. Symlink merging madness

Finally, you solved problems 1 and 2 and got the build to finish. Because we put wxWidgets-devel in the muniversal group, now MacPorts will install the two build trees into two destroots, then merge them together. Unfortunately, there's one small problem with that: MacPorts doesn't know how to merge symlink files. Here's a relevant snippet from the log:

:debug:destroot universal: merge: /opt/local/lib/wx-devel/bin/wx-config only exists in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/destroot-x86_64
:debug:destroot universal: merge: /opt/local/lib/wx-devel/bin/wx-config only exists in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/destroot-i386

So it knows that both symlinks are there, but it thinks they're distinct. So, it copies each one over to the merged destroot. Unfortunately, copying the second one fails because the file already exists:

:error:destroot Target org.macports.destroot returned: error copying "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/destroot-i386//opt/local/lib/wx-devel/bin/wx-config" to "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/destroot-intel//opt/local/lib/wx-devel/bin/wx-config": file already exists

This is as far as I got. One possible solution is to forcibly copy the symlink over. However, I think the real solution is to teach MacPorts to recognize and handle symlinks properly when merging two destroots.

comment:10 Changed 13 years ago by piotr1212@…

Cc: piotr1212@… added

Cc Me!

comment:11 Changed 13 years ago by piotr1212@…

I get the wxwidgets-devel port installed, but when I try to run a program which is linked to wxwidgets I get the next error:

$ ./bitcoin 
dyld: Library not loaded: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_wxWidgets-devel/work/wxWidgets-2.9.1/build/lib/libwx_osx_carbonu-2.9.1.0.0.dylib
  Referenced from: /usr/local/src/bitcoin/trunk/./bitcoin
  Reason: image not found
Trace/BPT trap

Why does it try to load the library from that path?

comment:12 Changed 13 years ago by bfulgham@…

Cc: bfulgham@… added

Cc Me!

comment:13 Changed 12 years ago by jyrkiwahlstedt

Is this still a problem with 2.9.4? On Lion and ML wxWidgets-devel builds fine with universal (just checked)

comment:14 Changed 12 years ago by jyrkiwahlstedt

Resolution: fixed
Status: newclosed

getting no comments, this will be closed for now, can be reopened, if the problem persists

Note: See TracTickets for help on using tickets.