This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/etc/bashrc.mingw

145 lines
5.8 KiB
Text
Raw Normal View History

2015-08-04 12:39:06 +00:00
#!/bin/sh
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
2016-06-20 15:00:40 +00:00
# \\ / O peration | Version: 4.0
2015-08-04 12:39:06 +00:00
# \\ / A nd | Web: http://www.foam-extend.org
# \\/ M anipulation | For copyright notice see file Copyright
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# etc/bashrc.mingw
#
# Description
# Startup file for FOAM for use with MSYS shell for MinGW-based build
# on Microsoft Windows 7 and 8.1.
2015-08-04 12:39:06 +00:00
# Calls the main etc/bashrc script.
# Sourced from ~/.profile or ~/.bashrc
#
# Author:
# Cesare Guardino, Alstom Power Ltd., (2015)
#
#------------------------------------------------------------------------------
2015-08-04 12:55:21 +00:00
export PROGRAMS_HOME=/c/Programs
2015-08-04 12:39:06 +00:00
# {{{ DEFINE USER EDITABLE FUNCTIONS
set_system_paths() {
echo "Setting environment variables for user-defined installed system tools and utilities ..."
2015-08-04 12:55:21 +00:00
export CMAKE_HOME=$PROGRAMS_HOME/cmake-3.2.3-win32-x86
#export GIT_HOME=$PROGRAMS_HOME/Git
#export JAVA_HOME="/c/Program Files/Java/jre1.8.0_45"
export MINGW_HOME=$PROGRAMS_HOME/x86_64-4.8.2-release-win32-seh-rt_v3-rev3/mingw64
2015-08-04 12:55:21 +00:00
export MPI_ROOTDIR=$PROGRAMS_HOME/OpenMPI_v1.6.1-x64
export PARAVIEW_HOME=$PROGRAMS_HOME/ParaView-4.3.1
export PERL_HOME=$PROGRAMS_HOME/strawberry-perl-5.20.2.1-64bit/perl
#export PEXPORTS_HOME=$PROGRAMS_HOME/pexports-0.46-mingw32
#export PYTHON_HOME=$PROGRAMS_HOME/Python27
#export SUBVERSION_HOME=$PROGRAMS_HOME/svn-win32-1.8.13
2015-08-04 12:39:06 +00:00
export WGET_HOME=$PROGRAMS_HOME/wget-1.11.4-1
2015-08-04 12:39:06 +00:00
export ZIP_HOME="/c/Program Files/7-Zip"
}
add_to_path() {
2015-08-05 12:49:55 +00:00
echo
echo "Adding user-defined installed system tools to PATH ..."
2015-08-04 12:39:06 +00:00
export PATH=$ZIP_HOME:$PATH
export PATH=$WGET_HOME/bin:$PATH
#export PATH=$JAVA_HOME/bin:$PATH
#export PATH=$PYTHON_HOME:$PATH
#export PATH=$SUBVERSION_HOME/bin:$PATH
#export PATH=$GIT_HOME/cmd:$PATH
export PATH=$PARAVIEW_HOME/bin:$PATH
export PATH=$PERL_HOME/bin:$PATH
2015-08-04 12:39:06 +00:00
export PATH=$CMAKE_HOME/bin:$PATH
export PATH=$MPI_ROOTDIR/bin:$PATH
#export PATH=$PEXPORTS_HOME/bin:$PATH
export PATH=$MINGW_HOME/bin:$PATH
2015-08-04 12:39:06 +00:00
}
# }}}
# {{{ DEFINE PROCESS FUNCTIONS
setup_foam_env() {
2015-08-05 12:49:55 +00:00
echo
2015-08-04 12:39:06 +00:00
export export FLEX_DIR=$(echo $WD\.. | sed 's/\\/\//g' | sed 's/\(.*\):/\/\1/')
FOAM_ETC_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
export FOAM_INST_DIR=$(readlink -f $FOAM_ETC_DIR/../..)
2015-08-05 12:49:55 +00:00
export FOAM_VERBOSE=1
export MPI_VERSION_MINGW=openmpi-1.6.1
2015-08-05 12:49:55 +00:00
export WM_OSTYPE=MSWindows
2015-08-07 09:51:47 +00:00
echo "Sourcing: $FOAM_ETC_DIR/bashrc"
2015-08-04 12:39:06 +00:00
. $FOAM_ETC_DIR/bashrc
}
set_OMPI_env() {
echo "Setting OpenMPI environment settings ..."
2015-08-04 12:39:06 +00:00
export OMPI_MPICC=gcc.exe
export OMPI_MPIXX=g++.exe
export OMPI_CXXFLAGS==-I$MPI_ROOTDIR/include
export OMPI_CFLAGS=-I$MPI_ROOTDIR/include
export OMPI_CXXFLAGS=-I$MPI_ROOTDIR/include
export OMPI_LDFLAGS=-L$MPI_ROOTDIR/lib
export OMPI_LIBS=$OMPI_LDFLAGS
}
check_versions() {
echo
2015-08-04 12:39:06 +00:00
echo "Checking versions of installed system tools (based on PATH) ..."
echo "7-Zip: " `which 7z` [`(7z --help 2>&1) 2> /dev/null | head -2`]
echo "Bison: " `which bison` [`(bison --version 2>&1) 2> /dev/null | head -1`]
2015-08-04 12:39:06 +00:00
echo "CMake: " `which cmake` [`(cmake --version 2>&1) 2> /dev/null | head -1`]
echo "Flex: " `which flex` [`(flex --version 2>&1) 2> /dev/null | head -1`]
echo "G++: " `which g++` [`(g++ --version 2>&1) 2> /dev/null | head -1`]
echo "GCC: " `which gcc` [`(gcc --version 2>&1) 2> /dev/null | head -1`]
echo "GMake: " `which gmake` [`(gmake --version 2>&1) 2> /dev/null | head -1`]
echo "Git: " `which git` [`(git --version 2>&1) 2> /dev/null | head -1`]
echo "Java: " `which java` [`(java -version 2>&1) 2> /dev/null | head -1`]
echo "M4: " `which m4` [`(m4 --version 2>&1) 2> /dev/null | head -1`]
echo "Make: " `which make` [`(make --version 2>&1) 2> /dev/null | head -1`]
2015-08-04 12:39:06 +00:00
echo "MinGW-w64: " $MINGW_HOME
echo "OpenMPI: " `which mpirun` [`(mpirun --version 2>&1) 2> /dev/null | head -1`]
echo "PEexports: " `which pexports` [`(pexports -v 2>&1) 2> /dev/null | head -1`]
echo "ParaView: " $PARAVIEW_HOME
echo "Perl: " `which perl` [`(perl -v 2>&1) 2> /dev/null | head -2`]
echo "Python: " `which python` [`(python --version 2>&1) 2> /dev/null | head -1`]
echo "Subversion: " `which svn` [`(svn --version 2>&1) 2> /dev/null | head -1`]
echo "Vim: " `which vim` [`(vim --version 2>&1) 2> /dev/null | head -1`]
echo "Wget: " `which wget` [`(wget --version 2>&1) 2> /dev/null | head -3`]
2015-08-04 12:39:06 +00:00
}
finish() {
2015-08-10 09:21:20 +00:00
export PATH=$PATH:$LD_LIBRARY_PATH
2015-08-04 12:39:06 +00:00
echo
echo
2015-08-04 12:39:06 +00:00
echo "FOAM_INST_DIR=$FOAM_INST_DIR"
echo "WM_PROJECT_DIR=$WM_PROJECT_DIR"
echo "WM_OSTYPE=$WM_OSTYPE"
2015-08-04 12:39:06 +00:00
echo "ENVIRONMENT SETUP COMPLETE."
}
# }}}
# {{{ MAIN EXECUTION
set_system_paths
setup_foam_env
add_to_path
set_OMPI_env
check_versions
finish
# }}}