Skip to content

Commit 5f698a4

Browse files
committed
Fix linker bug on MacOS
1 parent 22ceb97 commit 5f698a4

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ EXTENSIONS_DIR = ${PROJECT_DIR}/fidimag/extensions
33
PYTHON = python3
44
PYTEST = ${PYTHON} -m pytest
55

6-
CC=g++-8
6+
CC=gcc-8
7+
CXX=g++-8
78

89
FFTW_INC=local/include
910
FFTW_LIB=local/lib
@@ -14,6 +15,7 @@ SUNDIALS_LIB=local/lib
1415
CPPFLAGS = -fPIC -g -Iinclude/ \
1516
-I${FFTW_INC} -L${FFTW_LIB} \
1617
-I${SUNDIALS_INC} -L${SUNDIALS_LIB} \
18+
-Inative/include \
1719
-lm \
1820
-lfftw3_omp -lfftw3 \
1921
-lsundials_cvodes -lsundials_nvecserial -lsundials_nvecopenmp \
@@ -25,19 +27,20 @@ SOURCES = $(shell echo native/src/*.cpp)
2527
OBJECTS = $(SOURCES:.cpp=.o)
2628
LIBRARY = local/lib/libfidimag.so
2729

30+
########
31+
# Build
32+
########
33+
34+
2835
all: $(LIBRARY) build
2936

37+
3038
$(LIBRARY) : $(OBJECTS)
3139
$(CXX) $(CPPFLAGS) $(OBJECTS) -o $@ $(LDFLAGS)
3240

3341

34-
35-
#####################
36-
# Cython Extensions #
37-
#####################
38-
3942
build: $(LIBRARY)
40-
${PYTHON} setup.py build_ext --inplace
43+
CC=${CC} CXX=${CXX} ${PYTHON} setup.py build_ext --inplace
4144

4245

4346

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import glob
88
import os
99

10+
11+
print(os.environ['CC'], os.environ['CXX'])
1012
version = '5.0alpha'
1113

1214
MODULE_DIR = os.path.dirname(os.path.abspath(__file__))

0 commit comments

Comments
 (0)