You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2025-07-03-softwares.md
+33-76Lines changed: 33 additions & 76 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,96 +5,53 @@ date: 2025-07-03 15:09:00
5
5
description: instructions for setting up software packages and configuring systems for global simulations
6
6
tags: configuration newsystem code
7
7
categories: research
8
-
featured: true
8
+
featured: false
9
9
---
10
10
11
-
This theme implements a built-in Jekyll feature, the use of Rouge, for syntax highlighting.
12
-
It supports more than 100 languages.
13
-
This example is in C++.
14
-
All you have to do is wrap your code in markdown code tags:
11
+
Often when migrating to new systems, it can get difficult to setup all the necessary libraries and packages in the target system for
12
+
continuing working on the mddelling. In this post I will try to summarize the libraries required for setting up some of the simulations codes e.g.,
13
+
SWMF, MPI-AMRVAC, SFT-1D. Some of these codes require `hdf5`, `netcdf-c/fortran`, `zlib`, `curl`, `OPENMPI` and `GCC`.
15
14
16
-
````markdown
17
-
```c++
18
-
code code code
19
-
```
20
-
````
21
-
22
-
```c++
23
-
intmain(int argc, char const \*argv[])
24
-
{
25
-
string myString;
26
-
27
-
cout << "input a string: ";
28
-
getline(cin, myString);
29
-
int length = myString.length();
15
+
**GCC**
16
+
It is quite simple to build up on the existing system libraries (on Linux/Mac systems). The bash script file [`build_gcc_13.2.0.sh`](https://github.com/darrenjs/howto/blob/master/build_scripts/build_gcc_13.2.0.sh) is the best resource for this.
17
+
Download the file and run it in a `bash` shell. **Add `fortran` language to the list of langiages inside the shell script.** At the end of the building, it will show the instructions to append the installed libraries to the system `$PATH`. The script downloads and installs the libraries on the system. A note of caution, the whole process may take about ~3 hrs., so be patient.
30
18
31
-
char charArray = new char * [length];
19
+
After this, you can build the `OPENMPI` libraries. The installation version `openmpi-4.1.5` seem to work for me with the `GCC` installation versions. I prefer building the libraries with a local prefix.
32
20
33
-
charArray = myString;
34
-
for(int i = 0; i < length; ++i){
35
-
cout << charArray[i] << " ";
36
-
}
21
+
Inside the openmpi-4.1.5 directory run the following,
37
22
38
-
return 0;
39
-
}
23
+
```
24
+
./configure --prefix=~/opt/openmpi-4.1.5
25
+
make -j 4
26
+
make install
40
27
```
41
28
42
-
For displaying code in a list item, you have to be aware of the indentation, as stated in [this FAQ](https://github.com/planetjekyll/quickrefs/blob/master/FAQ.md#q-how-can-i-get-backtick-fenced-code-blocks-eg--working-inside-lists-with-kramdown). You must indent your code by **(3 \* bullet_indent_level)** spaces. This is because kramdown (the markdown engine used by Jekyll) indentation for the code block in lists is determined by the column number of the first non-space character after the list item marker. For example: [download the bash script.](assets/pdf/build_gcc_13.2.0.sh)
43
-
44
-
````markdown
45
-
1. We can put fenced code blocks inside nested bullets, too.
46
-
47
-
1. Like this:
48
-
49
-
```c
50
-
printf("Hello, World!");
51
-
```
52
-
53
-
2. The key is to indent your fenced block in the same line as the first character of the line.
54
-
````
55
-
56
-
Which displays:
57
-
58
-
1. We can put fenced code blocks inside nested bullets, too.
59
-
60
-
1. Like this:
61
-
62
-
```c
63
-
printf("Hello, World!");
64
-
```
65
-
66
-
2. The key is to indent your fenced block in the same line as the first character of the line.
67
-
68
-
By default, it does not display line numbers. If you want to display line numbers for every code block, you can set `kramdown.syntax_highlighter_opts.block.line_numbers` to true in your `_config.yml` file.
69
-
70
-
If you want to display line numbers for a specific code block, all you have to do is wrap your code in a liquid tag:
After the installation you can check the version of the `gcc` by typing `gcc -v`. Similarly for `fortran` as well. At the end of this the system should have all the `mpicc, mpif90, gcc, gfortran` executables in the default `$PATH` variable.
80
39
81
-
int main(int argc, char const \*argv[])
82
-
{
83
-
string myString;
40
+
**netCDF**
41
+
Installation of netcdf libraries is dependent on multiple other libraries e.g., `curl`, `zlib`, `hdf5`, `netcdf-c` and `netcdf-fortran`. Here is a shell script [install_netcdf.sh](https://github.com/sr-dash/SFT-1D/blob/main/install_netcdf.sh) for this. A few extra install flags and versions are suggested for a system-wide installation.
84
42
85
-
cout << "input a string: ";
86
-
getline(cin, myString);
87
-
int length = myString.length();
43
+
Suggested versions
44
+
*`hdf5-1.14.6`, build with `--enable-fortran`, `--enable-cxx`/`--enable-parallel`.
45
+
*`netcdf-c-4.9.3`
46
+
*`netcdf-fortran-4.6.1`
47
+
*`zlib-1.3.1`
48
+
*`curl-8.14.1`
88
49
89
-
char charArray = new char * [length];
50
+
Again the shell script downloads the required files and builds the libraries at a user location.
90
51
91
-
charArray = myString;
92
-
for(int i = 0; i < length; ++i){
93
-
cout << charArray[i] << " ";
94
-
}
95
52
96
-
return 0;
53
+
**None of the scripts require admin privileges, so building these libraries should be self-sufficient.**
97
54
98
-
}
55
+
After building these libraries, you must update the system `$PATH$` variable for future use. Individual simulation codes require independent path to the libraries.
0 commit comments