diff --git a/README.md b/README.md index 346be18..eacdf3b 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,23 @@ or for development purposes via python setup.py develop ``` +#### In case of errors + +If `python setup.py compile` fails (for example if blas and lapack are not installed on your system) you can copy the precompiled static executable `pamm_ubuntu` or `pamm_mac` into the pamm bin directory. + +``` +mkdir -p ./gmplabtools/pamm/precompiledPamm/bin +cp ./gmplabtools/pamm/precompiledPamm/pamm_ubuntu ./gmplabtools/pamm/precompiledPamm/bin/pamm +``` +or +``` +mkdir -p ./gmplabtools/pamm/precompiledPamm/bin +cp ./gmplabtools/pamm/precompiledPamm/pamm_mac ./gmplabtools/pamm/precompiledPamm/bin/pamm +``` + + +And then install gmplabtools with `python setup.py install`. + ### Docker In order to build docker images following command should be used diff --git a/gmplabtools/pamm/bin/.gitkeep b/gmplabtools/pamm/bin/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/gmplabtools/pamm/bin/pamm b/gmplabtools/pamm/precompiledPamm/pamm_mac similarity index 100% rename from gmplabtools/pamm/bin/pamm rename to gmplabtools/pamm/precompiledPamm/pamm_mac diff --git a/gmplabtools/pamm/precompiledPamm/pamm_ubuntu b/gmplabtools/pamm/precompiledPamm/pamm_ubuntu new file mode 100755 index 0000000..ff83e11 Binary files /dev/null and b/gmplabtools/pamm/precompiledPamm/pamm_ubuntu differ diff --git a/gmplabtools/pamm/src/Makefile b/gmplabtools/pamm/src/Makefile index 1d7db8d..42de4fb 100755 --- a/gmplabtools/pamm/src/Makefile +++ b/gmplabtools/pamm/src/Makefile @@ -20,23 +20,31 @@ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. FF=gfortran -FFLAGS=-O3 -g -Wall -Wno-maybe-uninitialized -cpp +DEVELOPFLAGS= -g -Wall -Wno-maybe-uninitialized +FFLAGS=-O3 -cpp #$(DEVELOPFLAGS) LDFLAGS=-llapack -lblas MODULES=libpamm.f90 xyz.f90 random.f90 OBJECTS=$(MODULES:.f90=.o) TOOLS=pamm -.PHONY: all clean $(TOOLS) +.PHONY: all clean cleanall $(TOOLS) all: $(TOOLS) $(TOOLS:%=%.o): $(OBJECTS) $(TOOLS): % : ../bin/% + $(TOOLS:%=../bin/%): ../bin/%: %.o $(OBJECTS) - $(FF) $(FFLAGS) -o $@ $^ $(LDFLAGS) + @echo compiling executable $@ + @mkdir -p ../bin + @$(FF) $(FFLAGS) -o $@ $^ $(LDFLAGS) %.o: %.f90 - $(FF) $(FFLAGS) -c $< + @echo compiling object $@ + @$(FF) $(FFLAGS) -c $< clean: - rm *.o *.mod + @rm -vf *.o *.mod + +cleanall: clean + @rm -vf ../bin/pamm diff --git a/setup.py b/setup.py index d49b694..1117d95 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,7 @@ def finalize_options(self): def run(self): # clean folder - _ = subprocess.run("cd ./gmplabtools/pamm/src && make clean", shell=True) + _ = subprocess.run("cd ./gmplabtools/pamm/src && make cleanall", shell=True) cmd_to_run = "cd ./gmplabtools/pamm/src && make" completed_process = subprocess.run(cmd_to_run, universal_newlines=True, shell=True)