Merge branch 'HrvojeJasak' of ssh://git.code.sf.net/u/hjasak/foam-extend-3.1 into...
[foam-extend-3.2.git] / etc / bashrc.mingw
blob305849ec0513d87b292e374844ea71c35b7fb687
1 #!/bin/sh
2 #----------------------------------*-sh-*--------------------------------------
3 # ========= |
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration | Version: 3.2
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 builds on Windows.
30 # Calls the main etc/bashrc script.
31 # Sourced from ~/.profile or ~/.bashrc
33 # Author:
34 # Cesare Guardino, Alstom Power Ltd., (2015)
36 #------------------------------------------------------------------------------
38 export PROGRAMS_HOME=/c/Programs
40 # {{{ DEFINE USER EDITABLE FUNCTIONS
41 set_system_paths() {
42 echo "Setting environment variables for user-defined installed system tools and utilities ..."
43 export CMAKE_HOME=$PROGRAMS_HOME/cmake-3.2.3-win32-x86
44 export GIT_HOME=$PROGRAMS_HOME/Git
45 export MINGW_HOME=$PROGRAMS_HOME/mingw64
46 export MPI_ROOTDIR=$PROGRAMS_HOME/OpenMPI_v1.6.1-x64
47 export PARAVIEW_HOME=$PROGRAMS_HOME/ParaView-4.3.1
48 #export PERL_HOME=$PROGRAMS_HOME/strawberry-perl-5.20.2.1-64bit/perl
49 export PEXPORTS_HOME=$PROGRAMS_HOME/pexports
50 export PYTHON_HOME=$PROGRAMS_HOME/Python27
51 export SUBVERSION_HOME=$PROGRAMS_HOME/svn-win32-1.8.13
52 export WGET_HOME=$PROGRAMS_HOME/wget-1.11.4-1
53 export ZIP_HOME="/c/Program Files/7-Zip"
56 add_to_path() {
57 echo
58 echo "Adding user-defined installed system tools to PATH ..."
59 export PATH=$ZIP_HOME:$PATH
60 export PATH=$WGET_HOME/bin:$PATH
61 export PATH=$PYTHON_HOME:$PATH
62 export PATH=$SUBVERSION_HOME/bin:$PATH
63 export PATH=$GIT_HOME/cmd:$PATH
64 #export PATH=$PERL_HOME/bin:$PATH
65 export PATH=$CMAKE_HOME/bin:$PATH
66 export PATH=$MPI_ROOTDIR/bin:$PATH
67 export PATH=$PEXPORTS_HOME/bin:$PATH
68 export PATH=$MINGW_HOME/bin:$PATH
69 export PATH=$PARAVIEW_HOME/bin:$PATH
71 # }}}
73 # {{{ DEFINE PROCESS FUNCTIONS
74 setup_foam_env() {
75 echo
76 export export FLEX_DIR=$(echo $WD\.. | sed 's/\\/\//g' | sed 's/\(.*\):/\/\1/')
77 FOAM_ETC_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
78 export FOAM_INST_DIR=$(readlink -f $FOAM_ETC_DIR/../..)
79 export FOAM_VERBOSE=1
80 export MPI_VERSION_MINGW=openmpi-1.6.1
81 export WM_OSTYPE=MSWindows
82 echo "Sourcing: $FOAM_ETC_DIR/bashrc"
83 . $FOAM_ETC_DIR/bashrc
86 set_OMPI_env() {
87 echo "Setting OpenMPI environment settings ..."
88 export OMPI_MPICC=gcc.exe
89 export OMPI_MPIXX=g++.exe
90 export OMPI_CXXFLAGS==-I$MPI_ROOTDIR/include
91 export OMPI_CFLAGS=-I$MPI_ROOTDIR/include
92 export OMPI_CXXFLAGS=-I$MPI_ROOTDIR/include
93 export OMPI_LDFLAGS=-L$MPI_ROOTDIR/lib
94 export OMPI_LIBS=$OMPI_LDFLAGS
97 check_versions() {
98 echo
99 echo "Checking versions of installed system tools (based on PATH) ..."
100 echo "7-Zip: " `which 7z` [`(7z --help 2>&1) 2> /dev/null | head -2`]
101 echo "Bison: " `which bison` [`(bison --version 2>&1) 2> /dev/null | head -1`]
102 echo "CMake: " `which cmake` [`(cmake --version 2>&1) 2> /dev/null | head -1`]
103 echo "Flex: " `which flex` [`(flex --version 2>&1) 2> /dev/null | head -1`]
104 echo "G++: " `which g++` [`(g++ --version 2>&1) 2> /dev/null | head -1`]
105 echo "GCC: " `which gcc` [`(gcc --version 2>&1) 2> /dev/null | head -1`]
106 echo "GMake: " `which gmake` [`(gmake --version 2>&1) 2> /dev/null | head -1`]
107 echo "Git: " `which git` [`(git --version 2>&1) 2> /dev/null | head -1`]
108 echo "Java: " `which java` [`(java -version 2>&1) 2> /dev/null | head -1`]
109 echo "M4: " `which m4` [`(m4 --version 2>&1) 2> /dev/null | head -1`]
110 echo "Make: " `which make` [`(make --version 2>&1) 2> /dev/null | head -1`]
111 echo "MinGW-w64: " $MINGW_HOME
112 echo "OpenMPI: " `which mpirun` [`(mpirun --version 2>&1) 2> /dev/null | head -1`]
113 echo "PEexports: " `which pexports` [`(pexports -v 2>&1) 2> /dev/null | head -1`]
114 echo "ParaView: " $PARAVIEW_HOME
115 echo "Perl: " `which perl` [`(perl -v 2>&1) 2> /dev/null | head -2`]
116 echo "Python: " `which python` [`(python --version 2>&1) 2> /dev/null | head -1`]
117 echo "Subversion: " `which svn` [`(svn --version 2>&1) 2> /dev/null | head -1`]
118 echo "Vim: " `which vim` [`(vim --version 2>&1) 2> /dev/null | head -1`]
119 echo "Wget: " `which wget` [`(wget --version 2>&1) 2> /dev/null | head -3`]
122 finish() {
123 export PATH=$PATH:$LD_LIBRARY_PATH
124 echo
125 echo
126 echo "FOAM_INST_DIR=$FOAM_INST_DIR"
127 echo "WM_PROJECT_DIR=$WM_PROJECT_DIR"
128 echo "WM_OSTYPE=$WM_OSTYPE"
129 echo "ENVIRONMENT SETUP COMPLETE."
131 # }}}
133 # {{{ MAIN EXECUTION
134 set_system_paths
135 setup_foam_env
136 add_to_path
137 set_OMPI_env
138 check_versions
139 finish
140 # }}}