Merge branch 'bugfix/partialOveralpGGI'
[foam-extend-4.0.git] / etc / bashrc.mingw
blobef23bb6860077527bbf15ea4523eaeae41503740
1 #!/bin/sh
2 #----------------------------------*-sh-*--------------------------------------
3 # ========= |
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration | Version: 4.0
6 # \\ / A nd | Web: http://www.foam-extend.org
7 # \\/ M anipulation | For copyright notice see file Copyright
8 #------------------------------------------------------------------------------
9 # License
10 # This file is part of foam-extend.
12 # foam-extend is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation, either version 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 # Script
26 # etc/bashrc.mingw
28 # Description
29 # Startup file for FOAM for use with MSYS shell for MinGW-based build
30 # on Microsoft Windows 7 and 8.1.
31 # Calls the main etc/bashrc script.
32 # Sourced from ~/.profile or ~/.bashrc
34 # Author:
35 # Cesare Guardino, Alstom Power Ltd., (2015)
37 #------------------------------------------------------------------------------
39 export PROGRAMS_HOME=/c/Programs
41 # {{{ DEFINE USER EDITABLE FUNCTIONS
42 set_system_paths() {
43 echo "Setting environment variables for user-defined installed system tools and utilities ..."
44 export CMAKE_HOME=$PROGRAMS_HOME/cmake-3.2.3-win32-x86
45 export GIT_HOME=$PROGRAMS_HOME/Git
46 export JAVA_HOME="/c/Program Files/Java/jre1.8.0_45"
47 #export MINGW_HOME=$PROGRAMS_HOME/x86_64-4.8.2-release-win32-seh-rt_v3-rev3/mingw64
48 export MINGW_HOME=$PROGRAMS_HOME/mingw64
49 export MPI_ROOTDIR=$PROGRAMS_HOME/OpenMPI_v1.6.1-x64
50 export PARAVIEW_HOME=$PROGRAMS_HOME/ParaView-4.3.1
51 export PERL_HOME=$PROGRAMS_HOME/strawberry-perl-5.20.2.1-64bit/perl
52 #export PEXPORTS_HOME=$PROGRAMS_HOME/pexports-0.46-mingw32
53 export PEXPORTS_HOME=$PROGRAMS_HOME/pexports-0.46
54 export PYTHON_HOME=$PROGRAMS_HOME/Python27
55 export SUBVERSION_HOME=$PROGRAMS_HOME/svn-win32-1.8.13
56 export WGET_HOME=$PROGRAMS_HOME/wget-1.11.4-1
57 export ZIP_HOME="/c/Program Files/7-Zip"
60 add_to_path() {
61 echo
62 echo "Adding user-defined installed system tools to PATH ..."
63 export PATH=$ZIP_HOME:$PATH
64 export PATH=$WGET_HOME/bin:$PATH
65 export PATH=$JAVA_HOME/bin:$PATH
66 export PATH=$PYTHON_HOME:$PATH
67 export PATH=$SUBVERSION_HOME/bin:$PATH
68 export PATH=$GIT_HOME/cmd:$PATH
69 export PATH=$PARAVIEW_HOME/bin:$PATH
70 export PATH=$PERL_HOME/bin:$PATH
71 export PATH=$CMAKE_HOME/bin:$PATH
72 export PATH=$MPI_ROOTDIR/bin:$PATH
73 export PATH=$PEXPORTS_HOME/bin:$PATH
74 export PATH=$MINGW_HOME/bin:$PATH
76 # }}}
78 # {{{ DEFINE PROCESS FUNCTIONS
79 setup_foam_env() {
80 echo
81 export export FLEX_DIR=$(echo $WD\.. | sed 's/\\/\//g' | sed 's/\(.*\):/\/\1/')
82 FOAM_ETC_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
83 export FOAM_INST_DIR=$(readlink -f $FOAM_ETC_DIR/../..)
84 export FOAM_VERBOSE=1
85 export MPI_VERSION_MINGW=openmpi-1.6.1
86 export WM_OSTYPE=MSWindows
87 echo "Sourcing: $FOAM_ETC_DIR/bashrc"
88 . $FOAM_ETC_DIR/bashrc
91 set_OMPI_env() {
92 echo "Setting OpenMPI environment settings ..."
93 export OMPI_MPICC=gcc.exe
94 export OMPI_MPIXX=g++.exe
95 export OMPI_CXXFLAGS==-I$MPI_ROOTDIR/include
96 export OMPI_CFLAGS=-I$MPI_ROOTDIR/include
97 export OMPI_CXXFLAGS=-I$MPI_ROOTDIR/include
98 export OMPI_LDFLAGS=-L$MPI_ROOTDIR/lib
99 export OMPI_LIBS=$OMPI_LDFLAGS
102 check_versions() {
103 echo
104 echo "Checking versions of installed system tools (based on PATH) ..."
105 echo "7-Zip: " `which 7z` [`(7z --help 2>&1) 2> /dev/null | head -2`]
106 echo "Bison: " `which bison` [`(bison --version 2>&1) 2> /dev/null | head -1`]
107 echo "CMake: " `which cmake` [`(cmake --version 2>&1) 2> /dev/null | head -1`]
108 echo "Flex: " `which flex` [`(flex --version 2>&1) 2> /dev/null | head -1`]
109 echo "G++: " `which g++` [`(g++ --version 2>&1) 2> /dev/null | head -1`]
110 echo "GCC: " `which gcc` [`(gcc --version 2>&1) 2> /dev/null | head -1`]
111 echo "GMake: " `which gmake` [`(gmake --version 2>&1) 2> /dev/null | head -1`]
112 echo "Git: " `which git` [`(git --version 2>&1) 2> /dev/null | head -1`]
113 echo "Java: " `which java` [`(java -version 2>&1) 2> /dev/null | head -1`]
114 echo "M4: " `which m4` [`(m4 --version 2>&1) 2> /dev/null | head -1`]
115 echo "Make: " `which make` [`(make --version 2>&1) 2> /dev/null | head -1`]
116 echo "MinGW-w64: " $MINGW_HOME
117 echo "OpenMPI: " `which mpirun` [`(mpirun --version 2>&1) 2> /dev/null | head -1`]
118 echo "PEexports: " `which pexports` [`(pexports -v 2>&1) 2> /dev/null | head -1`]
119 echo "ParaView: " $PARAVIEW_HOME
120 echo "Perl: " `which perl` [`(perl -v 2>&1) 2> /dev/null | head -2`]
121 echo "Python: " `which python` [`(python --version 2>&1) 2> /dev/null | head -1`]
122 echo "Subversion: " `which svn` [`(svn --version 2>&1) 2> /dev/null | head -1`]
123 echo "Vim: " `which vim` [`(vim --version 2>&1) 2> /dev/null | head -1`]
124 echo "Wget: " `which wget` [`(wget --version 2>&1) 2> /dev/null | head -3`]
127 finish() {
128 export PATH=$PATH:$LD_LIBRARY_PATH
129 echo
130 echo
131 echo "FOAM_INST_DIR=$FOAM_INST_DIR"
132 echo "WM_PROJECT_DIR=$WM_PROJECT_DIR"
133 echo "WM_OSTYPE=$WM_OSTYPE"
134 echo "ENVIRONMENT SETUP COMPLETE."
136 # }}}
138 # {{{ MAIN EXECUTION
139 set_system_paths
140 setup_foam_env
141 add_to_path
142 set_OMPI_env
143 check_versions
144 finish
145 # }}}