You are here:
SNID >
Frequently Asked Questions
You can also access:
manual
Contents: Installation problems and Compilation errors | Runtime errors | General questions
Update (2025-01-06): Robert Fisher has created a Docker container for SNID, which enables to easily install SNID under macos, Linux, Windows using a single command. It is available for download at this webpage.
NOTE: If you do get error messages after typing "make" then make sure you clean up before attempting to recompile. This is done by typing:make realclean ; makeIf the compilation then succeeds you can type 'make install' to copy the executable files to the bin/ directory.
FFLAGS= -O -fno-automatic -fallow-argument-mismatchMany thanks to Tobias Haugeneder for providing this workaround related to gcc-10 and later versions.
brew install brewsci/science/snid
NOTE: tested on macOS 10.13.6 (High Sierra)
If you encounter a runtime error related to gcc libraries not being found, a quick workaround is to copy the relevant files from another version of gcc.
E.g., suppose you are lacking the following files:
/usr/local/Cellar/gcc/8.2.0/lib/gcc/7/libgfortran.4.dylib /usr/local/Cellar/gcc/8.2.0/lib/gcc/7/libquadmath.0.dylibbut you have a directory /usr/local/Cellar/gcc/8.2.0/lib/gcc/8 (notice the "8" instead of "7" for the final directory in the path), you can simply execute:
cd /usr/local/Cellar/gcc/8.2.0/lib/gcc mkdir 7 # NOTE: you can omit this command if the directory "7/" already exists cd 8 cp libgfortran.4.dylib libquadmath.0.dylib ../7Many thanks to Xinghan Zhang for providing installation instructions and a workaround for the gcc-related segmentation fault.
xwdriv.c:(.text+0x236): undefined reference to `XCopyArea'
xwdriv.c:(.text+0x4f3): undefined reference to `XFree'
...
when attempting to compile SNID under Ubuntu 14.x. It seems that Ubuntu uses the --as-needed linker flag as a default instead of --no-as-needed on other systems, which means that some libraries are effectively not linked (unless the -l commands are placed after the -o in the makefile). I was able to compile SNID by simply changing:
FFLAGS= -O -fno-automaticto:
FFLAGS= -O -fno-automatic -Wl,--no-as-neededin the Makefile.
make realclean
FC= gfortran-mp-4.8
FC= gfortran-mp-4.8
FFLGAS= -O -fno-automatic
XLIBS= -L/usr/X11/lib -lX11
PGLIBS= -L/opt/local/lib/pgplot -lpgplot
[in (t)csh]
setenv LD_LIBRARY_PATH /opt/local/lib/pgplot
setenv PGPLOT_DIR /opt/local/lib/pgplot
[in bash]
export LD_LIBRARY_PATH="/opt/local/lib/pgplot"
export PGPLOT_DIR="/opt/local/lib/pgplot"
make
make install
Mac PPC and Intel: You can install g77 and gfortran binaries at High-performance computing for Mac OS X. Note that you will need to have Apple's Developer Tools installed. They are included on a separate CD in the retail version of OS X and also available as a free download from Apple's Developer Site.
UNIX/Linux/etc.: You can install g77 or gfortran through the GNU Compiler Collection (GCC). Note that the final release of g77 is in GCC version 3.4. Future versions of GCC have gfortran instead.
Mac PPC and Intel: You can download Scisoft OSX, which (amongst many other things) includes PGPLOT. Scisoft OSX is available for both Mac PPC and Intel.
PGPLOT is also available as an "unstable package" through Fink. "Unstable" packages can be made available in Fink Commander by checking "Use unstable packages" in the "Fink" tab of the Fink Commander Preferences panel. If you use the command line version of Fink, then you will need to edit /sw/etc/fink.conf, add unstable/main and unstable/crypto to the Trees: line, and then run fink selfupdate; fink index. You can then install the Package pgplot by typing:
fink install pgplotat the terminal prompt.
Update (12 Nov 2012): If you're running Mac OS X 10.6 or later and/or 64-bit CPU Macs, check out Compiling PGPLOT on Mac OS X for detailed instructions on how to install/compile PGPLOT.
UNIX/Linux/etc.: You can download PGPLOT here. That website also includes installation instructions for UNIX, Linux, VMS, and Windows. Part of the installation requires you select specific device drivers from a file called drivers.list. For SNID, the only device drivers you will need are:
AQDRIV 0 /AQT AquaTerm.app under Mac OS X C <=== ONLY FOR MAC OSX!
PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77
PSDRIV 3 /CPS PostScript printers, color, landscape Std F77
XWDRIV 1 /XWINDOW Workstations running X Window System C
XWDRIV 2 /XSERVE Persistent window on X Window System C
although the complete recommended list is:
AQDRIV 0 /AQT AquaTerm.app under Mac OS X C <=== ONLY FOR MAC OSX!
GIDRIV 1 /GIF GIF-format file, landscape
GIDRIV 2 /VGIF GIF-format file, portrait
LXDRIV 0 /LATEX LaTeX picture environment
PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77
PSDRIV 2 /VPS Postscript printers, monochrome, portrait Std F77
PSDRIV 3 /CPS PostScript printers, color, landscape Std F77
PSDRIV 4 /VCPS PostScript printers, color, portrait Std F77
TTDRIV 4 /GTERM GTERM Tektronix terminal emulator Std F77
TTDRIV 5 /XTERM XTERM Tektronix terminal emulator Std F77
WDDRIV 1 /WD X Window dump file, landscape
WDDRIV 2 /VWD X Window dump file, portrait
XWDRIV 1 /XWINDOW Workstations running X Window System C
XWDRIV 2 /XSERVE Persistent window on X Window System C
NOTE: Do not install any of the widget drivers unless you are
planning to develop programs that will use them.
Compiling PGPLOT with gfortran under Linux: make sure you use 'linux g77_gcc_aout' as the 3rd and 4th arguments to the makemake command. You'll then need to edit the makefile to replace:
FCOMPL=g77with
FCOMPL=gfortran
PGLIBS= -L/opt/lib/pgplot -lpgplot
PGLIBS= -L/usr/local/pgplot -lpgplot /usr/lib/libpng.soNOTE: the PGPLOT libraries may not be located at /usr/local/pgplot/. If this is the case, edit the PGLIBS settings accordingly.
libpgplot.so: undefined reference to `e_wsfe' libpgplot.so: undefined reference to `s_rsfe' libpgplot.so: undefined reference to `s_cmp' libpgplot.so: undefined reference to `do_uio' libpgplot.so: undefined reference to `e_rsfe' libpgplot.so: undefined reference to `f_inqu' libpgplot.so: undefined reference to `e_rsue' libpgplot.so: undefined reference to `i_indx' libpgplot.so: undefined reference to `do_fio' libpgplot.so: undefined reference to `e_wsfi' libpgplot.so: undefined reference to `s_cat' libpgplot.so: undefined reference to `s_stop' libpgplot.so: undefined reference to `s_wsfi' libpgplot.so: undefined reference to `G77_getenv_0' libpgplot.so: undefined reference to `s_rsue' libpgplot.so: undefined reference to `f_clos' libpgplot.so: undefined reference to `f_open' libpgplot.so: undefined reference to `s_wsfe' libpgplot.so: undefined reference to `s_copy' collect2: ld returned 1 exit status make: *** [snid] Error 1
[in (t)csh]
setenv LD_LIBRARY_PATH /usr/local/pgplot
setenv PGPLOT_DIR /usr/local/pgplot
[in bash]
export LD_LIBRARY_PATH="/usr/local/pgplot"
export PGPLOT_DIR="/usr/local/pgplot"
NOTE: the PGPLOT installation directory may not be located at
/usr/local/pgplot/. If this is the case, edit the LD_LIBRARY_PATH and
PGPLOT_DIR settings accordingly.
[in (t)csh]
setenv LD_LIBRARY_PATH /usr/local/pgplot
setenv PGPLOT_DIR /usr/local/pgplot
[in bash]
export LD_LIBRARY_PATH="/usr/local/pgplot"
export PGPLOT_DIR="/usr/local/pgplot"
NOTE: the PGPLOT installation directory may not be located at
/usr/local/pgplot/. If this is the case, edit the LD_LIBRARY_PATH and
PGPLOT_DIR settings accordingly.
[in (t)csh]
setenv LD_LIBRARY_PATH /usr/local/pgplot
setenv PGPLOT_DIR /usr/local/pgplot
[in bash]
export LD_LIBRARY_PATH="/usr/local/pgplot"
export PGPLOT_DIR="/usr/local/pgplot"
NOTE: the PGPLOT libraries may not be located at
/usr/local/pgplot/. If this is the case, edit the LD_LIBRARY_PATH and
PGPLOT_DIR settings accordingly.
! XWDRIV 2 /XSERVE Persistent window on X Window System C(The ! at the start of the line means it is commented out). If this is the case, or if any of the following lines are commented out:
AQDRIV 0 /AQT AquaTerm.app under Mac OS X C PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77 PSDRIV 3 /CPS PostScript printers, color, landscape Std F77 XWDRIV 1 /XWINDOW Workstations running X Window System C XWDRIV 2 /XSERVE Persistent window on X Window System Cthen this means you have to recompile PGPLOT. No worries, it isn't that complicated! Follow these steps and you should be fine:
cd /scisoft/i386/Packages/pgplot-5.2.2/
AQDRIV 0 /AQT AquaTerm.app under Mac OS X C PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77 PSDRIV 3 /CPS PostScript printers, color, landscape Std F77 XWDRIV 1 /XWINDOW Workstations running X Window System C XWDRIV 2 /XSERVE Persistent window on X Window System Cyour drivers.list file should look something like this.
sudo ./makemake . macosx g77_gcc_AQT [if you use g77 as your fortran compiler]
OR sudo ./makemake . macosx gfortran_gcc_AQT [if you use gfortran as your fortran compiler]
which should produce the following output:
Reading configuration file: ./sys_macosx/g77_gcc_AQT.conf
Selecting uncommented drivers from ./drivers.list
Found drivers AQDRIV PSDRIV XWDRIV
Creating make file: makefile
Determining object file dependencies.
sudo ./make
make realclean ; make
make install
plotlnw.f:298: xtit='Rest Wavelength [\\A]'
snidplot.f:457: xtit='Observed Wavelength [\\A]'
snidplot.f:459: tit='Rest Wavelength [\\A]'
snidplot.f:488: $ dlabels(5)(:lnb(dlabels(5)))//'\\(2233)'//
snidplot.f:603: xtit='Observed Wavelength [\\A]'
snidplot.f:605: tit='Rest Wavelength [\\A]'
snidplot.f:634: $ dlabels(5)(:lnb(dlabels(5)))//'\\(2233)'//
snidplot.f:1039: tit='Redshift vs. Age for correlations with rlap \\(2244) '//
snidplot.f:1081: call pgmtxt('T',-4.75,.75,0,'\\(0806) \\(0806) \\(0806) '//
snidplot.f:1086: $ labels(3)(:lnb(labels(3)))//'| \\(2244) '//
snidplot.f:1185: ytit='Template fraction \\(2244) rlap'
snidplot.f:1325: ytit='Template fraction \\(2244) rlap'
Thanks to Don Neill for pointing this out.
. In your email, you should specify your OS, fortran
compiler, and the complete screen output up until the error is
generated.
One possible solution would be to reinstall different versions of the
aquaterm and pgplot libraries
(e.g. through macports). Apparently
there are problems with those libraries within Scisoft
OSX, Intel version 2009.9.1 (thanks to Ben Dilday for pointing
this out).
. In your email, you should specify your OS, fortran
compiler, and the complete screen output up until the error is
generated.
. Make sure to include all the relevant information (as well
as your OS and fortran compiler).
* WeirdSN
typename(6,1) = 'WeirdSN' ! first element is the name of type
typename(6,2) = 'WeirdSN1' ! subtypes follow...
typename(6,3) = 'WeirdSN2'
typename(6,4) = 'WeirdSN3'
After adding more (sub)types, make sure to change the values of
the parameters NT and NST in the snid.inc file in the
snid-5.0/source/ directory. NT is the total number of
template types; NST is the maximum number of template subtypes in
any given type, +1.
make realclean ; make
make install
snid tempdir=/path/to/templates-2.0_2500_20000_1024/ zmax=1.8 input_spectrum.dat
ls *.lnw > templist
cp ../templates/texplist .
cp ../templates/tfirstlist .
tempdir='INSTALL_DIR/snid-5.0/templates_bsnip_v7.0/'
Alternatively you can skip this step and simply use the tempdir option at runtime.
typename(1,7) = 'Ia-99aa'
typename(1,8) = 'Ia-02cx'
and
typename(5,6) = 'QSO'
typename(5,7) = 'C-star'
Your typeinfo.f file should look like this.
parameter (NST = 8)
make realclean ; make
make install
Update (30 May 2016): the indices for the 'QSO' and 'C-star' subtypes were mistakenly inverted. If you installed this template set prior to 30 May 2016 you should download the new typeinfo.f file (here) and recompile SNID (step 7 above). Thanks to Jeff Silverman for pointing this out!
Scandinavian Network for Infectious Diseases
Smart Network Interface Device
Studies in National and International Development
Subscriber Network Interface Device
Sud Nivernais Imphy Decize