Author Topic: can not compile headless on osx  (Read 6002 times)

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #15 on: April 09, 2014, 03:26:22 PM »
You are the man! ;D I got the nox executable and it seems to be okay, will try to set it up sometime soon!

Though I have the following remarks:
  • qmake qbittorrent.pro only works if I run configure before. On a fresh folder the make command after qmake gives: make: *** No targets specified and no makefile found.  Stop.
  • Bundling the nox build is an error, the app has a huge "no entry sign" on the icon and won't run with a double click. Only the executable is needed.
  • The boost library from homebrew has dylib-s instead of so files, which is the equivalent default on a mac. So if configure is needed and it's using /usr/local/Cellar as a source, there are no .so files in that directory tree. I think other paths are symlink to these files.

And just out of curiosity, what will be the official way of fixing the issue? Apart from the obvious main.cpp addition. Will the forementioned and the missing nogui switch be revised or just added to the wiki to use them in the correct order and edit macxconf.pri if you want a headless build?

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +151/-2
    • View Profile
Re: can not compile headless on osx
« Reply #16 on: April 09, 2014, 03:58:45 PM »
You are the man! ;D I got the nox executable and it seems to be okay, will try to set it up sometime soon!

Though I have the following remarks:
  • qmake qbittorrent.pro only works if I run configure before. On a fresh folder the make command after qmake gives: make: *** No targets specified and no makefile found.  Stop.

Try one of these(in the order defined) instead of the configure script:
Code: [Select]
qmake "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -macx "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -macx "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -makefile "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -makefile -macx "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
  • Bundling the nox build is an error, the app has a huge "no entry sign" on the icon and won't run with a double click. Only the executable is needed.

Does the bundle include the libraries too(qt, boost, libtorrent, openssl etc)? If yes, I don't know how else you could distribute it, since the binary will not run on other machines that don't have these libs installed.

And just out of curiosity, what will be the official way of fixing the issue? Apart from the obvious main.cpp addition. Will the forementioned and the missing nogui switch be revised or just added to the wiki to use them in the correct order and edit macxconf.pri if you want a headless build?

I am revising the build system for 3.2.x. I will take this into account. Are you willing to make test builds in the future to see if my changes work?

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +151/-2
    • View Profile
Re: can not compile headless on osx
« Reply #17 on: April 09, 2014, 04:05:46 PM »
After reading the qmake manual, I want you to try this in order to disable the bundle:

1. If the above qmake instructions work try this:
Code: [Select]
qmake "CONFIG += release nox" "CONFIG -= app_bundle debug" qbittorrent.pro
2. If the above doesn't work edit macxconf.pri and put
Code: [Select]
CONFIG -= app_bundle

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #18 on: April 09, 2014, 04:48:57 PM »
Yeah, sure thing! That's the least I can do. Though I can not guarantee a 100% availability - but if my schedule allows me, I am glad to be of assistance.

So.. Neither of those qmake candidates worked for me.

And the bundle does not contain the libraries, but you are right, the executable won't run on another mac, tried it. Having homebrew installed can be a requirement for developers, or if you plan to have an official build you can pack it into an installer .pkg file to move the dylib-s into place. Or I don't know, if the compiled binary could load them from a specified directory, like, a lib/ folder next to it, that could be another solution too. Now it tries to find them in /usr/local/lib/ but on that dev-free iMac I don't even have /usr/local/ at all.

Tried CONFIG -= app_bundle with the configure method and it's good to go.

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +151/-2
    • View Profile
Re: can not compile headless on osx
« Reply #19 on: April 09, 2014, 05:46:09 PM »
When you run "qmake blah blah qbittorrent.pro" did any file get created in the root folder?
You can try this:
Code: [Select]
qmake "CONFIG += release nox" "CONFIG -= app_bundle debug" -o Makefile qbittorrent.pro
Did you copy the entire bundle on the new machine or just the binary?

Quote
Tried CONFIG -= app_bundle with the configure method and it's good to go.

Does this mean that it didn't create a bundle, just a binary?

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #20 on: April 10, 2014, 10:28:46 AM »
Quote
When you run "qmake blah blah qbittorrent.pro" did any file get created in the root folder?

Yes, a qbittorrent.xcodeproj bundle. And the latest one made a Makefile.xcodeproj . Xcode can open it but it doesn't really seem valid to me. But I'm unfamiliar with Xcode.

Quote
Does this mean that it didn't create a bundle, just a binary?

Yes it does, a single unix binary with the correct name and content.

Quote
Did you copy the entire bundle on the new machine or just the binary?

No I didn't, since it does not contain the libraries and only the Contents/MacOS/qbittorrent file is useful. The other branches of the directory tree are for the gui version, in this form it's invalid. Have any thoughts or suggestions regarding this?

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #21 on: April 10, 2014, 10:41:54 AM »
To avoid confusion, the middle attachment is a tree of the gui build, not the nox. But it's all the same for the headless, it just puts a different binary into the gui bundle.

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +151/-2
    • View Profile
Re: can not compile headless on osx
« Reply #22 on: April 10, 2014, 02:46:45 PM »
Please try this one final thing for creating the makefile. (be sure to do it in a clean dir)
Code: [Select]
qmake -makefile -macx -o Makefile "CONFIG += release nox" "CONFIG -= app_bundle debug"  qbittorrent.pro
What file is created now? I would expect to create only "Makefile".

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #23 on: April 10, 2014, 02:54:13 PM »
Makefile.xcodeproj again  :-\

The last line of qmake is a warning, does this help you in any way? Weird that it's looking for an xcodeproj file.

Code: [Select]
WARNING: Ignored (not found) '/Volumes/Data/Users/gereenice/Desktop/qbittorrent-3.1.9/src/qbittorrent-nox.xcodeproj'

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +151/-2
    • View Profile
Re: can not compile headless on osx
« Reply #24 on: April 10, 2014, 02:55:30 PM »
If it still creates a *.xcodeproj file then try this:
Code: [Select]
qmake -makefile -unix -o Makefile "CONFIG += release nox" "CONFIG -= app_bundle debug"  qbittorrent.pro

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #25 on: April 10, 2014, 03:00:29 PM »
+1 warning, same result. I only managed to get a conf.pri after a successful ./configure .

Code: [Select]
WARNING: /Volumes/Data/Users/gereenice/Desktop/qbittorrent-3.1.9/unixconf.pri:9: Unable to find file for inclusion conf.pri
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.
WARNING: Ignored (not found) '/Volumes/Data/Users/gereenice/Desktop/qbittorrent-3.1.9/src/qbittorrent-nox.xcodeproj'

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +151/-2
    • View Profile
Re: can not compile headless on osx
« Reply #26 on: April 10, 2014, 03:05:15 PM »
The point of the qmake aproach is to ultimately make a valid Makefile for make. The conf.pri isn't need for mac, only for the other unix targets(linux). However the configure script seems to make a valid Makefile via qmake and I can't undertand what we are doing wrong....

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #27 on: April 10, 2014, 03:12:51 PM »
Can this be helpful from configure at line 1582?
Quote
$qm conf4.pro >/dev/null

And there it is from just a few lines before:
Quote
cat >$1/conf4.pro <<EOT
CONFIG  += console
CONFIG  -= app_bundle
QT      -= gui
TARGET   = conf

HEADERS += conf4.h
SOURCES += conf4.cpp


DEFINES += HAVE_MODULES

EOT

I'm a bit lost in that, but it seems like the magic is happening somewhere around there, maybe this can give an idea.

GereeNice

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: can not compile headless on osx
« Reply #28 on: April 10, 2014, 03:14:25 PM »
The qmake with the -unix switch was the accepted linux approach? I would assume that if there is a (another) command line to create a makefile on linux with qmake that might work here too.

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +151/-2
    • View Profile
Re: can not compile headless on osx
« Reply #29 on: April 10, 2014, 03:17:55 PM »
hmm, what are the contents of Makefile.xcodeproj? (copy the first ~20 lines)

edit: with -macx switch