Difference between revisions of "Install ISIS on Mac"

From Remeis-Wiki
Jump to navigation Jump to search
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
This instruction is intended for Mac OS X 10.10 (yosemite) users to "completely" install ISIS including the modules for: gsl, xfig, isisscripts.
+
This instruction is intended for Mac OS X 11.6 (Big Sur) users to "completely" install ISIS including the modules for: gsl, xfig, isisscripts. It was tested on an Intel machine with both 11.6 (Big Sur) and 10.15 (Catalina). No tests were done with ARM machines. 
  
Assuming a fresh Mac OS X 10.10 installation (alternatively make sure that /usr/local/ or the prefix path of the installation is empty).
+
Assuming a fresh Mac OS X 11.6 installation (alternatively make sure that /usr/local/ or the prefix path of the installation is empty).
  
 
== 1. Install Xcode (latest version) and Xquartz ==
 
== 1. Install Xcode (latest version) and Xquartz ==
Line 19: Line 19:
 
After installation the X11 libraries should now be available in <code>/opt/X11/</code>
 
After installation the X11 libraries should now be available in <code>/opt/X11/</code>
  
== 2. Install Mac Ports ==
+
== 2. Install Mac Ports or Homebrew ==
 
Fink could also work, the differences should be some package names and the location of some libraries which should be <code> /opt/local/</code> for Mac Ports or <code>/sw/local/ </code> for Fink.
 
Fink could also work, the differences should be some package names and the location of some libraries which should be <code> /opt/local/</code> for Mac Ports or <code>/sw/local/ </code> for Fink.
  
This instruction assumes that [https://www.macports.org/install.php Mac Ports] will be installed.
+
This instruction assumes that [https://www.macports.org/install.php Mac Ports] is installed. It is also possible to use [https://brew.sh/ Homebrew].
  
 
== 3. Install packages with Mac Ports ==
 
== 3. Install packages with Mac Ports ==
There are several packages including their dependencies to be installed. I recommend installing everything with the universal flag set (which includes 32bit and 64bit versions)
+
There are several packages including their dependencies to be installed. I recommend installing everything with the universal flag set (which includes 32bit and 64bit versions) on older macOS versions, otherwise it is not necessary. You can also use homebrew. First update port and all packages
 +
<pre>
 +
sudo port selfupdate
 +
sudo port upgrade outdated # repeat this until it does nothing
 +
sudo port install gcc12
 +
sudo port install gsl
 +
sudo port install fig2dev
 +
sudo port install z
 +
sudo port install git
 +
sudo port install texlive # only if latex is not available yet
 +
sudo port install texlive-latex-extra # if sltikz will be used
 +
</pre>
  
 +
These packages install a necessary gfortran compiler as well as necessary libraries to build the slgsl / slxfig module for slang / isis. To make sure that the proper compilers are used (and not <code>/usr/bin/gcc</code>, which is a only "frontend" that can parse gcc), set the following in your <code>~/.bash_profile</code>:
 
<pre>
 
<pre>
sudo port install gcc49 +universal
+
export GCC="/opt/local/bin/gcc-mp-12"
sudo port install gsl +universal
+
export CC="/opt/local/bin/gcc-mp-12"
sudo port install transfig +universal
+
export CXX="/opt/local/bin/g++-mp-12"
 +
export FC="/opt/local/bin/gfortran-mp-12" # mac ports gfortran compiler
 
</pre>
 
</pre>
 
+
Then type <code>source ~/.bash_profile</code> in the terminal.
These packages install a necessary gfortran compiler as well as necessary libraries to build the slgsl / slxfig module for slang / isis.
 
  
 
== 4. Install HEADAS ==
 
== 4. Install HEADAS ==
 +
'''This is not necessary if only the "stellar_isisscripts" will be used.'''
 
* Download the latest version of [https://heasarc.gsfc.nasa.gov/lheasoft/download.html HEASOFT (source)]
 
* Download the latest version of [https://heasarc.gsfc.nasa.gov/lheasoft/download.html HEASOFT (source)]
 
* Up until HEASOFT 6.15, XSPEC did not work properly on Mac OS X in 64bit mode. As of HEASOFT 6.16 this is no longer the case and the recommendation is to install everything in 64bit. You don't need to set anything to do that, but if you have old compiler flags set to "-m32", remove them!
 
* Up until HEASOFT 6.15, XSPEC did not work properly on Mac OS X in 64bit mode. As of HEASOFT 6.16 this is no longer the case and the recommendation is to install everything in 64bit. You don't need to set anything to do that, but if you have old compiler flags set to "-m32", remove them!
<pre>
 
export GCC="/usr/bin/gcc"
 
export CC="/usr/bin/gcc"
 
export CXX="/usr/bin/g++"
 
export FC="/opt/local/bin/gfortran-mp-4.9" # mac ports gfortran compiler
 
</pre>
 
 
* create a directory in your $HOME called Software
 
* create a directory in your $HOME called Software
 
* unpack the HEADAS tar file in this directory
 
* unpack the HEADAS tar file in this directory
Line 51: Line 58:
 
sudo make install
 
sudo make install
 
</pre>
 
</pre>
* Add the following to your .profile (change this according to your terminal type and username)
+
* Add the following to your ~/.bash_profile (change this according to your terminal type and username)
 
<pre>
 
<pre>
 
export HEADAS="/Users/username/path/to/heasoft/"
 
export HEADAS="/Users/username/path/to/heasoft/"
Line 62: Line 69:
 
</pre>
 
</pre>
 
* apply the new settings to your terminal by either closing the current terminal windows and open a new terminal or by writing
 
* apply the new settings to your terminal by either closing the current terminal windows and open a new terminal or by writing
<code>source ~/.profile</code> in your command line
+
<code>source ~/.bash_profile</code> in your command line
  
 
== 5. Install slang / slang modules / isis / isisscripts ==
 
== 5. Install slang / slang modules / isis / isisscripts ==
  
First get the latest versions of slang / jed/ slgsl / slxfig / isis / isisscripts. I recommend using the git repositories. Go to the Software directory in your terminal and clone the repositories:
+
First get the latest versions of slang / jed/ slgsl / slxfig / slirp / isis / isisscripts. I recommend using the git repositories. Go to the Software directory in your terminal and clone the repositories:
 
<pre>
 
<pre>
git clone http://space.mit.edu/cxc/isis/isis.git
+
git clone https://github.com/houckj/isis
 
git clone git://git.jedsoft.org/git/slang.git
 
git clone git://git.jedsoft.org/git/slang.git
 
git clone git://git.jedsoft.org/git/slxfig.git
 
git clone git://git.jedsoft.org/git/slxfig.git
 
git clone git://git.jedsoft.org/git/slgsl.git
 
git clone git://git.jedsoft.org/git/slgsl.git
 
git clone git://git.jedsoft.org/git/jed.git
 
git clone git://git.jedsoft.org/git/jed.git
 +
git clone git://git.jedsoft.org/git/slirp.git
 
git clone http://www.sternwarte.uni-erlangen.de/git.public/isisscripts  
 
git clone http://www.sternwarte.uni-erlangen.de/git.public/isisscripts  
 
</pre>  
 
</pre>  
Line 82: Line 90:
 
sudo make install
 
sudo make install
 
</pre>
 
</pre>
Install isis. Go to the isis directory
+
Install isis. Go to the isis directory (--with-headas is not required for the stellar scripts)
 
<pre>
 
<pre>
 
./configure --with-headas=$HEADAS
 
./configure --with-headas=$HEADAS
 +
make
 +
make check
 +
sudo make install
 +
</pre>
 +
If your aim is to install the "stellar_isisscripts", you don't need HEADAS and you can instead do:
 +
<pre>
 +
sudo port install wget
 +
sudo port install pgplot
 +
sudo port install cfitsio
 +
./configure --with-pgplot=/opt/local/ --with-cfitsio=/opt/local/ --with-x=/opt/X11/
 
make
 
make
 
sudo make install
 
sudo make install
 
</pre>
 
</pre>
  
Add <tt>'''--with-slang=/path/to/slang'''</tt> to the following configuration set ups in case you installed slang in a different path other than <tt>/usr/local/</tt>
+
Add <tt>'''--with-slang=/path/to/slang'''</tt> to the following configuration setups in case you installed slang in a different path other than <tt>/usr/local/</tt>
  
 
Install jed. Go to the jed directory
 
Install jed. Go to the jed directory
 
<pre>
 
<pre>
 
./configure --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
 
./configure --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
 +
make clean
 
make
 
make
 
sudo make install
 
sudo make install
Line 112: Line 131:
 
</pre>
 
</pre>
  
Install the isisscripts. Go to the isisscripts directory
+
Install slirp. Go to the slirp directory
 +
<pre>
 +
./configure
 +
make
 +
sudo make install
 +
</pre>
 +
 
 +
Before building the isisscripts, install the "SLURP" perl module.  
 +
<pre>
 +
sudo perl -MCPAN -e shell
 +
install CPAN
 +
reload cpan
 +
install File::Slurp
 +
quit
 +
</pre>
 +
 
 +
Then go to the isisscripts directory and
 
<pre>
 
<pre>
 
make
 
make
Line 120: Line 155:
 
<pre>
 
<pre>
 
add_to_isis_load_path("/Path/To/isisscripts/share/");
 
add_to_isis_load_path("/Path/To/isisscripts/share/");
 +
define ris() { require("isisscripts"); };
 
</pre>
 
</pre>
 
This allows the easy access to <tt>require("isisscripts")</tt> in isis.
 
This allows the easy access to <tt>require("isisscripts")</tt> in isis.
  
== 6. Possible problems with other software ==
+
== (6. Install stellar_isisscripts) ==
 +
 
 +
Get the newest version of the stellar_isisscripts from git.
 +
If you have a Remeis/gitlab account and are at the Remeis observatory, do:
 +
<pre>
 +
git clone git@serpens.sternwarte.uni-erlangen.de:irrgang/stellar.git
 +
mv stellar stellar_isisscripts
 +
</pre>
 +
If you have a Remeis/gitlab account and are not at the Remeis observatory, do:
 +
<pre>
 +
git clone http://www.sternwarte.uni-erlangen.de/gitlab/irrgang/stellar.git
 +
mv stellar stellar_isisscripts
 +
</pre>
 +
Otherwise ask Matti Dorsch. Then:
 +
<pre>
 +
cd stellar_isisscripts
 +
make
 +
</pre>
 +
 
 +
Now compile some necessary C functions:
 +
<pre>
 +
cd stellar_isisscripts/slirp
 +
slirp -make -lm -lgsl -lgslcblas -lpthread c_functions.h c_functions.o
 +
sed -i -e 's/^CFLAGS[[:space:]]*= -g -O2/CFLAGS = -g -Ofast -Wall -Wextra/g' Makefile
 +
</pre>
 +
 
 +
In the Makefile, change these two lines to read:
 +
<pre>
 +
SLANGINC        = -I/usr/local/include -I/opt/local/include
 +
SLANGLIB        =  -L/usr/local/lib -L/opt/local/lib -lslang
 +
</pre>
 +
 
 +
Also make sure that the newest version of gcc-mp is used, e.g. gcc-mp-12. Then:
 +
<pre>
 +
make
 +
make test
 +
rm c_functions-test.sl ; rm c_functions.o ; rm c_functions_glue.o ; rm c_functions_glue.c ; rm Makefile ; rm *~
 +
</pre>
 +
 
 +
Edit the [[ISIS auto start (.isisrc)|.isisrc]] file in your <tt>$HOME</tt> directory and add the following lines
 +
<pre>
 +
add_to_isis_load_path("/Path/To/stellar_isisscripts/share/");
 +
define rmy() { require("stellar_isisscripts"); };
 +
</pre>
 +
 
 +
To use all functions, you need the stilts tool, which is related to TOPCAT
 +
<pre>
 +
mkdir stilts; cd stilts
 +
wget http://www.star.bris.ac.uk/~mbt/stilts/stilts.jar
 +
wget 'http://www.star.bris.ac.uk/~mbt/stilts/stilts'
 +
chmod +x stilts
 +
sudo cp * /opt/local/bin 
 +
</pre>
 +
 
 +
To test if the scripts work, try for example:
 +
<pre>
 +
isis
 +
rmy;
 +
s = query_photometry ("HZ44");
 +
s.print();
 +
help query_photometry
 +
q
 +
exit;
 +
</pre>
 +
 
 +
== 7. Possible problems with other software ==
 
=== XMM SAS ===
 
=== XMM SAS ===
 
The XMM SAS resets part of your $PATH variable and uses its some of its own libraries. This might break some programs of HEASOFT when the SAS is loaded. As our <tt>xmmscripts</tt> rely on the <tt>ftools</tt>, this behavior is highly inconvenient.  
 
The XMM SAS resets part of your $PATH variable and uses its some of its own libraries. This might break some programs of HEASOFT when the SAS is loaded. As our <tt>xmmscripts</tt> rely on the <tt>ftools</tt>, this behavior is highly inconvenient.  

Latest revision as of 22:29, 23 July 2023

This instruction is intended for Mac OS X 11.6 (Big Sur) users to "completely" install ISIS including the modules for: gsl, xfig, isisscripts. It was tested on an Intel machine with both 11.6 (Big Sur) and 10.15 (Catalina). No tests were done with ARM machines.

Assuming a fresh Mac OS X 11.6 installation (alternatively make sure that /usr/local/ or the prefix path of the installation is empty).

1. Install Xcode (latest version) and Xquartz

To check whether Xcode is installed execute: \\

xcode-select -p

on command line

If you see /Applications/Xcode.app/Contents/Developer it should be installed. Use the App Store to update or install Xcode

Execute xcode-select --install on command line to install the Xcode command line tools

Xquartz / X11 is no longer included in the latest versions of Mac OS X and need to be installed separately. X11 is also no longer available from Apple directly, but has to be obtained from the web. Download X11 and install it. Note: if this link is out of date, search the Web for "OS X Xquartz". After installation the X11 libraries should now be available in /opt/X11/

2. Install Mac Ports or Homebrew

Fink could also work, the differences should be some package names and the location of some libraries which should be /opt/local/ for Mac Ports or /sw/local/ for Fink.

This instruction assumes that Mac Ports is installed. It is also possible to use Homebrew.

3. Install packages with Mac Ports

There are several packages including their dependencies to be installed. I recommend installing everything with the universal flag set (which includes 32bit and 64bit versions) on older macOS versions, otherwise it is not necessary. You can also use homebrew. First update port and all packages

sudo port selfupdate
sudo port upgrade outdated # repeat this until it does nothing
sudo port install gcc12
sudo port install gsl
sudo port install fig2dev
sudo port install z
sudo port install git
sudo port install texlive # only if latex is not available yet
sudo port install texlive-latex-extra # if sltikz will be used

These packages install a necessary gfortran compiler as well as necessary libraries to build the slgsl / slxfig module for slang / isis. To make sure that the proper compilers are used (and not /usr/bin/gcc, which is a only "frontend" that can parse gcc), set the following in your ~/.bash_profile:

export GCC="/opt/local/bin/gcc-mp-12"
export CC="/opt/local/bin/gcc-mp-12"
export CXX="/opt/local/bin/g++-mp-12"
export FC="/opt/local/bin/gfortran-mp-12" # mac ports gfortran compiler

Then type source ~/.bash_profile in the terminal.

4. Install HEADAS

This is not necessary if only the "stellar_isisscripts" will be used.

  • Download the latest version of HEASOFT (source)
  • Up until HEASOFT 6.15, XSPEC did not work properly on Mac OS X in 64bit mode. As of HEASOFT 6.16 this is no longer the case and the recommendation is to install everything in 64bit. You don't need to set anything to do that, but if you have old compiler flags set to "-m32", remove them!
  • create a directory in your $HOME called Software
  • unpack the HEADAS tar file in this directory
  • Install HEASOFT from source but use the following configurations
 ./configure --x-libraries=/opt/X11/lib --x-includes=/opt/X11/include
make
sudo make install
  • Add the following to your ~/.bash_profile (change this according to your terminal type and username)
export HEADAS="/Users/username/path/to/heasoft/"
alias heainit="source $HEADAS/headas-init.sh
heainit

The HEADAS path could/should look something like this:

$HEADAS=/Users/chgross/Software/heasoft-6.16/x86-apple-darwin14.1.0/
  • apply the new settings to your terminal by either closing the current terminal windows and open a new terminal or by writing

source ~/.bash_profile in your command line

5. Install slang / slang modules / isis / isisscripts

First get the latest versions of slang / jed/ slgsl / slxfig / slirp / isis / isisscripts. I recommend using the git repositories. Go to the Software directory in your terminal and clone the repositories:

git clone https://github.com/houckj/isis
git clone git://git.jedsoft.org/git/slang.git
git clone git://git.jedsoft.org/git/slxfig.git
git clone git://git.jedsoft.org/git/slgsl.git
git clone git://git.jedsoft.org/git/jed.git
git clone git://git.jedsoft.org/git/slirp.git
git clone http://www.sternwarte.uni-erlangen.de/git.public/isisscripts 

Install slang. Go to the slang directory.

./configure --with-png=/opt/local/
make
sudo make install

Install isis. Go to the isis directory (--with-headas is not required for the stellar scripts)

./configure --with-headas=$HEADAS
make
make check
sudo make install

If your aim is to install the "stellar_isisscripts", you don't need HEADAS and you can instead do:

sudo port install wget
sudo port install pgplot
sudo port install cfitsio 
./configure --with-pgplot=/opt/local/ --with-cfitsio=/opt/local/ --with-x=/opt/X11/
make
sudo make install

Add --with-slang=/path/to/slang to the following configuration setups in case you installed slang in a different path other than /usr/local/

Install jed. Go to the jed directory

./configure --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
make clean
make
sudo make install

Install slgsl. Go to the slgsl directory

./configure --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib --with-gsl=/opt/local/
make
sudo make install

Install slxfig. Go to the slxfig directory

./configure --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
make
sudo make install

Install slirp. Go to the slirp directory

./configure
make
sudo make install 

Before building the isisscripts, install the "SLURP" perl module.

sudo perl -MCPAN -e shell
install CPAN
reload cpan
install File::Slurp
quit

Then go to the isisscripts directory and

make

Create / modify the .isisrc file in your $HOME directory and add the following line

add_to_isis_load_path("/Path/To/isisscripts/share/");
define ris() { require("isisscripts"); };

This allows the easy access to require("isisscripts") in isis.

(6. Install stellar_isisscripts)

Get the newest version of the stellar_isisscripts from git. If you have a Remeis/gitlab account and are at the Remeis observatory, do:

git clone git@serpens.sternwarte.uni-erlangen.de:irrgang/stellar.git
mv stellar stellar_isisscripts

If you have a Remeis/gitlab account and are not at the Remeis observatory, do:

git clone http://www.sternwarte.uni-erlangen.de/gitlab/irrgang/stellar.git
mv stellar stellar_isisscripts

Otherwise ask Matti Dorsch. Then:

cd stellar_isisscripts
make 

Now compile some necessary C functions:

cd stellar_isisscripts/slirp
slirp -make -lm -lgsl -lgslcblas -lpthread c_functions.h c_functions.o
sed -i -e 's/^CFLAGS[[:space:]]*= -g -O2/CFLAGS = -g -Ofast -Wall -Wextra/g' Makefile 

In the Makefile, change these two lines to read:

SLANGINC        = -I/usr/local/include -I/opt/local/include
SLANGLIB        =  -L/usr/local/lib -L/opt/local/lib -lslang 

Also make sure that the newest version of gcc-mp is used, e.g. gcc-mp-12. Then:

make
make test
rm c_functions-test.sl ; rm c_functions.o ; rm c_functions_glue.o ; rm c_functions_glue.c ; rm Makefile ; rm *~ 

Edit the .isisrc file in your $HOME directory and add the following lines

add_to_isis_load_path("/Path/To/stellar_isisscripts/share/");
define rmy() { require("stellar_isisscripts"); };

To use all functions, you need the stilts tool, which is related to TOPCAT

mkdir stilts; cd stilts
wget http://www.star.bris.ac.uk/~mbt/stilts/stilts.jar
wget 'http://www.star.bris.ac.uk/~mbt/stilts/stilts'
chmod +x stilts
sudo cp * /opt/local/bin  

To test if the scripts work, try for example:

isis
rmy;
s = query_photometry ("HZ44");
s.print();
help query_photometry
q
exit;

7. Possible problems with other software

XMM SAS

The XMM SAS resets part of your $PATH variable and uses its some of its own libraries. This might break some programs of HEASOFT when the SAS is loaded. As our xmmscripts rely on the ftools, this behavior is highly inconvenient. As a workaround install the HEASOFT wrapper by following the instructions here.

This will create a new directory with the executables of HEASOFT. Add this directory to your $PATH variable (in front of the rest of $PATH)!