# Copyright © 2019-2022 Dynare Team # # This file is part of Dynare. # # Dynare is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Dynare is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Dynare. If not, see . include versions.mk GCC_VERSION = 12 ROOT_PATH = $(realpath .) WGET_OPTIONS := --no-verbose --no-use-server-timestamps --retry-connrefused --retry-on-host-error .PHONY: all clean_all\ build-x86_64 build-x86_64-slicot build-x86_64-x13as \ build-arm64 build-arm64-slicot build-arm64-x13as \ clean-x86_64-lib clean-x86_64-libslicot clean-x86_64-x13as-bin \ clean-arm64-lib clean-arm64-libslicot clean-arm64-x13as-bin \ clean-x86_64-src clean-x86_64-slicot-src clean-x86_64-x13as-src \ clean-arm64-src clean-arm64-slicot-src clean-arm64-x13as-src \ clean-tar clean-slicot-tar clean-x13as-tar \ clean-x86_64-all clean-x86_64-lib clean-x86_64-src \ clean-arm64-all clean-arm64-lib clean-arm64-src \ ln-x86_64-matio ln-x86_64-gsl \ ln-arm64-matio ln-arm64-gsl all: build-x86_64 build-arm64 clean_all: clean-x86_64-all clean-arm64-all build-x86_64: build-x86_64-slicot build-x86_64-x13as ln-x86_64-matio ln-x86_64-gsl build-arm64: build-arm64-slicot build-arm64-x13as ln-arm64-matio ln-arm64-gsl clean-x86_64-lib: clean-x86_64-libslicot clean-x86_64-x13as-bin clean-arm64-lib: clean-arm64-libslicot clean-arm64-x13as-bin clean-x86_64-src: clean-x86_64-slicot-src clean-x86_64-x13as-src clean-arm64-src: clean-arm64-slicot-src clean-arm64-x13as-src clean-tar: clean-slicot-tar clean-x13as-tar clean-x86_64-all: clean-x86_64-lib clean-x86_64-src clean-tar clean-arm64-all: clean-arm64-lib clean-arm64-src clean-tar # # Matio & GSL # (done to link only to static Matio and GSL libraries) # Matio lib64/x86_64/matio/lib/libmatio.a: /usr/local/lib/libmatio.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/arm64/matio/lib/libmatio.a: /opt/homebrew/lib/libmatio.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/x86_64/matio/lib/libhdf5.a: /usr/local/lib/libhdf5.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/arm64/matio/lib/libhdf5.a: /opt/homebrew/lib/libhdf5.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/x86_64/matio/lib/libsz.a: /usr/local/lib/libsz.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/arm64/matio/lib/libsz.a: /opt/homebrew/lib/libsz.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/x86_64/matio/include/matio.h: /usr/local/include/matio.h mkdir -p $(dir $@) && cd $(dir $@).. && rm -rf include && ln -sf $(dir $<) . lib64/arm64/matio/include/matio.h: /opt/homebrew/include/matio.h mkdir -p $(dir $@) && cd $(dir $@).. && rm -rf include && ln -sf $(dir $<) . ln-x86_64-matio: lib64/x86_64/matio/lib/libmatio.a \ lib64/x86_64/matio/lib/libhdf5.a \ lib64/x86_64/matio/lib/libsz.a \ lib64/x86_64/matio/include/matio.h ln-arm64-matio: lib64/arm64/matio/lib/libmatio.a \ lib64/arm64/matio/lib/libhdf5.a \ lib64/arm64/matio/lib/libsz.a \ lib64/arm64/matio/include/matio.h clean-x86_64-matio: rm -rf lib64/x86_64/matio clean-arm64-matio: rm -rf lib64/arm64/matio # GSL lib64/x86_64/gsl/lib/libgsl.a: /usr/local/lib/libgsl.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/arm64/gsl/lib/libgsl.a: /opt/homebrew/lib/libgsl.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/x86_64/gsl/lib/libgslcblas.a: /usr/local/lib/libgslcblas.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/arm64/gsl/lib/libgslcblas.a: /opt/homebrew/lib/libgslcblas.a mkdir -p $(dir $@) && ln -sf $< $@ lib64/x86_64/gsl/include/gsl/gsl_blas.h: /usr/local/include/gsl/gsl_blas.h mkdir -p $(dir $@) && cd $(dir $@).. && rm -rf gsl && ln -sf $(dir $<) . lib64/arm64/gsl/include/gsl/gsl_blas.h: /opt/homebrew/include/gsl/gsl_blas.h mkdir -p $(dir $@) && cd $(dir $@).. && rm -rf gsl && ln -sf $(dir $<) . ln-x86_64-gsl: lib64/x86_64/gsl/lib/libgsl.a \ lib64/x86_64/gsl/lib/libgslcblas.a \ lib64/x86_64/gsl/include/gsl/gsl_blas.h ln-arm64-gsl: lib64/arm64/gsl/lib/libgsl.a \ lib64/arm64/gsl/lib/libgslcblas.a \ lib64/arm64/gsl/include/gsl/gsl_blas.h clean-x86_64-gsl: rm -rf lib64/x86_64/gsl clean-arm64-gsl: rm -rf lib64/arm64/gsl # # Slicot # tarballs/slicot-$(SLICOT_VERSION).tar.gz: mkdir -p tarballs wget $(WGET_OPTIONS) -O $@ https://deb.debian.org/debian/pool/main/s/slicot/slicot_$(SLICOT_VERSION).orig.tar.gz sources64/x86_64/slicot-$(SLICOT_VERSION)-with-32bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz rm -rf sources64/x86_64/slicot-*-with-32bit-integer-and-underscore mkdir -p $@ tar xf $< --directory $@ --strip-components=1 touch $@ sources64/arm64/slicot-$(SLICOT_VERSION)-with-32bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz rm -rf sources64/arm64/slicot-*-with-32bit-integer-and-underscore mkdir -p $@ tar xf $< --directory $@ --strip-components=1 touch $@ sources64/x86_64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz rm -rf sources64/x86_64/slicot-*-with-64bit-integer-and-underscore mkdir -p $@ tar xf $< --directory $@ --strip-components=1 touch $@ sources64/arm64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz rm -rf sources64/arm64/slicot-*-with-64bit-integer-and-underscore mkdir -p $@ tar xf $< --directory $@ --strip-components=1 touch $@ lib64/x86_64/Slicot/with-underscore/lib/libslicot_pic.a: sources64/x86_64/slicot-$(SLICOT_VERSION)-with-32bit-integer-and-underscore make -C $< FORTRAN=/usr/local/bin/gfortran LOADER=/usr/local/bin/gfortran SLICOTLIB=../libslicot_pic.a OPTS="-O2 -g" lib strip -S $