Skip to content
Snippets Groups Projects
Commit d5f748f9 authored by KyleKlenk's avatar KyleKlenk
Browse files

Added Instructions for compiling SUMMA-Actors

parent a40a70b1
No related branches found
No related tags found
No related merge requests found
...@@ -17,51 +17,43 @@ SUMMA-Actors depends on the following Libraries: ...@@ -17,51 +17,43 @@ SUMMA-Actors depends on the following Libraries:
* [C++ Actor Framework](https://github.com/actor-framework/actor-framework) * [C++ Actor Framework](https://github.com/actor-framework/actor-framework)
Once the following libraries have been installed SUMMA-Actors can be compiled in Once the following libraries have been installed SUMMA-Actors can be compiled in
one of two ways. The first way is to modify the makefile directly and the second one of two ways. The first way is to modify the Makefile directly and the second
is to invoke the makefile by shellscript: is to invoke the makefile by shellscript:
### Method 1: Makefile ### Method 1: Makefile
The method is best used for a workstation build that does not have access to a Compute Canada environment where inlcudes and libraires will need to be explicitly specified. The method is best used for a workstation build that does not have access to a Compute Canada Software Stack where includes and libraries will need to be explicitly specified.
1. Makefile:
Changes need to be made to the following variables in the Makefile: The Makefile is located in the `build` directory and the following variables will need to be uncommented and changed:
- F_MASTER = directory/above/build - F_MASTER = Path/to/Summa-Actors/ # this is the directory above build/
- FC = gfortran - FC = gfortran
- CC = g++ - CC = g++
- INCLUDES = Path/to/netcdf/includes - INCLUDES = Path/to/netcdf/includes
- LIBRARIES = Path/to/netcdf/lib & Path/to/openblas - LIBRARIES = Path/to/netcdf/lib
-lnetcdff -lopenblas Path/to/openblas
- ACTORS_INCLUDES = $INCLUDES & Path/to/CAF/includes -lnetcdff -lopenblas
- ACTORS_LIBRARIES = $LIBRARIES & PATH/to/CAF/lib & PATH/to/libsumma.so - ACTORS_INCLUDES = $INCLUDES
Path/to/CAF/includes
- ACTORS_LIBRARIES = $LIBRARIES
PATH/to/CAF/lib
$(F_MASTER)/bin
-lcaf_core -lcaf_io -lsumma -lopenblas -lnetcdff -lcaf_core -lcaf_io -lsumma -lopenblas -lnetcdff
After the following SUMMA-Actors can be compiled with `make`. After the following SUMMA-Actors can be compiled with `make`.
Note: SUMMA is compiled as a shared library (libsumma.so) and the main program Once compiled you will need to set the library path variable with the following command (replace F_Master with the full path to the SUMMA-Actors directory):
will need to know where this library is located in order to properly link it. `export LD_LIBRARY_PATH=/F_MASTER/bin`
By compiling both libsumma.so and summaMain in the same directory (build/) should be
enough. However if there are issues, specifing where libsumma.so will be compiled can be done See section Running SUMMA-Actors for instructions on how to use the program.
by adding the path to `ACTORS_LIBRARIES` in the makefile this should rectify the issues.
### Method 2: Shell Script ### Method 2: Shell Script
2. ShellScript: This method is best used for cluster environments that have access to the Compute Canada Software Stack. This method has been tested on the University of Saskatchewan's Copernicus and Compute Canada's Graham. This method will invoke the Makefile and no modifications should be made to the Makefile for this method.
In the build directory exists a example_compile.sh script that can be modified.
This is usually used for HPC computing environments and includes which modules
to load for Compute Canada or the University of Saskatchewan's Copernicus.
example_compile.sh contains instructions on what parts to modify and how to
invoke the makefile from the script.
Once the shellscript has been modified running it with `source your_script.sh` will compile
SUMMA-Actors.
After SUMMA-Actors is compiled you should be left with a libsumma.so and a summaMain file The compilation script is located in the `build` as `compile_summa.sh`. The only variable within the compile script that needs to be changed is the `F_MASTER` path. This is the absolute path to the SUMMA-Actors directory.
in your build directory.
It is important to set the `LD_LIBRARY_PATH` environment variable before attempting to run Once the F_MASTER path has been specified the following command can be used to build SUMMA-Actors from the build directory:
summa. This variable needs to point to the location of libsumma.so. If you compiled using the `source compile_summa.sh`
shellscript using the `source` command and following the directions within the example_compile.sh
this should already be set for you.
This script should load all of the required modules from the Compute Canada Software Stack as well as set the environment variable `LD_LIBRARY_PATH` required for running SUMMA-Actors.
## Running Summa-Actors ## Running Summa-Actors
......
File added
#!/bin/bash
#### load modules if using Compute Canada or Copernicus ####
module load gcc/9.3.0
module load netcdf-fortran
module load openblas
module load caf
#### Specifiy Master Directory, parent of build directory
export F_MASTER=
#### Specifiy Compilers ####
export FC=gfortran
export CC=g++
#### Includes and Libraries ####
export INCLUDES="-I$EBROOTNETCDFMINFORTRAN/include"
export LIBRARIES="-L$EBROOTNETCDFMINFORTRAN/lib64\
-L$EBROOTOPENBLAS/lib\
-lnetcdff -lopenblas"
# INCLUDES FOR Actors Component
export ACTORS_INCLUDES="-I$EBROOTCAF/include\
-I$EBROOTNETCDFMINFORTRAN/include"
export ACTORS_LIBRARIES="-L$EBROOTCAF/lib\
-L$EBROOTCAF/lib64\
-L$EBROOTNETCDFMINFORTRAN/lib64\
-L$EBROOTOPENBLAS/lib\
-L$F_MASTER/bin\
-lcaf_core -lcaf_io -lsumma -lopenblas -lnetcdff"
#### Compile with the Makefile ####
make -f ${F_MASTER}/build/makefile
export LD_LIBRARY_PATH=${F_MASTER}/bin
\ No newline at end of file
#!/bin/bash
#### load modules if using Compute Canada or Copernicus ####
# module load gcc/9.3.0
# module load netcdf-fortran
# module load openblas
# module load caf
#### Specifiy Master Directory, parent of build directory
# export F_MASTER=/path/to/summaActors
#### Specifiy Compilers ####
# export FC=gfortran
# export CC=g++
#### Includes and Libraries ####
# export INCLUDES = NETCDF and OPENBLAS
# export LIBRARIES = NETCDF and OPENBLAS
# export ACTORS_INCLUDES = C++ Actor Framework
# export ACTORS_LIBRARIES = C++ Actor Framework and
# The directory in which libsumma.so resides
#### Compile with the Makefile ####
# make -f ${F_MASTER}/build/makefile lib # libsumma.so part
# mv libsumma.so ${F_MASTER}/bin # optional move of libsumma (just ensure that summaMain knows where to find it)
# make -f ${F_MASTER}/build/makefile main # summaMain part
# mv summaMain ${F_MASTER}/bin # optional move, cleans things up
# export LD_LIBRARY_PATH=Path/to/libsumma.so
\ No newline at end of file
#### parent directory of the 'build' directory #### #### parent directory of the 'build' directory ####
# F_MASTER = /home/kklenk/Summa-Actors # F_MASTER =
# #### fortran compiler #### #### fortran compiler ####
# FC = gfortran # FC =
# #### C++ compiler #### #### C++ compiler ####
# CC=g++ # CC =
# #### Includes AND Libraries #### #### Includes AND Libraries ####
# INCLUDES = -I/usr/include # INCLUDES =
# LIBRARIES = -L/usr/lib -lnetcdff -lnetcdf -lopenblas # LIBRARIES =
# ACTORS_INCLUDES = -I/usr/include -I/usr/local/include # ACTORS_INCLUDES =
# ACTORS_LIBRARIES = -L/home/linuxbrew.linuxbrew/lib -L/home/kklenk/Summa-Actors/build -lcaf_core -lcaf_io -lsumma -lopenblas -lnetcdff # ACTORS_LIBRARIES =
# Production runs # Production runs
...@@ -268,6 +268,7 @@ compile_summa: ...@@ -268,6 +268,7 @@ compile_summa:
# generate library # generate library
link: link:
$(FC) -shared *.o -o libsumma.so $(FC) -shared *.o -o libsumma.so
mv libsumma.so $(F_MASTER)/bin
# compile the c++ portion of SummaActors # compile the c++ portion of SummaActors
actors: actors:
...@@ -275,7 +276,9 @@ actors: ...@@ -275,7 +276,9 @@ actors:
actorsLink: actorsLink:
$(CC) -o summaMain *.o $(ACTORS_LIBRARIES) $(CC) -o summaMain *.o $(ACTORS_LIBRARIES)
mv summaMain $(F_MASTER)/bin
#### COMPILE TESTING FILES ####
actors_test: actors_test:
$(CC) $(FLAGS_ACTORS) -c $(ACTOR_TEST) -std=c++17 $(ACTORS_INCLUDES) $(CC) $(FLAGS_ACTORS) -c $(ACTOR_TEST) -std=c++17 $(ACTORS_INCLUDES)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment