gappy
March 24th, 2006, 07:37 AM
Debian is entirely built out of open source software. It covers almost all the needs of beginning and advanced users. One application that is still missing from the OSS universe (for the time being) is a robust, efficient Fortran 90/95 compiler. gFortran is not nearly as mature as the old f77 compiler, and g95 is a one-man operation. However, the Intel Fortran Compiler is a viable alternative, and is free for noncommercial purposes (e.g., scientific research, recreational). Unfortunately the compiler comes in .rpms, and is only tested on SUSE and RedHat (the horror! the horror!), although it is known to work on Debian distros. For those interested in installing the IFC 9.0 on Ubuntu, below are some steps to take. My experience is limited to an installation on a AMD64 Machine running Kubuntu 5.10, but I am quite confident that the procedure is indepedent of the desktop environment and the Ubuntu version (at least for the near past and future). However, it depends quite a bit on the CPU. I gathered the information from a variety of sources, notably from the following page: http://www.theochem.uwa.edu.au/fortran/intel_on_debian, which offers guidance for previous versions the compiler as well. Among other things, I am reproducing the information contained in that page, in case it is removed from the web.
We consider Intel-based systems first.
0. Before we begin: register on Intel's web site. You will receive an email with a license file, and instructions on how to download a gzipped tar file. Download the file, and extract it with tar -xvf <filename>. Do not erase the email.
1. Convert the rpm package to deb format.
alien -k intel-ifort9-9.0-031.i386.rpm
2. save the script as make9
#!/bin/csh
#************************************************* ******************************
# Copyright Daniel Grimwood, 2004, 2005
# The sed scripts are Copyright Intel Corporation, 1999-2005.
# Feel free to distribute and hack up my parts.
#************************************************* ******************************
setenv DEBFILE $1
if ( { test -z $DEBFILE } ) then
echo "Error: require a filename as an argument"
exit 1
endif
if (! -e $DEBFILE) then
echo "Error: file $DEBFILE does not exist"
exit 1
endif
mkdir tmp
dpkg-deb -e $DEBFILE tmp/DEBIAN
dpkg-deb -x $DEBFILE tmp
if (! -e tmp/DEBIAN/postinst) then
cat << \"EOF > tmp/DEBIAN/postinst
#!/bin/sh
\"EOF
chmod 0755 tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q ifort && echo 1`) then
echo DESTINATION='/opt/intel/fc/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q icc && echo 1`) then
echo DESTINATION='/opt/intel/cc/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q idb && echo 1`) then
echo DESTINATION='/opt/intel/idb/9.0' >> tmp/DEBIAN/postinst
endif
cat << \"EOF >> tmp/DEBIAN/postinst
{
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei](cc|fort|fc|cpc)$\|.*cfg$\|.*pcl$\|.*vars[^/]*.c?sh$' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cpc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fort' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<CCBIN\>@"$DESTINATION/bin"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find "$DESTINATION/bin" -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<NON_ROOT_USER_HOME_FOLDER\>@"$DEFAULT_INSTALL_DIR_PREFIX"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
sed s@NON_ROOT_INSTALLATION=\"\"@NON_ROOT_INSTALLATION=\"1\"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
}
\"EOF
dpkg-deb -b tmp $DEBFILE
rm -rf tmp
and run ./make9 intel-ifort9-9.0-031.i386.deb
3. run dpkg -i intel-ifort9-9.0-031.i386.deb
4. add the following snippet to the files /etc/profile and ~/.bashrc
# add Intel Compiler environment variables
#INSTALLDIR is /opt/intel/fce/9.0/
if [ -z "${PATH}" ]
then
PATH="/opt/intel/fce/9.0/bin"; export PATH
else
PATH="/opt/intel/fce/9.0/bin:$PATH"; export PATH
fi
if [ -z "${LD_LIBRARY_PATH}" ]
then
LD_LIBRARY_PATH="/opt/intel/fce/9.0/lib"; export LD_LIBRARY_PATH
else
LD_LIBRARY_PATH="/opt/intel/fce/9.0/lib:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH
fi
if [ -z "${MANPATH}" ]
then
MANPATH="/opt/intel/fce/9.0/man":$(manpath); export MANPATH
else
MANPATH="/opt/intel/fce/9.0/man:${MANPATH}"; export MANPATH
fi
if [ -z "${INTEL_LICENSE_FILE}" ]
then
INTEL_LICENSE_FILE="/opt/intel/fce/9.0/licenses:/opt/intel/licenses:${HOME}/intel/licenses"; export INTEL_LICENSE_FILE
else
INTEL_LICENSE_FILE="${INTEL_LICENSE_FILE}:/opt/intel/fce/9.0/licenses:/opt/intel/licenses:${HOME}/intel/licenses"; export INTEL_LICENSE_FILE
fi
notice that /opt/intel/fce/9.0 could differ for you machine, in which case you have to replace it with the correct IFC install directory.
5. copy the license file contained in the confirmation email you received to the directory /opt/intel/fce/9.0/licenses
And you are ready to go.
For AMD64-based machines, the procedure is slightly more involved:
0. Same as above. Also, make sure the ia32-libs package is installed (as of Breezy Badger, it is).
1. Extract the contents of the rpm. For the below package it puts them into the subdirectory intel-iforte9-9.0.
alien -gsk intel-iforte9-9.0-031.em64t.rpm
1a. Fix some broken directory access permissions from the above extraction. (This is because these parent directories are not listed separately in the rpm, so alien creates them but with root-only permissions).
chmod a+rx intel-iforte9-9.0/opt intel-iforte9-9.0/opt/intel intel-iforte9-9.0/opt/intel/fce intel-iforte9-9.0/opt/intel/fce/9.0
1b. edit intel-iforte9-9.0/debian/control, change the Architecture from em64t to amd64; namely the line
Architecture: amd64
1c. Build the package.
cd intel-iforte9-9.0
debian/rules binary
Ignore the libstdc++ dependency warnings. The package is now built and installable.
2. Run the make_deb_9e script to do the Intel post-installation modifications. This is different to the make_deb_9 script above only because Intel added an "e" to the directory names - icce, iforte, idbe.
#!/bin/csh
#************************************************* ******************************
# Copyright Daniel Grimwood, 2004-2006
# The sed scripts are Copyright Intel Corporation, 1999-2005.
# Feel free to distribute and hack up my parts.
#************************************************* ******************************
setenv DEBFILE $1
if ( { test -z $DEBFILE } ) then
echo "Error: require a filename as an argument"
exit 1
endif
if (! -e $DEBFILE) then
echo "Error: file $DEBFILE does not exist"
exit 1
endif
mkdir tmp
dpkg-deb -e $DEBFILE tmp/DEBIAN
dpkg-deb -x $DEBFILE tmp
if (! -e tmp/DEBIAN/postinst) then
cat << \"EOF > tmp/DEBIAN/postinst
#!/bin/sh
\"EOF
chmod 0755 tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q ifort && echo 1`) then
echo DESTINATION='/opt/intel/fce/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q icce && echo 1`) then
echo DESTINATION='/opt/intel/cce/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q idbe && echo 1`) then
echo DESTINATION='/opt/intel/idbe/9.0' >> tmp/DEBIAN/postinst
endif
cat << \"EOF >> tmp/DEBIAN/postinst
{
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei](cc|fort|fc|cpc)$\|.*cfg$\|.*pcl$\|.*vars[^/]*.c?sh$' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cpc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fort' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<CCBIN\>@"$DESTINATION/bin"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find "$DESTINATION/bin" -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<NON_ROOT_USER_HOME_FOLDER\>@"$DEFAULT_INSTALL_DIR_PREFIX"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
sed s@NON_ROOT_INSTALLATION=\"\"@NON_ROOT_INSTALLATION=\"1\"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
}
\"EOF
dpkg-deb -b tmp $DEBFILE
rm -rf tmp
Run
./make_deb_9e intel-iforte9_9.0-031_amd64.deb
3. Install the package.
dpkg -i intel-iforte9_9.0-031_amd64.deb
4. repeat step 4 as for x86 architecture
5. repeat step 4 as for x86 architecture
I hope this helps.
We consider Intel-based systems first.
0. Before we begin: register on Intel's web site. You will receive an email with a license file, and instructions on how to download a gzipped tar file. Download the file, and extract it with tar -xvf <filename>. Do not erase the email.
1. Convert the rpm package to deb format.
alien -k intel-ifort9-9.0-031.i386.rpm
2. save the script as make9
#!/bin/csh
#************************************************* ******************************
# Copyright Daniel Grimwood, 2004, 2005
# The sed scripts are Copyright Intel Corporation, 1999-2005.
# Feel free to distribute and hack up my parts.
#************************************************* ******************************
setenv DEBFILE $1
if ( { test -z $DEBFILE } ) then
echo "Error: require a filename as an argument"
exit 1
endif
if (! -e $DEBFILE) then
echo "Error: file $DEBFILE does not exist"
exit 1
endif
mkdir tmp
dpkg-deb -e $DEBFILE tmp/DEBIAN
dpkg-deb -x $DEBFILE tmp
if (! -e tmp/DEBIAN/postinst) then
cat << \"EOF > tmp/DEBIAN/postinst
#!/bin/sh
\"EOF
chmod 0755 tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q ifort && echo 1`) then
echo DESTINATION='/opt/intel/fc/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q icc && echo 1`) then
echo DESTINATION='/opt/intel/cc/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q idb && echo 1`) then
echo DESTINATION='/opt/intel/idb/9.0' >> tmp/DEBIAN/postinst
endif
cat << \"EOF >> tmp/DEBIAN/postinst
{
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei](cc|fort|fc|cpc)$\|.*cfg$\|.*pcl$\|.*vars[^/]*.c?sh$' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cpc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fort' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<CCBIN\>@"$DESTINATION/bin"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find "$DESTINATION/bin" -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<NON_ROOT_USER_HOME_FOLDER\>@"$DEFAULT_INSTALL_DIR_PREFIX"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
sed s@NON_ROOT_INSTALLATION=\"\"@NON_ROOT_INSTALLATION=\"1\"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
}
\"EOF
dpkg-deb -b tmp $DEBFILE
rm -rf tmp
and run ./make9 intel-ifort9-9.0-031.i386.deb
3. run dpkg -i intel-ifort9-9.0-031.i386.deb
4. add the following snippet to the files /etc/profile and ~/.bashrc
# add Intel Compiler environment variables
#INSTALLDIR is /opt/intel/fce/9.0/
if [ -z "${PATH}" ]
then
PATH="/opt/intel/fce/9.0/bin"; export PATH
else
PATH="/opt/intel/fce/9.0/bin:$PATH"; export PATH
fi
if [ -z "${LD_LIBRARY_PATH}" ]
then
LD_LIBRARY_PATH="/opt/intel/fce/9.0/lib"; export LD_LIBRARY_PATH
else
LD_LIBRARY_PATH="/opt/intel/fce/9.0/lib:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH
fi
if [ -z "${MANPATH}" ]
then
MANPATH="/opt/intel/fce/9.0/man":$(manpath); export MANPATH
else
MANPATH="/opt/intel/fce/9.0/man:${MANPATH}"; export MANPATH
fi
if [ -z "${INTEL_LICENSE_FILE}" ]
then
INTEL_LICENSE_FILE="/opt/intel/fce/9.0/licenses:/opt/intel/licenses:${HOME}/intel/licenses"; export INTEL_LICENSE_FILE
else
INTEL_LICENSE_FILE="${INTEL_LICENSE_FILE}:/opt/intel/fce/9.0/licenses:/opt/intel/licenses:${HOME}/intel/licenses"; export INTEL_LICENSE_FILE
fi
notice that /opt/intel/fce/9.0 could differ for you machine, in which case you have to replace it with the correct IFC install directory.
5. copy the license file contained in the confirmation email you received to the directory /opt/intel/fce/9.0/licenses
And you are ready to go.
For AMD64-based machines, the procedure is slightly more involved:
0. Same as above. Also, make sure the ia32-libs package is installed (as of Breezy Badger, it is).
1. Extract the contents of the rpm. For the below package it puts them into the subdirectory intel-iforte9-9.0.
alien -gsk intel-iforte9-9.0-031.em64t.rpm
1a. Fix some broken directory access permissions from the above extraction. (This is because these parent directories are not listed separately in the rpm, so alien creates them but with root-only permissions).
chmod a+rx intel-iforte9-9.0/opt intel-iforte9-9.0/opt/intel intel-iforte9-9.0/opt/intel/fce intel-iforte9-9.0/opt/intel/fce/9.0
1b. edit intel-iforte9-9.0/debian/control, change the Architecture from em64t to amd64; namely the line
Architecture: amd64
1c. Build the package.
cd intel-iforte9-9.0
debian/rules binary
Ignore the libstdc++ dependency warnings. The package is now built and installable.
2. Run the make_deb_9e script to do the Intel post-installation modifications. This is different to the make_deb_9 script above only because Intel added an "e" to the directory names - icce, iforte, idbe.
#!/bin/csh
#************************************************* ******************************
# Copyright Daniel Grimwood, 2004-2006
# The sed scripts are Copyright Intel Corporation, 1999-2005.
# Feel free to distribute and hack up my parts.
#************************************************* ******************************
setenv DEBFILE $1
if ( { test -z $DEBFILE } ) then
echo "Error: require a filename as an argument"
exit 1
endif
if (! -e $DEBFILE) then
echo "Error: file $DEBFILE does not exist"
exit 1
endif
mkdir tmp
dpkg-deb -e $DEBFILE tmp/DEBIAN
dpkg-deb -x $DEBFILE tmp
if (! -e tmp/DEBIAN/postinst) then
cat << \"EOF > tmp/DEBIAN/postinst
#!/bin/sh
\"EOF
chmod 0755 tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q ifort && echo 1`) then
echo DESTINATION='/opt/intel/fce/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q icce && echo 1`) then
echo DESTINATION='/opt/intel/cce/9.0' >> tmp/DEBIAN/postinst
endif
if (`echo $DEBFILE | grep -q idbe && echo 1`) then
echo DESTINATION='/opt/intel/idbe/9.0' >> tmp/DEBIAN/postinst
endif
cat << \"EOF >> tmp/DEBIAN/postinst
{
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei](cc|fort|fc|cpc)$\|.*cfg$\|.*pcl$\|.*vars[^/]*.c?sh$' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cpc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fort' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fc' 2> /dev/null) ; do
sed s@\<INSTALLDIR\>@$DESTINATION@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find $DESTINATION/bin/ -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<CCBIN\>@"$DESTINATION/bin"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
for FILE in $(find "$DESTINATION/bin" -type f -iname 'iccec' 2> /dev/null) ; do
sed s@\<NON_ROOT_USER_HOME_FOLDER\>@"$DEFAULT_INSTALL_DIR_PREFIX"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
sed s@NON_ROOT_INSTALLATION=\"\"@NON_ROOT_INSTALLATION=\"1\"@g $FILE > ${FILE}.abs
mv ${FILE}.abs $FILE
chmod 755 $FILE
done
}
\"EOF
dpkg-deb -b tmp $DEBFILE
rm -rf tmp
Run
./make_deb_9e intel-iforte9_9.0-031_amd64.deb
3. Install the package.
dpkg -i intel-iforte9_9.0-031_amd64.deb
4. repeat step 4 as for x86 architecture
5. repeat step 4 as for x86 architecture
I hope this helps.