Skip to content

Commit

Permalink
Fix compilation of zfp library.
Browse files Browse the repository at this point in the history
  • Loading branch information
lars2015 committed Nov 20, 2024
1 parent e3720e0 commit ade19be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
6 changes: 4 additions & 2 deletions libs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,12 @@ if [ $ifBuildAll = true ] || [ $ifBuildZFP = true ] ; then
strTarget=$strFileZFP
cp $strTarget.tar.bz2 $strBuildDir/src && cd $strBuildDir/src && tar xvjf $strTarget.tar.bz2
cd $strBuildDir/src/$strTarget \
&& make && make test \
&& make BUILD_SHARED_LIBS=0 && make test \
&& cp -a bin/* $strBuildDir/bin/ \
&& cp -a include/* $strBuildDir/include/ \
&& cp -a lib/* $strBuildDir/lib/ \
&& make BUILD_SHARED_LIBS=1 \
&& cp -a lib/* $strBuildDir/lib/ \
|| exit
fi

Expand All @@ -213,7 +215,7 @@ if [ $ifBuildAll = true ] || [ $ifBuildZSTD = true ] ; then
&& make -j $numProcs && make check \
&& cp -a lib/libzstd* $strBuildDir/lib/ \
&& cp -a lib/*.h $strBuildDir/include/ \
&& ln -sf $strBuildDir/$strTarget/lib/libzstd.so.1.5.2 $strBuildDir/lib/libzstd.so \
&& ln -sf $strBuildDir/$strTarget/lib/libzstd.so.1.5.5 $strBuildDir/lib/libzstd.so \
&& make clean \
|| exit
fi
Expand Down
19 changes: 11 additions & 8 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ GPU_PIN ?= 0
# Static compilation...
STATIC ?= 0

# Optimization flags...; default production -O3
# Optimization flags...
OPTI ?= -O3

# Optimization information...
Expand Down Expand Up @@ -86,7 +86,6 @@ CFLAGS += $(INCDIR) $(DEFINES) -DVERSION=\"$(VERSION)\" $(OPTI) -g
ifeq ($(COMPILER),gcc)
CC=gcc
CFLAGS += -DHAVE_INLINE -pedantic -Werror -Wall -W -Wmissing-prototypes -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wnested-externs -Wno-long-long -Wmissing-declarations -Wredundant-decls -Winline -fno-common -fshort-enums -fopenmp
#CFLAGS += -DHAVE_INLINE -pedantic -Wall -W -Wmissing-prototypes -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wnested-externs -Wno-long-long -Wmissing-declarations -Wredundant-decls -Winline -fno-common -fshort-enums -fopenmp
else ifeq ($(COMPILER),icx)
CC=icx
CFLAGS += -DHAVE_INLINE -pedantic -Wall -W -Wmissing-prototypes -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wnested-externs -Wno-long-long -Wmissing-declarations -Wredundant-decls -Winline -fno-common -fshort-enums -fopenmp
Expand Down Expand Up @@ -257,12 +256,12 @@ endif

.PHONY : all check clean coverage cppcheck dist doxygen indent install lib lizard mkdocs strip uninstall wrapper

all: $(EXC)
rm -f *~
ifeq ($(WRAPPER),1)
$(FC) $(FCFLAGS) -o mptrac_fortran.o -c mptrac_fortran.f90 $(LDFLAGS)
$(FC) $(FCFLAGS) -o trac_fortran.o -c trac_fortran.f90 $(LDFLAGS)
$(FC) $(FCFLAGS) -o trac_fortran trac_fortran.o mptrac_fortran.o mptrac.o $(LDFLAGS)
all: $(EXC) wrapper
rm -f *~
else
all: $(EXC)
rm -f *~
endif

$(EXC): %: %.c mptrac.o
Expand All @@ -271,11 +270,15 @@ $(EXC): %: %.c mptrac.o
mptrac.o: mptrac.c mptrac.h Makefile
$(CC) $(CFLAGS) -c -o mptrac.o mptrac.c

wrapper: mptrac_fortran.f90 trac_fortran.f90 mptrac.o
mptrac_fortran.o: mptrac_fortran.f90 Makefile
$(FC) $(FCFLAGS) -o mptrac_fortran.o -c mptrac_fortran.f90 $(LDFLAGS)

trac_fortran: trac_fortran.f90 mptrac.o mptrac_fortran.o
$(FC) $(FCFLAGS) -o trac_fortran.o -c trac_fortran.f90 $(LDFLAGS)
$(FC) $(FCFLAGS) -o trac_fortran trac_fortran.o mptrac_fortran.o mptrac.o $(LDFLAGS)

wrapper: trac_fortran

check: $(TESTS)

$(TESTS) cms_test gpu_test kpp_test: all
Expand Down

0 comments on commit ade19be

Please sign in to comment.