Commit afe6f6d4 authored by François Trigaux's avatar François Trigaux 🤠
Browse files

compilation as library enabled

parent eef47698
obj/* obj/*
!obj/.gitkeep
bin/* bin/*
!bin/.gitkeep
run/gebt* run/gebt*
run/output* run/output*
test.sh test.sh
.DS_Store .DS_Store
lib/*.
!lib/.gitkeep
run/
include/*
!include/.gitkeep
\ No newline at end of file
...@@ -2,18 +2,19 @@ CC=gcc ...@@ -2,18 +2,19 @@ CC=gcc
CF=gfortran CF=gfortran
LD=gcc LD=gcc
LIBS=-lgfortran -lreadinifile LIBS=-lgfortran -lreadinifile
CFLAGS=-g CFLAGS=-g -fPIC
F90FLAGS=-g -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan F90FLAGS=-g -fPIC -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
FFLAGS=-g -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan FFLAGS=-g -fPIC -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
# List of directories # List of directories
DIRC=src/interface DIRC=src/interface
DIRF90=src/fortran90 DIRF90=src/fortran90
DIRF=src/fortran DIRF=src/fortran
OBJDIR=obj OBJDIR=obj
BINDIR=bin BINDIR=bin
LIBDIR=bin
# List of objects # List of objects
OBJC=c_analysis.o beam.o main.o OBJC=c_analysis.o beam.o
OBJF90= CPUtime.o GlobalDataFun.o TimeFunction.o PrescribedCondition.o InternalData.o Preprocess.o Element.o Member.o System.o Solve.o EigenSolve.o Analysis.o Wrappers.o OBJF90= CPUtime.o GlobalDataFun.o TimeFunction.o PrescribedCondition.o InternalData.o Preprocess.o Element.o Member.o System.o Solve.o EigenSolve.o Analysis.o Wrappers.o
OBJF=ddep.o ma28.o mc19.o blas.o lapack.o arpack.o OBJF=ddep.o ma28.o mc19.o blas.o lapack.o arpack.o
...@@ -22,7 +23,15 @@ OBJC := $(OBJC:%.o=$(OBJDIR)/%.o) ...@@ -22,7 +23,15 @@ OBJC := $(OBJC:%.o=$(OBJDIR)/%.o)
OBJF90 := $(OBJF90:%.o=$(OBJDIR)/%.o) OBJF90 := $(OBJF90:%.o=$(OBJDIR)/%.o)
OBJF := $(OBJF:%.o=$(OBJDIR)/%.o) OBJF := $(OBJF:%.o=$(OBJDIR)/%.o)
default: $(OBJC) $(OBJF90) $(OBJF) default: lib
# This default rule is to compile the gebt as an independent library
lib: $(OBJC) $(OBJF90) $(OBJF)
$(LD) $(CFLAGS) -o libgebt.so -shared $^ $(LIBS)
cp src/interface/*.h ./include/
# Create an executable. Requires a main.c file in the OBJDIR directory
exe: $(OBJC) $(OBJF90) $(OBJF) $(OBJDIR)/main.o
$(LD) $(CFLAGS) -o $(BINDIR)/gebt $^ $(LIBS) $(LD) $(CFLAGS) -o $(BINDIR)/gebt $^ $(LIBS)
cp $(BINDIR)/gebt run/ cp $(BINDIR)/gebt run/
...@@ -36,6 +45,7 @@ $(OBJF): $(OBJDIR)/%.o: $(DIRF)/%.f ...@@ -36,6 +45,7 @@ $(OBJF): $(OBJDIR)/%.o: $(DIRF)/%.f
$(CF) $(FFLAGS) -fallow-argument-mismatch -c -o $@ $< -J$(OBJDIR) $(CF) $(FFLAGS) -fallow-argument-mismatch -c -o $@ $< -J$(OBJDIR)
clean: clean:
rm $(OBJDIR)/*.o rm -vf $(OBJDIR)/*.o
rm $(OBJDIR)/*.mod rm -vf $(OBJDIR)/*.mod
rm $(BINDIR)/gebt rm -vf $(BINDIR)/gebt
\ No newline at end of file rm -vf $(BINDIR)/libgebt.so
File added
#ifndef _BEAM_H_
#define _BEAM_H_
#define NSTRN 6 #define NSTRN 6
#define NDIM 3 #define NDIM 3
#define MEMB_CONST 7 #define MEMB_CONST 7
...@@ -119,4 +124,8 @@ typedef struct ...@@ -119,4 +124,8 @@ typedef struct
void initBeam(Beam *bm); void initBeam(Beam *bm);
void beam_setLoads(Beam *bm, double *loads, int load_no); void beam_setLoads(Beam *bm, double *loads, int load_no);
void beam_writeSolToFile(Beam *bm); void beam_writeSolToFile(Beam *bm);
void freeBeam(Beam *bm); void freeBeam(Beam *bm);
\ No newline at end of file
#endif
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment