Author Topic: Makefile Generator Script on OS X  (Read 5943 times)

Offline hutchtx

  • Newcomer
  • Posts: 5
Makefile Generator Script on OS X
« on: 2010 December 28 09:43:50 »
A quick (and probably silly) question.

To execute this script, you need the environment variables set correctly.  How do you set them for OS X graphical apps?  I have them correct in my .bashrc and .tcshrc files, but this won't help me when executing the script from PI. 

Dave

PS: I know, I could just force the variable settings by editing the script, but would like to understand how to do this in case I run into is sometime in the future.

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Makefile Generator Script on OS X
« Reply #1 on: 2010 December 28 10:14:56 »
if it works like linux, take a look at the .bash_profile file. Usually the environment variables are defined there.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline hutchtx

  • Newcomer
  • Posts: 5
Re: Makefile Generator Script on OS X
« Reply #2 on: 2010 December 28 10:48:00 »
if it works like linux, take a look at the .bash_profile file. Usually the environment variables are defined there.

Thanks Carlos,
The .profile has them set correctly.  The problem is that in Mac OS X, the graphical apps are not launched from a terminal window.  There is likely some file in the boot routine I need to modify, I just don't know which one.

Dave

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: Makefile Generator Script on OS X
« Reply #3 on: 2010 December 29 01:04:05 »
If it works like linux ;) (which I don't know), graphical apps do have an environment, even if they're not lauched from a shell.
--
 David Serrano

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Makefile Generator Script on OS X
« Reply #4 on: 2010 December 30 16:32:14 »
Quote
If it works like linux ...

Unfortunately, it doesn't. Applications launched from the graphical desktop interface don't inherit the user's environment on Mac OS X; the .profile configuration file works exclusively for pure shell sessions (including ssh sessions).

You must define the required environment variables within PixInsight. It is actually very easy because PixInsight provides an internal 'export' command. A script similar to the following will do the trick:

export PCLDIR=$HOME/PCL
export PCLBINDIR32=$PCLDIR/dist/PixInsight32.app/Contents/MacOS
export PCLBINDIR64=$PCLDIR/dist/PixInsight64.app/Contents/MacOS
export PCLBINDIR=$PCLBINDIR64
export PCLLIBDIR32=$PCLDIR/lib/x86
export PCLLIBDIR64=$PCLDIR/lib/x86_64
export PCLLIBDIR=$PCLLIBDIR64
export PCLINCDIR=$PCLDIR/include
export PCLSRCDIR=$PCLDIR/src

These commands assume that you have your PCL distribution on your home folder, and copies of the PixInsight Core application (both 32-bit and 64-bit versions) on a dist subfolder. You must change the variable values to adapt them to your particular conditions.

You must execute the above commands on PixInsight's Processing Console. You can do that in several ways: manually (tedious), adding the above commands to your startup.scp script, or simply writing them to a new .scp file (for example, setenv.scp on your home folder) and invoking it with:

run $HOME/setenv.scp

The latter is the recommended option. Once you have defined the required environment variables, MakefileGenerator will run without problems.

Let me know how it goes.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline hutchtx

  • Newcomer
  • Posts: 5
Re: Makefile Generator Script on OS X
« Reply #5 on: 2010 December 31 13:08:28 »
Thanks Juan,
That is what i was looking for.  And this is better than forcing those variables in the script.  Thanks for the help  8)

Dave