On 24. juli 2013 16:07, Jens Havskov wrote:
> 
> it would be nice if some seisan user knew more c than me and was able to
> fix these compilation problems.
> 
> jens
> 
>> On Wed, 24 Jul 2013, Branden Christensen wrote:
>>>
>>>
>>> Many of the Google forums I am reading suggest that we are missing
>>> "#include <stdlib.h>" (/usr/include/stdlib.h).
>>>
>>>
>>> Kind Regards,
>>> Branden Christensen [email protected] Volcan, Panama

There is an missing #include <stdlib.h>, see attached patch for
suggested changes. This also removes an obsolete definition of SWAP.

To fix the compile error (with -fbounds-check) tdmt_invc_seisan.c must
be linked to gfortran (probably since seisan.a is fortran and includes
libgfortran functions because of the -fbounds-check). Add -lgfortran to
the corresponding SEISARCH line in PRO/Makefile. A -L option with the
path to the gfortran libraries may be required.

Regards, Gaute
>From 694b1eba1ed673cc06b4078263808369683cd145 Mon Sep 17 00:00:00 2001
From: Gaute Hope <[email protected]>
Date: Wed, 24 Jul 2013 18:29:52 +0200
Subject: [PATCH] Remove compile time warnings from tdmt_invc_seisan.c

---
 INC/tdmt_invb.h        | 2 ++
 PRO/tdmt_invc_seisan.c | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/INC/tdmt_invb.h b/INC/tdmt_invb.h
index ddbc75f..ee6c252 100644
--- a/INC/tdmt_invb.h
+++ b/INC/tdmt_invb.h
@@ -1,11 +1,13 @@
 /* apr 27 2012 jh  comment out malloc.h, not found on mac, not needed */
 #include <math.h>
 /* #include <malloc.h> */
+#include <stdlib.h>
 #include <stdio.h>
 #include <sys/file.h>
 #include <string.h>
 #define ABS(x) ((x) < 0.0 ? -1.0*(x) : (x))
 #define PI 3.1415927
+#define SWAP(a,b) {double temp=(a);(a)=(b);(b)=temp;}
 
 struct MOMENT
  {
diff --git a/PRO/tdmt_invc_seisan.c b/PRO/tdmt_invc_seisan.c
index c982ee4..6757ae2 100644
--- a/PRO/tdmt_invc_seisan.c
+++ b/PRO/tdmt_invc_seisan.c
@@ -14,6 +14,7 @@
 /* apr 27 2012 pv : change depth to float         */
 
 #include"tdmt_invb.h"
+#include "nrutil.h"
 
  void gaussj();
  int correlate(),fclose();
@@ -397,7 +398,6 @@ fprintf(stderr,"Quality=%d\n",QUAL);
 precision */
 
 #include<stdio.h>
-#define SWAP(a,b) {double temp=(a);(a)=(b);(b)=temp;}
 void gaussj();
 double **dsubmatrix();
 
@@ -1069,7 +1069,6 @@ void correl(float data1[], float data2[], unsigned long n, float ans[])
 }
 #undef NRANSI
 #include <math.h>
-#define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr
 
 void four1(float data[], unsigned long nn, int isign)
 {
-- 
1.8.3.3

_______________________________________________
seisan mailing list
[email protected]
http://mailman.uib.no/listinfo/seisan

Reply via email to