Skip to content

Commit

Permalink
Merge pull request #14 from victorapm/build
Browse files Browse the repository at this point in the history
[joss review] Update Makefiles
  • Loading branch information
jcorbino authored Apr 20, 2024
2 parents 637ba8a + 2a9afa5 commit f03d65f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
20 changes: 18 additions & 2 deletions examples_C++/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,34 @@ MOLE = ../mole_C++

CXX ?= g++

CXXFLAGS = -O3 -fopenmp -DARMA_DONT_USE_WRAPPER
ifeq ($(DEBUG),1)
CXXFLAGS = -O0 -g
else
CXXFLAGS = -O3
endif
CXXFLAGS += -fopenmp -DARMA_DONT_USE_WRAPPER

INCPATH = -I. $(if $(ARMA), -I$(ARMA)/include) -I$(MOLE)

LIBS = -L$(MOLE) -lmole $(if $(ARMA), -L$(ARMA)) -larmadillo -lopenblas
#LIBS = -L$(MOLE) -lmole $(if $(ARMA),-L$(ARMA)/lib -Wl,-rpath,$(ARMA)/lib) -larmadillo -lopenblas
LIBS = -L$(MOLE) -lmole

ifdef ARMA
LIBS += -L$(ARMA)/lib -Wl,-rpath,$(ARMA)/lib -larmadillo -lopenblas
else
$(error ARMA is not defined. Please define ARMA with the path to the Armadillo library.)
endif

ifdef EIGEN
CXXFLAGS += -DEIGEN
INCPATH += -I$(EIGEN)
else
ifdef SUPERLU
LIBS += -L$(SUPERLU)/lib -Wl,-rpath,$(SUPERLU)/lib -lsuperlu
else
LIBS += -lsuperlu
endif
endif

all: transport1D schrodinger1D elliptic1D elliptic2D

Expand Down
7 changes: 6 additions & 1 deletion mole_C++/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CXX ?= g++

CXXFLAGS = -O3 -fopenmp
ifeq ($(DEBUG),1)
CXXFLAGS = -O0 -g
else
CXXFLAGS = -O3
endif
CXXFLAGS += -fopenmp

INCPATH = -I. $(if $(ARMA), -I$(ARMA)/include)

Expand Down
8 changes: 6 additions & 2 deletions tests_C++/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ CXX ?= g++

CXXFLAGS = -O3 -fopenmp -DARMA_DONT_USE_WRAPPER

INCPATH = -I. $(if $(ARMA), -I$(ARMA)/include) -I$(MOLE)
ifdef ARMA
INCPATH = -I. -I$(ARMA)/include -I$(MOLE)
else
$(error ARMA is not defined. Please define ARMA with the path to the Armadillo library.)
endif

LIBS = -L$(MOLE) -lmole $(if $(ARMA), -L$(ARMA)) -larmadillo -lopenblas
LIBS = -L$(MOLE) -lmole -lopenblas

all: test1 test2 test3 test4 run

Expand Down

0 comments on commit f03d65f

Please sign in to comment.