Skip to content

rianmantasasp/Running-SCHISM-for-the-first-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

Running SCHISM for the first time

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

Click: https://www.youtube.com/watch?v=wjbbl0TTMeo&pp=ygUjaG93IHRvIGluc3RhbGwgdWJ1bnR1IG9uIHdpbmRvd3MgMTE%3D

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

Error: compiler mpif90

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`

No python

  1. Install Python or link it correctly. First, check if Python 3 is installed

python3 --version

  1. If Python 3 is installed, create a symlink so python points to python3

sudo ln -s /usr/bin/python3 /usr/bin/python

  1. If Python is not installed, install it with:

sudo apt update

sudo apt install python3

Error: Makefile:115: o/svn.BORA/autosrc.mk: No such file or directory

This error means autosrc.mk is missing.

Check if there’s an instruction to generate this file, or try running:

make clean

Error after type: make pschism

  1. /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.

  1. Perl Dependency

Install Perl if it’s missing:

sudo apt update

sudo apt install perl

  1. Reset building environment

make clean

make pschism

To build the SCHISM code using CMake

  1. Navigate to the cmake/ Directory

cd /path/to/schism/cmake

  1. 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)

  1. Set Up SCHISM.local.cluster_name

cp -L SCHISM.local.whirlwind SCHISM.local.myown

  1. Run CMake

cd ..

mkdir build

cd build

  1. 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.

  1. Build the Code

Compile the project by running make within the build directory:

make -j$(nproc) pschism

Error: I cannot find the file build/ CMakeCache.txt

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.

  1. 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

Error: Compiler not found

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

  1. Ensure mpif90 uses Intel Fortran compiler instead of Gfortran

export I_MPI_F90=ifort

  1. Source the setvars.sh script to set up paths and environment variables

  2. 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

I CANNOT FIND IFORT AGAIN

  1. Alternative: GNU Fortran

sudo apt update

sudo apt install gfortran

  1. After installed, build SCHISM

/mnt/c/schism/build

cd /mnt/c/schism/build

ls

Error: Cmake Fortran compiler

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)

Build directory

ls /mnt/c/schism

cd /mnt/c/schism/build

Run CMake with gfortran

cmake -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/

cd /mnt/c/schism

mkdir build

cd build

Error again

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/

Error: NET CDF

  1. Install NetCDF Libraries

sudo apt update

sudo apt install libnetcdf-dev libnetcdff-dev

  1. Verify Installation of nc-config

nc-config --version

  1. 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/

  1. Clear CMake Cache and Retry

rm -rf CMakeCache.txt CMakeFiles/

Still error

  1. Install g++ (GNU C++ Compiler)

sudo apt update

sudo apt install build-essential

  1. Verify the Installation

g++ --version

  1. Set CXX Environment Variable

export CXX=/usr/bin/g++

  1. Clear CMake Cache

rm -rf CMakeCache.txt CMakeFiles/

Re-run

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)

Error compiler

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.

  1. Navigate to the Build Directory and Run CMake

  2. 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

  1. Run CMake configuration

cmake -DCMAKE_Fortran_COMPILER=gfortran -C ../cmake/SCHISM.local.build -C ../cmake/SCHISM.local.myown ../src/

  1. Compile the Project with make

make -j8 pschism

make VERBOSE=1 pschism

Execute SCHISM sample run test

  1. Ensure svn is Installed

sudo apt update

sudo apt install subversion

  1. Download SCHISM Verification Tests Using svn

svn co https://columbia.vims.edu/schism/schism_verification_tests

  1. Locate and Use the Correct param.nml File

  2. 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/

  1. Check for Updates in Readme.beta_notes

cat /path/to/schism/src/Readme.beta_notes

Run the Benchmark Tests

cd schism_verification_tests

Explore the available test cases

ls

Error 10 November 2024

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'.

I try to recall the 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

16 November

Try to re-run the code

Run successfully

27 November 2024 attempt

Starting with cloning

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

Cloning into 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/

Error

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

Resolving

/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

Error

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`

Resolving

/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

Trying to resolve again

/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

Extracting modules

/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

About

Running SCHISM for the first time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published