Help - Search - Members - Calendar
Full Version: Can't install this software - "Undefined variable"
Linuxhelp > Support > Technical Support
robin
Hello

I've been trying to install this software called Aperture Photometry Tool, even though I follow their instructions I can't get it working. I tried to contact them but I haven't gotten a reply yet (after 3 weeks of waiting). I therefore wonder if you might be able to help me out. The instructions to the installations I've been following can be found below:

-------------------------------------------------------------------------------------
Installation instructions (and uninstalling previous version of APT):

cp APT_platform_independent_v2.3.2.tar.gz ~/Applications
cd ~/Applications
rm -rf APT_v2.3.1 (if you installed it here last time)
gunzip APT_platform_independent_v2.3.2.tar.gz
tar xvf APT_platform_independent_v2.3.2.tar
rm APT_platform_independent_v2.3.2.tar

Now, you need to set up your environment. If your default shell is bash, add these lines to your .bash_profile file (or change from 2.3.1 to 2.3.2 if you installed the previous version of APT):

export APT_HOME=/Applications/APT_v2.3.2
export PATH=$APT_HOME:$PATH
export APT_ARCH=MAC (omit if a Mac is not the target machine)
-------------------------------------------------------------------------------------

When I later try to run ./APT.csh while in the directory /home/robin/Applications/APT_v2.3.3. I get
"APT_ARCH: Undefined variable."
Why is that? When I go to my .bash_profile file I have added the two lines (see above). I've been told that I edit the .bash_profile file in "/home/robin" with the command sudo gedit .bash_profile. Is this correct? Thanks in advance.

Note that the version I've been installing is APT_v2.3.3 and not APT_v2.3.2 as the instructions above are from. But this is easily modified of course in the export lines.

//Robin
michaelk
It appears that the software is looking for the environment variable even though the instructions say omit. Try adding the following and see what happens.
export APT_ARCH
or if that does not work then try
export APT_ARCH=linux
robin
QUOTE (michaelk @ Apr 15 2013, 02:16 PM) *
It appears that the software is looking for the environment variable even though the instructions say omit. Try adding the following and see what happens.
export APT_ARCH
or if that does not work then try
export APT_ARCH=linux


I did change to my directory /home/robin and wrote sudo gedit .bash_profile
added the line export export APT_ARCH=linux, it still didn't work. I tried to open the APT.csh file with sudo gedit APT.csh and I did find something interesting, the beginning of the file is as the text below
------------------------------------------------------------------------------------------------
#! /bin/csh

echo "APT_ARCH=$APT_ARCH";
echo "APT_HOME=$APT_HOME";

if ($#argv == 0) then

if ($APT_ARCH == "MAC") then
java -Duser.language=en -Duser.region=US -mx1024M -Xdock:name="APT" -Xdock:icon=$APT_HOME/Aperture\ Photometry\ Tool.app/Contents/Resources/APT.icns -jar $APT_HOME/APT.jar
else
java -Duser.language=en -Duser.region=US -mx1024M -jar $APT_HOME/APT.jar
endif
--------------------------------------------------------------------------------------------------
And there are other following if-statements depending on the argument "argv == some number" ($#argv == 0). But for me, it looks like it should be just fine leaving it as APT_ARCH= linux as well, or something else might be wrong?
michaelk
When trying to run the program does the following output the correct information?
echo "APT_ARCH=$APT_ARCH";
echo "APT_HOME=$APT_HOME";

robin
QUOTE (michaelk @ Apr 15 2013, 10:31 PM) *
When trying to run the program does the following output the correct information?
echo "APT_ARCH=$APT_ARCH";
echo "APT_HOME=$APT_HOME";


Not really sure if I understand your question correctly, sorry. However, when I do
echo "APT_ARCH=$APT_ARCH" in the terminal I get
APT_ARCH=
and echo "APT_HOME=$APT_HOME" in the terminal ,gives
APT_HOME=

Maybe this is what's wrong? Shouldnt it be like "APT_HOME=/home/robin/Applications/APT_v2.3.3"??? (according to how I've understood this to be)

michaelk
So the environment variables are not being set. If you logout then login the .bash-profile should run which in theory should set those variables.
robin
QUOTE (michaelk @ Apr 16 2013, 08:59 PM) *
So the environment variables are not being set. If you logout then login the .bash-profile should run which in theory should set those variables.


How do I do that?
michaelk
What linux distribution / version are you running?
robin
QUOTE (michaelk @ Apr 18 2013, 11:24 PM) *
What linux distribution / version are you running?


linux mint
robin
Any ideas?
michaelk
Have you restarted the computer?
robin
yes multiple times, I've even removed everything and started over from the beginning.
I'm confused though how the .bash_profile works. I have .bash_profile files all over near my home folder since I didn't know how to handle it from the beginning. Do you think that can affect the installation? I mean that there are multiple files called .bash_profile???

michaelk
Having multiple bash_profiles might be screwing things up but I assume that the installer is just making a backup.

When you login .bash_profile is executed as well as when you open up a new terminal window.
robin
Ahh I see thanks. Still can't get this software working... Still thanks for all your help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.