From: akl Date: Fri, 17 Aug 2007 14:03:25 +0000 (+0000) Subject: Script to check Fortran compilers and libraries on current system. X-Git-Tag: IMP_BR_4~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d57174c1e36bc06a199b0d4557c0577fd3e52a53;p=tools%2Finstall.git Script to check Fortran compilers and libraries on current system. --- diff --git a/config_files/checkFortran.sh b/config_files/checkFortran.sh new file mode 100755 index 0000000..ebdd67a --- /dev/null +++ b/config_files/checkFortran.sh @@ -0,0 +1,82 @@ +#!/bin/bash -noprofile + +#################################################################################### +# File : checkFortran.sh +# Created : Mon Jun 25 17:09:00 2007 +# Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com) +# Project : SALOME +# Module : Installation Wizard +# Copyright : 2002-2007 CEA +# +# This script is the part of the SALOME installation procedure. +# +# The script to check if the Fortran is installed. +# +#################################################################################### + +find_compilers(){ + +# Known compilers: +# f77/f90/f95 : generic compiler names +# g77 : GNU Fortran 77 compiler +# gfortran : putative GNU Fortran 95+ compiler (in progress) +# fort77 : native F77 compiler under HP-UX (and some older Crays) +# frt : Fujitsu F77 compiler +# pgf77/pgf90/pgf95 : Portland Group F77/F90/F95 compilers +# xlf/xlf90/xlf95 : IBM (AIX) F77/F90/F95 compilers +# lf95 : Lahey-Fujitsu F95 compiler +# fl32 : Microsoft Fortran 77 "PowerStation" compiler +# af77 : Apogee F77 compiler for Intergraph hardware running CLIX +# epcf90 : "Edinburgh Portable Compiler" F90 +# fort : Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha +# ifc : Intel Fortran 95 compiler for Linux/x86 +# efc : Intel Fortran 95 compiler for IA64 + +# set path separator +IFS=: +FORT="" + +for prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + do +# echo "Checking for $prog" + for as_dir in $PATH; do + test -z "$as_dir" && as_dir=. + if test -f "$as_dir/$prog"; then + FORT="$prog" + echo "Found $as_dir/$prog" + break 2 + fi + done +# echo "Result: no" +done + +if test -n "$FORT"; then + cat >conftest.f <<_ACEOF + program main + + end +_ACEOF + $FORT conftest.f > /dev/null + rm -f conftest.* + exit $? +else + # Fortran compiler was not found + exit 1 +fi +} + +find_libraries(){ + source ${INST_DIR}/env_products.sh + ldd ${INST_DIR}/*/lib/salome/*.so | grep not + if test $? -eq 0; then + exit 1 + else + exit 0 + fi +} + +PROCEDURE=$1 +test $# -eq 2 && INST_DIR=$2 + +$PROCEDURE +