10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-12 17:13:54 +01:00

Update scripts for irpf90 and ezfio

This commit is contained in:
Anthony Scemama 2014-11-04 01:03:50 +01:00
parent bab7aac3a8
commit 9fd9159f04
4 changed files with 77 additions and 3 deletions

View File

@ -32,6 +32,7 @@ bin/irpf90:
(echo Unable to download IRPF90 : $(WWW_SERVER)/$(IRPF90_TGZ) ; exit 1)
tar -zxf $(IRPF90_TGZ) && rm $(IRPF90_TGZ)
$(MAKE) -C irpf90 | tee install_irpf90.log
rm -rf -- $$PWD/bin/irpf90 $$PWD/bin/irpman
ln -s $$PWD/irpf90/bin/irpf90 $$PWD/bin/irpf90
ln -s $$PWD/irpf90/bin/irpman $$PWD/bin/irpman

26
scripts/upgrade_ezfio.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
#
# Upgrades the EZFIO library from the web.
# Tue Nov 4 00:53:13 CET 2014
if [[ -z ${QPACKAGE_ROOT} ]]
then
print "The QPACKAGE_ROOT environment variable is not set."
print "Please reload the quantum_package.rc file."
fi
cd -- ${QPACKAGE_ROOT}
mv -- ${QPACKAGE_ROOT}/EZFIO ${QPACKAGE_ROOT}/EZFIO.old
make EZFIO
if [[ $? -eq 0 ]]
then
rm -rf -- ${QPACKAGE_ROOT}/EZFIO.old
echo "Successfully updated EZFIO"
else
rm -rf -- ${QPACKAGE_ROOT}/EZFIO
mv -- ${QPACKAGE_ROOT}/EZFIO.old ${QPACKAGE_ROOT}/EZFIO
echo "Failed to update EZFIO"
fi

25
scripts/upgrade_irpf90.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
#
# Upgrades IRPF90 from the web.
# Tue Nov 4 00:53:13 CET 2014
if [[ -z ${QPACKAGE_ROOT} ]]
then
print "The QPACKAGE_ROOT environment variable is not set."
print "Please reload the quantum_package.rc file."
fi
cd -- ${QPACKAGE_ROOT}
mv -- ${QPACKAGE_ROOT}/irpf90 ${QPACKAGE_ROOT}/irpf90.old
make irpf90
if [[ $? -eq 0 ]]
then
rm -rf -- ${QPACKAGE_ROOT}/irpf90.old
echo "Successfully updated IRPF90"
else
rm -rf -- ${QPACKAGE_ROOT}/irpf90
mv -- ${QPACKAGE_ROOT}/irpf90.old ${QPACKAGE_ROOT}/irpf90
echo "Failed to update IRPF90"
fi

View File

@ -1,3 +1,9 @@
# Required EZFIO version
EZFIO_VERSION=1.1
# Required IRPF90 version
IRPF90_VERSION=1.4
# Check if QPACKAGE_ROOT is defined
ifndef QPACKAGE_ROOT
@ -28,10 +34,12 @@ include $(QPACKAGE_ROOT)/src/Makefile.config
# Check the version of IRPF90
IRP_VERSION_OK=$(shell $(IRPF90) -v | python -c "import sys ; print float(sys.stdin.readline().rsplit('.',1)[0]) >= 1.3")
IRP_VERSION_OK=$(shell $(IRPF90) -v | python -c "import sys ; print float(sys.stdin.readline().rsplit('.',1)[0]) >= $(IRPF90_VERSION)")
ifeq ($(IRP_VERSION_OK),False)
$(info -------------------- Error --------------------)
$(info IRPF90 version >= 1.3 is required)
$(info IRPF90 version >= $(IRPF90_VERSION) is required)
$(info To upgrade IRPF90, run : )
$(info $(QPACKAGE_ROOT)/scripts/upgrade_irpf90.sh )
$(info -----------------------------------------------)
$(error )
endif
@ -85,12 +93,26 @@ $(info -----------------------------------------------)
endif
# Define the Makefile common variables and rules
# Define the Makefile common variables
EZFIO_DIR=$(QPACKAGE_ROOT)/EZFIO
EZFIO=$(EZFIO_DIR)/lib/libezfio_irp.a
INCLUDE_DIRS=$(NEEDED_MODULES) include
# Check EZFIO version
EZFIO_VERSION_OK=$(shell cat $(EZFIO_DIR)/version | cut -d '=' -f 2 | python -c "import sys ; print float(sys.stdin.readline().rsplit('.',1)[0]) >= $(EZFIO_VERSION)")
ifeq ($(EZFIO_VERSION_OK),False)
$(info -------------------- Error --------------------)
$(info EZFIO version >= $(EZFIO_VERSION) is required )
$(info To upgrade EZFIO, run : )
$(info $(QPACKAGE_ROOT)/scripts/upgrade_ezfio.sh )
$(info -----------------------------------------------)
$(error )
endif
# Define the EZFIO rules
$(EZFIO): $(wildcard $(QPACKAGE_ROOT)/src/*.ezfio_config) $(wildcard $(QPACKAGE_ROOT)/src/*/*.ezfio_config)
@echo Building EZFIO library
@cp $(wildcard $(QPACKAGE_ROOT)/src/*.ezfio_config) $(wildcard $(QPACKAGE_ROOT)/src/*/*.ezfio_config) $(EZFIO_DIR)/config