diff --git a/example/concurrent-inference.f90 b/example/concurrent-inference.f90 index c3126219a..96acb3576 100644 --- a/example/concurrent-inference.f90 +++ b/example/concurrent-inference.f90 @@ -24,7 +24,7 @@ program concurrent_inferences if (len(input_files)==0) then error stop new_line('a') // new_line('a') // & - 'Usage: fpm run --example concurrent-inference -- --input-files ""' + 'Usage: ./build/run-fpm.sh run --example concurrent-inference -- --input-files ""' end if print *,"Defining an array of inference_engine_t objects by reading the following files: ", input_files diff --git a/example/construct-and-write.f90 b/example/construct-and-write.f90 index d69af98d6..90b9e7d52 100644 --- a/example/construct-and-write.f90 +++ b/example/construct-and-write.f90 @@ -19,7 +19,7 @@ program construct_and_write if (len(output_file_name)==0) then error stop new_line('a') // new_line('a') // & - 'Usage: fpm run --example construct-and-write -- --output-file ""' + 'Usage: ./build/run-fpm.sh run --example construct-and-write -- --output-file ""' end if xor = inference_engine_t( & diff --git a/example/read-and-query.f90 b/example/read-and-query.f90 index 48157753d..2860a940a 100644 --- a/example/read-and-query.f90 +++ b/example/read-and-query.f90 @@ -16,7 +16,7 @@ program read_and_query if (len(input_file_name)==0) then error stop new_line('a') // new_line('a') // & - 'Usage: fpm run --example read-and-query -- --input-file ""' + 'Usage: ./build/run-fpm.sh run --example read-and-query -- --input-file ""' end if print *,"Defining an inference_engine_t object by reading the file '"//input_file_name//"'" diff --git a/scripts/run-fpm.sh-header b/scripts/run-fpm.sh-header new file mode 100755 index 000000000..bf8e478c5 --- /dev/null +++ b/scripts/run-fpm.sh-header @@ -0,0 +1,19 @@ +#!/bin/sh +#-- DO NOT EDIT -- created by inference-engine/setup.sh +export PKG_CONFIG_PATH + +fpm_arguments="" +program_arguments="" +while test $# -gt 0 +do + case "$1" in + --) program_arguments="$@" + ;; + *) if [ -z "$program_arguments" ]; then + fpm_arguments="$fpm_arguments $1" + fi + ;; + esac + shift +done + diff --git a/setup.sh b/setup.sh index a40cfece7..4203a07a4 100755 --- a/setup.sh +++ b/setup.sh @@ -113,7 +113,7 @@ echo "INFERENCE_ENGINE_FPM_FLAG=\"$FPM_FLAG\"" >> $INFERENCE_ENGINE echo "Name: inference-engine" >> $INFERENCE_ENGINE_PC echo "Description: Inference Engine" >> $INFERENCE_ENGINE_PC echo "URL: https://github.com/berkeleylab/inference-engine" >> $INFERENCE_ENGINE_PC -echo "Version: 0.1.0" >> $INFERENCE_ENGINE_PC +echo "Version: 0.1.1" >> $INFERENCE_ENGINE_PC if [ $CI = true ]; then echo "---------------" echo "cat $INFERENCE_ENGINE_PC" @@ -122,16 +122,15 @@ if [ $CI = true ]; then fi export PKG_CONFIG_PATH +cp scripts/run-fpm.sh-header build/run-fpm.sh RUN_FPM_SH="`realpath ./build/run-fpm.sh`" -echo "#!/bin/sh" > $RUN_FPM_SH -echo "#-- DO NOT EDIT -- created by inference-engine/install.sh" >> $RUN_FPM_SH -echo "export PKG_CONFIG_PATH" >> $RUN_FPM_SH -echo "`brew --prefix fpm`/bin/fpm \$@ \\" >> $RUN_FPM_SH -echo "--profile debug \\" >> $RUN_FPM_SH -echo "--c-compiler \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_CC`\" \\" >> $RUN_FPM_SH -echo "--compiler \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_FC`\" \\" >> $RUN_FPM_SH -echo "--flag \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_FLAG`\" \\" >> $RUN_FPM_SH -echo "--link-flag \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_LD_FLAG`\"" >> $RUN_FPM_SH +echo "`which fpm` \$fpm_arguments \\" >> $RUN_FPM_SH +echo "--profile debug \\" >> $RUN_FPM_SH +echo "--c-compiler \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_CC`\" \\" >> $RUN_FPM_SH +echo "--compiler \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_FC`\" \\" >> $RUN_FPM_SH +echo "--flag \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_FLAG`\" \\" >> $RUN_FPM_SH +echo "--link-flag \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_LD_FLAG`\" \\" >> $RUN_FPM_SH +echo "\$program_arguments" >> $RUN_FPM_SH chmod u+x $RUN_FPM_SH if [ $CI = true ]; then echo "---------------"