Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#25716 closed defect (fixed)

liblastfm-0.3.0 fails to build: configure couldn't read Makefile

Reported by: macports@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc:
Port: liblastfm

Description

When trying to install liblastfm the build fails because it cannot read "src/Makefile". The Makefile does not exist, only toplevel Makefile seems to be created (in

port -v install liblastfm
--->  Computing dependencies for liblastfm.
--->  Configuring liblastfm
==> Welcome to liblastfm configure 
Using /opt/local/libexec/qt4-mac/bin/qmake
==> Determining installation prefix 
Will install to: /opt/local
==> Generating Build System 
==> Generating .qmake.env 
==> Running qpp... 
==> Configuring qmake... 
==> Generating Makefile... 

Good, your configure is finished! Now type: make
cd src && qmake -config release
Error: reinplace: couldn't read file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_liblastfm/work/liblastfm-0.3.0/src/Makefile": no such file or directory
Error: Target org.macports.configure returned: reinplace sed(1) failed
Warning: the following items did not execute (for liblastfm): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Log for liblastfm is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_liblastfm/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Attachments (3)

main.log (33.2 KB) - added by macports@… 14 years ago.
main.log
liblastfm-debug.tar (49.0 KB) - added by macports@… 14 years ago.
Tarball as requested in comment:6
liblastfm-src_Makefile.tar (21.5 KB) - added by macports@… 14 years ago.
Makefile generated in (2) of comment:8

Download all attachments as: .zip

Change History (16)

Changed 14 years ago by macports@…

Attachment: main.log added

main.log

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

Port: liblastfm added

comment:2 Changed 14 years ago by michaelld (Michael Dickens)

Owner: changed from macports-tickets@… to michaelld@…

From a terminal shell, can you go (e.g., "cd" or "pushd") to "port dir liblastfm/work/liblastfm-0.3.0/src" and see if there is any Makefile* there (e.g., "ls Makefile*"). If so, can you create a tarball of them & attach it to this ticket?

comment:3 Changed 14 years ago by michaelld (Michael Dickens)

Correcting the above:

cd `port dir liblastfm`/work/liblastfm-0.3.0
find . -name "Makefile*"

which should return at least one filename (in "."). You could then create a tarball via:

tar cf ~/Desktop/liblastfm-Makefiles.tar `find . -name "Makefile*"`

which puts the tarball on your Desktop and thus easy to attach to this ticket. I think I know the issue, but I'd like to confirm via this tarball. Thanks!

comment:4 Changed 14 years ago by michaelld (Michael Dickens)

I've checked in a trial fix in r69829. Please sync and try again & let this ticket know if it works or not. I'm guessing that the issue is that the generated file is named "Makefile.Release" instead of just "Makefile" -- I'm recompiling qt4-mac right now (without no_debug) & can test this out tonight, but if you're "listening" then maybe you can get there faster.

comment:5 Changed 14 years ago by macports@…

find . -name "Makefile*" returned:

./admin/Makefile.rb
./Makefile

I will not add the tar because your fix seems to work. With your trial fix configure runs fine and compile starts. But compile fails with:

cd src && /usr/bin/make
...
/usr/bin/g++-4.2 -headerpad_max_install_names -L/opt/local/lib -arch x86_64 -arch -Xarch_x86_64 -mmacosx-version-min=10.5 -single_module -dynamiclib -compatibility_version      0.3 -current_version    0.3.0 -install_name     liblastfm.0.dylib
g++-4.2: Invalid arch name : -Xarch_x86_64
make[1]: *** [../_bin/liblastfm.0.3.0.dylib] Error 1
make: *** [__src] Error 2
shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_liblastfm/work/liblastfm-0.3.0" && /usr/bin/make -j2 all " returned error 2
Error: Target org.macports.build returned: shell command failed
Warning: the following items did not execute (for liblastfm): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Log for liblastfm is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_liblastfm/main.log
Error: Status 1 encountered during processing.

In src/Makefile I changed:

LFLAGS        = -headerpad_max_install_names -L/opt/local/lib -arch x86_64 -arch -Xarch_x86_64 -mmacosx-version-min=10.5 -single_module -dynamiclib -compatibility_version      0.3 -current_version    0.3.0 -install_name     liblastfm.0.dylib

to

LFLAGS        = -headerpad_max_install_names -L/opt/local/lib -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -single_module -dynamiclib -compatibility_version      0.3 -current_version    0.3.0 -install_name     liblastfm.0.dylib

(note the removed stray "-arch")

Also, I needed to change the LFLAGS in demos/Makefile, tests/Makefile and src/fingerprint/Makefile

After that liblastfm build successfully.

comment:6 Changed 14 years ago by michaelld (Michael Dickens)

OK; can you do the following, and please do post it this time:

sudo port clean liblastfm
sudo port sync
sudo port -d configure liblastfm 2>&1 | tee ~/Desktop/liblastfm_configure.txt
pushd `port dir liblastfm`/work/liblastfm-0.3.0
tar cf ~/Desktop/liblastfm-debug.tar `find . -name "Makefile*"` ~/Desktop/liblastfm_configure.txt
popd

and then post the tarball "~/Desktop/liblastfm-debug.tar". I need to look at what the top-level Makefile has in it, and the debug log will also tell me some things.

What you did is recreate what I've done on 10.5 i385 -- for 10.6 x86_64. The issue is that the src/Makefile (and the others in subdirs you mention) are created during 'build' dynamically, which means we'd need to correct the issue somehow in qmake or in the .pro files used to create the Makefile's. I tried this route, but quickly got lost since there are so many places where the issues might be. Hence, I moved to using a post-configure script that (1) goes through & tells the top-level Makefile to create the subdir Makefiles, and then (2) patches them (by looking for "-arch ${build_arch} -arch" and replacing it with "-arch ${build_arch}"). This script works on my setup; I had hoped that the new more generic scripts would work on others' setups as well.

Thank you for your continued feedback!

Changed 14 years ago by macports@…

Attachment: liblastfm-debug.tar added

Tarball as requested in comment:6

comment:7 Changed 14 years ago by michaelld (Michael Dickens)

Thanks. From the debugging output I can see that new script is finding the Makefile's to be created & calling the top-level Makefile to make them, and then 'make' is calling 'qmake' to do it's thing -- and, no errors are reported. But, only 2 Makefile's are found in the tarball -- so 'qmake' isn't doing something.

Can you now do:

(1) What does "which qmake" return?

(2) Try this script:

bash
sudo port clean liblastfm
sudo port configure liblastfm
cd `port dir liblastfm`/work/liblastfm-0.3.0/src
export PATH=/opt/local/libexec/qt4-mac/bin:$PATH
sudo qmake -config release

which will either generate 'src/Makefile' (quietly; try "sudo make" after this -- it'll still error out with the stray "-arch" during linking), or complain about something. Please let me know what it returns and, if the latter, can you please post it here? To finish up, enter "exit" & you'll be back where you started.

comment:8 Changed 14 years ago by macports@…

regarding (1)

$ which qmake
/usr/bin/qmake
$ qmake -v
QMake version 2.01a
Using Qt version 4.6.1 in /Library/Frameworks

regarding (2)

bash-3.2$ sudo port clean liblastfm
--->  Cleaning liblastfm
bash-3.2$ sudo port configure liblastfm
--->  Computing dependencies for liblastfm
--->  Fetching liblastfm
--->  Verifying checksum(s) for liblastfm
--->  Extracting liblastfm
--->  Applying patches to liblastfm
--->  Configuring liblastfm
bash-3.2$ cd `port dir liblastfm`/work/liblastfm-0.3.0/src
bash-3.2$ export PATH=/opt/local/libexec/qt4-mac/bin:$PATH
bash-3.2$ which qmake
/opt/local/libexec/qt4-mac/bin/qmake
bash-3.2$ sudo qmake -config release
bash-3.2$ sudo make 
...
/usr/bin/g++-4.2 -headerpad_max_install_names -L/opt/local/lib -arch x86_64 -arch -Xarch_x86_64 -mmacosx-version-min=10.5 -single_module -dynamiclib -compatibility_version 0.3 -current_version    0.3.0 -install_name     liblastfm.0.dylib -o liblastfm.0.3.0.dylib _build/ws.o _build/NetworkAccessManager.o _build/InternetConnectionMonitor.o _build/Xspf.o _build/User.o _build/Track.o _build/Tag.o _build/Playlist.o _build/Mbid.o _build/FingerprintId.o _build/Artist.o _build/Album.o _build/ScrobblerSubmission.o _build/ScrobblerHttp.o _build/ScrobbleCache.o _build/Scrobble.o _build/NowPlaying.o _build/Handshake.o _build/Audioscrobbler.o _build/RadioTuner.o _build/XmlQuery.o _build/UrlBuilder.o _build/misc.o _build/moc_NetworkAccessManager.o _build/moc_InternetConnectionMonitor.o _build/moc_ScrobblerHttp.o _build/moc_Audioscrobbler.o _build/moc_RadioTuner.o  -F/opt/local/libexec/qt4-mac/lib -L/opt/local/libexec/qt4-mac/lib -framework SystemConfiguration -framework Carbon -framework CoreFoundation -framework QtXml -framework QtNetwork -framework QtCore  
g++-4.2: Invalid arch name : -Xarch_x86_64
make: *** [../_bin/liblastfm.0.3.0.dylib] Error 1

Changed 14 years ago by macports@…

Attachment: liblastfm-src_Makefile.tar added

Makefile generated in (2) of comment:8

comment:9 Changed 14 years ago by michaelld (Michael Dickens)

OK; so you already have Qt installed ... that might make a difference. Can you do:

sudo port clean liblastfm
sudo port configure liblastfm
cd `port dir liblastfm`/work/liblastfm-0.3.0/src
sudo /usr/bin/qmake -config release

and see if using the other 'qmake' works on that last line.

comment:10 Changed 14 years ago by macports@…

$ sudo port clean liblastfm
--->  Cleaning liblastfm
$ sudo port configure liblastfm
--->  Computing dependencies for liblastfm
--->  Fetching liblastfm
--->  Verifying checksum(s) for liblastfm
--->  Extracting liblastfm
--->  Applying patches to liblastfm
--->  Configuring liblastfm
$ cd `port dir liblastfm`/work/liblastfm-0.3.0/src
$ sudo /usr/bin/qmake -spec macx-g++ -config release

The spec definition is needed because qmake will create a xcode-project otherwise. Unfortunately, I cannot test further because the installed Qt is 32bit:

$ sudo make
/usr/bin/g++-4.2 -c -pipe -fno-operator-names -O2 -arch x86_64 -I/opt/local/include -fvisibility-inlines-hidden -fvisibility=hidden -arch i386 -Wall -W -fPIC -DQT_NO_DEBUG -DQT_XML_LIB -DQT_NETWORK_LIp
In file included from /Library/Frameworks/QtCore.framework/Versions/4/Headers/QtGlobal:1,
                 from /opt/local/include/lastfm/global.h:24,
                 from ws/ws.h:23,
                 from ws/ws.cpp:20:
/Library/Frameworks/QtCore.framework/Versions/4/Headers/qglobal.h:288:2: error: #error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."
lipo: can't open input file: /var/tmp//cce6R0bo.out (No such file or directory)
make: *** [_build/ws.o] Error 1

Additionally, the Makefile is now generated with -arch x86_64 and -arch i386 (but I think this is to be expected, because it is a 32bit Qt)

$ cat Makefile

#############################################################################
# Makefile for building: liblastfm.0.3.0.dylib
# Generated by qmake (2.01a) (Qt 4.6.1) on: Mon Jul 19 18:50:34 2010
# Project:  lastfm.pro
# Template: lib
# Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -config release -o Makefile lastfm.pro
#############################################################################

####### Compiler, tools and options

CC            = /usr/bin/gcc-4.2
CXX           = /usr/bin/g++-4.2
DEFINES       = -DQT_NO_DEBUG -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS        = -pipe -O2 -arch x86_64 -I/opt/local/include -arch i386 -Wall -W -fPIC $(DEFINES)
CXXFLAGS      = -pipe -fno-operator-names -O2 -arch x86_64 -I/opt/local/include -fvisibility-inlines-hidden -fvisibility=hidden -arch i386 -Wall -W -fPIC $(DEFINES)
INCPATH       = -I/usr/local/Qt4.6/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/usr/include/QtNetwork -I/Library/Frameworks/QtXml.framework/Versions/4/Headers -I/usr/include/QtXml -I/usr/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_liblastfm/work/liblastfm-0.3.0/_include -I_build -F/Library/Frameworks
LINK          = g++
LFLAGS        = -headerpad_max_install_names -L/opt/local/lib -arch x86_64 -arch i386 -single_module -dynamiclib -compatibility_version	0.3 -current_version	0.3.0 -install_name	liblastfm.0.dylib
LIBS          = $(SUBLIBS) -F/Library/Frameworks -L/Library/Frameworks -framework SystemConfiguration -framework Carbon -framework CoreFoundation -framework QtXml -framework QtNetwork -framework QtCore 
AR            = ar cq
RANLIB        = ranlib -s
QMAKE         = /usr/bin/qmake
TAR           = tar -cf
COMPRESS      = gzip -9f
COPY          = cp -f
SED           = sed
COPY_FILE     = cp -f
COPY_DIR      = cp -f -R
STRIP         = 
INSTALL_FILE  = $(COPY_FILE)
INSTALL_DIR   = $(COPY_DIR)
INSTALL_PROGRAM = $(COPY_FILE)
DEL_FILE      = rm -f
SYMLINK       = ln -f -s
DEL_DIR       = rmdir
MOVE          = mv -f
CHK_DIR_EXISTS= test -d
MKDIR         = mkdir -p
export MACOSX_DEPLOYMENT_TARGET = 10.4

####### Output directory

comment:11 Changed 14 years ago by michaelld (Michael Dickens)

OK; so in the latest "script", if you did just "sudo /usr/bin/qmake -config release" (without the "-spec macx-g++") then what is returned? I assume this doesn't create a Makefile but doesn't generate errors either (sounds like it generates an XCode project file of something like that)?

I think the issue is that for running 'configure' the correct version of 'qmake' is used (the MacPorts' version in /opt/local/libexec/qt4-mac/bin), while for the post-configure the one in /usr/bin is being used -- resulting in no Makefile but also not direct error. I'm working on getting the PATH correct for both configure parts, and I'll check in a trail fix when it works for me.

comment:12 Changed 14 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

OK; should be fixed in r69884. Please "sync" and try again. MacPorts' 'qmake' should now be used for both 'configure' as well as the 'post-configure' "make" calls. I'm closing this ticket, but please reopen it if these changes do not work for you.

comment:13 Changed 14 years ago by macports@…

works for me, thanks a lot.

Note: See TracTickets for help on using tickets.