Page 1 of 1

Apple M1 Max build

Posted: Thu Mar 24, 2022 7:12 pm
by mgovoni
The following instructions were used to build Qbox rel1_74_1 on Apple M1 Max.

In the /src folder create the file macos.mk, with the following:

Code: Select all

 PLT=macos

 SCALAPACKDIR=/Users/mgovoni/LIBRARIES/SCALAPACK
 BLASDIR=/Users/mgovoni/LIBRARIES/BLAS
 LAPACKDIR=/Users/mgovoni/LIBRARIES/LAPACK

# PLTOBJECTS = readTSC.o

 CXX=mpiCC
 LD=$(CXX)

 PLTFLAGS += -DIA32 -DUSE_MPI -DUSE_FFTW3 -D_LARGEFILE_SOURCE \
             -D_FILE_OFFSET_BITS=64 -DADD_ \
             -DAPP_NO_THREADS -DXML_USE_NO_THREADS -DUSE_XERCES -DXERCESC_3 \
             -DSCALAPACK -DUSE_UUID

 INCLUDE = -I/Users/mgovoni/LIBRARIES/FFTW3/include -I/Users/mgovoni/LIBRARIES/XERCES/include

 CXXFLAGS= -g -O3 -std=c++11 -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)

 LIBPATH = -L$(SCALAPACKDIR) -L$(LAPACKDIR) -L$(BLASDIR) -L/Users/mgovoni/LIBRARIES/XERCES/lib -L/Users/mgovoni/LIBRARIES/FFTW3/lib

 LIBS =  -lfftw3 -lscalapack -llapack -lblas -lm -lgfortran \
         -lxerces-c -lpthread -lstdc++

 LDFLAGS = $(LIBPATH) $(LIBS)
To build, execute the following command: make TARGET=macos