Bugfix: Moved case insensitive directory name clash
[foam-extend-3.2.git] / etc / bashrc.mingw
blobd4928d906f4727ca0fce12debaf413580a237185
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 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 MINGW_HOME=$PROGRAMS_HOME/mingw64
47 export MPI_ROOTDIR=$PROGRAMS_HOME/OpenMPI_v1.6.1-x64
48 export PARAVIEW_HOME=$PROGRAMS_HOME/ParaView-4.3.1
49 #export PERL_HOME=$PROGRAMS_HOME/strawberry-perl-5.20.2.1-64bit/perl
50 export PEXPORTS_HOME=$PROGRAMS_HOME/pexports-0.46
51 export PYTHON_HOME=$PROGRAMS_HOME/Python27
52 export SUBVERSION_HOME=$PROGRAMS_HOME/svn-win32-1.8.13
53 export WGET_HOME=$PROGRAMS_HOME/wget-1.11.4-1
54 export ZIP_HOME="/c/Program Files/7-Zip"
57 add_to_path() {
58 echo
59 echo "Adding user-defined installed system tools to PATH ..."
60 export PATH=$ZIP_HOME:$PATH
61 export PATH=$WGET_HOME/bin:$PATH
62 export PATH=$PYTHON_HOME:$PATH
63 export PATH=$SUBVERSION_HOME/bin:$PATH
64 export PATH=$GIT_HOME/cmd:$PATH
65 #export PATH=$PERL_HOME/bin:$PATH
66 export PATH=$PARAVIEW_HOME/bin:$PATH
67 export PATH=$CMAKE_HOME/bin:$PATH
68 export PATH=$PEXPORTS_HOME/bin:$PATH
69 export PATH=$MINGW_HOME/bin:$PATH
70 # MPI comes last to enforce the path
71 export PATH=$MPI_ROOTDIR/bin:$PATH
73 # }}}
75 # {{{ DEFINE PROCESS FUNCTIONS
76 setup_foam_env() {
77 echo
78 export export FLEX_DIR=$(echo $WD\.. | sed 's/\\/\//g' | sed 's/\(.*\):/\/\1/')
79 FOAM_ETC_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
80 export FOAM_INST_DIR=$(readlink -f $FOAM_ETC_DIR/../..)
81 export FOAM_VERBOSE=1
82 export MPI_VERSION_MINGW=openmpi-1.6.1
83 export WM_OSTYPE=MSWindows
84 echo "Sourcing: $FOAM_ETC_DIR/bashrc"
85 . $FOAM_ETC_DIR/bashrc
88 set_OMPI_env() {
89 echo "Setting OpenMPI environment settings ..."
90 export OMPI_MPICC=gcc.exe
91 export OMPI_MPIXX=g++.exe
92 export OMPI_CXXFLAGS==-I$MPI_ROOTDIR/include
93 export OMPI_CFLAGS=-I$MPI_ROOTDIR/include
94 export OMPI_CXXFLAGS=-I$MPI_ROOTDIR/include
95 export OMPI_LDFLAGS=-L$MPI_ROOTDIR/lib
96 export OMPI_LIBS=$OMPI_LDFLAGS
99 check_versions() {
100 echo
101 echo "Checking versions of installed system tools (based on PATH) ..."
102 echo "7-Zip: " `which 7z` [`(7z --help 2>&1) 2> /dev/null | head -2`]
103 echo "Bison: " `which bison` [`(bison --version 2>&1) 2> /dev/null | head -1`]
104 echo "CMake: " `which cmake` [`(cmake --version 2>&1) 2> /dev/null | head -1`]
105 echo "Flex: " `which flex` [`(flex --version 2>&1) 2> /dev/null | head -1`]
106 echo "G++: " `which g++` [`(g++ --version 2>&1) 2> /dev/null | head -1`]
107 echo "GCC: " `which gcc` [`(gcc --version 2>&1) 2> /dev/null | head -1`]
108 echo "GMake: " `which gmake` [`(gmake --version 2>&1) 2> /dev/null | head -1`]
109 echo "Git: " `which git` [`(git --version 2>&1) 2> /dev/null | head -1`]
110 echo "Java: " `which java` [`(java -version 2>&1) 2> /dev/null | head -1`]
111 echo "M4: " `which m4` [`(m4 --version 2>&1) 2> /dev/null | head -1`]
112 echo "Make: " `which make` [`(make --version 2>&1) 2> /dev/null | head -1`]
113 echo "MinGW-w64: " $MINGW_HOME
114 echo "OpenMPI: " `which mpirun` [`(mpirun --version 2>&1) 2> /dev/null | head -1`]
115 echo "PEexports: " `which pexports` [`(pexports -v 2>&1) 2> /dev/null | head -1`]
116 echo "ParaView: " $PARAVIEW_HOME
117 echo "Perl: " `which perl` [`(perl -v 2>&1) 2> /dev/null | head -2`]
118 echo "Python: " `which python` [`(python --version 2>&1) 2> /dev/null | head -1`]
119 echo "Subversion: " `which svn` [`(svn --version 2>&1) 2> /dev/null | head -1`]
120 echo "Vim: " `which vim` [`(vim --version 2>&1) 2> /dev/null | head -1`]
121 echo "Wget: " `which wget` [`(wget --version 2>&1) 2> /dev/null | head -3`]
124 finish() {
125 export PATH=$PATH:$LD_LIBRARY_PATH
126 echo
127 echo
128 echo "FOAM_INST_DIR=$FOAM_INST_DIR"
129 echo "WM_PROJECT_DIR=$WM_PROJECT_DIR"
130 echo "WM_OSTYPE=$WM_OSTYPE"
131 echo "ENVIRONMENT SETUP COMPLETE."
133 # }}}
135 # {{{ MAIN EXECUTION
136 set_system_paths
137 setup_foam_env
138 add_to_path
139 set_OMPI_env
140 check_versions
141 finish
142 # }}}