1 Check Windows in Command prompt
Press Win + R
, type cmd, and press Enter, or search for Command Prompt
in the Start menu
winver
This will open a window displaying your Windows version and build information
2 Install Ubuntu linux on Windows
3 Ubuntu installed
To navigate to the C:\schism directory from within Ubuntu (assuming it’s mounted in the /mnt directory), you can use the following command
cd /mnt/c/schism
Install MPI. You can choose between openmpi or mpich, depending on your preference. To install openmpi, run:
`sudo apt update`, then
`sudo apt install openmpi-bin openmpi-common libopenmpi-dev`
- Install Python or link it correctly. First, check if Python 3 is installed
python3 --version
- If Python 3 is installed, create a symlink so python points to python3
sudo ln -s /usr/bin/python3 /usr/bin/python
- If Python is not installed, install it with:
sudo apt update
sudo apt install python3
This error means autosrc.mk is missing.
Check if there’s an instruction to generate this file, or try running:
make clean
- /bin/sh: 1: ../mk/sfmakedepend.pl: not found
Check if sfmakedepend.pl exists in your project. If not, it may have been missed during the project setup or download. Ensure that all files are fully downloaded or cloned from the repository.
If sfmakedepend.pl exists but is located elsewhere, you might need to modify the Makefile to point to its correct path.
- Perl Dependency
Install Perl if it’s missing:
sudo apt update
sudo apt install perl
- Reset building environment
make clean
make pschism
- Navigate to the cmake/ Directory
cd /path/to/schism/cmake
- Set Up SCHISM.local.build
TVD_LIM=1
BLD_STANDALONE=ON
NO_PARMETIS=ON
# (if bypassing ParMETIS)
OLDIO=ON
# (set to OFF if you want to use asynchronous I/O)
- Set Up SCHISM.local.cluster_name
cp -L SCHISM.local.whirlwind SCHISM.local.myown
- Run CMake
cd ..
mkdir build
cd build
- Run cmake to configure the build:
cmake ..
This will read the CMake files and configure the build based on the settings you specified in the SCHISM.local.build and SCHISM.local.cluster_name files.
- Build the Code
Compile the project by running make within the build directory:
make -j$(nproc) pschism
The cmake is essentially a pre-processor for make, and it creates cache files (e.g. build/ CMakeCache.txt, where you can inspect all env variables). After cmake is done, make can be executed in parallel or in serial mode.
If the CMakeCache.txt file is missing, it usually indicates an issue during the CMake configuration process.
- Remove Old build/ Directory and Retry
cd ../build
rm -rf *
2. Run CMake with Verbose Output
cd ../build
cmake -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/ -DCMAKE_VERBOSE_MAKEFILE=ON
It is difficult for me to install ifort, so I use gfortran
Download OneAPI Compiler first
Code to try ifort (but turn out I cannot get it)
nano ~/.bashrc
- Ensure mpif90 uses Intel Fortran compiler instead of Gfortran
export I_MPI_F90=ifort
-
Source the setvars.sh script to set up paths and environment variables
-
Replace /opt/intel/oneapi with the actual path where Intel oneAPI is installed
source /opt/intel/oneapi/setvars.sh > /dev/null
source ~/.bashrc
mpif90 -show
ifort --version
- Alternative: GNU Fortran
sudo apt update
sudo apt install gfortran
- After installed, build SCHISM
/mnt/c/schism/build
cd /mnt/c/schism/build
ls
Verify, gfortran --version
Set gfortran as the Fortran Compiler in CMake
cd /path/to/your/build/directory
cmake -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
make -j$(nproc)
ls /mnt/c/schism
cd /mnt/c/schism/build
cmake -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
cd /mnt/c/schism
mkdir build
cd build
which gfortran
cmake -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
cmake -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
export FC=gfortran
cmake -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
- Install NetCDF Libraries
sudo apt update
sudo apt install libnetcdf-dev libnetcdff-dev
- Verify Installation of nc-config
nc-config --version
- Set NetCDF Paths Explicitly in CMake
nc-config --cflags
# This will give the include directory path
nc-config --libs
# This will give the library path
cmake -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so \ -DNetCDF_Fortran_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdff.so \ -DNetCDF_INCLUDE_DIR=/usr/include \ -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
- Clear CMake Cache and Retry
rm -rf CMakeCache.txt CMakeFiles/
- Install g++ (GNU C++ Compiler)
sudo apt update
sudo apt install build-essential
- Verify the Installation
g++ --version
- Set CXX Environment Variable
export CXX=/usr/bin/g++
- Clear CMake Cache
rm -rf CMakeCache.txt CMakeFiles/
cd /path/to/your/build/directory
rm -rf CMakeCache.txt CMakeFiles/
cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
make -j$(nproc)
gfortran --version
sudo apt update
sudo apt install gfortran
which gfortran
cmake -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
rm -rf CMakeCache.txt CMakeFiles/
Run the CMake configuration and build your project using make on Ubuntu. Replace paths and options as needed.
-
Navigate to the Build Directory and Run CMake
-
Navigate to the build directory (create if it doesn't exist)
cd /path/to/your/project/build || mkdir -p /path/to/your/project/build && cd /path/to/your/project/build
- Run CMake configuration
cmake -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
- Compile the Project with make
make -j8 pschism
make VERBOSE=1 pschism
- Ensure svn is Installed
sudo apt update
sudo apt install subversion
- Download SCHISM Verification Tests Using svn
svn co https://columbia.vims.edu/schism/schism_verification_tests
-
Locate and Use the Correct param.nml File
-
Replace /path/to/schism with the actual path where SCHISM is installed
cp /path/to/schism/sample_inputs/param.nml /path/to/schism_verification_tests/
- Check for Updates in Readme.beta_notes
cat /path/to/schism/src/Readme.beta_notes
cd schism_verification_tests
ls
svn: E000104: Error running context: Connection reset by peer
ERROR: cannot verify columbia.vims.edu's certificate, issued by ‘CN=Sectigo RSA Domain Validation Secure Server CA,O=Sectigo Limited,L=Salford,ST=Greater Manchester,C=GB’:
Unable to locally verify the issuer's authority.
To connect to columbia.vims.edu insecurely, use `--no-check-certificate'.
wget --no-check-certificate -r -np -nH --cut-dirs=3 -R "index.html*" https://columbia.vims.edu/schism/schism_verification_tests/
Install ca-certificates Package
sudo apt update
sudo apt install ca-certificates
Try to re-run the code
Run successfully
cd /
cd /mnt/c/Users/uqrprast/Documents
/mnt/c/Users/uqrprast/Documents# git clone --recurse-submodules https://github.com/schism-dev/schism.git
cd schism
/mnt/c/Users/uqrprast/Documents/schism# sudo apt update
/mnt/c/Users/uqrprast/Documents/schism# sudo apt install openmpi-bin openmpi-common libopenmpi-dev
/mnt/c/Users/uqrprast/Documents/schism# python3 --version
/mnt/c/Users/uqrprast/Documents/schism# sudo apt install perl
/mnt/c/Users/uqrprast/Documents/schism/build#
/mnt/c/Users/uqrprast/Documents/schism/build# rm -rf
/mnt/c/Users/uqrprast/Documents/schism/build# cmake -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
CMake Error: Not a file: /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.myown CMake Error: Error processing file: /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.myown
/mnt/c/Users/uqrprast/Documents/schism/build# ls /mnt/c/Users/uqrprast/Documents/schism/build
/mnt/c/Users/uqrprast/Documents/schism/build# cmake ../cmake/SCHISM.local.myown
CMake Error: The source directory "/mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.myown" does not exist.
/mnt/c/Users/uqrprast/Documents/schism/build# ls /mnt/c/Users/uqrprast/Documents/schism/cmake
/mnt/c/Users/uqrprast/Documents/schism/build# find /mnt/c/Users/uqrprast/Documents/schism -name "SCHISM.local*"
/mnt/c/Users/uqrprast/Documents/schism/build# nano /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.myown
/mnt/c/Users/uqrprast/Documents/schism/build# cd /mnt/c/Users/uqrprast/Documents/schism/build
cmake ../cmake/SCHISM.local.myown
'/mnt/c/Users/uqrprast/Documents/schism/build# make -j8 pschism`
/mnt/c/Users/uqrprast/Documents/schism/build# sudo apt update
/mnt/c/Users/uqrprast/Documents/schism/build# cd ../build
/mnt/c/Users/uqrprast/Documents/schism/build# cmake -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/ -DCMAKE_VERBOSE_MAKEFILE=ON
#gfortran
/mnt/c/Users/uqrprast/Documents/schism/build# sudo apt install gfortran
/mnt/c/Users/uqrprast/Documents/schism/build# cd /path/to/your/build/directory
cd: /path/to/your/build/directory: No such file or directory
Make directory folder
/mnt/c/schism/build# gfortran --version
/mnt/c/schism/build# cmake -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
/mnt/c/schism/build# which gfortran
/mnt/c/schism/build# export FC=/usr/bin/gfortran
/mnt/c/schism/build# cmake -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran ../cmake/SCHISM.local.myown
/mnt/c/Users/uqrprast/Documents/schism/build# sudo apt update
/mnt/c/Users/uqrprast/Documents/schism/build# sudo apt install libnetcdf-dev libnetcdff-dev
/mnt/c/Users/uqrprast/Documents/schism/build# nc-config --version
/mnt/c/Users/uqrprast/Documents/schism/build# nc-config --cflags
/mnt/c/Users/uqrprast/Documents/schism/build# nc-config --libs
/mnt/c/Users/uqrprast/Documents/schism/build# cmake -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so \ -DNetCDF_Fortran_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdff.so \ -DNetCDF_INCLUDE_DIR=/usr/include \ -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
/mnt/c/Users/uqrprast/Documents/schism/build# export CXX=/usr/bin/g++
/mnt/c/Users/uqrprast/Documents/schism/build# rm -rf CMakeCache.txt CMakeFiles/
/mnt/c/Users/uqrprast/Documents/schism/build# mkdir -p /path/to/your/build/directory
/mnt/c/Users/uqrprast/Documents/schism/build# cd /path/to/your/build/directory
/path/to/your/build/directory# rm -rf CMakeCache.txt CMakeFiles/
/path/to/your/build/directory# cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/
/path/to/your/build/directory# ls /mnt/c/Users/uqrprast/Documents/schism/cmake
/path/to/your/build/directory# ls /mnt/c/Users/uqrprast/Documents/schism/src
/path/to/your/build/directory# cd /mnt/c/Users/uqrprast/Documents/schism/build
/mnt/c/Users/uqrprast/Documents/schism/build# cmake -C ../cmake/SCHISM.local.myown ..
/mnt/c/Users/uqrprast/Documents/schism/build# ls /mnt/c/Users/uqrprast/Documents/schism
/path/to/your/build/directory# ls /mnt/c/Users/uqrprast/Documents/schism/src ls /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.build ls /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.myown
/path/to/your/build/directory# cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \ -C /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.build \ -C /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.myown \ /mnt/c/Users/uqrprast/Documents/schism/src
/path/to/your/build/directory# find /mnt/c/Users/uqrprast/Documents/schism -name "SCHISM.local*"
/path/to/your/build/directory# cd /mnt/c/Users/uqrprast/Documents/schism/build
/mnt/c/Users/uqrprast/Documents/schism/build# rm -rf *
/mnt/c/Users/uqrprast/Documents/schism/build# cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \ -C /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.build \ -C /mnt/c/Users/uqrprast/Documents/schism/cmake/SCHISM.local.myown \ /mnt/c/Users/uqrprast/Documents/schism/src
/mnt/c/Users/uqrprast/Documents/schism/build# make -j8 pschism /mnt/c/Users/uqrprast/Documents/schism/src/Core/gen_version.py /mnt/c/Users/uqrprast/Documents/schism/src/Core /mnt/c/Users/uqrprast/Documents/schism/src/Core/_version
/mnt/c/Users/uqrprast/Documents/schism/build#
/mnt/c/Users/uqrprast/Documents/schism/build# sudo apt update
/mnt/c/Users/uqrprast/Documents/schism/build# sudo apt install subversion
/mnt/c/Users/uqrprast/Documents/schism/build# svn co https://columbia.vims.edu/schism/schism_verification_tests