diff --git a/bin/qpsh b/bin/qpsh index f7a00546..9f1019f9 100755 --- a/bin/qpsh +++ b/bin/qpsh @@ -2,6 +2,11 @@ export QP_ROOT=$(dirname $0)/.. +python2 ${QP_ROOT}/scripts/hello.py +echo "" +echo " -- Quantum Package Shell -- " +echo "" + exec bash --init-file <(cat << EOF [[ -f \${HOME}/.bashrc ]] && source \${HOME}/.bashrc source \${QP_ROOT}/quantum_package.rc diff --git a/configure b/configure index 1d0229ef..9da4c264 100755 --- a/configure +++ b/configure @@ -21,10 +21,12 @@ Usage: $(basename $0) -i | --install= Options: - -c, --config= Define a configuration file, in "${QP_ROOT}/config/". - -h, --help Print the help message - -i, --install= Install . Use at your own risk: - no support will be provided for the installation of dependencies. + -c, --config= Define a COMPILATION configuration file, + in "${QP_ROOT}/config/". + -h, --help Print the HELP message + -i, --install= INSTALL . Use at your OWN RISK: + no support will be provided for the installation of + dependencies. Example: ./$(basename $0) -c config/gfortran.cfg @@ -68,7 +70,7 @@ while true : ; do *) if [[ -f $2 ]] ; then CONFIG="$2" else - error "error: configuration file not accessible" + error "error: configuration file $2 not found." exit 1 fi esac @@ -414,6 +416,7 @@ if [[ ${RESULTSFILE} = $(not_found) ]] ; then fail fi +printf "\e[0;34m" echo " ___________________________ " echo "< All dependencies installed. >" echo " --------------------------- " @@ -423,22 +426,24 @@ echo " (__)\ )\/\. " echo " ||----w | " echo " || || " echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" -echo "" -echo "Now, if you want to use the current shell," -echo "" -echo " source $QP_ROOT/quantum_package.rc" -echo "" -echo "Or if you want to use a Bash shell adapted for QP:" -echo "" -echo " $QP_ROOT/qpsh" -echo "" - - +printf "\e[m\n" + if [[ -n $CONFIG ]] ; then "${QP_ROOT}"/scripts/compilation/qp_create_ninja create --development "${CONFIG}" fi +if [[ -f ${QP_ROOT}/build.ninja ]] ; then + exec ${QP_ROOT}/bin/qpsh +else + echo "" + echo "${QP_ROOT}/build.ninja does not exist," + echo "you need to specify the COMPILATION configuration file." + echo "See ./configure --help for more details." + echo "" +fi + + diff --git a/etc/ninja.rc b/etc/ninja.rc index a5d5f4a9..4b000dcd 100644 --- a/etc/ninja.rc +++ b/etc/ninja.rc @@ -1,3 +1,13 @@ # Configuration for the Ninja package export NINJA=${QP_ROOT}/bin/ninja + +function ninja () { + if [[ -f ${QP_ROOT}/build.ninja ]] ; then + exec ninja "$@" + else + >&2 echo "Error: build.ninja does not exists. +You need to run ./configure first." + fi + +} diff --git a/scripts/hello.py b/scripts/hello.py new file mode 100644 index 00000000..3c500252 --- /dev/null +++ b/scripts/hello.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python2 + +import random + +def main(): + hello = [ """ + ) + ( ( /( + ( )\ ` ) ( )\()) + )(( ) /(/( )\ ((_)\ +((_)_)((_)_\ ((_)| |(_) +/ _` || '_ \)(_-<| ' \ +\__, || .__/ /__/|_||_| + |_||_| +""", """ + .x+=:. + z` ^% .uef^" + .d`` . + 88E 888 ^ `Y" 888 + 98> *8E J88" + '8 '8> @% + ` " +""", """ + + @@@@@@ @@@@@@@ @@@@@@ @@@ @@@ +@@@@@@@@ @@@@@@@@ @@@@@@@ @@@ @@@ +@@! @@@ @@! @@@ !@@ @@! @@@ +!@! @!@ !@! @!@ !@! !@! @!@ +@!@ !@! @!@@!@! !!@@!! @!@!@!@! +!@! !!! !!@!!! !!@!!! !!!@!!!! +!!:!!:!: !!: !:! !!: !!! +:!: :!: :!: !:! :!: !:! +::::: :! :: :::: :: :: ::: + : : ::: : :: : : : : : + +""", """ + + ,-----. .-------. .-'''-. .---. .---. + .' .-, '. \ _(`)_ \ / _ \| | |_ _| + / ,-.| \ _ \ | (_ o._)| (`' )/`--'| | ( ' ) +; \ '_ / | : | (_,_) /(_ o _). | '-(_{;}_) +| _`,/ \ _/ | | '-.-' (_,_). '. | (_,_) +: ( '\_/ \ ; | | .---. \ :| _ _--. | + \ `"/ \ ) \ | | \ `-' ||( ' ) | | + '. \_/``"/) )/ ) \ / (_{;}_)| | + '-----' `-' `---' `-...-' '(_,_) '---' + +""", r""" + ___ ___ ___ + ___ / /\ / /\ /__/\ + / /\ / /::\ / /:/_ \ \:\ + / /::\ / /:/\:\ / /:/ /\ \__\:\ + / /:/\:\ / /:/~/:// /:/ /::\ ___ / /::\ + / /:/~/::\ /__/:/ /://__/:/ /:/\:\/__/\ /:/\:\ + /__/:/ /:/\:\\ \:\/:/ \ \:\/:/~/:/\ \:\/:/__\/ + \ \:\/:/__\/ \ \::/ \ \::/ /:/ \ \::/ + \ \::/ \ \:\ \__\/ /:/ \ \:\ + \__\/ \ \:\ /__/:/ \ \:\ + \__\/ \__\/ \__\/ + +""", r""" + + ______ _____ ______ ____ ____ + ___|\ \ ___|\ \ ___|\ \ | | | | + / /\ \ | |\ \ | |\ \| | | | + / / | || | | | | |/____/|| |_| | +| | | || |/____/| ___| \| | || .-. | +|\ \ |__ || || ||| \ \___|/ | | | | +| \ \\` \ /|| ||____|/| |\ \ | | | | + \ \ ___\\ \ ||____| |\ ___\|_____| |____| |____| + \ | ||___|/| | | | | | | | | | + \|____|| | |____| \|____|_____| |____| |____| + \( |___| \( \( )/ \( )/ + ' )/ ' ' ' ' ' + ' +""", r""" + +______________________________________________/\\\_________ + _____________________________________________\/\\\_________ + ___/\\\\\\\\______/\\\\\\\\\_________________\/\\\_________ + __/\\\////\\\____/\\\/////\\\___/\\\\\\\\\\__\/\\\_________ + _\//\\\\\\\\\___\/\\\\\\\\\\___\/\\\//////___\/\\\\\\\\\\__ + __\///////\\\___\/\\\//////____\/\\\\\\\\\\__\/\\\/////\\\_ + ________\/\\\___\/\\\__________\////////\\\__\/\\\___\/\\\_ + ________\/\\\\__\/\\\___________/\\\\\\\\\\__\/\\\___\/\\\_ + ________\////___\///___________\//////////___\///____\///__ + +""".replace(r"\\","\033[0;34m\\\\\033[m"), """ + _ _ _ _ _ _ _ _ + (c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c) + / ._. \ / ._. \ / ._. \ / ._. \ + __\( Y )/__ __\( Y )/__ __\( Y )/__ __\( Y )/__ +(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._) + || \033[0;32mQ\033[m || || \033[0;32mP\033[m || || \033[0;32mS\033[m || || \033[0;32mH\033[m || + _.' `-' '._ _.' `-' '._ _.' `-' '._ _.' `-' '._ +(.-./`-'\.-.)(.-./`-'\.-.)(.-./`-`\.-.)(.-./`-'\.-.) + `-' `-' `-' `-' `-' `-' `-' `-' + +""".replace("Y","\033[0;31mY\033[m"), r""" + + _ _ _ _ + __/\\___ _/\\___ /\\__ _/\\___ +(_ __)) (_ _ _)) / \\(_ __ __)) + / _ \\ / |))\\ _\ \_// / |_| \\ +/:.(_)) \\_ /:. ___//// \:.\ /:. _ \\ +\ _______//\_ \\ \\__ / \___| | // + \// \// \\/ \// + +""", """ + _ _ _ _ + _( )__ _( )__ _( )__ _( )__ + _| _|_| _|_| _|_| _| +(_ Q _ (_(_ P _ (_(_ S _ (_(_ H _ (_ + |_( )__| |_( )__| |_( )__| |_( )__| + +""", r""" + ______ +______ _________ ___________ /_ +_ __ `/___ __ \__ ___/__ __ \ +/ /_/ / __ /_/ /_(__ ) _ / / / +\__, / _ .___/ /____/ /_/ /_/ + /_/ /_/ + +""" ] + + print random.choice(hello) + + +if __name__ == "__main__": + main() + +