Skip to content

Commit

Permalink
Apply portability fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
johncbowman committed Jan 8, 2024
1 parent f31134b commit a3e533a
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 23 deletions.
46 changes: 23 additions & 23 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@ IDIR =../
LDFLAGS=
# GNU compiler
ifeq ($(shell $(CXX) -v 2>&1 | tail -n 1 | head -c 3),gcc)
CXXFLAGS+=-Ofast -g -Wall -DNDEBUG
CXXFLAGS+=-fopenmp
CXXFLAGS+=-fomit-frame-pointer -fstrict-aliasing -ffast-math
CXXFLAGS+=-march=native
#CXXFLAGS+= -flto
#CXXFLAGS+= -fprofile-generate
#CXXFLAGS+= -fprofile-use -fprofile-dir=.
CXXFLAGS += -Ofast -g -Wall -DNDEBUG
CXXFLAGS += -fopenmp
CXXFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math
CXXFLAGS += -march=native
#CXXFLAGS += -flto
#CXXFLAGS += -fprofile-generate
#CXXFLAGS += -fprofile-use -fprofile-dir=.
#For valgrind:
#CXXFLAGS=-fopenmp -g -Wall -fomit-frame-pointer -fstrict-aliasing -ffast-math -msse2 -mfpmath=sse
endif

#Clang compiler
ifeq ($(shell $(CXX) -v 2>&1 | head -n 1 | head -c 5),clang)
CXXFLAGS+=-Ofast -g -Wall -DNDEBUG
CXXFLAGS+=-fomit-frame-pointer -fstrict-aliasing -ffast-math
CXXFLAGS+=-msse2 -mfpmath=sse -march=native
CXXFLAGS += -Ofast -g -Wall -DNDEBUG
CXXFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math
CXXFLAGS += -msse2 -mfpmath=sse -march=native
#Thread nonsense
#CXXFLAGS+=-I/opt/local/include/libomp -Xpreprocessor -fopenmp
#CXXFLAGS += -I/opt/local/include/libomp -Xpreprocessor -fopenmp
endif

#Apple Clang compiler
ifeq ($(shell $(CXX) -v 2>&1 | head -n 1 | head -c 11),Apple clang)
CXXFLAGS+=-Ofast -g -Wall -DNDEBUG
CXXFLAGS+=-fomit-frame-pointer -fstrict-aliasing -ffast-math
#CXXFLAGS+=-msse2 -mfpmath=sse -march=native
#Thread nonsense
CXXFLAGS+=-I/opt/local/include/libomp -Xpreprocessor -fopenmp
LDFLAGS+=-L/opt/local/lib -L/opt/local/lib/libomp -lomp
CXXFLAGS += -Ofast -g -Wall -DNDEBUG
CXXFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math
#CXXFLAGS += -msse2 -mfpmath=sse -march=native
CXXFLAGS +=-I/opt/local/include/libomp -Xpreprocessor -fopenmp
LDFLAGS +=-L/opt/local/lib -L/opt/local/lib/libomp -lomp
endif

#Intel compiler
ifeq ($(shell $(CXX) -v 2>&1 | head -c 4),icpc)
CXXFLAGS=-O3 -qopenmp -ansi-alias -malign-double -fp-model fast=2
ifeq ($(shell $(CXX) --version 2>&1 | head -c 4),icpc)
CXXFLAGS += -O3 -qopenmp -ansi-alias -malign-double -fp-model fast=2
LDFLAGS += -lmpi -lmpi_cxx
endif

#IBM compiler
ifeq ($(shell $(CXX) -qversion 2>&1 | head -c 3),IBM)
CXXFLAGS=-O5 -P -qsmp -qalign -qarch -qtune -qcache -qipa -qarch=qp
CXXFLAGS += -O5 -P -qsmp -qalign -qarch -qtune -qcache -qipa -qarch=qp
endif

CXXFLAGS += $(DEFS) -I$(IDIR) -std=c++11
Expand All @@ -50,10 +50,10 @@ endif


ifneq ($(strip $(FFTW_LIB_PATH)),)
LDFLAGS+=-L$(FFTW_LIB_PATH)
LDFLAGS += -L$(FFTW_LIB_PATH)
endif
#LDFLAGS+=-lfftw3_threads -lfftw3 -lm
LDFLAGS+=-lfftw3_omp -lfftw3 -lm
#LDFLAGS += -lfftw3_threads -lfftw3 -lm
LDFLAGS += -lfftw3_omp -lfftw3 -lm

MAKEDEPEND=$(CXXFLAGS) -O0 -M -DDEPEND

Expand Down
1 change: 1 addition & 0 deletions tests/fft1.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <getopt.h>
#include <iostream>

#include "Complex.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/fft1r.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/fft2.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/fft2r.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/fft3.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/fft3r.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/mfft1.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/mfft1r.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/transpose.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <getopt.h>

#include "Complex.h"
#include "Array.h"
#include "fftw++.h"
Expand Down

0 comments on commit a3e533a

Please sign in to comment.