From 328dc6547f290361f8bd49177c2d6c27cc966456 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Thu, 28 Dec 2017 17:53:16 +0100 Subject: [PATCH 01/25] some clean ups --- .gitignore | 1 - A_fortran/{readme.txt => README.md} | 21 +++++++++++---------- A_fortran/test1/{readme.txt => README.md} | 13 ++++++++----- README.md | 22 ++++++++++++++++------ 4 files changed, 35 insertions(+), 22 deletions(-) rename A_fortran/{readme.txt => README.md} (51%) rename A_fortran/test1/{readme.txt => README.md} (82%) diff --git a/.gitignore b/.gitignore index 147680c..c412f95 100644 --- a/.gitignore +++ b/.gitignore @@ -140,7 +140,6 @@ $RECYCLE.BIN/ #other *.zip - *.pdf *.ppt diff --git a/A_fortran/readme.txt b/A_fortran/README.md similarity index 51% rename from A_fortran/readme.txt rename to A_fortran/README.md index b821332..f3a8c5b 100644 --- a/A_fortran/readme.txt +++ b/A_fortran/README.md @@ -1,15 +1,16 @@ -FORTRAN or Fortran is actually a different programing language separated from C, however considering it has been the de facto programing language for mathematical and algebraic calculations, many legacy libraries, including original implementations BLAS and LAPACK APIs are written in Fortran. Of course you can use the libraries mentioned in this tutorial without knowing how to do mixed Fortran and C programing, but knowing that not only will help you a lot understanding what happening under the hood, but also gives you the ability to modify or even write your own fortran subroutines if required. not to mention it opens the door to tens of other libraries out there written in fortran. fortran is historically the gold standard programing language for mathematical operations and learning fortran for you as a C programer will be life changing. +# Description: +FORTRAN/Fortran is obviously a different programing language from C. However, considering it has been the de facto programing language for mathematical and algebraic calculations, many legacy libraries, including original implementations BLAS and LAPACK APIs are written in Fortran. Of course you can use the libraries mentioned in this tutorial without knowing how to do mixed Fortran and C programing, but knowing that not only will help you a lot understanding what happening under the hood, but also gives you the ability to modify or even write your own Fortran subroutines if required. not to mention it opens the door to tens of other libraries out there written in Fortran. Fortran is historically the gold standard programing language for mathematical operations and learning Fortran for you as a C programmer will be life changing. -keywords: -mixed language programing -call fortran functions/subroutines -interface the function calls +# keywords: +* mixed language programing +* call Fortran functions/subroutines from C/C++ +* interface the function calls +# Points: +1. name of the routines/subroutines/functions and structs/commons in some versions or dialects of Fortran must be in small letters and an underscore _ must be added to the C function -sources to be looked at: -1. -2. +# Sources to be studied: 3. http://arnholm.org/software/cppf77/cppf77.htm --> test35 4. http://www.nag.com/lapack-ex/node1.html#sec:Introduction 5. http://physics.oregonstate.edu/~landaur/nacphy/lapack/fortran.html @@ -28,9 +29,9 @@ sources to be looked at: 18. cfortran--> http://www-zeus.desy.de/~burow/cfortran/ -points: +# To do: -1. name of the routines/subroutines/functions and structs/commons in some versions or dialects of fortran must be in small letters and and an underscore _ must be added to the C function +1. Change the naming scheme from test-- to example-- and add 0 before the single digit numbers so it sorts correctly issues: diff --git a/A_fortran/test1/readme.txt b/A_fortran/test1/README.md similarity index 82% rename from A_fortran/test1/readme.txt rename to A_fortran/test1/README.md index 28d934c..d15ab54 100644 --- a/A_fortran/test1/readme.txt +++ b/A_fortran/test1/README.md @@ -1,11 +1,14 @@ -fortran code written if FORTRAN 77? +fortran code written in FORTRAN 77? -this file shows how we can call a C function from fortran and how to pass a string properly from fortran to C -source: http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html +# Abstract: +This example shows how we can call a C function from Fortran and how to pass a string properly from Fortran to C +# Source: + http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html -points: -1. when you pass a string from fortran to C you actually pass two variables including a pointer to an array of single characters (string) and also the length of the array. + +# Points: +1. when you pass a string from Fortran to C you actually pass two variables including a pointer to an array of single characters (string) and also the length of the array. 2. when you pass a string to C you need to first be sure that you allocate at least one letter more than the characters you need and in C first of se "\0" or NULL as the end of the string 3. common is the equivalent of struct in C in C: diff --git a/README.md b/README.md index 908d4bf..d03cf79 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,32 @@ -# A collection of math tutorials in C +# Description: While ago, when I started doing some linear algebra in C, it came to me as a surprise to see there are so few tutorials for BLAS, LAPACK and other fundamental APIs. Despite the fact that they are somehow the building blocks of many other libraries. For that reason I started collecting all the examples I could find all over the net for BLAS, LAPACK, CLAPACK, LAPACKE, ATLAS, OpenBLAS ... in this Github repo. Well, I should warn you that as a mechanical engineer I have little experience in managing such a repo and it might firstly seems as a complete mess to you guys. However if you manage to get over the mess you will find all kind of examples and instructions which might be help. I have tried the most and the ones does not compile I have mentioned. I have modified many of them to be compilable with GNU compilers (gcc, g++ and gfortran). I have made make files which you can read to learn how you can call individual fortran routines in a C or C++ program. I have also put some installations instructions for mac and linux (sorry windows guys!). I want to make sure if you are a C developer you can use any of these libraries without any problems regardless of your platform or hardware -issues: +# Issues: 1. not able to compile ATLAS on mac OS X. a bug report was made on sourceforce: https://sourceforge.net/p/math-atlas/bugs/261/ -2. for some of the BLAS and CBLAS examples the -lgfortran is requred to compile. I don't know why! (on mac OS X you need to install gfortran and then look for libgfortran.dylib and link against it while compiling) +2. for some of the BLAS and CBLAS examples the -lgfortran is required to compile. I don't know why! (on mac OS X you need to install gfortran and then look for libgfortran.dylib and link against it while compiling) +3. Change the name of the repository from Cmathtuts to something more relevant including linear algebra +4. When to use Fortran or FORTRAN? -to do: + +# To do: 1. make compiling/installation for all libraries for different platforms -2. check the Makefile s on other platforms(tested only on mac OS X) + 1. windows + 2. macOS + 3. GNU/linux +2. check the Makefiles on other platforms(tested only on mac OS X) + + +# Ideas: +1. Adding OpenCL implementations of the APIs -sources to be studied: +# sources to be studied: 1. http://physics.oregonstate.edu/~landaur/nacphy/lapack/cprogp.html 2. https://people.sc.fsu.edu/~jburkardt/c_src/clapack/clapack.html From 076360e36658578926b8d35d281a0943ec646d8e Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Thu, 28 Dec 2017 18:07:06 +0100 Subject: [PATCH 02/25] clean up --- A_fortran/README.md | 6 ++++-- A_fortran/test1/README.md | 29 +++++++++++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/A_fortran/README.md b/A_fortran/README.md index f3a8c5b..2563bd9 100644 --- a/A_fortran/README.md +++ b/A_fortran/README.md @@ -6,8 +6,10 @@ FORTRAN/Fortran is obviously a different programing language from C. However, co * call Fortran functions/subroutines from C/C++ * interface the function calls -# Points: +# requirements +you need to have Fortran and C compilers. Preferably GNU gcc and gfortran +# Points: 1. name of the routines/subroutines/functions and structs/commons in some versions or dialects of Fortran must be in small letters and an underscore _ must be added to the C function # Sources to be studied: @@ -34,7 +36,7 @@ FORTRAN/Fortran is obviously a different programing language from C. However, co 1. Change the naming scheme from test-- to example-- and add 0 before the single digit numbers so it sorts correctly -issues: +# Issues: 1. test22 result not correct 2. test19 does not compile 3. test24 not compiling diff --git a/A_fortran/test1/README.md b/A_fortran/test1/README.md index d15ab54..bf5971b 100644 --- a/A_fortran/test1/README.md +++ b/A_fortran/test1/README.md @@ -1,5 +1,3 @@ -fortran code written in FORTRAN 77? - # Abstract: This example shows how we can call a C function from Fortran and how to pass a string properly from Fortran to C @@ -9,37 +7,48 @@ This example shows how we can call a C function from Fortran and how to pass a s # Points: 1. when you pass a string from Fortran to C you actually pass two variables including a pointer to an array of single characters (string) and also the length of the array. -2. when you pass a string to C you need to first be sure that you allocate at least one letter more than the characters you need and in C first of se "\0" or NULL as the end of the string -3. common is the equivalent of struct in C +2. when you pass a string to C you need to first be sure that you allocate at least one letter more than the characters you need. In C first of se "\0" or NULL as the end of the string +3. common in Fortran is the equivalent of struct in C in C: + +```c extern struct { int i; char c; ... } mystruct_; - in fortran +``` + + in Fortran + +```fortran integer i character c ... common/mystruct/ i, c, ... +``` -4. when fortran passes a variable to C function, the C function receives a pointer? -5. when you want to call a C function in fortran you don't need to declare a dummy in the fortran code, unlike C ,fortran doesn't care if the function is not declared and then on run time it will look for the function (how about variables and structs?) -6. when passing variables, functions or srtucts from/to C/fortran it is Case-insensitive. but you should be careful that inside each world it is case sensitive. +4. when Fortran passes a variable to C function, the C function receives a pointer? +5. when you want to call a C function in Fortran you don't need to declare a dummy in the Fortran code, unlike C Fortran doesn't care if the function is not declared and then on run time it will look for the function (how about variables and structs?) +6. when passing variables, functions or srtucts from/to C/Fortran it is Case-insensitive. but you should be careful that inside each world it is case sensitive. -questions: +# Questions: 1. this pages says when you want to call a C function from fortran you need to also declare it as external but here it works properly without declaring! https://docs.oracle.com/cd/E19059-01/stud.9/817-6694/11_cfort.html I think we needed a external doubleijk here, but we don't! +2. Is Fortran code written in FORTRAN 77? -fortran points: +# Fortran points: 1. in FORTRAN 77 (?) one can print to terminal with something like: + +```fortran write(6,) var_1,var_2,... 10 format('some text', typeof_var_N,'some other text',...) +``` From 63aa6d86d463db2630b7d9e23994611f80a042c2 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sat, 1 Dec 2018 00:23:37 +0100 Subject: [PATCH 03/25] the write-format commands explained the former explanations for write and format commands were wrong --- A_fortran/test1/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/A_fortran/test1/README.md b/A_fortran/test1/README.md index bf5971b..3b642fa 100644 --- a/A_fortran/test1/README.md +++ b/A_fortran/test1/README.md @@ -46,9 +46,13 @@ I think we needed a # Fortran points: -1. in FORTRAN 77 (?) one can print to terminal with something like: +1. in FORTRAN 77 and Fortran 90 (?) one can use the `write` command to print to terminal: ```fortran - write(6,) var_1,var_2,... - 10 format('some text', typeof_var_N,'some other text',...) + write (, (, , ...)) var_1, var_2, ... +``` +where `` specifies the output (terminals, files ...). One can put `6` for the standard terminal or `*` for the default output (which should be also the stardard terminal). The `` specfies how each variable should be printed depending to their data type. If `*` then the default formating will be used. More formating options for integers `Iw`, reals `Fw.d` and strings `Aw` can be found. Alternatively one can put a line lable instead and then specifiy the format for mutiple `write`/`print` commands: + +```fortran +10 format (, , ...) ``` From 7401dcd50d0307ad2552a7f9b3418b86c348dba4 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sat, 1 Dec 2018 01:23:52 +0100 Subject: [PATCH 04/25] folders renamed --- A_fortran/{test1 => Ex01}/Makefile | 0 A_fortran/{test1 => Ex01}/README.md | 0 A_fortran/{test1 => Ex01}/test1C.c | 0 A_fortran/{test1 => Ex01}/test1F.f | 0 A_fortran/{test2 => Ex02}/Makefile | 0 A_fortran/{test2 => Ex02}/readme.txt | 0 A_fortran/{test2 => Ex02}/test2C.c | 0 A_fortran/{test2 => Ex02}/test2F.f | 0 A_fortran/{test3 => Ex03}/CSUBS.C | 0 A_fortran/{test3 => Ex03}/FORMAIN.FOR | 0 A_fortran/{test3 => Ex03}/Makefile | 0 A_fortran/{test3 => Ex03}/readme.txt | 0 A_fortran/{test4 => Ex04}/Makefile | 0 A_fortran/{test4 => Ex04}/README | 0 A_fortran/{test4 => Ex04}/cpp_main_0.cpp | 0 A_fortran/{test4 => Ex04}/cpp_main_1.cpp | 0 A_fortran/{test4 => Ex04}/fortran_matrix_multiply.f90 | 0 A_fortran/{test5 => Ex05}/CMAIN.c | 0 A_fortran/{test5 => Ex05}/FORSUBS.FOR | 0 A_fortran/{test5 => Ex05}/Makefile | 0 A_fortran/{test5 => Ex05}/readme.txt | 0 A_fortran/{test6 => Ex06}/Makefile | 0 A_fortran/{test6 => Ex06}/readme.txt | 0 A_fortran/{test6 => Ex06}/test6C.c | 0 A_fortran/{test6 => Ex06}/test6F.f | 0 A_fortran/{test7 => Ex07}/Makefile | 0 A_fortran/{test7 => Ex07}/cfunction1.c | 0 A_fortran/{test7 => Ex07}/cppfunction.cpp | 0 A_fortran/{test7 => Ex07}/cprogram.c | 0 A_fortran/{test7 => Ex07}/ffunction.f | 0 A_fortran/{test7 => Ex07}/readme.txt | 0 A_fortran/{test8 => Ex08}/Makefile | 0 A_fortran/{test8 => Ex08}/cfunction1.c | 0 A_fortran/{test8 => Ex08}/cppfunction.cpp | 0 A_fortran/{test8 => Ex08}/cppprogram.cpp | 0 A_fortran/{test8 => Ex08}/ffunction.f | 0 A_fortran/{test9 => Ex09}/Makefile | 0 A_fortran/{test9 => Ex09}/cfunction1.c | 0 A_fortran/{test9 => Ex09}/cppfunction.cpp | 0 A_fortran/{test9 => Ex09}/ffunction.f | 0 A_fortran/{test9 => Ex09}/fprogram.f | 0 A_fortran/{test10 => Ex10}/Makefile | 0 A_fortran/{test10 => Ex10}/main.c | 0 A_fortran/{test10 => Ex10}/ranvec.f90 | 0 A_fortran/{test10 => Ex10}/readme.txt | 0 A_fortran/{test11 => Ex11}/Makefile | 0 A_fortran/{test11 => Ex11}/add.f | 0 A_fortran/{test11 => Ex11}/redme.txt | 0 A_fortran/{test11 => Ex11}/test11.c | 0 A_fortran/{test12 => Ex12}/Makefile | 0 A_fortran/{test12 => Ex12}/driver.f | 0 A_fortran/{test12 => Ex12}/readme.txt | 0 A_fortran/{test12 => Ex12}/testdot.cpp | 0 A_fortran/{test12 => Ex12}/testmat.cpp | 0 A_fortran/{test12 => Ex12}/testret.cpp | 0 A_fortran/{test13 => Ex13}/Makefile | 0 A_fortran/{test13 => Ex13}/readme.txt | 0 A_fortran/{test13 => Ex13}/test13C.c | 0 A_fortran/{test13 => Ex13}/test13F.f | 0 A_fortran/{test14 => Ex14}/Makefile | 0 A_fortran/{test14 => Ex14}/readme.txt | 0 A_fortran/{test14 => Ex14}/test13C.c | 0 A_fortran/{test14 => Ex14}/test13F.f | 0 A_fortran/{test15 => Ex15}/Makefile | 0 A_fortran/{test15 => Ex15}/readme.txt | 0 A_fortran/{test15 => Ex15}/test13C.c | 0 A_fortran/{test15 => Ex15}/test13F.f | 0 A_fortran/{test16 => Ex16}/Makefile | 0 A_fortran/{test16 => Ex16}/readme.txt | 0 A_fortran/{test16 => Ex16}/test13C.c | 0 A_fortran/{test16 => Ex16}/test13F.f | 0 A_fortran/{test17 => Ex17}/Makefile | 0 A_fortran/{test17 => Ex17}/readme.txt | 0 A_fortran/{test17 => Ex17}/test13C.c | 0 A_fortran/{test17 => Ex17}/test13F.f | 0 A_fortran/{test18 => Ex18}/Makefile | 0 A_fortran/{test18 => Ex18}/readme.txt | 0 A_fortran/{test18 => Ex18}/test13C.c | 0 A_fortran/{test18 => Ex18}/test13F.f90 | 0 A_fortran/{test19 => Ex19}/Makefile | 0 A_fortran/{test19 => Ex19}/readme.txt | 0 A_fortran/{test19 => Ex19}/test13C.c | 0 A_fortran/{test19 => Ex19}/test13F.f90 | 0 A_fortran/{test20 => Ex20}/Makefile | 0 A_fortran/{test20 => Ex20}/readme.txt | 0 A_fortran/{test20 => Ex20}/test13C.c | 0 A_fortran/{test20 => Ex20}/test13F.f90 | 0 A_fortran/{test21 => Ex21}/Makefile | 0 A_fortran/{test21 => Ex21}/readme.txt | 0 A_fortran/{test21 => Ex21}/test13C.c | 0 A_fortran/{test21 => Ex21}/test13F.f90 | 0 A_fortran/{test22 => Ex22}/Ctest.c | 0 A_fortran/{test22 => Ex22}/Ftest.FOR | 0 A_fortran/{test22 => Ex22}/Makefile | 0 A_fortran/{test22 => Ex22}/readme.txt | 0 A_fortran/{test23 => Ex23}/Makefile | 0 A_fortran/{test23 => Ex23}/readme.txt | 0 A_fortran/{test23 => Ex23}/tst01.cc | 0 A_fortran/{test23 => Ex23}/tstfunc1.f | 0 A_fortran/{test24 => Ex24}/FNUM.FOR | 0 A_fortran/{test24 => Ex24}/NUMBERS.C | 0 A_fortran/{test24 => Ex24}/readme.txt | 0 A_fortran/{test32 => Ex32}/Makefile | 0 A_fortran/{test32 => Ex32}/cpps.cpp | 0 A_fortran/{test32 => Ex32}/main.f | 0 A_fortran/{test32 => Ex32}/readme.txt | 0 A_fortran/{test33 => Ex33}/Makefile | 0 A_fortran/{test33 => Ex33}/cpps.cpp | 0 A_fortran/{test33 => Ex33}/main.f | 0 A_fortran/{test33 => Ex33}/readme.txt | 0 A_fortran/{test34 => Ex34}/ftnfctn.f | 0 A_fortran/{test34 => Ex34}/main.c | 0 A_fortran/{test34 => Ex34}/readme.txt | 0 A_fortran/{test35 => Ex35}/f77char.h | 0 A_fortran/{test35 => Ex35}/f77cmplx.h | 0 A_fortran/{test35 => Ex35}/f77matrx.h | 0 A_fortran/{test35 => Ex35}/fortran.h | 0 A_fortran/{test35 => Ex35}/readme.txt | 0 A_fortran/{test36 => Ex36}/c_calls_f77/c_calls_f77.html | 0 A_fortran/{test36 => Ex36}/c_calls_f77/kronrod.f | 0 A_fortran/{test36 => Ex36}/c_calls_f77/kronrod_prb.c | 0 A_fortran/{test36 => Ex36}/c_calls_f77/kronrod_prb.sh | 0 A_fortran/{test36 => Ex36}/c_calls_f77/kronrod_prb_output.txt | 0 A_fortran/{test36 => Ex36}/c_calls_f77/robots.txt | 0 A_fortran/{test36 => Ex36}/c_calls_f90/c_calls_f90.html | 0 A_fortran/{test36 => Ex36}/c_calls_f90/kronrod.f90 | 0 A_fortran/{test36 => Ex36}/c_calls_f90/kronrod_prb.c | 0 A_fortran/{test36 => Ex36}/c_calls_f90/kronrod_prb.sh | 0 A_fortran/{test36 => Ex36}/c_calls_f90/kronrod_prb_output.txt | 0 A_fortran/{test36 => Ex36}/c_calls_f90/robots.txt | 0 A_fortran/{test36 => Ex36}/f77_calls_c/f77_calls_c.html | 0 A_fortran/{test36 => Ex36}/f77_calls_c/kronrod.c | 0 A_fortran/{test36 => Ex36}/f77_calls_c/kronrod.h | 0 A_fortran/{test36 => Ex36}/f77_calls_c/kronrod.sh | 0 A_fortran/{test36 => Ex36}/f77_calls_c/kronrod_output.txt | 0 A_fortran/{test36 => Ex36}/f77_calls_c/kronrod_prb.f | 0 A_fortran/{test36 => Ex36}/f77_calls_c/robots.txt | 0 A_fortran/{test36 => Ex36}/f90_calls_c/f90_calls_c.html | 0 A_fortran/{test36 => Ex36}/f90_calls_c/hello.c | 0 A_fortran/{test36 => Ex36}/f90_calls_c/hello.sh | 0 A_fortran/{test36 => Ex36}/f90_calls_c/hello_output.txt | 0 A_fortran/{test36 => Ex36}/f90_calls_c/hello_prb.f90 | 0 A_fortran/{test36 => Ex36}/f90_calls_c/kronrod.c | 0 A_fortran/{test36 => Ex36}/f90_calls_c/kronrod.h | 0 A_fortran/{test36 => Ex36}/f90_calls_c/kronrod.sh | 0 A_fortran/{test36 => Ex36}/f90_calls_c/kronrod_output.txt | 0 A_fortran/{test36 => Ex36}/f90_calls_c/kronrod_prb.f90 | 0 A_fortran/{test36 => Ex36}/f90_calls_c/robots.txt | 0 A_fortran/{test36 => Ex36}/mixed77/ex1_f77_cc.sh | 0 A_fortran/{test36 => Ex36}/mixed77/ex1_f77_cc_output.txt | 0 A_fortran/{test36 => Ex36}/mixed77/ex1_g77_gcc.sh | 0 A_fortran/{test36 => Ex36}/mixed77/ex1_g77_gcc_output.txt | 0 A_fortran/{test36 => Ex36}/mixed77/ex1_main.f | 0 A_fortran/{test36 => Ex36}/mixed77/ex1_sub.c | 0 A_fortran/{test36 => Ex36}/mixed77/mixed.html | 0 A_fortran/{test36 => Ex36}/mixed77/robots.txt | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_fort_cc.sh | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_fort_cc_output.txt | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_fort_gcc.sh | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_fort_gcc_output.txt | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_gfortran_gcc.sh | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_gfortran_gcc_output.txt | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_main.f90 | 0 A_fortran/{test36 => Ex36}/mixed90/ex1_sub.c | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_fort_cxx.sh | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_fort_cxx_output.txt | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_fort_g++.sh | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_fort_g++_output.txt | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_gfortran_g++.sh | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_gfortran_g++_output.txt | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_main.f90 | 0 A_fortran/{test36 => Ex36}/mixed90/ex2_sub.cpp | 0 A_fortran/{test36 => Ex36}/mixed90/robots.txt | 0 A_fortran/{test36 => Ex36}/mixedC/ex1_cc_fort.sh | 0 A_fortran/{test36 => Ex36}/mixedC/ex1_cc_fort_output.txt | 0 A_fortran/{test36 => Ex36}/mixedC/ex1_gcc_fort.sh | 0 A_fortran/{test36 => Ex36}/mixedC/ex1_gcc_fort_output.txt | 0 A_fortran/{test36 => Ex36}/mixedC/ex1_main.c | 0 A_fortran/{test36 => Ex36}/mixedC/ex1_sub.f90 | 0 A_fortran/{test36 => Ex36}/mixedC/ex2_cc_fort.sh | 0 A_fortran/{test36 => Ex36}/mixedC/ex2_cc_fort_output.txt | 0 A_fortran/{test36 => Ex36}/mixedC/ex2_gcc_fort.sh | 0 A_fortran/{test36 => Ex36}/mixedC/ex2_gcc_fort_output.txt | 0 A_fortran/{test36 => Ex36}/mixedC/ex2_main.c | 0 A_fortran/{test36 => Ex36}/mixedC/ex2_sub.f90 | 0 A_fortran/{test36 => Ex36}/mixedC/mixed.html | 0 A_fortran/{test36 => Ex36}/mixedC/robots.txt | 0 A_fortran/{test36 => Ex36}/readme.txt | 0 188 files changed, 0 insertions(+), 0 deletions(-) rename A_fortran/{test1 => Ex01}/Makefile (100%) rename A_fortran/{test1 => Ex01}/README.md (100%) rename A_fortran/{test1 => Ex01}/test1C.c (100%) rename A_fortran/{test1 => Ex01}/test1F.f (100%) rename A_fortran/{test2 => Ex02}/Makefile (100%) rename A_fortran/{test2 => Ex02}/readme.txt (100%) rename A_fortran/{test2 => Ex02}/test2C.c (100%) rename A_fortran/{test2 => Ex02}/test2F.f (100%) rename A_fortran/{test3 => Ex03}/CSUBS.C (100%) rename A_fortran/{test3 => Ex03}/FORMAIN.FOR (100%) rename A_fortran/{test3 => Ex03}/Makefile (100%) rename A_fortran/{test3 => Ex03}/readme.txt (100%) rename A_fortran/{test4 => Ex04}/Makefile (100%) rename A_fortran/{test4 => Ex04}/README (100%) rename A_fortran/{test4 => Ex04}/cpp_main_0.cpp (100%) rename A_fortran/{test4 => Ex04}/cpp_main_1.cpp (100%) rename A_fortran/{test4 => Ex04}/fortran_matrix_multiply.f90 (100%) rename A_fortran/{test5 => Ex05}/CMAIN.c (100%) rename A_fortran/{test5 => Ex05}/FORSUBS.FOR (100%) rename A_fortran/{test5 => Ex05}/Makefile (100%) rename A_fortran/{test5 => Ex05}/readme.txt (100%) rename A_fortran/{test6 => Ex06}/Makefile (100%) rename A_fortran/{test6 => Ex06}/readme.txt (100%) rename A_fortran/{test6 => Ex06}/test6C.c (100%) rename A_fortran/{test6 => Ex06}/test6F.f (100%) rename A_fortran/{test7 => Ex07}/Makefile (100%) rename A_fortran/{test7 => Ex07}/cfunction1.c (100%) rename A_fortran/{test7 => Ex07}/cppfunction.cpp (100%) rename A_fortran/{test7 => Ex07}/cprogram.c (100%) rename A_fortran/{test7 => Ex07}/ffunction.f (100%) rename A_fortran/{test7 => Ex07}/readme.txt (100%) rename A_fortran/{test8 => Ex08}/Makefile (100%) rename A_fortran/{test8 => Ex08}/cfunction1.c (100%) rename A_fortran/{test8 => Ex08}/cppfunction.cpp (100%) rename A_fortran/{test8 => Ex08}/cppprogram.cpp (100%) rename A_fortran/{test8 => Ex08}/ffunction.f (100%) rename A_fortran/{test9 => Ex09}/Makefile (100%) rename A_fortran/{test9 => Ex09}/cfunction1.c (100%) rename A_fortran/{test9 => Ex09}/cppfunction.cpp (100%) rename A_fortran/{test9 => Ex09}/ffunction.f (100%) rename A_fortran/{test9 => Ex09}/fprogram.f (100%) rename A_fortran/{test10 => Ex10}/Makefile (100%) rename A_fortran/{test10 => Ex10}/main.c (100%) rename A_fortran/{test10 => Ex10}/ranvec.f90 (100%) rename A_fortran/{test10 => Ex10}/readme.txt (100%) rename A_fortran/{test11 => Ex11}/Makefile (100%) rename A_fortran/{test11 => Ex11}/add.f (100%) rename A_fortran/{test11 => Ex11}/redme.txt (100%) rename A_fortran/{test11 => Ex11}/test11.c (100%) rename A_fortran/{test12 => Ex12}/Makefile (100%) rename A_fortran/{test12 => Ex12}/driver.f (100%) rename A_fortran/{test12 => Ex12}/readme.txt (100%) rename A_fortran/{test12 => Ex12}/testdot.cpp (100%) rename A_fortran/{test12 => Ex12}/testmat.cpp (100%) rename A_fortran/{test12 => Ex12}/testret.cpp (100%) rename A_fortran/{test13 => Ex13}/Makefile (100%) rename A_fortran/{test13 => Ex13}/readme.txt (100%) rename A_fortran/{test13 => Ex13}/test13C.c (100%) rename A_fortran/{test13 => Ex13}/test13F.f (100%) rename A_fortran/{test14 => Ex14}/Makefile (100%) rename A_fortran/{test14 => Ex14}/readme.txt (100%) rename A_fortran/{test14 => Ex14}/test13C.c (100%) rename A_fortran/{test14 => Ex14}/test13F.f (100%) rename A_fortran/{test15 => Ex15}/Makefile (100%) rename A_fortran/{test15 => Ex15}/readme.txt (100%) rename A_fortran/{test15 => Ex15}/test13C.c (100%) rename A_fortran/{test15 => Ex15}/test13F.f (100%) rename A_fortran/{test16 => Ex16}/Makefile (100%) rename A_fortran/{test16 => Ex16}/readme.txt (100%) rename A_fortran/{test16 => Ex16}/test13C.c (100%) rename A_fortran/{test16 => Ex16}/test13F.f (100%) rename A_fortran/{test17 => Ex17}/Makefile (100%) rename A_fortran/{test17 => Ex17}/readme.txt (100%) rename A_fortran/{test17 => Ex17}/test13C.c (100%) rename A_fortran/{test17 => Ex17}/test13F.f (100%) rename A_fortran/{test18 => Ex18}/Makefile (100%) rename A_fortran/{test18 => Ex18}/readme.txt (100%) rename A_fortran/{test18 => Ex18}/test13C.c (100%) rename A_fortran/{test18 => Ex18}/test13F.f90 (100%) rename A_fortran/{test19 => Ex19}/Makefile (100%) rename A_fortran/{test19 => Ex19}/readme.txt (100%) rename A_fortran/{test19 => Ex19}/test13C.c (100%) rename A_fortran/{test19 => Ex19}/test13F.f90 (100%) rename A_fortran/{test20 => Ex20}/Makefile (100%) rename A_fortran/{test20 => Ex20}/readme.txt (100%) rename A_fortran/{test20 => Ex20}/test13C.c (100%) rename A_fortran/{test20 => Ex20}/test13F.f90 (100%) rename A_fortran/{test21 => Ex21}/Makefile (100%) rename A_fortran/{test21 => Ex21}/readme.txt (100%) rename A_fortran/{test21 => Ex21}/test13C.c (100%) rename A_fortran/{test21 => Ex21}/test13F.f90 (100%) rename A_fortran/{test22 => Ex22}/Ctest.c (100%) rename A_fortran/{test22 => Ex22}/Ftest.FOR (100%) rename A_fortran/{test22 => Ex22}/Makefile (100%) rename A_fortran/{test22 => Ex22}/readme.txt (100%) rename A_fortran/{test23 => Ex23}/Makefile (100%) rename A_fortran/{test23 => Ex23}/readme.txt (100%) rename A_fortran/{test23 => Ex23}/tst01.cc (100%) rename A_fortran/{test23 => Ex23}/tstfunc1.f (100%) rename A_fortran/{test24 => Ex24}/FNUM.FOR (100%) rename A_fortran/{test24 => Ex24}/NUMBERS.C (100%) rename A_fortran/{test24 => Ex24}/readme.txt (100%) rename A_fortran/{test32 => Ex32}/Makefile (100%) rename A_fortran/{test32 => Ex32}/cpps.cpp (100%) rename A_fortran/{test32 => Ex32}/main.f (100%) rename A_fortran/{test32 => Ex32}/readme.txt (100%) rename A_fortran/{test33 => Ex33}/Makefile (100%) rename A_fortran/{test33 => Ex33}/cpps.cpp (100%) rename A_fortran/{test33 => Ex33}/main.f (100%) rename A_fortran/{test33 => Ex33}/readme.txt (100%) rename A_fortran/{test34 => Ex34}/ftnfctn.f (100%) rename A_fortran/{test34 => Ex34}/main.c (100%) rename A_fortran/{test34 => Ex34}/readme.txt (100%) rename A_fortran/{test35 => Ex35}/f77char.h (100%) rename A_fortran/{test35 => Ex35}/f77cmplx.h (100%) rename A_fortran/{test35 => Ex35}/f77matrx.h (100%) rename A_fortran/{test35 => Ex35}/fortran.h (100%) rename A_fortran/{test35 => Ex35}/readme.txt (100%) rename A_fortran/{test36 => Ex36}/c_calls_f77/c_calls_f77.html (100%) rename A_fortran/{test36 => Ex36}/c_calls_f77/kronrod.f (100%) rename A_fortran/{test36 => Ex36}/c_calls_f77/kronrod_prb.c (100%) rename A_fortran/{test36 => Ex36}/c_calls_f77/kronrod_prb.sh (100%) rename A_fortran/{test36 => Ex36}/c_calls_f77/kronrod_prb_output.txt (100%) rename A_fortran/{test36 => Ex36}/c_calls_f77/robots.txt (100%) rename A_fortran/{test36 => Ex36}/c_calls_f90/c_calls_f90.html (100%) rename A_fortran/{test36 => Ex36}/c_calls_f90/kronrod.f90 (100%) rename A_fortran/{test36 => Ex36}/c_calls_f90/kronrod_prb.c (100%) rename A_fortran/{test36 => Ex36}/c_calls_f90/kronrod_prb.sh (100%) rename A_fortran/{test36 => Ex36}/c_calls_f90/kronrod_prb_output.txt (100%) rename A_fortran/{test36 => Ex36}/c_calls_f90/robots.txt (100%) rename A_fortran/{test36 => Ex36}/f77_calls_c/f77_calls_c.html (100%) rename A_fortran/{test36 => Ex36}/f77_calls_c/kronrod.c (100%) rename A_fortran/{test36 => Ex36}/f77_calls_c/kronrod.h (100%) rename A_fortran/{test36 => Ex36}/f77_calls_c/kronrod.sh (100%) rename A_fortran/{test36 => Ex36}/f77_calls_c/kronrod_output.txt (100%) rename A_fortran/{test36 => Ex36}/f77_calls_c/kronrod_prb.f (100%) rename A_fortran/{test36 => Ex36}/f77_calls_c/robots.txt (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/f90_calls_c.html (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/hello.c (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/hello.sh (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/hello_output.txt (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/hello_prb.f90 (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/kronrod.c (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/kronrod.h (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/kronrod.sh (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/kronrod_output.txt (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/kronrod_prb.f90 (100%) rename A_fortran/{test36 => Ex36}/f90_calls_c/robots.txt (100%) rename A_fortran/{test36 => Ex36}/mixed77/ex1_f77_cc.sh (100%) rename A_fortran/{test36 => Ex36}/mixed77/ex1_f77_cc_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed77/ex1_g77_gcc.sh (100%) rename A_fortran/{test36 => Ex36}/mixed77/ex1_g77_gcc_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed77/ex1_main.f (100%) rename A_fortran/{test36 => Ex36}/mixed77/ex1_sub.c (100%) rename A_fortran/{test36 => Ex36}/mixed77/mixed.html (100%) rename A_fortran/{test36 => Ex36}/mixed77/robots.txt (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_fort_cc.sh (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_fort_cc_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_fort_gcc.sh (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_fort_gcc_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_gfortran_gcc.sh (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_gfortran_gcc_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_main.f90 (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex1_sub.c (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_fort_cxx.sh (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_fort_cxx_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_fort_g++.sh (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_fort_g++_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_gfortran_g++.sh (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_gfortran_g++_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_main.f90 (100%) rename A_fortran/{test36 => Ex36}/mixed90/ex2_sub.cpp (100%) rename A_fortran/{test36 => Ex36}/mixed90/robots.txt (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex1_cc_fort.sh (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex1_cc_fort_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex1_gcc_fort.sh (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex1_gcc_fort_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex1_main.c (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex1_sub.f90 (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex2_cc_fort.sh (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex2_cc_fort_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex2_gcc_fort.sh (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex2_gcc_fort_output.txt (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex2_main.c (100%) rename A_fortran/{test36 => Ex36}/mixedC/ex2_sub.f90 (100%) rename A_fortran/{test36 => Ex36}/mixedC/mixed.html (100%) rename A_fortran/{test36 => Ex36}/mixedC/robots.txt (100%) rename A_fortran/{test36 => Ex36}/readme.txt (100%) diff --git a/A_fortran/test1/Makefile b/A_fortran/Ex01/Makefile similarity index 100% rename from A_fortran/test1/Makefile rename to A_fortran/Ex01/Makefile diff --git a/A_fortran/test1/README.md b/A_fortran/Ex01/README.md similarity index 100% rename from A_fortran/test1/README.md rename to A_fortran/Ex01/README.md diff --git a/A_fortran/test1/test1C.c b/A_fortran/Ex01/test1C.c similarity index 100% rename from A_fortran/test1/test1C.c rename to A_fortran/Ex01/test1C.c diff --git a/A_fortran/test1/test1F.f b/A_fortran/Ex01/test1F.f similarity index 100% rename from A_fortran/test1/test1F.f rename to A_fortran/Ex01/test1F.f diff --git a/A_fortran/test2/Makefile b/A_fortran/Ex02/Makefile similarity index 100% rename from A_fortran/test2/Makefile rename to A_fortran/Ex02/Makefile diff --git a/A_fortran/test2/readme.txt b/A_fortran/Ex02/readme.txt similarity index 100% rename from A_fortran/test2/readme.txt rename to A_fortran/Ex02/readme.txt diff --git a/A_fortran/test2/test2C.c b/A_fortran/Ex02/test2C.c similarity index 100% rename from A_fortran/test2/test2C.c rename to A_fortran/Ex02/test2C.c diff --git a/A_fortran/test2/test2F.f b/A_fortran/Ex02/test2F.f similarity index 100% rename from A_fortran/test2/test2F.f rename to A_fortran/Ex02/test2F.f diff --git a/A_fortran/test3/CSUBS.C b/A_fortran/Ex03/CSUBS.C similarity index 100% rename from A_fortran/test3/CSUBS.C rename to A_fortran/Ex03/CSUBS.C diff --git a/A_fortran/test3/FORMAIN.FOR b/A_fortran/Ex03/FORMAIN.FOR similarity index 100% rename from A_fortran/test3/FORMAIN.FOR rename to A_fortran/Ex03/FORMAIN.FOR diff --git a/A_fortran/test3/Makefile b/A_fortran/Ex03/Makefile similarity index 100% rename from A_fortran/test3/Makefile rename to A_fortran/Ex03/Makefile diff --git a/A_fortran/test3/readme.txt b/A_fortran/Ex03/readme.txt similarity index 100% rename from A_fortran/test3/readme.txt rename to A_fortran/Ex03/readme.txt diff --git a/A_fortran/test4/Makefile b/A_fortran/Ex04/Makefile similarity index 100% rename from A_fortran/test4/Makefile rename to A_fortran/Ex04/Makefile diff --git a/A_fortran/test4/README b/A_fortran/Ex04/README similarity index 100% rename from A_fortran/test4/README rename to A_fortran/Ex04/README diff --git a/A_fortran/test4/cpp_main_0.cpp b/A_fortran/Ex04/cpp_main_0.cpp similarity index 100% rename from A_fortran/test4/cpp_main_0.cpp rename to A_fortran/Ex04/cpp_main_0.cpp diff --git a/A_fortran/test4/cpp_main_1.cpp b/A_fortran/Ex04/cpp_main_1.cpp similarity index 100% rename from A_fortran/test4/cpp_main_1.cpp rename to A_fortran/Ex04/cpp_main_1.cpp diff --git a/A_fortran/test4/fortran_matrix_multiply.f90 b/A_fortran/Ex04/fortran_matrix_multiply.f90 similarity index 100% rename from A_fortran/test4/fortran_matrix_multiply.f90 rename to A_fortran/Ex04/fortran_matrix_multiply.f90 diff --git a/A_fortran/test5/CMAIN.c b/A_fortran/Ex05/CMAIN.c similarity index 100% rename from A_fortran/test5/CMAIN.c rename to A_fortran/Ex05/CMAIN.c diff --git a/A_fortran/test5/FORSUBS.FOR b/A_fortran/Ex05/FORSUBS.FOR similarity index 100% rename from A_fortran/test5/FORSUBS.FOR rename to A_fortran/Ex05/FORSUBS.FOR diff --git a/A_fortran/test5/Makefile b/A_fortran/Ex05/Makefile similarity index 100% rename from A_fortran/test5/Makefile rename to A_fortran/Ex05/Makefile diff --git a/A_fortran/test5/readme.txt b/A_fortran/Ex05/readme.txt similarity index 100% rename from A_fortran/test5/readme.txt rename to A_fortran/Ex05/readme.txt diff --git a/A_fortran/test6/Makefile b/A_fortran/Ex06/Makefile similarity index 100% rename from A_fortran/test6/Makefile rename to A_fortran/Ex06/Makefile diff --git a/A_fortran/test6/readme.txt b/A_fortran/Ex06/readme.txt similarity index 100% rename from A_fortran/test6/readme.txt rename to A_fortran/Ex06/readme.txt diff --git a/A_fortran/test6/test6C.c b/A_fortran/Ex06/test6C.c similarity index 100% rename from A_fortran/test6/test6C.c rename to A_fortran/Ex06/test6C.c diff --git a/A_fortran/test6/test6F.f b/A_fortran/Ex06/test6F.f similarity index 100% rename from A_fortran/test6/test6F.f rename to A_fortran/Ex06/test6F.f diff --git a/A_fortran/test7/Makefile b/A_fortran/Ex07/Makefile similarity index 100% rename from A_fortran/test7/Makefile rename to A_fortran/Ex07/Makefile diff --git a/A_fortran/test7/cfunction1.c b/A_fortran/Ex07/cfunction1.c similarity index 100% rename from A_fortran/test7/cfunction1.c rename to A_fortran/Ex07/cfunction1.c diff --git a/A_fortran/test7/cppfunction.cpp b/A_fortran/Ex07/cppfunction.cpp similarity index 100% rename from A_fortran/test7/cppfunction.cpp rename to A_fortran/Ex07/cppfunction.cpp diff --git a/A_fortran/test7/cprogram.c b/A_fortran/Ex07/cprogram.c similarity index 100% rename from A_fortran/test7/cprogram.c rename to A_fortran/Ex07/cprogram.c diff --git a/A_fortran/test7/ffunction.f b/A_fortran/Ex07/ffunction.f similarity index 100% rename from A_fortran/test7/ffunction.f rename to A_fortran/Ex07/ffunction.f diff --git a/A_fortran/test7/readme.txt b/A_fortran/Ex07/readme.txt similarity index 100% rename from A_fortran/test7/readme.txt rename to A_fortran/Ex07/readme.txt diff --git a/A_fortran/test8/Makefile b/A_fortran/Ex08/Makefile similarity index 100% rename from A_fortran/test8/Makefile rename to A_fortran/Ex08/Makefile diff --git a/A_fortran/test8/cfunction1.c b/A_fortran/Ex08/cfunction1.c similarity index 100% rename from A_fortran/test8/cfunction1.c rename to A_fortran/Ex08/cfunction1.c diff --git a/A_fortran/test8/cppfunction.cpp b/A_fortran/Ex08/cppfunction.cpp similarity index 100% rename from A_fortran/test8/cppfunction.cpp rename to A_fortran/Ex08/cppfunction.cpp diff --git a/A_fortran/test8/cppprogram.cpp b/A_fortran/Ex08/cppprogram.cpp similarity index 100% rename from A_fortran/test8/cppprogram.cpp rename to A_fortran/Ex08/cppprogram.cpp diff --git a/A_fortran/test8/ffunction.f b/A_fortran/Ex08/ffunction.f similarity index 100% rename from A_fortran/test8/ffunction.f rename to A_fortran/Ex08/ffunction.f diff --git a/A_fortran/test9/Makefile b/A_fortran/Ex09/Makefile similarity index 100% rename from A_fortran/test9/Makefile rename to A_fortran/Ex09/Makefile diff --git a/A_fortran/test9/cfunction1.c b/A_fortran/Ex09/cfunction1.c similarity index 100% rename from A_fortran/test9/cfunction1.c rename to A_fortran/Ex09/cfunction1.c diff --git a/A_fortran/test9/cppfunction.cpp b/A_fortran/Ex09/cppfunction.cpp similarity index 100% rename from A_fortran/test9/cppfunction.cpp rename to A_fortran/Ex09/cppfunction.cpp diff --git a/A_fortran/test9/ffunction.f b/A_fortran/Ex09/ffunction.f similarity index 100% rename from A_fortran/test9/ffunction.f rename to A_fortran/Ex09/ffunction.f diff --git a/A_fortran/test9/fprogram.f b/A_fortran/Ex09/fprogram.f similarity index 100% rename from A_fortran/test9/fprogram.f rename to A_fortran/Ex09/fprogram.f diff --git a/A_fortran/test10/Makefile b/A_fortran/Ex10/Makefile similarity index 100% rename from A_fortran/test10/Makefile rename to A_fortran/Ex10/Makefile diff --git a/A_fortran/test10/main.c b/A_fortran/Ex10/main.c similarity index 100% rename from A_fortran/test10/main.c rename to A_fortran/Ex10/main.c diff --git a/A_fortran/test10/ranvec.f90 b/A_fortran/Ex10/ranvec.f90 similarity index 100% rename from A_fortran/test10/ranvec.f90 rename to A_fortran/Ex10/ranvec.f90 diff --git a/A_fortran/test10/readme.txt b/A_fortran/Ex10/readme.txt similarity index 100% rename from A_fortran/test10/readme.txt rename to A_fortran/Ex10/readme.txt diff --git a/A_fortran/test11/Makefile b/A_fortran/Ex11/Makefile similarity index 100% rename from A_fortran/test11/Makefile rename to A_fortran/Ex11/Makefile diff --git a/A_fortran/test11/add.f b/A_fortran/Ex11/add.f similarity index 100% rename from A_fortran/test11/add.f rename to A_fortran/Ex11/add.f diff --git a/A_fortran/test11/redme.txt b/A_fortran/Ex11/redme.txt similarity index 100% rename from A_fortran/test11/redme.txt rename to A_fortran/Ex11/redme.txt diff --git a/A_fortran/test11/test11.c b/A_fortran/Ex11/test11.c similarity index 100% rename from A_fortran/test11/test11.c rename to A_fortran/Ex11/test11.c diff --git a/A_fortran/test12/Makefile b/A_fortran/Ex12/Makefile similarity index 100% rename from A_fortran/test12/Makefile rename to A_fortran/Ex12/Makefile diff --git a/A_fortran/test12/driver.f b/A_fortran/Ex12/driver.f similarity index 100% rename from A_fortran/test12/driver.f rename to A_fortran/Ex12/driver.f diff --git a/A_fortran/test12/readme.txt b/A_fortran/Ex12/readme.txt similarity index 100% rename from A_fortran/test12/readme.txt rename to A_fortran/Ex12/readme.txt diff --git a/A_fortran/test12/testdot.cpp b/A_fortran/Ex12/testdot.cpp similarity index 100% rename from A_fortran/test12/testdot.cpp rename to A_fortran/Ex12/testdot.cpp diff --git a/A_fortran/test12/testmat.cpp b/A_fortran/Ex12/testmat.cpp similarity index 100% rename from A_fortran/test12/testmat.cpp rename to A_fortran/Ex12/testmat.cpp diff --git a/A_fortran/test12/testret.cpp b/A_fortran/Ex12/testret.cpp similarity index 100% rename from A_fortran/test12/testret.cpp rename to A_fortran/Ex12/testret.cpp diff --git a/A_fortran/test13/Makefile b/A_fortran/Ex13/Makefile similarity index 100% rename from A_fortran/test13/Makefile rename to A_fortran/Ex13/Makefile diff --git a/A_fortran/test13/readme.txt b/A_fortran/Ex13/readme.txt similarity index 100% rename from A_fortran/test13/readme.txt rename to A_fortran/Ex13/readme.txt diff --git a/A_fortran/test13/test13C.c b/A_fortran/Ex13/test13C.c similarity index 100% rename from A_fortran/test13/test13C.c rename to A_fortran/Ex13/test13C.c diff --git a/A_fortran/test13/test13F.f b/A_fortran/Ex13/test13F.f similarity index 100% rename from A_fortran/test13/test13F.f rename to A_fortran/Ex13/test13F.f diff --git a/A_fortran/test14/Makefile b/A_fortran/Ex14/Makefile similarity index 100% rename from A_fortran/test14/Makefile rename to A_fortran/Ex14/Makefile diff --git a/A_fortran/test14/readme.txt b/A_fortran/Ex14/readme.txt similarity index 100% rename from A_fortran/test14/readme.txt rename to A_fortran/Ex14/readme.txt diff --git a/A_fortran/test14/test13C.c b/A_fortran/Ex14/test13C.c similarity index 100% rename from A_fortran/test14/test13C.c rename to A_fortran/Ex14/test13C.c diff --git a/A_fortran/test14/test13F.f b/A_fortran/Ex14/test13F.f similarity index 100% rename from A_fortran/test14/test13F.f rename to A_fortran/Ex14/test13F.f diff --git a/A_fortran/test15/Makefile b/A_fortran/Ex15/Makefile similarity index 100% rename from A_fortran/test15/Makefile rename to A_fortran/Ex15/Makefile diff --git a/A_fortran/test15/readme.txt b/A_fortran/Ex15/readme.txt similarity index 100% rename from A_fortran/test15/readme.txt rename to A_fortran/Ex15/readme.txt diff --git a/A_fortran/test15/test13C.c b/A_fortran/Ex15/test13C.c similarity index 100% rename from A_fortran/test15/test13C.c rename to A_fortran/Ex15/test13C.c diff --git a/A_fortran/test15/test13F.f b/A_fortran/Ex15/test13F.f similarity index 100% rename from A_fortran/test15/test13F.f rename to A_fortran/Ex15/test13F.f diff --git a/A_fortran/test16/Makefile b/A_fortran/Ex16/Makefile similarity index 100% rename from A_fortran/test16/Makefile rename to A_fortran/Ex16/Makefile diff --git a/A_fortran/test16/readme.txt b/A_fortran/Ex16/readme.txt similarity index 100% rename from A_fortran/test16/readme.txt rename to A_fortran/Ex16/readme.txt diff --git a/A_fortran/test16/test13C.c b/A_fortran/Ex16/test13C.c similarity index 100% rename from A_fortran/test16/test13C.c rename to A_fortran/Ex16/test13C.c diff --git a/A_fortran/test16/test13F.f b/A_fortran/Ex16/test13F.f similarity index 100% rename from A_fortran/test16/test13F.f rename to A_fortran/Ex16/test13F.f diff --git a/A_fortran/test17/Makefile b/A_fortran/Ex17/Makefile similarity index 100% rename from A_fortran/test17/Makefile rename to A_fortran/Ex17/Makefile diff --git a/A_fortran/test17/readme.txt b/A_fortran/Ex17/readme.txt similarity index 100% rename from A_fortran/test17/readme.txt rename to A_fortran/Ex17/readme.txt diff --git a/A_fortran/test17/test13C.c b/A_fortran/Ex17/test13C.c similarity index 100% rename from A_fortran/test17/test13C.c rename to A_fortran/Ex17/test13C.c diff --git a/A_fortran/test17/test13F.f b/A_fortran/Ex17/test13F.f similarity index 100% rename from A_fortran/test17/test13F.f rename to A_fortran/Ex17/test13F.f diff --git a/A_fortran/test18/Makefile b/A_fortran/Ex18/Makefile similarity index 100% rename from A_fortran/test18/Makefile rename to A_fortran/Ex18/Makefile diff --git a/A_fortran/test18/readme.txt b/A_fortran/Ex18/readme.txt similarity index 100% rename from A_fortran/test18/readme.txt rename to A_fortran/Ex18/readme.txt diff --git a/A_fortran/test18/test13C.c b/A_fortran/Ex18/test13C.c similarity index 100% rename from A_fortran/test18/test13C.c rename to A_fortran/Ex18/test13C.c diff --git a/A_fortran/test18/test13F.f90 b/A_fortran/Ex18/test13F.f90 similarity index 100% rename from A_fortran/test18/test13F.f90 rename to A_fortran/Ex18/test13F.f90 diff --git a/A_fortran/test19/Makefile b/A_fortran/Ex19/Makefile similarity index 100% rename from A_fortran/test19/Makefile rename to A_fortran/Ex19/Makefile diff --git a/A_fortran/test19/readme.txt b/A_fortran/Ex19/readme.txt similarity index 100% rename from A_fortran/test19/readme.txt rename to A_fortran/Ex19/readme.txt diff --git a/A_fortran/test19/test13C.c b/A_fortran/Ex19/test13C.c similarity index 100% rename from A_fortran/test19/test13C.c rename to A_fortran/Ex19/test13C.c diff --git a/A_fortran/test19/test13F.f90 b/A_fortran/Ex19/test13F.f90 similarity index 100% rename from A_fortran/test19/test13F.f90 rename to A_fortran/Ex19/test13F.f90 diff --git a/A_fortran/test20/Makefile b/A_fortran/Ex20/Makefile similarity index 100% rename from A_fortran/test20/Makefile rename to A_fortran/Ex20/Makefile diff --git a/A_fortran/test20/readme.txt b/A_fortran/Ex20/readme.txt similarity index 100% rename from A_fortran/test20/readme.txt rename to A_fortran/Ex20/readme.txt diff --git a/A_fortran/test20/test13C.c b/A_fortran/Ex20/test13C.c similarity index 100% rename from A_fortran/test20/test13C.c rename to A_fortran/Ex20/test13C.c diff --git a/A_fortran/test20/test13F.f90 b/A_fortran/Ex20/test13F.f90 similarity index 100% rename from A_fortran/test20/test13F.f90 rename to A_fortran/Ex20/test13F.f90 diff --git a/A_fortran/test21/Makefile b/A_fortran/Ex21/Makefile similarity index 100% rename from A_fortran/test21/Makefile rename to A_fortran/Ex21/Makefile diff --git a/A_fortran/test21/readme.txt b/A_fortran/Ex21/readme.txt similarity index 100% rename from A_fortran/test21/readme.txt rename to A_fortran/Ex21/readme.txt diff --git a/A_fortran/test21/test13C.c b/A_fortran/Ex21/test13C.c similarity index 100% rename from A_fortran/test21/test13C.c rename to A_fortran/Ex21/test13C.c diff --git a/A_fortran/test21/test13F.f90 b/A_fortran/Ex21/test13F.f90 similarity index 100% rename from A_fortran/test21/test13F.f90 rename to A_fortran/Ex21/test13F.f90 diff --git a/A_fortran/test22/Ctest.c b/A_fortran/Ex22/Ctest.c similarity index 100% rename from A_fortran/test22/Ctest.c rename to A_fortran/Ex22/Ctest.c diff --git a/A_fortran/test22/Ftest.FOR b/A_fortran/Ex22/Ftest.FOR similarity index 100% rename from A_fortran/test22/Ftest.FOR rename to A_fortran/Ex22/Ftest.FOR diff --git a/A_fortran/test22/Makefile b/A_fortran/Ex22/Makefile similarity index 100% rename from A_fortran/test22/Makefile rename to A_fortran/Ex22/Makefile diff --git a/A_fortran/test22/readme.txt b/A_fortran/Ex22/readme.txt similarity index 100% rename from A_fortran/test22/readme.txt rename to A_fortran/Ex22/readme.txt diff --git a/A_fortran/test23/Makefile b/A_fortran/Ex23/Makefile similarity index 100% rename from A_fortran/test23/Makefile rename to A_fortran/Ex23/Makefile diff --git a/A_fortran/test23/readme.txt b/A_fortran/Ex23/readme.txt similarity index 100% rename from A_fortran/test23/readme.txt rename to A_fortran/Ex23/readme.txt diff --git a/A_fortran/test23/tst01.cc b/A_fortran/Ex23/tst01.cc similarity index 100% rename from A_fortran/test23/tst01.cc rename to A_fortran/Ex23/tst01.cc diff --git a/A_fortran/test23/tstfunc1.f b/A_fortran/Ex23/tstfunc1.f similarity index 100% rename from A_fortran/test23/tstfunc1.f rename to A_fortran/Ex23/tstfunc1.f diff --git a/A_fortran/test24/FNUM.FOR b/A_fortran/Ex24/FNUM.FOR similarity index 100% rename from A_fortran/test24/FNUM.FOR rename to A_fortran/Ex24/FNUM.FOR diff --git a/A_fortran/test24/NUMBERS.C b/A_fortran/Ex24/NUMBERS.C similarity index 100% rename from A_fortran/test24/NUMBERS.C rename to A_fortran/Ex24/NUMBERS.C diff --git a/A_fortran/test24/readme.txt b/A_fortran/Ex24/readme.txt similarity index 100% rename from A_fortran/test24/readme.txt rename to A_fortran/Ex24/readme.txt diff --git a/A_fortran/test32/Makefile b/A_fortran/Ex32/Makefile similarity index 100% rename from A_fortran/test32/Makefile rename to A_fortran/Ex32/Makefile diff --git a/A_fortran/test32/cpps.cpp b/A_fortran/Ex32/cpps.cpp similarity index 100% rename from A_fortran/test32/cpps.cpp rename to A_fortran/Ex32/cpps.cpp diff --git a/A_fortran/test32/main.f b/A_fortran/Ex32/main.f similarity index 100% rename from A_fortran/test32/main.f rename to A_fortran/Ex32/main.f diff --git a/A_fortran/test32/readme.txt b/A_fortran/Ex32/readme.txt similarity index 100% rename from A_fortran/test32/readme.txt rename to A_fortran/Ex32/readme.txt diff --git a/A_fortran/test33/Makefile b/A_fortran/Ex33/Makefile similarity index 100% rename from A_fortran/test33/Makefile rename to A_fortran/Ex33/Makefile diff --git a/A_fortran/test33/cpps.cpp b/A_fortran/Ex33/cpps.cpp similarity index 100% rename from A_fortran/test33/cpps.cpp rename to A_fortran/Ex33/cpps.cpp diff --git a/A_fortran/test33/main.f b/A_fortran/Ex33/main.f similarity index 100% rename from A_fortran/test33/main.f rename to A_fortran/Ex33/main.f diff --git a/A_fortran/test33/readme.txt b/A_fortran/Ex33/readme.txt similarity index 100% rename from A_fortran/test33/readme.txt rename to A_fortran/Ex33/readme.txt diff --git a/A_fortran/test34/ftnfctn.f b/A_fortran/Ex34/ftnfctn.f similarity index 100% rename from A_fortran/test34/ftnfctn.f rename to A_fortran/Ex34/ftnfctn.f diff --git a/A_fortran/test34/main.c b/A_fortran/Ex34/main.c similarity index 100% rename from A_fortran/test34/main.c rename to A_fortran/Ex34/main.c diff --git a/A_fortran/test34/readme.txt b/A_fortran/Ex34/readme.txt similarity index 100% rename from A_fortran/test34/readme.txt rename to A_fortran/Ex34/readme.txt diff --git a/A_fortran/test35/f77char.h b/A_fortran/Ex35/f77char.h similarity index 100% rename from A_fortran/test35/f77char.h rename to A_fortran/Ex35/f77char.h diff --git a/A_fortran/test35/f77cmplx.h b/A_fortran/Ex35/f77cmplx.h similarity index 100% rename from A_fortran/test35/f77cmplx.h rename to A_fortran/Ex35/f77cmplx.h diff --git a/A_fortran/test35/f77matrx.h b/A_fortran/Ex35/f77matrx.h similarity index 100% rename from A_fortran/test35/f77matrx.h rename to A_fortran/Ex35/f77matrx.h diff --git a/A_fortran/test35/fortran.h b/A_fortran/Ex35/fortran.h similarity index 100% rename from A_fortran/test35/fortran.h rename to A_fortran/Ex35/fortran.h diff --git a/A_fortran/test35/readme.txt b/A_fortran/Ex35/readme.txt similarity index 100% rename from A_fortran/test35/readme.txt rename to A_fortran/Ex35/readme.txt diff --git a/A_fortran/test36/c_calls_f77/c_calls_f77.html b/A_fortran/Ex36/c_calls_f77/c_calls_f77.html similarity index 100% rename from A_fortran/test36/c_calls_f77/c_calls_f77.html rename to A_fortran/Ex36/c_calls_f77/c_calls_f77.html diff --git a/A_fortran/test36/c_calls_f77/kronrod.f b/A_fortran/Ex36/c_calls_f77/kronrod.f similarity index 100% rename from A_fortran/test36/c_calls_f77/kronrod.f rename to A_fortran/Ex36/c_calls_f77/kronrod.f diff --git a/A_fortran/test36/c_calls_f77/kronrod_prb.c b/A_fortran/Ex36/c_calls_f77/kronrod_prb.c similarity index 100% rename from A_fortran/test36/c_calls_f77/kronrod_prb.c rename to A_fortran/Ex36/c_calls_f77/kronrod_prb.c diff --git a/A_fortran/test36/c_calls_f77/kronrod_prb.sh b/A_fortran/Ex36/c_calls_f77/kronrod_prb.sh similarity index 100% rename from A_fortran/test36/c_calls_f77/kronrod_prb.sh rename to A_fortran/Ex36/c_calls_f77/kronrod_prb.sh diff --git a/A_fortran/test36/c_calls_f77/kronrod_prb_output.txt b/A_fortran/Ex36/c_calls_f77/kronrod_prb_output.txt similarity index 100% rename from A_fortran/test36/c_calls_f77/kronrod_prb_output.txt rename to A_fortran/Ex36/c_calls_f77/kronrod_prb_output.txt diff --git a/A_fortran/test36/c_calls_f77/robots.txt b/A_fortran/Ex36/c_calls_f77/robots.txt similarity index 100% rename from A_fortran/test36/c_calls_f77/robots.txt rename to A_fortran/Ex36/c_calls_f77/robots.txt diff --git a/A_fortran/test36/c_calls_f90/c_calls_f90.html b/A_fortran/Ex36/c_calls_f90/c_calls_f90.html similarity index 100% rename from A_fortran/test36/c_calls_f90/c_calls_f90.html rename to A_fortran/Ex36/c_calls_f90/c_calls_f90.html diff --git a/A_fortran/test36/c_calls_f90/kronrod.f90 b/A_fortran/Ex36/c_calls_f90/kronrod.f90 similarity index 100% rename from A_fortran/test36/c_calls_f90/kronrod.f90 rename to A_fortran/Ex36/c_calls_f90/kronrod.f90 diff --git a/A_fortran/test36/c_calls_f90/kronrod_prb.c b/A_fortran/Ex36/c_calls_f90/kronrod_prb.c similarity index 100% rename from A_fortran/test36/c_calls_f90/kronrod_prb.c rename to A_fortran/Ex36/c_calls_f90/kronrod_prb.c diff --git a/A_fortran/test36/c_calls_f90/kronrod_prb.sh b/A_fortran/Ex36/c_calls_f90/kronrod_prb.sh similarity index 100% rename from A_fortran/test36/c_calls_f90/kronrod_prb.sh rename to A_fortran/Ex36/c_calls_f90/kronrod_prb.sh diff --git a/A_fortran/test36/c_calls_f90/kronrod_prb_output.txt b/A_fortran/Ex36/c_calls_f90/kronrod_prb_output.txt similarity index 100% rename from A_fortran/test36/c_calls_f90/kronrod_prb_output.txt rename to A_fortran/Ex36/c_calls_f90/kronrod_prb_output.txt diff --git a/A_fortran/test36/c_calls_f90/robots.txt b/A_fortran/Ex36/c_calls_f90/robots.txt similarity index 100% rename from A_fortran/test36/c_calls_f90/robots.txt rename to A_fortran/Ex36/c_calls_f90/robots.txt diff --git a/A_fortran/test36/f77_calls_c/f77_calls_c.html b/A_fortran/Ex36/f77_calls_c/f77_calls_c.html similarity index 100% rename from A_fortran/test36/f77_calls_c/f77_calls_c.html rename to A_fortran/Ex36/f77_calls_c/f77_calls_c.html diff --git a/A_fortran/test36/f77_calls_c/kronrod.c b/A_fortran/Ex36/f77_calls_c/kronrod.c similarity index 100% rename from A_fortran/test36/f77_calls_c/kronrod.c rename to A_fortran/Ex36/f77_calls_c/kronrod.c diff --git a/A_fortran/test36/f77_calls_c/kronrod.h b/A_fortran/Ex36/f77_calls_c/kronrod.h similarity index 100% rename from A_fortran/test36/f77_calls_c/kronrod.h rename to A_fortran/Ex36/f77_calls_c/kronrod.h diff --git a/A_fortran/test36/f77_calls_c/kronrod.sh b/A_fortran/Ex36/f77_calls_c/kronrod.sh similarity index 100% rename from A_fortran/test36/f77_calls_c/kronrod.sh rename to A_fortran/Ex36/f77_calls_c/kronrod.sh diff --git a/A_fortran/test36/f77_calls_c/kronrod_output.txt b/A_fortran/Ex36/f77_calls_c/kronrod_output.txt similarity index 100% rename from A_fortran/test36/f77_calls_c/kronrod_output.txt rename to A_fortran/Ex36/f77_calls_c/kronrod_output.txt diff --git a/A_fortran/test36/f77_calls_c/kronrod_prb.f b/A_fortran/Ex36/f77_calls_c/kronrod_prb.f similarity index 100% rename from A_fortran/test36/f77_calls_c/kronrod_prb.f rename to A_fortran/Ex36/f77_calls_c/kronrod_prb.f diff --git a/A_fortran/test36/f77_calls_c/robots.txt b/A_fortran/Ex36/f77_calls_c/robots.txt similarity index 100% rename from A_fortran/test36/f77_calls_c/robots.txt rename to A_fortran/Ex36/f77_calls_c/robots.txt diff --git a/A_fortran/test36/f90_calls_c/f90_calls_c.html b/A_fortran/Ex36/f90_calls_c/f90_calls_c.html similarity index 100% rename from A_fortran/test36/f90_calls_c/f90_calls_c.html rename to A_fortran/Ex36/f90_calls_c/f90_calls_c.html diff --git a/A_fortran/test36/f90_calls_c/hello.c b/A_fortran/Ex36/f90_calls_c/hello.c similarity index 100% rename from A_fortran/test36/f90_calls_c/hello.c rename to A_fortran/Ex36/f90_calls_c/hello.c diff --git a/A_fortran/test36/f90_calls_c/hello.sh b/A_fortran/Ex36/f90_calls_c/hello.sh similarity index 100% rename from A_fortran/test36/f90_calls_c/hello.sh rename to A_fortran/Ex36/f90_calls_c/hello.sh diff --git a/A_fortran/test36/f90_calls_c/hello_output.txt b/A_fortran/Ex36/f90_calls_c/hello_output.txt similarity index 100% rename from A_fortran/test36/f90_calls_c/hello_output.txt rename to A_fortran/Ex36/f90_calls_c/hello_output.txt diff --git a/A_fortran/test36/f90_calls_c/hello_prb.f90 b/A_fortran/Ex36/f90_calls_c/hello_prb.f90 similarity index 100% rename from A_fortran/test36/f90_calls_c/hello_prb.f90 rename to A_fortran/Ex36/f90_calls_c/hello_prb.f90 diff --git a/A_fortran/test36/f90_calls_c/kronrod.c b/A_fortran/Ex36/f90_calls_c/kronrod.c similarity index 100% rename from A_fortran/test36/f90_calls_c/kronrod.c rename to A_fortran/Ex36/f90_calls_c/kronrod.c diff --git a/A_fortran/test36/f90_calls_c/kronrod.h b/A_fortran/Ex36/f90_calls_c/kronrod.h similarity index 100% rename from A_fortran/test36/f90_calls_c/kronrod.h rename to A_fortran/Ex36/f90_calls_c/kronrod.h diff --git a/A_fortran/test36/f90_calls_c/kronrod.sh b/A_fortran/Ex36/f90_calls_c/kronrod.sh similarity index 100% rename from A_fortran/test36/f90_calls_c/kronrod.sh rename to A_fortran/Ex36/f90_calls_c/kronrod.sh diff --git a/A_fortran/test36/f90_calls_c/kronrod_output.txt b/A_fortran/Ex36/f90_calls_c/kronrod_output.txt similarity index 100% rename from A_fortran/test36/f90_calls_c/kronrod_output.txt rename to A_fortran/Ex36/f90_calls_c/kronrod_output.txt diff --git a/A_fortran/test36/f90_calls_c/kronrod_prb.f90 b/A_fortran/Ex36/f90_calls_c/kronrod_prb.f90 similarity index 100% rename from A_fortran/test36/f90_calls_c/kronrod_prb.f90 rename to A_fortran/Ex36/f90_calls_c/kronrod_prb.f90 diff --git a/A_fortran/test36/f90_calls_c/robots.txt b/A_fortran/Ex36/f90_calls_c/robots.txt similarity index 100% rename from A_fortran/test36/f90_calls_c/robots.txt rename to A_fortran/Ex36/f90_calls_c/robots.txt diff --git a/A_fortran/test36/mixed77/ex1_f77_cc.sh b/A_fortran/Ex36/mixed77/ex1_f77_cc.sh similarity index 100% rename from A_fortran/test36/mixed77/ex1_f77_cc.sh rename to A_fortran/Ex36/mixed77/ex1_f77_cc.sh diff --git a/A_fortran/test36/mixed77/ex1_f77_cc_output.txt b/A_fortran/Ex36/mixed77/ex1_f77_cc_output.txt similarity index 100% rename from A_fortran/test36/mixed77/ex1_f77_cc_output.txt rename to A_fortran/Ex36/mixed77/ex1_f77_cc_output.txt diff --git a/A_fortran/test36/mixed77/ex1_g77_gcc.sh b/A_fortran/Ex36/mixed77/ex1_g77_gcc.sh similarity index 100% rename from A_fortran/test36/mixed77/ex1_g77_gcc.sh rename to A_fortran/Ex36/mixed77/ex1_g77_gcc.sh diff --git a/A_fortran/test36/mixed77/ex1_g77_gcc_output.txt b/A_fortran/Ex36/mixed77/ex1_g77_gcc_output.txt similarity index 100% rename from A_fortran/test36/mixed77/ex1_g77_gcc_output.txt rename to A_fortran/Ex36/mixed77/ex1_g77_gcc_output.txt diff --git a/A_fortran/test36/mixed77/ex1_main.f b/A_fortran/Ex36/mixed77/ex1_main.f similarity index 100% rename from A_fortran/test36/mixed77/ex1_main.f rename to A_fortran/Ex36/mixed77/ex1_main.f diff --git a/A_fortran/test36/mixed77/ex1_sub.c b/A_fortran/Ex36/mixed77/ex1_sub.c similarity index 100% rename from A_fortran/test36/mixed77/ex1_sub.c rename to A_fortran/Ex36/mixed77/ex1_sub.c diff --git a/A_fortran/test36/mixed77/mixed.html b/A_fortran/Ex36/mixed77/mixed.html similarity index 100% rename from A_fortran/test36/mixed77/mixed.html rename to A_fortran/Ex36/mixed77/mixed.html diff --git a/A_fortran/test36/mixed77/robots.txt b/A_fortran/Ex36/mixed77/robots.txt similarity index 100% rename from A_fortran/test36/mixed77/robots.txt rename to A_fortran/Ex36/mixed77/robots.txt diff --git a/A_fortran/test36/mixed90/ex1_fort_cc.sh b/A_fortran/Ex36/mixed90/ex1_fort_cc.sh similarity index 100% rename from A_fortran/test36/mixed90/ex1_fort_cc.sh rename to A_fortran/Ex36/mixed90/ex1_fort_cc.sh diff --git a/A_fortran/test36/mixed90/ex1_fort_cc_output.txt b/A_fortran/Ex36/mixed90/ex1_fort_cc_output.txt similarity index 100% rename from A_fortran/test36/mixed90/ex1_fort_cc_output.txt rename to A_fortran/Ex36/mixed90/ex1_fort_cc_output.txt diff --git a/A_fortran/test36/mixed90/ex1_fort_gcc.sh b/A_fortran/Ex36/mixed90/ex1_fort_gcc.sh similarity index 100% rename from A_fortran/test36/mixed90/ex1_fort_gcc.sh rename to A_fortran/Ex36/mixed90/ex1_fort_gcc.sh diff --git a/A_fortran/test36/mixed90/ex1_fort_gcc_output.txt b/A_fortran/Ex36/mixed90/ex1_fort_gcc_output.txt similarity index 100% rename from A_fortran/test36/mixed90/ex1_fort_gcc_output.txt rename to A_fortran/Ex36/mixed90/ex1_fort_gcc_output.txt diff --git a/A_fortran/test36/mixed90/ex1_gfortran_gcc.sh b/A_fortran/Ex36/mixed90/ex1_gfortran_gcc.sh similarity index 100% rename from A_fortran/test36/mixed90/ex1_gfortran_gcc.sh rename to A_fortran/Ex36/mixed90/ex1_gfortran_gcc.sh diff --git a/A_fortran/test36/mixed90/ex1_gfortran_gcc_output.txt b/A_fortran/Ex36/mixed90/ex1_gfortran_gcc_output.txt similarity index 100% rename from A_fortran/test36/mixed90/ex1_gfortran_gcc_output.txt rename to A_fortran/Ex36/mixed90/ex1_gfortran_gcc_output.txt diff --git a/A_fortran/test36/mixed90/ex1_main.f90 b/A_fortran/Ex36/mixed90/ex1_main.f90 similarity index 100% rename from A_fortran/test36/mixed90/ex1_main.f90 rename to A_fortran/Ex36/mixed90/ex1_main.f90 diff --git a/A_fortran/test36/mixed90/ex1_sub.c b/A_fortran/Ex36/mixed90/ex1_sub.c similarity index 100% rename from A_fortran/test36/mixed90/ex1_sub.c rename to A_fortran/Ex36/mixed90/ex1_sub.c diff --git a/A_fortran/test36/mixed90/ex2_fort_cxx.sh b/A_fortran/Ex36/mixed90/ex2_fort_cxx.sh similarity index 100% rename from A_fortran/test36/mixed90/ex2_fort_cxx.sh rename to A_fortran/Ex36/mixed90/ex2_fort_cxx.sh diff --git a/A_fortran/test36/mixed90/ex2_fort_cxx_output.txt b/A_fortran/Ex36/mixed90/ex2_fort_cxx_output.txt similarity index 100% rename from A_fortran/test36/mixed90/ex2_fort_cxx_output.txt rename to A_fortran/Ex36/mixed90/ex2_fort_cxx_output.txt diff --git a/A_fortran/test36/mixed90/ex2_fort_g++.sh b/A_fortran/Ex36/mixed90/ex2_fort_g++.sh similarity index 100% rename from A_fortran/test36/mixed90/ex2_fort_g++.sh rename to A_fortran/Ex36/mixed90/ex2_fort_g++.sh diff --git a/A_fortran/test36/mixed90/ex2_fort_g++_output.txt b/A_fortran/Ex36/mixed90/ex2_fort_g++_output.txt similarity index 100% rename from A_fortran/test36/mixed90/ex2_fort_g++_output.txt rename to A_fortran/Ex36/mixed90/ex2_fort_g++_output.txt diff --git a/A_fortran/test36/mixed90/ex2_gfortran_g++.sh b/A_fortran/Ex36/mixed90/ex2_gfortran_g++.sh similarity index 100% rename from A_fortran/test36/mixed90/ex2_gfortran_g++.sh rename to A_fortran/Ex36/mixed90/ex2_gfortran_g++.sh diff --git a/A_fortran/test36/mixed90/ex2_gfortran_g++_output.txt b/A_fortran/Ex36/mixed90/ex2_gfortran_g++_output.txt similarity index 100% rename from A_fortran/test36/mixed90/ex2_gfortran_g++_output.txt rename to A_fortran/Ex36/mixed90/ex2_gfortran_g++_output.txt diff --git a/A_fortran/test36/mixed90/ex2_main.f90 b/A_fortran/Ex36/mixed90/ex2_main.f90 similarity index 100% rename from A_fortran/test36/mixed90/ex2_main.f90 rename to A_fortran/Ex36/mixed90/ex2_main.f90 diff --git a/A_fortran/test36/mixed90/ex2_sub.cpp b/A_fortran/Ex36/mixed90/ex2_sub.cpp similarity index 100% rename from A_fortran/test36/mixed90/ex2_sub.cpp rename to A_fortran/Ex36/mixed90/ex2_sub.cpp diff --git a/A_fortran/test36/mixed90/robots.txt b/A_fortran/Ex36/mixed90/robots.txt similarity index 100% rename from A_fortran/test36/mixed90/robots.txt rename to A_fortran/Ex36/mixed90/robots.txt diff --git a/A_fortran/test36/mixedC/ex1_cc_fort.sh b/A_fortran/Ex36/mixedC/ex1_cc_fort.sh similarity index 100% rename from A_fortran/test36/mixedC/ex1_cc_fort.sh rename to A_fortran/Ex36/mixedC/ex1_cc_fort.sh diff --git a/A_fortran/test36/mixedC/ex1_cc_fort_output.txt b/A_fortran/Ex36/mixedC/ex1_cc_fort_output.txt similarity index 100% rename from A_fortran/test36/mixedC/ex1_cc_fort_output.txt rename to A_fortran/Ex36/mixedC/ex1_cc_fort_output.txt diff --git a/A_fortran/test36/mixedC/ex1_gcc_fort.sh b/A_fortran/Ex36/mixedC/ex1_gcc_fort.sh similarity index 100% rename from A_fortran/test36/mixedC/ex1_gcc_fort.sh rename to A_fortran/Ex36/mixedC/ex1_gcc_fort.sh diff --git a/A_fortran/test36/mixedC/ex1_gcc_fort_output.txt b/A_fortran/Ex36/mixedC/ex1_gcc_fort_output.txt similarity index 100% rename from A_fortran/test36/mixedC/ex1_gcc_fort_output.txt rename to A_fortran/Ex36/mixedC/ex1_gcc_fort_output.txt diff --git a/A_fortran/test36/mixedC/ex1_main.c b/A_fortran/Ex36/mixedC/ex1_main.c similarity index 100% rename from A_fortran/test36/mixedC/ex1_main.c rename to A_fortran/Ex36/mixedC/ex1_main.c diff --git a/A_fortran/test36/mixedC/ex1_sub.f90 b/A_fortran/Ex36/mixedC/ex1_sub.f90 similarity index 100% rename from A_fortran/test36/mixedC/ex1_sub.f90 rename to A_fortran/Ex36/mixedC/ex1_sub.f90 diff --git a/A_fortran/test36/mixedC/ex2_cc_fort.sh b/A_fortran/Ex36/mixedC/ex2_cc_fort.sh similarity index 100% rename from A_fortran/test36/mixedC/ex2_cc_fort.sh rename to A_fortran/Ex36/mixedC/ex2_cc_fort.sh diff --git a/A_fortran/test36/mixedC/ex2_cc_fort_output.txt b/A_fortran/Ex36/mixedC/ex2_cc_fort_output.txt similarity index 100% rename from A_fortran/test36/mixedC/ex2_cc_fort_output.txt rename to A_fortran/Ex36/mixedC/ex2_cc_fort_output.txt diff --git a/A_fortran/test36/mixedC/ex2_gcc_fort.sh b/A_fortran/Ex36/mixedC/ex2_gcc_fort.sh similarity index 100% rename from A_fortran/test36/mixedC/ex2_gcc_fort.sh rename to A_fortran/Ex36/mixedC/ex2_gcc_fort.sh diff --git a/A_fortran/test36/mixedC/ex2_gcc_fort_output.txt b/A_fortran/Ex36/mixedC/ex2_gcc_fort_output.txt similarity index 100% rename from A_fortran/test36/mixedC/ex2_gcc_fort_output.txt rename to A_fortran/Ex36/mixedC/ex2_gcc_fort_output.txt diff --git a/A_fortran/test36/mixedC/ex2_main.c b/A_fortran/Ex36/mixedC/ex2_main.c similarity index 100% rename from A_fortran/test36/mixedC/ex2_main.c rename to A_fortran/Ex36/mixedC/ex2_main.c diff --git a/A_fortran/test36/mixedC/ex2_sub.f90 b/A_fortran/Ex36/mixedC/ex2_sub.f90 similarity index 100% rename from A_fortran/test36/mixedC/ex2_sub.f90 rename to A_fortran/Ex36/mixedC/ex2_sub.f90 diff --git a/A_fortran/test36/mixedC/mixed.html b/A_fortran/Ex36/mixedC/mixed.html similarity index 100% rename from A_fortran/test36/mixedC/mixed.html rename to A_fortran/Ex36/mixedC/mixed.html diff --git a/A_fortran/test36/mixedC/robots.txt b/A_fortran/Ex36/mixedC/robots.txt similarity index 100% rename from A_fortran/test36/mixedC/robots.txt rename to A_fortran/Ex36/mixedC/robots.txt diff --git a/A_fortran/test36/readme.txt b/A_fortran/Ex36/readme.txt similarity index 100% rename from A_fortran/test36/readme.txt rename to A_fortran/Ex36/readme.txt From 10a32cf1ff6e6e9e503b2dd61151d491e56dc127 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sat, 1 Dec 2018 01:29:47 +0100 Subject: [PATCH 05/25] Fortran ignore files added --- .gitignore | 331 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 185 insertions(+), 146 deletions(-) diff --git a/.gitignore b/.gitignore index c412f95..b9a9e6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,81 +1,120 @@ - -# Created by https://www.gitignore.io/api/c,c++,macos,windows,linux - -### C ### -# Prerequisites -*.d - -# Object files -*.o -*.ko -*.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -modules.order -Module.symvers -Mkfile.old -dkms.conf - - -### C++ ### -# Prerequisites - -# Compiled Object files -*.slo - -# Precompiled Headers - -# Compiled Dynamic libraries - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai - -# Executables - - -### macOS ### + +# Created by https://www.gitignore.io/api/c,c++,macos,windows,linux + +### C ### +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +modules.order +Module.symvers +Mkfile.old +dkms.conf + + +### C++ ### +# Prerequisites + +# Compiled Object files +*.slo + +# Precompiled Headers + +# Compiled Dynamic libraries + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai + +# Executables +*.exe +*.out +*.app + + +### Fortran ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + + + +### macOS ### *.DS_Store .AppleDouble .LSOverride @@ -98,71 +137,71 @@ Icon Network Trash Folder Temporary Items .apdisk - - -### Windows ### -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - - - -#other -*.zip -*.pdf -*.ppt - - -blaswrap.h -cblas_f77.h -cblas.h -clapack.h -f2c.h -lapack_config.h -lapacke_mangling_with_flags.h -lapacke_mangling.h -lapack_utils.h -lapacke.h - - -libblas.a -librefblas.a -libcblas.a -libf2c.a -libgfortran.dylib -liblapack.a -liblapacke.a -liblapacke.dylib -librefblas.a -libtmglib.a + + +### Windows ### +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + + + +#other +*.zip +*.pdf +*.ppt + + +blaswrap.h +cblas_f77.h +cblas.h +clapack.h +f2c.h +lapack_config.h +lapacke_mangling_with_flags.h +lapacke_mangling.h +lapack_utils.h +lapacke.h + + +libblas.a +librefblas.a +libcblas.a +libf2c.a +libgfortran.dylib +liblapack.a +liblapacke.a +liblapacke.dylib +librefblas.a +libtmglib.a From 277badd12ffbc9d6fb56ec689b57d5c622160e22 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sat, 1 Dec 2018 03:11:39 +0100 Subject: [PATCH 06/25] common explained --- A_fortran/Ex01/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/A_fortran/Ex01/README.md b/A_fortran/Ex01/README.md index 3b642fa..6c09765 100644 --- a/A_fortran/Ex01/README.md +++ b/A_fortran/Ex01/README.md @@ -1,5 +1,5 @@ # Abstract: -This example shows how we can call a C function from Fortran and how to pass a string properly from Fortran to C +This example shows how we can call a C function from Fortran and how to pass a string properly from Fortran to C. The code is written in legacy FORTRAN 77 standard. # Source: http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html @@ -8,7 +8,7 @@ This example shows how we can call a C function from Fortran and how to pass a s # Points: 1. when you pass a string from Fortran to C you actually pass two variables including a pointer to an array of single characters (string) and also the length of the array. 2. when you pass a string to C you need to first be sure that you allocate at least one letter more than the characters you need. In C first of se "\0" or NULL as the end of the string -3. common in Fortran is the equivalent of struct in C +3. common in Fortran is the similar to struct in C in C: ```c @@ -28,6 +28,8 @@ This example shows how we can call a C function from Fortran and how to pass a s common/mystruct/ i, c, ... ``` +where the attributes can be acceses via `.att` convention. Except `common` defines only one instance of the struct globally. + 4. when Fortran passes a variable to C function, the C function receives a pointer? 5. when you want to call a C function in Fortran you don't need to declare a dummy in the Fortran code, unlike C Fortran doesn't care if the function is not declared and then on run time it will look for the function (how about variables and structs?) 6. when passing variables, functions or srtucts from/to C/Fortran it is Case-insensitive. but you should be careful that inside each world it is case sensitive. From bf89b2d556eb85f6421c95f05b55fbf66a621ae9 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sun, 2 Dec 2018 01:26:43 +0100 Subject: [PATCH 07/25] example 25 added --- A_fortran/Ex01/Makefile | 4 ++-- A_fortran/Ex25/.Cfile.c.swp | Bin 0 -> 12288 bytes A_fortran/Ex25/.Ffile.f.swp | Bin 0 -> 12288 bytes A_fortran/Ex25/.Makefile.swp | Bin 0 -> 12288 bytes A_fortran/Ex25/Cfile.c | 17 +++++++++++++++++ A_fortran/Ex25/Ffile.f | 7 +++++++ A_fortran/Ex25/Makefile | 8 ++++++++ 7 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 A_fortran/Ex25/.Cfile.c.swp create mode 100644 A_fortran/Ex25/.Ffile.f.swp create mode 100644 A_fortran/Ex25/.Makefile.swp create mode 100644 A_fortran/Ex25/Cfile.c create mode 100644 A_fortran/Ex25/Ffile.f create mode 100644 A_fortran/Ex25/Makefile diff --git a/A_fortran/Ex01/Makefile b/A_fortran/Ex01/Makefile index 95af412..d171a75 100644 --- a/A_fortran/Ex01/Makefile +++ b/A_fortran/Ex01/Makefile @@ -1,7 +1,7 @@ all: - gfortran -c test1F.f + gfortran -c -std=legacy test1F.f gcc -c test1C.c - gfortran -o test1.out test1C.o test1F.o + gfortran -o test1.out -std=legacy test1C.o test1F.o rm -rf *.o diff --git a/A_fortran/Ex25/.Cfile.c.swp b/A_fortran/Ex25/.Cfile.c.swp new file mode 100644 index 0000000000000000000000000000000000000000..47dbcc5241ca410470f2369c35024eeb0dbe726c GIT binary patch literal 12288 zcmeI%Jxjwt7zgmD+NFcZ#su|3rc=+Jy5(nw~ZjnT?dQe=1y7ciFC_r{cSiRRH{g2_7ZuOXWW^1Uyi$^X;c!#kirW26ZmVnRJlnNOO9aI&t6U&;-IR`W Z^%X)}>0T+%x9g!J#crS+uVK{o=@&86mRtY; literal 0 HcmV?d00001 diff --git a/A_fortran/Ex25/.Ffile.f.swp b/A_fortran/Ex25/.Ffile.f.swp new file mode 100644 index 0000000000000000000000000000000000000000..ad16164bde252344a21dbf27c2abaac091fd4276 GIT binary patch literal 12288 zcmeI%F-yZh6bJCvA~=bnU*OcCAhws9p`C;njTTJ;Npx~)NumLX)m%F2_wjQ$34RV2 z{SLkh)uA1N-HQK5UXIJXyM!NPIBsNI4P4Rh7{swb^zqibel=I9-6Tryhp~QK7v-qT zRasX>^rRP*aWauADO7dqN+-?kl1^Gb8x;_Mz`_EhO56Q4G7q}dufDspEw(l<7hVn% zApijgKmY;|fB*y_0D;M1& literal 0 HcmV?d00001 diff --git a/A_fortran/Ex25/.Makefile.swp b/A_fortran/Ex25/.Makefile.swp new file mode 100644 index 0000000000000000000000000000000000000000..0fb75d0403a993bb9c6a5ec121c338726100eaf4 GIT binary patch literal 12288 zcmeI&KTE?v7{~D^;$R0+^bMT4329mdk%E&TICRv>!8Cu07!yq|f{QM0`T~4S4!#i= zcNd=v5vw2>Iu*VLzZ{o5cZ3gQIC7)j>G9C)cYC63Rpjl%J3H?!ioYO|7Gdmex3y|i z<+f_861jH^261v5*koesOFtNfmq~h&CGFFxKmdW61eRrYr(b{STbmnZeeGnX)tHO` z0tg_000IagfB*vXC19^TdC*tZ?S9>sn%?`OP&G U5&bIsDTwqz)J%*d%(8)e0mSi3X#fBK literal 0 HcmV?d00001 diff --git a/A_fortran/Ex25/Cfile.c b/A_fortran/Ex25/Cfile.c new file mode 100644 index 0000000..517eb32 --- /dev/null +++ b/A_fortran/Ex25/Cfile.c @@ -0,0 +1,17 @@ +#include + +typedef struct { + char s[30]; + int l; +} fstring; + +extern fstring stringf_; + +int main() { + //printf("%s\n", stringf_.string); + fstring stringc = stringf_; + printf("%d\n", stringc.l); + stringc.s[29] = '\0'; + printf("%s\n",stringc.s); + return 0; +} diff --git a/A_fortran/Ex25/Ffile.f b/A_fortran/Ex25/Ffile.f new file mode 100644 index 0000000..cbd948f --- /dev/null +++ b/A_fortran/Ex25/Ffile.f @@ -0,0 +1,7 @@ + BLOCK DATA + + CHARACTER*30 S + COMMON /STRINGF/ S + DATA S /'this is a string in FROTRAN77'/ + + end diff --git a/A_fortran/Ex25/Makefile b/A_fortran/Ex25/Makefile new file mode 100644 index 0000000..b5ab7ab --- /dev/null +++ b/A_fortran/Ex25/Makefile @@ -0,0 +1,8 @@ +all: + gcc -c Cfile.c + gfortran -c -std=legacy Ffile.f + gfortran -o test.out -std=legacy Cfile.o Ffile.f + rm -rf *.o + +clean: + rm -rf *.o *.out From 9f3b7ad70de8dc8584a0e1fb2a03e91aa8dd66c7 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sun, 2 Dec 2018 01:33:24 +0100 Subject: [PATCH 08/25] ignore .swp files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b9a9e6d..f714e62 100644 --- a/.gitignore +++ b/.gitignore @@ -205,3 +205,6 @@ liblapacke.a liblapacke.dylib librefblas.a libtmglib.a + + +*.swp From 8fc1f22ed6955def93a5fdee0e22155601e29bc7 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sun, 2 Dec 2018 01:33:52 +0100 Subject: [PATCH 09/25] Delete .Cfile.c.swp --- A_fortran/Ex25/.Cfile.c.swp | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 A_fortran/Ex25/.Cfile.c.swp diff --git a/A_fortran/Ex25/.Cfile.c.swp b/A_fortran/Ex25/.Cfile.c.swp deleted file mode 100644 index 47dbcc5241ca410470f2369c35024eeb0dbe726c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI%Jxjwt7zgmD+NFcZ#su|3rc=+Jy5(nw~ZjnT?dQe=1y7ciFC_r{cSiRRH{g2_7ZuOXWW^1Uyi$^X;c!#kirW26ZmVnRJlnNOO9aI&t6U&;-IR`W Z^%X)}>0T+%x9g!J#crS+uVK{o=@&86mRtY; From e67541aa3b620aabaf2b6bd84c3532a7ca014b3f Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sun, 2 Dec 2018 01:34:00 +0100 Subject: [PATCH 10/25] Delete .Ffile.f.swp --- A_fortran/Ex25/.Ffile.f.swp | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 A_fortran/Ex25/.Ffile.f.swp diff --git a/A_fortran/Ex25/.Ffile.f.swp b/A_fortran/Ex25/.Ffile.f.swp deleted file mode 100644 index ad16164bde252344a21dbf27c2abaac091fd4276..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI%F-yZh6bJCvA~=bnU*OcCAhws9p`C;njTTJ;Npx~)NumLX)m%F2_wjQ$34RV2 z{SLkh)uA1N-HQK5UXIJXyM!NPIBsNI4P4Rh7{swb^zqibel=I9-6Tryhp~QK7v-qT zRasX>^rRP*aWauADO7dqN+-?kl1^Gb8x;_Mz`_EhO56Q4G7q}dufDspEw(l<7hVn% zApijgKmY;|fB*y_0D;M1& From 7448b6b5f1924e20232d5edac992a36ba7cc3d4e Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sun, 2 Dec 2018 01:34:10 +0100 Subject: [PATCH 11/25] Delete .Makefile.swp --- A_fortran/Ex25/.Makefile.swp | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 A_fortran/Ex25/.Makefile.swp diff --git a/A_fortran/Ex25/.Makefile.swp b/A_fortran/Ex25/.Makefile.swp deleted file mode 100644 index 0fb75d0403a993bb9c6a5ec121c338726100eaf4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&KTE?v7{~D^;$R0+^bMT4329mdk%E&TICRv>!8Cu07!yq|f{QM0`T~4S4!#i= zcNd=v5vw2>Iu*VLzZ{o5cZ3gQIC7)j>G9C)cYC63Rpjl%J3H?!ioYO|7Gdmex3y|i z<+f_861jH^261v5*koesOFtNfmq~h&CGFFxKmdW61eRrYr(b{STbmnZeeGnX)tHO` z0tg_000IagfB*vXC19^TdC*tZ?S9>sn%?`OP&G U5&bIsDTwqz)J%*d%(8)e0mSi3X#fBK From ff7ebb1af8a93e1b41fadf31f65675ac2613fa89 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sun, 2 Dec 2018 21:33:42 +0100 Subject: [PATCH 12/25] some minor improvements the readme is ahuge mess anyway! --- B_BLAS/{readme.txt => readme.md} | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) rename B_BLAS/{readme.txt => readme.md} (73%) diff --git a/B_BLAS/readme.txt b/B_BLAS/readme.md similarity index 73% rename from B_BLAS/readme.txt rename to B_BLAS/readme.md index db343bd..0a6e0be 100644 --- a/B_BLAS/readme.txt +++ b/B_BLAS/readme.md @@ -1,14 +1,13 @@ -BLAS is a actually not a library but an API, specification or interface which gives you the ability to use functions for linear algebra, including vector-vector, vector-matrix and matrix-matrix operations. there are several implementations of BLAS. Netlib BLAS (formerly belonged to Bell Laboratories), OpenBLAS, ATLAS, ... +BLAS is not a library but an API, specification or interface which gives you the ability to use specific functions for linear algebra, including vector-vector, vector-matrix and matrix-matrix operations. There are several implementations of BLAS including the original Netlib BLAS (formerly BellLabs), OpenBLAS/GotoBLAS2, ATLAS, GSL, ... -to compile these examples you need to have BLAS library installed. to do this you have several possibilities: -1. use existing capabilities/repositories of your operating system. if you use these options then you can compile your C code with -lblas linker and the compiler automatically knows where to look for libblas.* (e.g. gcc foo.c -lblas) - 1.1. ubuntu: - on ubuntu you can install by - sudo apt-get build-essential libblas-dev +To compile these examples you need to have any of the BLAS implementations installed. to do this you have several possibilities: +1. Use existing capabilities/repositories of your operating system: if you use these options then you can compile your C code with -lblas linker and the compiler automatically knows where to look for libblas.* (e.g. gcc foo.c -lblas) + 1.1. ubuntu: on ubuntu you can install by + + sudo apt-get build-essential libblas-dev - 1.2. mac OS X: - Acceleration framework is already built in the OS just link against the frame work + 1.2. mac OS X: Acceleration framework is already built in the OS just link against the frame work gcc foo.c -framework Accelerate or gcc foo.c -lblas @@ -46,9 +45,7 @@ to compile these examples you need to have BLAS library installed. to do this yo useful notes: to use BLAS fortran routine inside the C code you need to declare the BLAS fortran routine inside the C code first. for example if foo is a fortran routine with output and inputs, you need to declare it in yor C code as: output foo_(inputs) -and then use it as foo_ inside the code - -source: http://stackoverflow.com/questions/22085277/how-to-call-clapack-from-c +and then use it as foo_ inside the code. [source](http://stackoverflow.com/questions/22085277/how-to-call-clapack-from-c) From ff246b5a7da46a523c694de48ad61e06c759e51c Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Sun, 2 Dec 2018 23:13:35 +0100 Subject: [PATCH 13/25] link added https://docs.oracle.com/cd/E19957-01/805-4940/6j4m1u7qq/index.html --- A_fortran/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/A_fortran/README.md b/A_fortran/README.md index 2563bd9..591c7d1 100644 --- a/A_fortran/README.md +++ b/A_fortran/README.md @@ -29,6 +29,7 @@ you need to have Fortran and C compilers. Preferably GNU gcc and gfortran 16. http://people.sc.fsu.edu/~jburkardt/c_src/mixed/mixed.html 17. https://docs.oracle.com/cd/E19422-01/819-3685/11_cfort.html 18. cfortran--> http://www-zeus.desy.de/~burow/cfortran/ +19. https://docs.oracle.com/cd/E19957-01/805-4940/6j4m1u7qq/index.html # To do: From c4c4020082dd7ce89eeb145659e7781d3fe485e4 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 17:45:32 +0100 Subject: [PATCH 14/25] Ex25 added --- A_fortran/Ex01/README.md | 18 +++++++----------- A_fortran/Ex01/test1F.f | 2 +- A_fortran/Ex25/Makefile | 1 + A_fortran/Ex25/test02/CMAIN.c | 19 +++++++++++++++++++ A_fortran/Ex25/test02/FORSUBS.FOR | 18 ++++++++++++++++++ A_fortran/Ex25/test02/Makefile | 8 ++++++++ 6 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 A_fortran/Ex25/test02/CMAIN.c create mode 100644 A_fortran/Ex25/test02/FORSUBS.FOR create mode 100644 A_fortran/Ex25/test02/Makefile diff --git a/A_fortran/Ex01/README.md b/A_fortran/Ex01/README.md index 6c09765..e625b59 100644 --- a/A_fortran/Ex01/README.md +++ b/A_fortran/Ex01/README.md @@ -1,14 +1,14 @@ # Abstract: -This example shows how we can call a C function from Fortran and how to pass a string properly from Fortran to C. The code is written in legacy FORTRAN 77 standard. +This example shows how we can call a C function from FORTRAN and how to pass a string properly from Fortran to C. The code is written in legacy FORTRAN 77 standard. # Source: http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html # Points: -1. when you pass a string from Fortran to C you actually pass two variables including a pointer to an array of single characters (string) and also the length of the array. -2. when you pass a string to C you need to first be sure that you allocate at least one letter more than the characters you need. In C first of se "\0" or NULL as the end of the string -3. common in Fortran is the similar to struct in C +1. when you pass a string from Fortran to C you actually pass two variables including a pointer to an array of single characters (string) and also the length of the array? +2. when you pass a string to C you need to first be sure that you allocate at least one letter more than the characters you need. In FORTRAN strings are not NULL ended, so the "\0" must be added at the end of the string in C. +3. common in FORTRAN is the similar to struct in C in C: ```c @@ -19,7 +19,7 @@ This example shows how we can call a C function from Fortran and how to pass a s } mystruct_; ``` - in Fortran + in FORTRAN ```fortran integer i @@ -28,9 +28,9 @@ This example shows how we can call a C function from Fortran and how to pass a s common/mystruct/ i, c, ... ``` -where the attributes can be acceses via `.att` convention. Except `common` defines only one instance of the struct globally. +where the attributes can be accesed via `.att` convention. Except `common` defines only one instance of the struct globally. It just groups the attributes and make them global. It can be request like struct though. -4. when Fortran passes a variable to C function, the C function receives a pointer? +4. when FORTRAN passes a variable to C function, the C function receives a pointer? 5. when you want to call a C function in Fortran you don't need to declare a dummy in the Fortran code, unlike C Fortran doesn't care if the function is not declared and then on run time it will look for the function (how about variables and structs?) 6. when passing variables, functions or srtucts from/to C/Fortran it is Case-insensitive. but you should be careful that inside each world it is case sensitive. @@ -39,10 +39,6 @@ where the attributes can be acceses via `.att` convention. Except `common` defin # Questions: 1. this pages says when you want to call a C function from fortran you need to also declare it as external but here it works properly without declaring! https://docs.oracle.com/cd/E19059-01/stud.9/817-6694/11_cfort.html -I think we needed a - external doubleijk - here, but we don't! -2. Is Fortran code written in FORTRAN 77? diff --git a/A_fortran/Ex01/test1F.f b/A_fortran/Ex01/test1F.f index 6be8faf..c675cfd 100644 --- a/A_fortran/Ex01/test1F.f +++ b/A_fortran/Ex01/test1F.f @@ -1,7 +1,7 @@ program test integer ii, jj, kk - common/IjK/ ii, jj, kk + common/IJK/ ii, jj, kk real*8 ff character*25 cc diff --git a/A_fortran/Ex25/Makefile b/A_fortran/Ex25/Makefile index b5ab7ab..8491e23 100644 --- a/A_fortran/Ex25/Makefile +++ b/A_fortran/Ex25/Makefile @@ -2,6 +2,7 @@ all: gcc -c Cfile.c gfortran -c -std=legacy Ffile.f gfortran -o test.out -std=legacy Cfile.o Ffile.f + #gcc -o test.out -std=legacy -lgfortran Cfile.o Ffile.o rm -rf *.o clean: diff --git a/A_fortran/Ex25/test02/CMAIN.c b/A_fortran/Ex25/test02/CMAIN.c new file mode 100644 index 0000000..10d9015 --- /dev/null +++ b/A_fortran/Ex25/test02/CMAIN.c @@ -0,0 +1,19 @@ +/* File CMAIN.C */ + +#include + +extern int fact_(int* n); +extern void pythagoras_(float* a, float* b, float* c); + +int main() +{ + int n = 7; + printf("Factorial of 7 is: %d\n", fact_(&n)); + + float a, b, c; + a = 30; + b = 40; + pythagoras_(&a, &b, &c); + printf("Hypotenuse if sides 30, 40 is: %f\n", c); + return 0; +} diff --git a/A_fortran/Ex25/test02/FORSUBS.FOR b/A_fortran/Ex25/test02/FORSUBS.FOR new file mode 100644 index 0000000..5a108c5 --- /dev/null +++ b/A_fortran/Ex25/test02/FORSUBS.FOR @@ -0,0 +1,18 @@ +C File FORSUBS.FOR +C + INTEGER*4 FUNCTION FACT (n) + INTEGER*4 n + INTEGER*4 i, amt + amt = 1 + DO i = 1, n + amt = amt * i + END DO + Fact = amt + END + + SUBROUTINE PYTHAGORAS (a, b, c) + REAL*4 a + REAL*4 b + REAL*4 c + c = SQRT (a * a + b * b) + END diff --git a/A_fortran/Ex25/test02/Makefile b/A_fortran/Ex25/test02/Makefile new file mode 100644 index 0000000..e13ff15 --- /dev/null +++ b/A_fortran/Ex25/test02/Makefile @@ -0,0 +1,8 @@ +all: + gcc -c CMAIN.c + gfortran -c FORSUBS.FOR + gfortran -o result.out CMAIN.o FORSUBS.o + +clean : + rm -rf *.out *~ *.bak *.o + From 5af3dba6b05d2551bc75adafbe0dfb2399f82ea5 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 17:49:15 +0100 Subject: [PATCH 15/25] Ex26 added --- A_fortran/{Ex25/test02 => Ex26}/CMAIN.c | 0 A_fortran/{Ex25/test02 => Ex26}/FORSUBS.FOR | 0 A_fortran/{Ex25/test02 => Ex26}/Makefile | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename A_fortran/{Ex25/test02 => Ex26}/CMAIN.c (100%) rename A_fortran/{Ex25/test02 => Ex26}/FORSUBS.FOR (100%) rename A_fortran/{Ex25/test02 => Ex26}/Makefile (100%) diff --git a/A_fortran/Ex25/test02/CMAIN.c b/A_fortran/Ex26/CMAIN.c similarity index 100% rename from A_fortran/Ex25/test02/CMAIN.c rename to A_fortran/Ex26/CMAIN.c diff --git a/A_fortran/Ex25/test02/FORSUBS.FOR b/A_fortran/Ex26/FORSUBS.FOR similarity index 100% rename from A_fortran/Ex25/test02/FORSUBS.FOR rename to A_fortran/Ex26/FORSUBS.FOR diff --git a/A_fortran/Ex25/test02/Makefile b/A_fortran/Ex26/Makefile similarity index 100% rename from A_fortran/Ex25/test02/Makefile rename to A_fortran/Ex26/Makefile From 6581371a40da1ab105fe436faae8c21cd84eca2f Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 20:33:10 +0100 Subject: [PATCH 16/25] Ex03 fixed --- A_fortran/Ex03/CSUBS.C | 11 ----------- A_fortran/Ex03/CSUBS.c | 14 ++++++++++++++ A_fortran/Ex03/FORMAIN.FOR | 19 +++++++++++-------- A_fortran/Ex03/Makefile | 6 +++--- 4 files changed, 28 insertions(+), 22 deletions(-) delete mode 100644 A_fortran/Ex03/CSUBS.C create mode 100644 A_fortran/Ex03/CSUBS.c diff --git a/A_fortran/Ex03/CSUBS.C b/A_fortran/Ex03/CSUBS.C deleted file mode 100644 index e49334b..0000000 --- a/A_fortran/Ex03/CSUBS.C +++ /dev/null @@ -1,11 +0,0 @@ -/* File CSUBS.C */ - -#include - -int Fact(int n) { - if (n > 1) - return (n * Fact(n - 1)); - return 1; -} - -void Pythagoras(float a, float b, float *c) { *c = sqrt(a * a + b * b); } diff --git a/A_fortran/Ex03/CSUBS.c b/A_fortran/Ex03/CSUBS.c new file mode 100644 index 0000000..364c012 --- /dev/null +++ b/A_fortran/Ex03/CSUBS.c @@ -0,0 +1,14 @@ +/* File CSUBS.C */ + +#include + +int fact_(int* np) { + int n = *np; + if (n > 1) { + int m = n-1; + return (n * fact_(&m)); + }; + return 1; +} + +void pythagoras_(float* a, float* b, float* c) { *c = sqrt(*a * *a + *b * *b); } diff --git a/A_fortran/Ex03/FORMAIN.FOR b/A_fortran/Ex03/FORMAIN.FOR index d6b76c0..1b397fa 100644 --- a/A_fortran/Ex03/FORMAIN.FOR +++ b/A_fortran/Ex03/FORMAIN.FOR @@ -1,18 +1,21 @@ C File FORMAIN.FOR C - INTERFACE TO INTEGER*4 FUNCTION Fact [C,ALIAS:'_Fact'] (n) - INTEGER*4 n [VALUE] + INTERFACE + INTEGER*4 FUNCTION Fact (n) + INTEGER*4 n END + END INTERFACE - INTERFACE TO SUBROUTINE Pythagoras [C,ALIAS:'_Pythagoras'] (a,b,c) - REAL*4 a [VALUE] - REAL*4 b [VALUE] - REAL*4 c [REFERENCE] + INTERFACE + SUBROUTINE Pythagoras (a,b,c) + REAL*4 a + REAL*4 b + REAL*4 c END + END INTERFACE - INTEGER*4 Fact REAL*4 c WRITE (*,*) 'Factorial of 7 is ', Fact (7) - CALL Pythagoras (30, 40, c) + CALL Pythagoras (30.0, 40.0, c) WRITE (*,*) 'Hypotenuse if sides 30, 40 is ', c END diff --git a/A_fortran/Ex03/Makefile b/A_fortran/Ex03/Makefile index 107e6f9..dc9fbfc 100644 --- a/A_fortran/Ex03/Makefile +++ b/A_fortran/Ex03/Makefile @@ -1,7 +1,7 @@ all: - gfortran -c FORMAIN.FOR - gcc -c CSUBS.C - gfortran -o result.out FORMAIN.o CSUBS.o + gfortran -c -std=legacy FORMAIN.FOR + gcc -c CSUBS.c + gfortran -o result.out -std=legacy FORMAIN.o CSUBS.o rm -rf *.o From 8503557cbaa62f06645a4663ea9aecee7fd1d594 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 20:35:28 +0100 Subject: [PATCH 17/25] fixed the issue now it compiles with gcc-gfortran --- A_fortran/Ex03/readme.md | 2 ++ A_fortran/Ex03/readme.txt | 16 ---------------- 2 files changed, 2 insertions(+), 16 deletions(-) create mode 100644 A_fortran/Ex03/readme.md delete mode 100644 A_fortran/Ex03/readme.txt diff --git a/A_fortran/Ex03/readme.md b/A_fortran/Ex03/readme.md new file mode 100644 index 0000000..cc44838 --- /dev/null +++ b/A_fortran/Ex03/readme.md @@ -0,0 +1,2 @@ +source: https://msdn.microsoft.com/en-us/library/aa279034(v=vs.60).aspx + diff --git a/A_fortran/Ex03/readme.txt b/A_fortran/Ex03/readme.txt deleted file mode 100644 index ccd19ae..0000000 --- a/A_fortran/Ex03/readme.txt +++ /dev/null @@ -1,16 +0,0 @@ -source: https://msdn.microsoft.com/en-us/library/aa279034(v=vs.60).aspx - -isues: -not compiling: - - -FORMAIN.FOR:3:26: - - INTERFACE TO INTEGER*4 FUNCTION Fact [C,ALIAS:'_Fact'] (n) - 1 -Error: Syntax error: Trailing garbage in INTERFACE statement at (1) -FORMAIN.FOR:4:19: - - INTEGER*4 n [VALUE] - 1 -Fatal Error: Coarrays disabled at (1), use '-fcoarray=' to enable From 0b611d780aca56a7f0ac96fb91667c423f5673af Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 20:36:24 +0100 Subject: [PATCH 18/25] links added --- A_fortran/Ex26/readme.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 A_fortran/Ex26/readme.md diff --git a/A_fortran/Ex26/readme.md b/A_fortran/Ex26/readme.md new file mode 100644 index 0000000..a5cebdf --- /dev/null +++ b/A_fortran/Ex26/readme.md @@ -0,0 +1,3 @@ +source: https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa293328(v%3dvs.60) + +more info here: https://stackoverflow.com/questions/53585628/minimum-modification-to-make-a-visual-studio-fortran-c-mixed-code-gfortran-gcc-c From 7fc2de0529e2c7b33ff06692099841aa93481bb2 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 21:41:49 +0100 Subject: [PATCH 19/25] apt-get install fixed --- B_BLAS/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/B_BLAS/readme.md b/B_BLAS/readme.md index 0a6e0be..242e15b 100644 --- a/B_BLAS/readme.md +++ b/B_BLAS/readme.md @@ -5,7 +5,7 @@ To compile these examples you need to have any of the BLAS implementations insta 1. Use existing capabilities/repositories of your operating system: if you use these options then you can compile your C code with -lblas linker and the compiler automatically knows where to look for libblas.* (e.g. gcc foo.c -lblas) 1.1. ubuntu: on ubuntu you can install by - sudo apt-get build-essential libblas-dev + sudo apt-get install libblas-dev 1.2. mac OS X: Acceleration framework is already built in the OS just link against the frame work gcc foo.c -framework Accelerate From e991a92aadbe9ed88f6bb32ee4993db8b4cedc95 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 21:54:32 +0100 Subject: [PATCH 20/25] some folder renamed --- B_BLAS/{ibm/sample1 => Ex01}/Makefile | 4 ++-- B_BLAS/{ibm/sample1 => Ex01}/readme.txt | 5 +++++ B_BLAS/{ibm/sample1 => Ex01}/sample1.c | 0 B_BLAS/{intel => Ex02}/example1.c | 0 B_BLAS/ibm/readme.txt | 3 --- 5 files changed, 7 insertions(+), 5 deletions(-) rename B_BLAS/{ibm/sample1 => Ex01}/Makefile (78%) rename B_BLAS/{ibm/sample1 => Ex01}/readme.txt (93%) rename B_BLAS/{ibm/sample1 => Ex01}/sample1.c (100%) rename B_BLAS/{intel => Ex02}/example1.c (100%) delete mode 100644 B_BLAS/ibm/readme.txt diff --git a/B_BLAS/ibm/sample1/Makefile b/B_BLAS/Ex01/Makefile similarity index 78% rename from B_BLAS/ibm/sample1/Makefile rename to B_BLAS/Ex01/Makefile index 8d3f6a6..a18771c 100644 --- a/B_BLAS/ibm/sample1/Makefile +++ b/B_BLAS/Ex01/Makefile @@ -1,7 +1,7 @@ FLNAME = sample1. # path to your libraries if you have followed the instructions spsecific for these examples or /usr/local/... -BINDIR = ../../../common +BINDIR = ../../common NBLAS = true NGFORTRAN = true @@ -11,4 +11,4 @@ NCLAPACK = false NLAPACKE = false -include ../../../common/Makefile.inc +include ../../common/Makefile.inc diff --git a/B_BLAS/ibm/sample1/readme.txt b/B_BLAS/Ex01/readme.txt similarity index 93% rename from B_BLAS/ibm/sample1/readme.txt rename to B_BLAS/Ex01/readme.txt index e0d4bd7..8aa0041 100644 --- a/B_BLAS/ibm/sample1/readme.txt +++ b/B_BLAS/Ex01/readme.txt @@ -1,3 +1,8 @@ +on ubuntu install BLAS via + sudo apt-get install libblas-dev +and then compile with + gcc foo.c -lblas + source: https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.cbcpx01/atlasexample1.htm issues: diff --git a/B_BLAS/ibm/sample1/sample1.c b/B_BLAS/Ex01/sample1.c similarity index 100% rename from B_BLAS/ibm/sample1/sample1.c rename to B_BLAS/Ex01/sample1.c diff --git a/B_BLAS/intel/example1.c b/B_BLAS/Ex02/example1.c similarity index 100% rename from B_BLAS/intel/example1.c rename to B_BLAS/Ex02/example1.c diff --git a/B_BLAS/ibm/readme.txt b/B_BLAS/ibm/readme.txt deleted file mode 100644 index bad0b4d..0000000 --- a/B_BLAS/ibm/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -source: https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.cbcpx01/atlasexample1.htm - -needs ATLAS From c1917c5f2c20d469394de4ff68a01e3a0e926bdf Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 21:56:47 +0100 Subject: [PATCH 21/25] this is LAPACK not BLAS --- B_BLAS/Ex02/example1.c | 145 --------------------------------------- D_LAPACK/Ex02/example1.c | 76 ++++++++++++++++++++ 2 files changed, 76 insertions(+), 145 deletions(-) delete mode 100644 B_BLAS/Ex02/example1.c create mode 100644 D_LAPACK/Ex02/example1.c diff --git a/B_BLAS/Ex02/example1.c b/B_BLAS/Ex02/example1.c deleted file mode 100644 index a525f7e..0000000 --- a/B_BLAS/Ex02/example1.c +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2009-2015 Intel Corporation. All Rights Reserved. -* The information and material ("Material") provided below is owned by Intel -* Corporation or its suppliers or licensors, and title to such Material remains -* with Intel Corporation or its suppliers or licensors. The Material contains -* proprietary information of Intel or its suppliers and licensors. The Material -* is protected by worldwide copyright laws and treaty provisions. No part of -* the Material may be copied, reproduced, published, uploaded, posted, -* transmitted, or distributed in any way without Intel's prior express written -* permission. No license under any patent, copyright or other intellectual -* property rights in the Material is granted to or conferred upon you, either -* expressly, by implication, inducement, estoppel or otherwise. Any license -* under such intellectual property rights must be express and approved by Intel -* in writing. -* -******************************************************************************** -*/ -/* - ZGESV Example. - ============== - - The program computes the solution to the system of linear - equations with a square matrix A and multiple - right-hand sides B, where A is the coefficient matrix: - - ( 1.23, -5.50) ( 7.91, -5.38) ( -9.80, -4.86) ( -7.32, 7.57) - ( -2.14, -1.12) ( -9.92, -0.79) ( -9.18, -1.12) ( 1.37, 0.43) - ( -4.30, -7.10) ( -6.47, 2.52) ( -6.51, -2.67) ( -5.86, 7.38) - ( 1.27, 7.29) ( 8.90, 6.92) ( -8.82, 1.25) ( 5.41, 5.37) - - and B is the right-hand side matrix: - - ( 8.33, -7.32) ( -6.11, -3.81) - ( -6.18, -4.80) ( 0.14, -7.71) - ( -5.71, -2.80) ( 1.41, 3.40) - ( -1.60, 3.08) ( 8.54, -4.05) - - Description. - ============ - - The routine solves for X the system of linear equations A*X = B, - where A is an n-by-n matrix, the columns of matrix B are individual - right-hand sides, and the columns of X are the corresponding - solutions. - - The LU decomposition with partial pivoting and row interchanges is - used to factor A as A = P*L*U, where P is a permutation matrix, L - is unit lower triangular, and U is upper triangular. The factored - form of A is then used to solve the system of equations A*X = B. - - Example Program Results. - ======================== - - ZGESV Example Program Results - - Solution - ( -1.09, -0.18) ( 1.28, 1.21) - ( 0.97, 0.52) ( -0.22, -0.97) - ( -0.20, 0.19) ( 0.53, 1.36) - ( -0.59, 0.92) ( 2.22, -1.00) - - Details of LU factorization - ( -4.30, -7.10) ( -6.47, 2.52) ( -6.51, -2.67) ( -5.86, 7.38) - ( 0.49, 0.47) ( 12.26, -3.57) ( -7.87, -0.49) ( -0.98, 6.71) - ( 0.25, -0.15) ( -0.60, -0.37) (-11.70, -4.64) ( -1.35, 1.38) - ( -0.83, -0.32) ( 0.05, 0.58) ( 0.93, -0.50) ( 2.66, 7.86) - - Pivot indices - 3 3 3 4 -*/ -#include -#include - -/* Complex datatype */ -struct _dcomplex { - double re, im; -}; -typedef struct _dcomplex dcomplex; - -/* ZGESV prototype */ -extern void zgesv(int *n, int *nrhs, dcomplex *a, int *lda, int *ipiv, - dcomplex *b, int *ldb, int *info); -/* Auxiliary routines prototypes */ -extern void print_matrix(char *desc, int m, int n, dcomplex *a, int lda); -extern void print_int_vector(char *desc, int n, int *a); - -/* Parameters */ -#define N 4 -#define NRHS 2 -#define LDA N -#define LDB N - -/* Main program */ -int main() { - /* Locals */ - int n = N, nrhs = NRHS, lda = LDA, ldb = LDB, info; - /* Local arrays */ - int ipiv[N]; - dcomplex a[LDA * N] = { - {1.23, -5.50}, {-2.14, -1.12}, {-4.30, -7.10}, {1.27, 7.29}, - {7.91, -5.38}, {-9.92, -0.79}, {-6.47, 2.52}, {8.90, 6.92}, - {-9.80, -4.86}, {-9.18, -1.12}, {-6.51, -2.67}, {-8.82, 1.25}, - {-7.32, 7.57}, {1.37, 0.43}, {-5.86, 7.38}, {5.41, 5.37}}; - dcomplex b[LDB * NRHS] = {{8.33, -7.32}, {-6.18, -4.80}, {-5.71, -2.80}, - {-1.60, 3.08}, {-6.11, -3.81}, {0.14, -7.71}, - {1.41, 3.40}, {8.54, -4.05}}; - /* Executable statements */ - printf(" ZGESV Example Program Results\n"); - /* Solve the equations A*X = B */ - zgesv(&n, &nrhs, a, &lda, ipiv, b, &ldb, &info); - /* Check for the exact singularity */ - if (info > 0) { - printf("The diagonal element of the triangular factor of A,\n"); - printf("U(%i,%i) is zero, so that A is singular;\n", info, info); - printf("the solution could not be computed.\n"); - exit(1); - } - /* Print solution */ - print_matrix("Solution", n, nrhs, b, ldb); - /* Print details of LU factorization */ - print_matrix("Details of LU factorization", n, n, a, lda); - /* Print pivot indices */ - print_int_vector("Pivot indices", n, ipiv); - exit(0); -} /* End of ZGESV Example */ - -/* Auxiliary routine: printing a matrix */ -void print_matrix(char *desc, int m, int n, dcomplex *a, int lda) { - int i, j; - printf("\n %s\n", desc); - for (i = 0; i < m; i++) { - for (j = 0; j < n; j++) - printf(" (%6.2f,%6.2f)", a[i + j * lda].re, a[i + j * lda].im); - printf("\n"); - } -} - -/* Auxiliary routine: printing a vector of integers */ -void print_int_vector(char *desc, int n, int *a) { - int j; - printf("\n %s\n", desc); - for (j = 0; j < n; j++) - printf(" %6i", a[j]); - printf("\n"); -} diff --git a/D_LAPACK/Ex02/example1.c b/D_LAPACK/Ex02/example1.c new file mode 100644 index 0000000..ad5e8f3 --- /dev/null +++ b/D_LAPACK/Ex02/example1.c @@ -0,0 +1,76 @@ + +#include +#include + +/* Complex datatype */ +struct _dcomplex { + double re, im; +}; +typedef struct _dcomplex dcomplex; + +/* ZGESV prototype */ +extern void zgesv(int *n, int *nrhs, dcomplex *a, int *lda, int *ipiv, + dcomplex *b, int *ldb, int *info); +/* Auxiliary routines prototypes */ +extern void print_matrix(char *desc, int m, int n, dcomplex *a, int lda); +extern void print_int_vector(char *desc, int n, int *a); + +/* Parameters */ +#define N 4 +#define NRHS 2 +#define LDA N +#define LDB N + +/* Main program */ +int main() { + /* Locals */ + int n = N, nrhs = NRHS, lda = LDA, ldb = LDB, info; + /* Local arrays */ + int ipiv[N]; + dcomplex a[LDA * N] = { + {1.23, -5.50}, {-2.14, -1.12}, {-4.30, -7.10}, {1.27, 7.29}, + {7.91, -5.38}, {-9.92, -0.79}, {-6.47, 2.52}, {8.90, 6.92}, + {-9.80, -4.86}, {-9.18, -1.12}, {-6.51, -2.67}, {-8.82, 1.25}, + {-7.32, 7.57}, {1.37, 0.43}, {-5.86, 7.38}, {5.41, 5.37}}; + dcomplex b[LDB * NRHS] = {{8.33, -7.32}, {-6.18, -4.80}, {-5.71, -2.80}, + {-1.60, 3.08}, {-6.11, -3.81}, {0.14, -7.71}, + {1.41, 3.40}, {8.54, -4.05}}; + /* Executable statements */ + printf(" ZGESV Example Program Results\n"); + /* Solve the equations A*X = B */ + zgesv(&n, &nrhs, a, &lda, ipiv, b, &ldb, &info); + /* Check for the exact singularity */ + if (info > 0) { + printf("The diagonal element of the triangular factor of A,\n"); + printf("U(%i,%i) is zero, so that A is singular;\n", info, info); + printf("the solution could not be computed.\n"); + exit(1); + } + /* Print solution */ + print_matrix("Solution", n, nrhs, b, ldb); + /* Print details of LU factorization */ + print_matrix("Details of LU factorization", n, n, a, lda); + /* Print pivot indices */ + print_int_vector("Pivot indices", n, ipiv); + exit(0); +} /* End of ZGESV Example */ + +/* Auxiliary routine: printing a matrix */ +void print_matrix(char *desc, int m, int n, dcomplex *a, int lda) { + int i, j; + printf("\n %s\n", desc); + for (i = 0; i < m; i++) { + for (j = 0; j < n; j++) + printf(" (%6.2f,%6.2f)", a[i + j * lda].re, a[i + j * lda].im); + printf("\n"); + } +} + +/* Auxiliary routine: printing a vector of integers */ +void print_int_vector(char *desc, int n, int *a) { + int j; + printf("\n %s\n", desc); + for (j = 0; j < n; j++) + printf(" %6i", a[j]); + printf("\n"); +} From 4b222e0fb2764f83ec51e9db915ba030193dd375 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 21:57:05 +0100 Subject: [PATCH 22/25] Create readme.md --- D_LAPACK/Ex02/readme.md | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 D_LAPACK/Ex02/readme.md diff --git a/D_LAPACK/Ex02/readme.md b/D_LAPACK/Ex02/readme.md new file mode 100644 index 0000000..fac3abc --- /dev/null +++ b/D_LAPACK/Ex02/readme.md @@ -0,0 +1,53 @@ +/* + ZGESV Example. + ============== + + The program computes the solution to the system of linear + equations with a square matrix A and multiple + right-hand sides B, where A is the coefficient matrix: + + ( 1.23, -5.50) ( 7.91, -5.38) ( -9.80, -4.86) ( -7.32, 7.57) + ( -2.14, -1.12) ( -9.92, -0.79) ( -9.18, -1.12) ( 1.37, 0.43) + ( -4.30, -7.10) ( -6.47, 2.52) ( -6.51, -2.67) ( -5.86, 7.38) + ( 1.27, 7.29) ( 8.90, 6.92) ( -8.82, 1.25) ( 5.41, 5.37) + + and B is the right-hand side matrix: + + ( 8.33, -7.32) ( -6.11, -3.81) + ( -6.18, -4.80) ( 0.14, -7.71) + ( -5.71, -2.80) ( 1.41, 3.40) + ( -1.60, 3.08) ( 8.54, -4.05) + + Description. + ============ + + The routine solves for X the system of linear equations A*X = B, + where A is an n-by-n matrix, the columns of matrix B are individual + right-hand sides, and the columns of X are the corresponding + solutions. + + The LU decomposition with partial pivoting and row interchanges is + used to factor A as A = P*L*U, where P is a permutation matrix, L + is unit lower triangular, and U is upper triangular. The factored + form of A is then used to solve the system of equations A*X = B. + + Example Program Results. + ======================== + + ZGESV Example Program Results + + Solution + ( -1.09, -0.18) ( 1.28, 1.21) + ( 0.97, 0.52) ( -0.22, -0.97) + ( -0.20, 0.19) ( 0.53, 1.36) + ( -0.59, 0.92) ( 2.22, -1.00) + + Details of LU factorization + ( -4.30, -7.10) ( -6.47, 2.52) ( -6.51, -2.67) ( -5.86, 7.38) + ( 0.49, 0.47) ( 12.26, -3.57) ( -7.87, -0.49) ( -0.98, 6.71) + ( 0.25, -0.15) ( -0.60, -0.37) (-11.70, -4.64) ( -1.35, 1.38) + ( -0.83, -0.32) ( 0.05, 0.58) ( 0.93, -0.50) ( 2.66, 7.86) + + Pivot indices + 3 3 3 4 +*/ From 4cb6cf44fa5d8d0ed1ae00a17a808cdffcb92655 Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 22:13:32 +0100 Subject: [PATCH 23/25] folders renamed --- B_BLAS/{lindonslog/example1 => Ex02}/Makefile | 4 ++-- B_BLAS/{lindonslog/example1 => Ex02}/example1.c | 0 B_BLAS/{lindonslog/example1/readme.txt => Ex02/readme.md} | 0 B_BLAS/{ubuntuforums/example1 => Ex03}/Makefile | 0 B_BLAS/{ubuntuforums/example1 => Ex03}/example1.c | 0 B_BLAS/{ubuntuforums/example1 => Ex03}/readme.txt | 0 B_BLAS/{ubuntuforums/example2 => Ex04}/Makefile | 0 B_BLAS/{ubuntuforums/example2 => Ex04}/example2.c | 0 B_BLAS/{ubuntuforums/example2 => Ex04}/readme.txt | 0 B_BLAS/{xianyi/example2 => Ex05}/Makefile | 0 B_BLAS/{xianyi/example2 => Ex05}/readme.txt | 0 B_BLAS/Ex05/timeDGEMM.txt | 1 + B_BLAS/{xianyi/example2 => Ex05}/time_dgemm.c | 4 ++-- B_BLAS/ubuntuforums/readme.txt | 3 --- 14 files changed, 5 insertions(+), 7 deletions(-) rename B_BLAS/{lindonslog/example1 => Ex02}/Makefile (78%) rename B_BLAS/{lindonslog/example1 => Ex02}/example1.c (100%) rename B_BLAS/{lindonslog/example1/readme.txt => Ex02/readme.md} (100%) rename B_BLAS/{ubuntuforums/example1 => Ex03}/Makefile (100%) rename B_BLAS/{ubuntuforums/example1 => Ex03}/example1.c (100%) rename B_BLAS/{ubuntuforums/example1 => Ex03}/readme.txt (100%) rename B_BLAS/{ubuntuforums/example2 => Ex04}/Makefile (100%) rename B_BLAS/{ubuntuforums/example2 => Ex04}/example2.c (100%) rename B_BLAS/{ubuntuforums/example2 => Ex04}/readme.txt (100%) rename B_BLAS/{xianyi/example2 => Ex05}/Makefile (100%) rename B_BLAS/{xianyi/example2 => Ex05}/readme.txt (100%) create mode 100644 B_BLAS/Ex05/timeDGEMM.txt rename B_BLAS/{xianyi/example2 => Ex05}/time_dgemm.c (94%) delete mode 100644 B_BLAS/ubuntuforums/readme.txt diff --git a/B_BLAS/lindonslog/example1/Makefile b/B_BLAS/Ex02/Makefile similarity index 78% rename from B_BLAS/lindonslog/example1/Makefile rename to B_BLAS/Ex02/Makefile index 9b9c5b5..8b1389f 100644 --- a/B_BLAS/lindonslog/example1/Makefile +++ b/B_BLAS/Ex02/Makefile @@ -2,7 +2,7 @@ FLNAME = example1. # path to your libraries if you have followed the instructions spsecific for these examples or /usr/local/... -BINDIR = ../../../common +BINDIR = ../../common NBLAS = true NGFORTRAN = false @@ -12,4 +12,4 @@ NCLAPACK = false NLAPACKE = false -include ../../../common/Makefile.inc +include ../../common/Makefile.inc diff --git a/B_BLAS/lindonslog/example1/example1.c b/B_BLAS/Ex02/example1.c similarity index 100% rename from B_BLAS/lindonslog/example1/example1.c rename to B_BLAS/Ex02/example1.c diff --git a/B_BLAS/lindonslog/example1/readme.txt b/B_BLAS/Ex02/readme.md similarity index 100% rename from B_BLAS/lindonslog/example1/readme.txt rename to B_BLAS/Ex02/readme.md diff --git a/B_BLAS/ubuntuforums/example1/Makefile b/B_BLAS/Ex03/Makefile similarity index 100% rename from B_BLAS/ubuntuforums/example1/Makefile rename to B_BLAS/Ex03/Makefile diff --git a/B_BLAS/ubuntuforums/example1/example1.c b/B_BLAS/Ex03/example1.c similarity index 100% rename from B_BLAS/ubuntuforums/example1/example1.c rename to B_BLAS/Ex03/example1.c diff --git a/B_BLAS/ubuntuforums/example1/readme.txt b/B_BLAS/Ex03/readme.txt similarity index 100% rename from B_BLAS/ubuntuforums/example1/readme.txt rename to B_BLAS/Ex03/readme.txt diff --git a/B_BLAS/ubuntuforums/example2/Makefile b/B_BLAS/Ex04/Makefile similarity index 100% rename from B_BLAS/ubuntuforums/example2/Makefile rename to B_BLAS/Ex04/Makefile diff --git a/B_BLAS/ubuntuforums/example2/example2.c b/B_BLAS/Ex04/example2.c similarity index 100% rename from B_BLAS/ubuntuforums/example2/example2.c rename to B_BLAS/Ex04/example2.c diff --git a/B_BLAS/ubuntuforums/example2/readme.txt b/B_BLAS/Ex04/readme.txt similarity index 100% rename from B_BLAS/ubuntuforums/example2/readme.txt rename to B_BLAS/Ex04/readme.txt diff --git a/B_BLAS/xianyi/example2/Makefile b/B_BLAS/Ex05/Makefile similarity index 100% rename from B_BLAS/xianyi/example2/Makefile rename to B_BLAS/Ex05/Makefile diff --git a/B_BLAS/xianyi/example2/readme.txt b/B_BLAS/Ex05/readme.txt similarity index 100% rename from B_BLAS/xianyi/example2/readme.txt rename to B_BLAS/Ex05/readme.txt diff --git a/B_BLAS/Ex05/timeDGEMM.txt b/B_BLAS/Ex05/timeDGEMM.txt new file mode 100644 index 0000000..2873b84 --- /dev/null +++ b/B_BLAS/Ex05/timeDGEMM.txt @@ -0,0 +1 @@ +10x5x3 0.000022 s 13.636364 MFLOPS diff --git a/B_BLAS/xianyi/example2/time_dgemm.c b/B_BLAS/Ex05/time_dgemm.c similarity index 94% rename from B_BLAS/xianyi/example2/time_dgemm.c rename to B_BLAS/Ex05/time_dgemm.c index 442c007..79370b0 100644 --- a/B_BLAS/xianyi/example2/time_dgemm.c +++ b/B_BLAS/Ex05/time_dgemm.c @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) int i; printf("test!\n"); if(argc<4){ - printf("Input Error\n"); + printf("Input Error. you need at least 3 integer arguments for the executable\n"); return 1; } @@ -61,4 +61,4 @@ int main(int argc, char* argv[]) free(B); free(C); return 0; -} \ No newline at end of file +} diff --git a/B_BLAS/ubuntuforums/readme.txt b/B_BLAS/ubuntuforums/readme.txt deleted file mode 100644 index 2f77d88..0000000 --- a/B_BLAS/ubuntuforums/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -source: https://ubuntuforums.org/showthread.php?t=1740797 - -ddot is the dot product of two vectors/arrays From a5af85a46da0cceed48a02f7a8e905ab997e83fa Mon Sep 17 00:00:00 2001 From: Foad Sojoodi Farimani Date: Mon, 3 Dec 2018 22:25:21 +0100 Subject: [PATCH 24/25] Update readme.md --- B_BLAS/readme.md | 66 ++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/B_BLAS/readme.md b/B_BLAS/readme.md index 242e15b..8a0b5d7 100644 --- a/B_BLAS/readme.md +++ b/B_BLAS/readme.md @@ -1,45 +1,55 @@ -BLAS is not a library but an API, specification or interface which gives you the ability to use specific functions for linear algebra, including vector-vector, vector-matrix and matrix-matrix operations. There are several implementations of BLAS including the original Netlib BLAS (formerly BellLabs), OpenBLAS/GotoBLAS2, ATLAS, GSL, ... - - -To compile these examples you need to have any of the BLAS implementations installed. to do this you have several possibilities: -1. Use existing capabilities/repositories of your operating system: if you use these options then you can compile your C code with -lblas linker and the compiler automatically knows where to look for libblas.* (e.g. gcc foo.c -lblas) - 1.1. ubuntu: on ubuntu you can install by +There are several implementations of BLAS including the original Netlib BLAS (formerly BellLabs), OpenBLAS/GotoBLAS2, ATLAS, GSL, ... To compile these examples you need to have any of those installed. To do this you have several possibilities: + 1. Use existing capabilities/repositories of your operating system: if you use these options then you can compile your C code with `-lblas` linker and the compiler automatically knows where to look for libblas.* (e.g. gcc foo.c -lblas) + 1.1. ubuntu: on ubuntu you can install by `sudo apt-get install libblas-dev` + 1.2. mac OS X: Acceleration framework is already built in the OS just link against the frame work `gcc foo.c -framework Accelerate` or `gcc foo.c -lblas` + 2. compile the Netlib BLAS yourself: + 2.1. compile a C code if you have followed this option: following this option you will have a static library `libblas.a` or `librefblas.a` which is an archived collection of object files *.o compiled from Netlib BLAS fortran subroutines. When we want to compile a C code which want to call one of those routines, we also need to link to the gfortran library `libgfortran.*` or use gfortran to compile the object files so I will put two make files here: - sudo apt-get install libblas-dev - - 1.2. mac OS X: Acceleration framework is already built in the OS just link against the frame work - gcc foo.c -framework Accelerate - or - gcc foo.c -lblas - - -2. compile the Netlib BLAS yourself: - 2.1. compile a C code if you have followed this option: - following this option you will have a static library libblas.a or librefblas.a which is an archived collection of object files *.o compiled from Netlib BLAS fortran subroutines. when we want to compile a C code which want to call one of those routines, we also need to link to the gfortran library libgfortran.* or use gfortran to compile the object files so I will put two make files here: + ``` all: gcc -c foo.c gcc -o bar.out foo.o -L path/to/libgfortran.*/ -lgfortran -L path/to/libblas.a -lblas + ``` + or alternatively compile the code directly with gfortran: + + ``` all: gcc -c foo.c gfortran -o bar.out foo.o -L path/to/libblas.a -lblas + ``` + or + + ``` all: gcc foo.c bar.out -L path/to/libgfortran.*/ -lgfortran -L path/to/libblas.a -lblas - 2.2. compile: - 2.2.1. compile using the unix bash script provided for you in the BZ_common folder. this will provide you with a libblas.a file inside the BZ_common/bin/lib which you can link against later - 2.2.2. compile it your self: - a. download the latest from netlib: http://www.netlib.org/blas/ - b. unarchive - c. run make from terminal - d. rename the blas_LINUX.a to libblas.a - e. if you want your compiler to know automatically where to look for the library copy the libblas.a file after to a folder you know. (e.g. /usr/local/lib/) - d. compile your C code linking against this folder + ``` + + 2.2. compile: + + 2.2.1. compile using the unix bash script provided for you in the BZ_common folder. this will provide you with a libblas.a file inside the BZ_common/bin/lib which you can link against later + + 2.2.2. compile it your self: + a. download the latest from netlib: http://www.netlib.org/blas/ + + b. unarchive + + c. run make from terminal + + d. rename the blas_LINUX.a to libblas.a + + e. if you want your compiler to know automatically where to look for the library copy the libblas.a file after to a folder you know. (e.g. /usr/local/lib/) + + d. compile your C code linking against this folder compiler bla...bla -L your/folder/ -lblas - -3. install it with other libraries + + 3. install it with other libraries + 3.1. install it with ATLAS + 3.2. install it with openblas? + 3.3. install it with LAPACK useful notes: From 403bf5d5855cf4c620f1123c8b8396505f32f3fc Mon Sep 17 00:00:00 2001 From: "F. S. Farimani" Date: Fri, 5 Feb 2021 14:51:21 -1000 Subject: [PATCH 25/25] small edits --- A_fortran/Ex01/README.md | 22 +++++++++++----------- README.md | 3 ++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/A_fortran/Ex01/README.md b/A_fortran/Ex01/README.md index e625b59..0d09623 100644 --- a/A_fortran/Ex01/README.md +++ b/A_fortran/Ex01/README.md @@ -1,5 +1,5 @@ # Abstract: -This example shows how we can call a C function from FORTRAN and how to pass a string properly from Fortran to C. The code is written in legacy FORTRAN 77 standard. +This example shows how we can call a C function from FORTRAN and how to pass a string back to C in a proper way. The code is written in legacy FORTRAN 77 standard. # Source: http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html @@ -12,20 +12,20 @@ This example shows how we can call a C function from FORTRAN and how to pass a s in C: ```c - extern struct { - int i; - char c; - ... - } mystruct_; +extern struct { + int i; + char c; + ... +} mystruct_; ``` in FORTRAN ```fortran - integer i - character c - ... - common/mystruct/ i, c, ... +integer i +character c +... +common/mystruct/ i, c, ... ``` where the attributes can be accesed via `.att` convention. Except `common` defines only one instance of the struct globally. It just groups the attributes and make them global. It can be request like struct though. @@ -47,7 +47,7 @@ where the attributes can be accesed via `.att` convention. Except `common` defin 1. in FORTRAN 77 and Fortran 90 (?) one can use the `write` command to print to terminal: ```fortran - write (, (, , ...)) var_1, var_2, ... +write (, (, , ...)) var_1, var_2, ... ``` where `` specifies the output (terminals, files ...). One can put `6` for the standard terminal or `*` for the default output (which should be also the stardard terminal). The `` specfies how each variable should be printed depending to their data type. If `*` then the default formating will be used. More formating options for integers `Iw`, reals `Fw.d` and strings `Aw` can be found. Alternatively one can put a line lable instead and then specifiy the format for mutiple `write`/`print` commands: diff --git a/README.md b/README.md index d03cf79..a3c207b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Description: -While ago, when I started doing some linear algebra in C, it came to me as a surprise to see there are so few tutorials for BLAS, LAPACK and other fundamental APIs. Despite the fact that they are somehow the building blocks of many other libraries. For that reason I started collecting all the examples I could find all over the net for BLAS, LAPACK, CLAPACK, LAPACKE, ATLAS, OpenBLAS ... in this Github repo. Well, I should warn you that as a mechanical engineer I have little experience in managing such a repo and it might firstly seems as a complete mess to you guys. However if you manage to get over the mess you will find all kind of examples and instructions which might be help. I have tried the most and the ones does not compile I have mentioned. I have modified many of them to be compilable with GNU compilers (gcc, g++ and gfortran). I have made make files which you can read to learn how you can call individual fortran routines in a C or C++ program. I have also put some installations instructions for mac and linux (sorry windows guys!). I want to make sure if you are a C developer you can use any of these libraries without any problems regardless of your platform or hardware + +When I started doing some linear algebra in C, it came to me as a surprise to see there are so few tutorials for BLAS, LAPACK, and other fundamental APIs. Even though they are somehow the building blocks of many other libraries. So, I started collecting all the examples I could find all over the internet for BLAS, LAPACK, CLAPACK, LAPACKE, ATLAS, OpenBLAS ... in this Github repo. Well, I should warn you that as a mechanical engineer, I have little experience managing such a repo, and it might first seem a complete mess to you guys. However, if you manage to get over the mess, you will find all kinds of examples and instructions that might help. I have tried the most, and the ones that do not compile I have mentioned. I have modified many of them to be compilable with GNU compilers (`gcc`, `g++`, and `gfortran`). I have made `MakeFile`s, which you can read to learn how you can call individual FORTRAN routines in a C or C++ program. I have also put some installation instructions for macOS and Linux (sorry, windows guys!). I want to make sure if you are a C developer, you can use any of these libraries without any problems, regardless of your platform or hardware.