$ ./testgslrun
This should print:
$ J0(5) = -1.775967713143382900e-001
Done!! Happy Computing.
#C #GNU #GSL #computing #programming
Random thoughts punctuated with periods of silence. Opinions, comments, and expressions are personal and should not be associated with my employer.
$ ./testgslrun
This should print:
$ J0(5) = -1.775967713143382900e-001
Done!! Happy Computing.
#C #GNU #GSL #computing #programming
I often find that students are struggling to install a compiler for C and GNU Scientific Library (GSL) on their MS Windows machines. Sometimes Windows can behave weirdly while you try to install these tools. This happens mostly when you have installed and uninstalled lots of programs and packages.
Here is a step-by-step guide to install 1) a compiler for C and 2) GSL on your Windows machine.
Installation of MinGW on Windows 10
1. MinGW is a native Windows port of the GNU Compiler Collection (GCC). Download the MinGW installer from SourceForge:
https://sourceforge.net/projects/mingw/
2. Run the installer and follow the instructions on the screen.
3. The installer will install the MinGW installation manager. This is used for installing MinGW and to uninstall MinGW.
4. Run the installation manager. To start with we will install the basic setup.
Select basic setup on the left-hand pane.
On the righthand pane for the package list, select each package one by one and mark those for installation (Right-click > Mark for Installation).
Once all the packages are marked, install those: Installation > Apply Changes
5. Installation may take some time. Note that apart from MinGW, this process will also install MSYS. MSYS is a bash shell that we will use while compiling and running C codes.
6. On successful installation you may have the following directory structure:
C:\MinGW
Within this folder, you will find the MSYS subfolder. Find the msys.bat file. For example, this may be at: C:\MinGW\msys\1.0\msys.bat
Run this batch file (double-click) to get the bash shell. You can create a shortcut for this batch file and keep it at a suitable location, like the desktop.
7. Check MinGW installation by running a simple C code. For example, here is a
code named as test.c
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return 0;
}
8. To compile the code, you have to be in the folder with the code. Use cd to reach the appropriate folder. Note that we are now working in Bash shell (not in the Windows default command prompt). Therefore, in the pathname, we have to use / in place of \
9. Compile the code:
$ gcc test.c -o testrun
10. Run the code
$ ./testrun
If everything works fine, the program will print:
$ Hello, world!
Installation of GSL on Windows 10
1. You must install MinGW with MSYS before installing GSL.
2. Download GSL:
https://www.gnu.org/software/gsl/
3. Place the downloaded compressed file (named like: gsl-latest.tar.gz) in the MinGW folder.
4. Start MSYS. We will now use MSYS for all the subsequent work.
5. cd to the appropriate folder and extract the files:
$ tar xzf gsl-latest.tar.gz
6. The files will be placed in a newly created folder, for example, gsl-2.6
7. Move to that newly created folder:
$ cd gsl-2.6
8. Configure, make, and install GSL:
$ ./configure
$ make
$ make install
Each of these steps takes some time. Wait for the completion of each step before executing the next.
9. Upon completion of installation you should find the GSL lib and include folders inside msys folder. For example:
C:\MinGW\msys\1.0\local\include
C:\MinGW\msys\1.0\local\lib
10. Compile and run a C code that uses GSL. Again, we will use MSYS to compile and run the code. For example, here is the code for testgsl.c:
#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>
int
main (void)
{
double x = 5.0;
double y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n", x, y);
return 0;
}
11. To compile:
$ gcc -I/usr/local/include -L/usr/local/lib testgsl.c -lgsl -o testgslrun
(Note that depending upon how MinGW and GSL have been installed, we may not have to include -I/usr/local/include -L/usr/local/lib in the command for compilation.)
12. Run the compiled code:
$ ./testgslrun
This should print:
$ J0(5) = -1.775967713143382900e-001
Done!! Happy Computing.
#C #programming #GSL #computing #compiler #gcc
oomfies solve this pic.twitter.com/0RO5zTJjKk— #em 𖤐 (@jik99k) July 28, 2019

Once a reviewer of one of our papers wrote that she/he did not understand our mathematical model. That's a honest submission. No one expect that every one will understand everything. But had not that affected the decision made on our paper? May be. May be not.
But every reviewer faces this problem. As science is getting more and more interdisciplinary, one often find some part of the paper bit difficult to understand and review. I am not talking of complete ignorance. Neither talking of a badly written paper. Am talking of a situation where you broadly understand the concepts and issues, but lacks clarity on particulars in that paper. The best option then is to ask the authors to explain and help you understand their paper better.
Once you have understood the paper, with clarity, then only you can make a rational judgment on the paper. Isn't that obvious? But not in practise. Journals does not allow you to post queries or make comments on a manuscript without making a judgment out of three choices: minor revision, major revision, or reject.
There is no scope of a dialogue, albeit with anonymity, between the people who did the science and those who did the vetting. Yes, there exist the practise of post-review rebuttal. But that's only after the reviewer has made the decision.
The purpose of publishing scientific papers has changed with time. So has changed the practise and culture of peer-review. Journal editors complain of shortage in serious reviewers, authors complain of lackluster reviews, reviewers complain of lack of professional incentive in reviewing papers.
Even then, there are people who review each others papers and do that with all earnest. They still believe in the elementary purpose of peer-review of a scientific paper: to improve the manuscript and to improve the work reported there.
Won't it be wiser to help this lot scientists to do the job better? One step towards better review would be to provide a fourth option to a reviewer. Let the reviewers post questions or start a thread of discussion with the authors, before they decide on the manuscript.
Obviously, such interactions would be considered as part of the review documents and has to bounded by a specific duration. It would also be bounded by all legal and ethical guidelines of peer-review.
Am not sure, how many of my peers will use this option. But letting some use it judiciously, wont harm science, but make it better.

batch_script.bat
:: -The script automates sequential repeated run of same Matlab code. :: -The user should enter the location of the parent folder which contains the Sub models :: -The user should enter the location of matlab.exe file :: -Every event is recorded in a LogFile.txt in the parent directory :: -The scripts does the following job :: 1.Creates a text file holding the name of the sub folders present in the parent directory :: 2.Executes each sub folder by invoking the main function (Main.m) :: 3. If the function is not found, the error message is recorded and the loop continues with the next sub folder. :: 4.If matlab throws any error, the error message is recorded and the loop continues with the next sub folder ::------------------------------------------------------------------------------------------------------------------------- ::Enter the location of the Model set ModelDir=D:\Dropbox\modeling_tool\MATLAB_vimal\ODEmodeling\ODE1 ::Enter the location of the Matlab.exe file set MatlabDir=C:\matlab\bin\matlab.exe ::------------------------------------------------------------------------------------------------------------------------- ::Do not make any changes in the code below ::------------------------------------------------------------------------------------------------------------------------- cd %ModelDir% Echo Start time is %date%_%time%>LogFile.txt ::Lists the folders in the current directory and writes them in a text file dir /A:D /O:N /B>List.txt setlocal enableextensions enabledelayedexpansion Echo off ::Counts the number of lines in the text file for /F %%A in ('type "List.txt"^|find "" /V /C') do ( set /A count=%%A ) set /A num=1 ::Executes the matlab code present in each sub folder for /F "tokens=*" %%A in (List.txt) do ( Echo.>>%ModelDir%\LogFile.txt Echo Executing !num!-%%A of %count% cd %ModelDir%\%%A IF EXIST ErrorFile.txt ( del ErrorFile.txt ) IF EXIST %ModelDir%\%%A\Main.m ( "%MatlabDir%" -nodisplay -nosplash -nodesktop -wait -r "run('Main.m');exit;" IF EXIST %ModelDir%\%%A\ErrorFile.txt ( Echo %%A is not executed>>%ModelDir%\LogFile.txt Echo WARNING. Matlab has logged an error file in the location %ModelDir%\%%A>>%ModelDir%\LogFile.txt ) IF NOT EXIST %ModelDir%\%%A\ErrorFile.txt ( Echo %%A is executed successfully>>%ModelDir%\LogFile.txt ) ) IF NOT EXIST %ModelDir%\%%A\Main.m ( Echo %%A is not executed>>%ModelDir%\LogFile.txt Echo WARNING. Main function is not found in the location %ModelDir%\%%A>>%ModelDir%\LogFile.txt ) set /A num+=1 cd %ModelDir% ) endlocal Echo.>>%ModelDir%\LogFile.txt Echo End time is %date%_%time%>>LogFile.txt ::Deletes the List.txt file del List.txt Echo on