--- NX-2.2-B09/install/installnx.pl.orig	2020-03-06 12:35:13.000000000 +0100
+++ NX-2.2-B09/install/installnx.pl	2021-06-08 07:41:44.615480573 +0200
@@ -22,7 +22,7 @@
 
 # 1) Select compiler
   #$comp = "ifort"; 
-  $comp = "gfortran"; 
+  $comp = "$ARGV[0]"; 
 
 # 2) Choose the BLAS/LAPACK variables (_OD will be used for cioverlap_od only)
   if($comp eq "ifort"){
@@ -44,8 +44,8 @@
   }
 
 # 3) Choose GSL paths:
-  $idgsl="/usr/include/gsl";              # Headers
-  $ldgsl="/usr/lib";                      # Libraries
+  $idgsl="$ARGV[1]/include/gsl";              # Headers
+  $ldgsl="$ARGV[1]/lib";                      # Libraries
 
 # 4) If necessary (usually it isn't), change the flags for the selected compiler (_OD will be used for cioverlap_od only) 
   if ($comp eq "ifort"){
@@ -98,13 +98,14 @@
 #================================================================
 #
 sub create_dir{
-  print STDOUT "\n Please enter directory for the NEWTON-X installation \n ";
-  $_ = <STDIN>;
-  chomp;$_ =~ s/^\s*//;$_ =~ s/\s*$//;
-  $instd = $_;
+  #print STDOUT "\n Please enter directory for the NEWTON-X installation \n ";
+  #$_ = <STDIN>;
+  #chomp;$_ =~ s/^\s*//;$_ =~ s/\s*$//;
+  $instd = $ARGV[2];
 
   if  (!-s $instd){
-    $create_d=simple_question("\n This directory seems not to exist - create it? (y/n) ","y");
+    #$create_d=simple_question("\n This directory seems not to exist - create it? (y/n) ","y");
+    $create_d = "y";
     if ($create_d eq "y"){
       system("mkdir -p $instd");
       if  (-s $instd){
@@ -140,7 +141,7 @@
   print STDOUT "    [4] Time-dependent overlaps I (CIOVERLAP)\n";
   print STDOUT "    [5] Time-dependent overlaps II (CIOVERLAP_OD)\n";
   print STDOUT " Enter comma separated list or dash separated range (<ENTER> for default): ";
-  $_=<STDIN>;
+  $_=$ARGV[3];
   chomp;$_ =~ s/^\s*//;$_ =~ s/\s*$//;
   @list=make_num_sequence($_);
   if (($_ eq "") or ($_ eq "0")){
@@ -358,12 +359,12 @@
 #
 sub copy_nx{
   print_STDOUT(" Copying files  ");
-  copyfiles("$original_dir/../","source",$instd,1);
-  copyfiles("$original_dir/../","docs",$instd,1);
-  copyfiles("$original_dir/../","test-nx",$instd,1);
-  copyfiles("$original_dir/../","batch",$instd,1);
-  copyfiles("$original_dir/../","install",$instd,1);
-  copyfiles("$original_dir/../","README.install",$instd,1);
+  copyfiles("$original_dir/NX-2.2-B09/","source",$instd,1);
+  copyfiles("$original_dir/NX-2.2-B09/","docs",$instd,1);
+  copyfiles("$original_dir/NX-2.2-B09/","test-nx",$instd,1);
+  copyfiles("$original_dir/NX-2.2-B09/","batch",$instd,1);
+  copyfiles("$original_dir/NX-2.2-B09/","install",$instd,1);
+  copyfiles("$original_dir/NX-2.2-B09/","README.install",$instd,1);
 # Create bin directory
   if (!-e $bin){
     system("mkdir $bin");
