Skip to content
Snippets Groups Projects
Commit b37a81f0 authored by Joan Solà Ortega's avatar Joan Solà Ortega Committed by Joan Solà Ortega
Browse files

Update ReadMe.md

parent a5267fe8
No related branches found
No related tags found
1 merge request!218Wolf script readme update
This commit is part of merge request !218. Comments created here will be created in the context of that merge request.
...@@ -10,12 +10,17 @@ Helpful scripts to create WOLF tree elements (e.g. processors) ...@@ -10,12 +10,17 @@ Helpful scripts to create WOLF tree elements (e.g. processors)
..*`sudo apt-get install realpath` ..*`sudo apt-get install realpath`
* __RealPath__ (Required, MacOSX): The realpath package above is not available for MacOSX. Here is an out-of-the-box alternative (credits to WaffleSouffle: https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx): * __RealPath__ (Required, MacOSX): The realpath package above is not available for MacOSX.
Here is an out-of-the-box alternative
(credits to WaffleSouffle: https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx):
- Create a small project `realpath` (here in `$HOME/dev/` as an example) - Create a small project `realpath` (here in `$HOME/dev/` as an example)
```
$ cd $HOME/dev $ cd $HOME/dev
$ mkdir realpath $ mkdir realpath
$ cd realpath
```
- Create a file `realpath.c` with the contents: - Create a file `realpath.c` with the contents:
...@@ -27,7 +32,7 @@ Helpful scripts to create WOLF tree elements (e.g. processors) ...@@ -27,7 +32,7 @@ Helpful scripts to create WOLF tree elements (e.g. processors)
int main (int argc, char* argv[]) int main (int argc, char* argv[])
{ {
if (argc > 1) { if (argc > 1) {
for (int argIter = 1; argIter < argc; ++argIter) { for (int argIter = 1; argIter < argc; ++argIter) {
char *resolved_path_buffer = NULL; char *resolved_path_buffer = NULL;
char *result = realpath(argv[argIter], resolved_path_buffer); char *result = realpath(argv[argIter], resolved_path_buffer);
...@@ -36,7 +41,7 @@ Helpful scripts to create WOLF tree elements (e.g. processors) ...@@ -36,7 +41,7 @@ Helpful scripts to create WOLF tree elements (e.g. processors)
if (result != NULL) { if (result != NULL) {
free(result); free(result);
} }
} }
} }
return 0; return 0;
...@@ -56,9 +61,17 @@ Helpful scripts to create WOLF tree elements (e.g. processors) ...@@ -56,9 +61,17 @@ Helpful scripts to create WOLF tree elements (e.g. processors)
gcc -o $@ $^ $(CFLAGS) gcc -o $@ $^ $(CFLAGS)
``` ```
- Then compile with make and put in a soft link with: - Then compile with `make`:
```
$ make
```
- and put in a soft link with:
```
$ ln -s $(pwd)/realpath /usr/local/bin/realpath $ ln -s $(pwd)/realpath /usr/local/bin/realpath
```
#### SCRIPTS installation #### SCRIPTS installation
......
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