Page 1 of 1

Proper installation on Snow Leopard

Posted: Sun Jan 02, 2011 2:20 am
by tarmsaft
How do I install PB (4.51) in snow leopard?

The install.txt claims there are two options for installing PB:
A) Using it from the IDE (easy installation)
1) Drag the PureBasic directory where you want.
2) Double-click on 'PureBasic' application, it will launch the IDE.
3) Drag the 'PureBasic' icon to your dock to have it permanently (optional).

B) Using it from terminal/shell (experienced users)
1) Drag the PureBasic directory in your home directory.
1) Open a terminal and enter the following:
$ bash
$ export PUREBASIC_HOME=~/purebasic
$ export PATH=$PATH:$PUREBASIC_HOME/compilers

These 3 lines do the following:
a) launch the bash shell, which is more apriopriate then the default one (should be the default on OS X 10.3 or above)
b) set the home variable for purebasic, so the purebasic compiler can know where the components lies
c) add the purebasic/compilers/ directory to the path, which means than the executables found in the compilers/ directory will be availabe from anywhere

if all works correctly, you can put this in your ~/.bashrc file (config file for bash)
Option A simply does not work as expected. I download the dmg file and move the included PureBasic folder to "/Applications/Coding/". When I run PB, it can not compile files other than the included example source files. Ok, a PATH error then I assumed. So much for option A as a fully functional install (even though it claims to be). I turn to option B.

After fiddling in the shell I realized that the first "export" line in option B assumes I put the PureBasic applications directory in the user root (without mentioning this fact). It might seem trivial but I am fairly new to the mac experience. I change the lines to

Code: Select all

export PUREBASIC_HOME=/Applications/Coding/PureBasic
export PATH=$PATH:$PUREBASIC_HOME/compilers
Exactly the same results. Hmm Ok, I better put the lines in the .bashrc then, as described. Wow, no .bashrc. After googling I discovered that it was abandoned for a .profile instead at least dating back to the introduction of snow leopard. I add the two lines in .profile and reboot. I should say I am fairly new to the mac experience and do not know what information is stored where, when it is loaded in to memory, etc. I.e. I play it safe and do a classic windows reboot. To my surprise and a tear in my eye, same behavior. I can not deduce any more information from the install.txt file to experiment further. So, how do I do this installation?

Oh, the symptom when I compile my own code stored in ~/code/test.pb is that the entire IDE freeze up while two messages appear on top of each other, "Compiling in progress…" and "The required compiler cannot be found: PureBasic". The PB application stops responding and a Force Quit is the only way to close it down.

Re: Proper installation on Snow Leopard

Posted: Fri Jan 07, 2011 12:45 am
by Blood
Have you got Xcode installed?

Re: Proper installation on Snow Leopard

Posted: Sat Jan 29, 2011 8:28 am
by tarmsaft
Yes of course. But thanks anyways.

I found out why my code did not compile while the example code did. A freaking bug, or at least an inconsistency in the UI :evil:. Such a simple thing caused me much headache. By default "Compiler options" -> "Use Compiler" is set to "PureBasic 4.51 (MacOS X - X86)", at the time of writing. The text was grayed, as in already chosen compiler by default. However in the case of compiling my own code I had to go there and click on the drop down list and choose the compiler (the only one to choose from) and mark it to the left of it as I want to use the compiler. WTF, why would I not want to use the compiler when I compile?

If I by any chance would not want to have a compiler associated with the IDE, then I should not be able to choose to compile in the compile menu....

Why it worked for the example code I do not know. As far as I understand the .pb format does not contain IDE specific information, or does it? Anyways, it does not explain the inconsistency in the UI.
No mater what, it certainly shall not freeze the entire purebasic app if no compiler is associated.