diff -u ccx_2.18/src.orig/CalculiX.h ccx_2.18/src/CalculiX.h
--- ccx_2.18/src.orig/CalculiX.h	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/CalculiX.h	2022-07-04 22:20:32.000000000 -0500
@@ -320,6 +320,10 @@
 			    ITG *irows,ITG *ndesi,ITG *nodedesi,double *corrlen,
 			    double *randomval,ITG *irobustdesign));
 
+void FORTRAN(auglag_inclusion ,(int conttype, double *gcontfull, int nacti,
+            int ncdim, double mufric, double atol, double rtol, double *pkvec,
+            int kitermax, double timek ));
+
 void FORTRAN(basis,(double *x,double *y,double *z,double *xo,double *yo,
                     double *zo,ITG *nx,ITG *ny,ITG *nz,double *planfa,
                     ITG *ifatet,ITG *nktet,ITG *netet,double *field,
@@ -901,7 +905,7 @@
 void FORTRAN(checktruecontact,(ITG *ntie,char *tieset,double *tietol,
              double *elcon,ITG *itruecontact,ITG *ncmat_,ITG *ntmat_));
 
-void FORTRAN(clonesensitivies,(ITG *nobject,ITG *nk,char *objectset,
+void FORTRAN(clonesensitivities,(ITG *nobject,ITG *nk,char *objectset,
 			       double *g0,double *dgdxglob));
 
 void FORTRAN(closefile,());
@@ -1391,6 +1395,11 @@
 				ITG *jqib,double *g,ITG *icolbb,ITG *nactdof,
 				double *qtmp));
 
+void FORTRAN(detectactivecont2,(double *gapnorm, double *gapdof,
+                double *auw, int *iroww, int *jqw,
+                int neqtot, int nslavs, double *springarea,
+                int *iacti, int nacti));
+
 void FORTRAN(determineextern,(ITG *ifac,ITG *itetfa,ITG *iedg,ITG *ipoed,
                               ITG *iexternedg,ITG *iexternfa,ITG *iexternnode,
                               ITG *nktet_,ITG *ipofa));
@@ -4674,6 +4683,8 @@
                       ITG *newsize,ITG *ifatet,ITG *itetfa,ITG *iedg,
                       ITG *ieled));
 
+void FORTRAN(relaxval_al, (double *gcontfull, int nacti, int ncdim));
+
 void remastruct(ITG *ipompc,double **coefmpcp,ITG **nodempcp,ITG *nmpc,
 		ITG *mpcfree,ITG *nodeboun,ITG *ndirboun,ITG *nboun,
 		ITG *ikmpc,ITG *ilmpc,ITG *ikboun,ITG *ilboun,
@@ -6020,6 +6031,12 @@
 
 void utempread(double *t1,ITG *istep,char *jobnamec);
 
+double v_betrag(double *a);
+
+void v_prod( double *A, double *B, double *C );
+
+void v_result( const double *A, const double *B, double *C );
+
 void FORTRAN(varsmooth,(double *aub,double *adl,
 			     double *sol,double *aux,ITG *irow,
 			     ITG *jq,ITG *neqa,ITG *neqb,double *alpha));
diff -u ccx_2.18/src.orig/Makefile ccx_2.18/src/Makefile
--- ccx_2.18/src.orig/Makefile	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/Makefile		2022-07-04 22:11:08.000000000 -0500
@@ -1,9 +1,10 @@
 
-CFLAGS = -Wall -O2  -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT
-FFLAGS = -Wall -O2
+CFLAGS += -Wall -O2 -pthread @@CFLAGS@@ -I../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT=1 -DBLAS_LIBRARIES=vecLibFort -DLAPACK_LIBRARIES=vecLibFort
+FFLAGS += -Wall -O2 @@FFLAGS@@
+LDFLAGS +=
 
-CC=cc
-FC=gfortran
+CC=@@CC@@
+FC=@@FC@@
 
 .c.o :
 	$(CC) $(CFLAGS) -c $<
@@ -18,14 +18,14 @@
 OCCXC = $(SCCXC:.c=.o)
 OCCXMAIN = $(SCCXMAIN:.c=.o)
 
-DIR=../../../SPOOLES.2.2
+DIR=../../SPOOLES.2.2
 
 LIBS = \
        $(DIR)/spooles.a \
-	../../../ARPACK/libarpack_INTEL.a \
-       -lpthread -lm -lc
+       -larpack -lvecLibFort \
+       -lpthread
 
-ccx_2.18: $(OCCXMAIN) ccx_2.18.a  $(LIBS)
-	./date.pl; $(CC) $(CFLAGS) -c ccx_2.18.c; $(FC)  -Wall -O2 -o $@ $(OCCXMAIN) ccx_2.18.a $(LIBS) -fopenmp
+ccx_2.18: $(OCCXMAIN) ccx_2.18.a 
+	./date.pl; $(CC) $(CFLAGS) -c ccx_2.18.c; $(FC)  -Wall -O2 -o $@ $(OCCXMAIN) ccx_2.18.a $(LDFLAGS) $(LIBS) -fopenmp
 
 ccx_2.18.a: $(OCCXF) $(OCCXC)
diff -u ccx_2.18/src.orig/cubtri.f ccx_2.18/src/cubtri.f
--- ccx_2.18/src.orig/cubtri.f	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/cubtri.f		2022-07-04 22:22:12.000000000 -0500
@@ -77,7 +77,7 @@
      &  mw,nfe
       REAL*8 ALFA, ANS, ANSKP, AREA, EPS, ERR, ERRMAX, H, Q1, Q2, R1,R2,
      * RDATA(1), D(2,4), S(4), T(2,3), VEC(2,3), W(6,NW), X(2),zero,
-     & point5,one,rnderr
+     & point5,one,F,rnderr
 C       ACTUAL DIMENSION OF W IS (6,NW/6)
 C
       REAL*8 TANS, TERR, DZERO
diff -u ccx_2.18/src.orig/date.pl ccx_2.18/src/date.pl
--- ccx_2.18/src.orig/date.pl	2022-07-04 21:40:23.000000000 -0500
+++ ccx_2.18/src/date.pl	2022-07-04 22:23:34.000000000 -0500
@@ -13,7 +13,7 @@
 
 # inserting the date into ccx_2.18step.c
 
-@ARGV="ccx_2.18step.c";
+@ARGV="CalculiXstep.c";
 $^I=".old";
 while(<>){
     s/You are using an executable made on.*/You are using an executable made on $date\\n");/g;
@@ -30,5 +30,5 @@
 }
 
 system "rm -f ccx_2.18.c.old";
-system "rm -f ccx_2.18step.c.old";
+system "rm -f CalculiXstep.c.old";
 system "rm -f frd.c.old";
diff -u ccx_2.18/src.orig/premortar.c ccx_2.18/src/premortar.c
--- ccx_2.18/src.orig/premortar.c	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/premortar.c	2022-07-04 22:24:43.000000000 -0500
@@ -19,6 +19,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include <time.h>
+#include <string.h>
 #include "CalculiX.h"
 #include "mortar.h"
 
diff -u ccx_2.18/src.orig/resultsmech_us3.f ccx_2.18/src/resultsmech_us3.f
--- ccx_2.18/src.orig/resultsmech_us3.f	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/resultsmech_us3.f	2022-07-04 22:26:22.000000000 -0500
@@ -461,7 +461,7 @@
      &     ihyper,istiff,elconloc,eth,kode,plicon,
      &     nplicon,plkcon,nplkcon,npmat_,
      &     plconloc,mi(1),dtime,k,
-     &     xstiff,alcon)
+     &     xstiff,ncmat_)
           e     = elas(1)
           un    = elas(2)
           rho   = rhcon(1,1,imat)        
diff -u ccx_2.18/src.orig/sensi_coor.c ccx_2.18/src/sensi_coor.c
--- ccx_2.18/src.orig/sensi_coor.c	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/sensi_coor.c	2022-07-04 22:27:21.000000000 -0500
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <math.h>
 #include <stdlib.h>
+#include <string.h>
 #include "CalculiX.h"
 
 void sensi_coor(double *co,ITG *nk,ITG **konp,ITG **ipkonp,char **lakonp,
diff -u ccx_2.18/src.orig/sensi_orien.c ccx_2.18/src/sensi_orien.c
--- ccx_2.18/src.orig/sensi_orien.c	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/sensi_orien.c	2022-07-04 22:28:25.000000000 -0500
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <math.h>
 #include <stdlib.h>
+#include <string.h>
 #include "CalculiX.h"
 
 void sensi_orien(double *co,ITG *nk,ITG **konp,ITG **ipkonp,char **lakonp,
diff -u ccx_2.18/src.orig/us4_sub.f ccx_2.18/src/us4_sub.f
--- ccx_2.18/src.orig/us4_sub.f	2022-07-04 21:40:22.000000000 -0500
+++ ccx_2.18/src/us4_sub.f	2022-07-04 22:30:52.000000000 -0500
@@ -454,7 +454,7 @@
       REAL*8, INTENT(IN)  :: X(4,3),rho,h             
       REAL*8, INTENT(OUT) :: M(24,24) 
       REAL*8 :: ri,si,Nrs(4),dNr(4),dNs(4),Jm(2,2)
-      REAL*8 :: invJm,detJm,detinvJm,dNx(4),dNy(4),q1
+      REAL*8 :: invJm(2,2),detJm,detinvJm,dNx(4),dNy(4),q1
       REAL*8 :: m_3t(6,6), N_u(6,24),g_p(4,3)
       INTEGER :: k,j
       !
--- ccx_2.18/src.orig/CalculiXstep.c	2022-07-24 20:42:02.000000000 -0500
+++ ccx_2.18/src/CalculiXstep.c	2022-07-24 20:48:29.000000000 -0500
@@ -261,7 +261,7 @@
    
     clock_gettime(CLOCK_MONOTONIC, &totalCalculixTimeStart);
 
-    if(argc==1){printf("Usage: CalculiX.exe -i jobname\n");FORTRAN(stop,());}
+    if(argc==1){printf("Usage: ccx -i jobname\n");FORTRAN(stop,());}
     else{
       for(i=1;i<argc;i++){
 	if(strcmp1(argv[i],"-i")==0) {
diff -ur ccx_2.18/src.orig/ccx_2.18.c ccx_2.18/src/ccx_2.18.c
--- ccx_2.18/src.orig/ccx_2.18.c	2022-07-24 20:42:02.000000000 -0500
+++ ccx_2.18/src/ccx_2.18.c	2022-07-24 20:50:03.000000000 -0500
@@ -115,7 +115,7 @@
 
   clock_gettime(CLOCK_MONOTONIC, &totalCalculixTimeStart);
 
-  if(argc==1){printf("Usage: CalculiX.exe -i jobname\n");FORTRAN(stop,());}
+  if(argc==1){printf("Usage: ccx -i jobname\n");FORTRAN(stop,());}
   else{
     for(i=1;i<argc;i++){
       if(strcmp1(argv[i],"-i")==0){
