szaghi / FoBiS

FoBiS.py, Fortran projects Building System for poor people
138 stars 35 forks source link

argument -compiler: invalid lower value: 'intel' #116

Closed vvshashkin closed 4 years ago

vvshashkin commented 4 years ago

Hi Stefano!

I get the error message: usage: FoBiS.py build [-h] [-comp] ....(some cmd-line args listed here) FoBiS.py build: error: argument -compiler: invalid lower value: 'intel'

while trying to run

$ FoBiS.py build -s ./src -m Makefile -compiler intel -fc "mpiifort" -lflags " -traceback -init=snan -init=arrays -check all -ftrapuv" -cflags " -c -traceback -init=snan -init=arrays -check all -ftrapuv"

with FoBiS.py version 3.0.2, FoBiS.py version 2.9.7 works correctly. System is ubuntu 18.04.

What is going wrong? Maybe something has changed in command line interface between v2.9 and 3.0?

Thank you in advance! Thank you for such an outstanding contribution to the fortran eco-system!

szaghi commented 4 years ago

Dear @vvshashkin thank you very much for reporting this, it is probably a bug of the new version. Unfortunately we are in quarantine due to covid-19 pandemic emergency and I am not sure to be able to reproduce all the scenario (versions, python versions...) to debug the code, but I will try (I should be able to start later today and I will go on tomorrow and ongoing).

I'll update the status of this issue soon, stay tuned.

vvshashkin commented 4 years ago

Good luck Stefano! Stay healthy!

Best regards, Vladimir Shashkin

szaghi commented 4 years ago

@vvshashkin Thank you! Do not worry, it is only a precaution, I am not been infected by the virus :+1:

szaghi commented 4 years ago

@vvshashkin

I am trying to reproduce the bug, but I am failing.

For now I have created a void program, i.e. issue116.f90, and I have tried to execute your command over it:

┌╼ stefano@apollo(01:02 PM Sun Mar 29)
├───╼ ~/fobis-issue-116 1 files, 12Kb
└──────╼ tree
.
└── src
    └── issue116.f90

┌╼ stefano@apollo(01:02 PM Sun Mar 29)
├───╼ ~/fobis-issue-116 1 files, 12Kb
└──────╼ FoBiS.py build -s ./src  -m Makefile -compiler intel -fc "mpiifort" -lflags " -traceback -init=snan -init=arrays -check all -ftrapuv" -cflags " -c -traceback -init=snan -init=arrays -check all -ftrapuvA"

┌╼ stefano@apollo(01:02 PM Sun Mar 29)
├───╼ ~/fobis-issue-116 4 files, 24Kb
└──────╼ tree
.
├── Makefile
├── mod
├── obj
└── src
    └── issue116.f90

┌╼ stefano@apollo(01:03 PM Sun Mar 29)
├───╼ ~/fobis-issue-116 4 files, 24Kb
└──────╼ cat Makefile 
#!/usr/bin/make

#main building variables
DSRC    = src
DOBJ    = obj/
DMOD    = mod/
DEXE    = ./
LIBS    =
FC      = mpiifort
OPTSC   =  -c -traceback -init=snan -init=arrays -check all -ftrapuvA -module mod
OPTSL   =  -traceback -init=snan -init=arrays -check all -ftrapuv -module mod
VPATH   = $(DSRC) $(DOBJ) $(DMOD)
MKDIRS  = $(DOBJ) $(DMOD) $(DEXE)
LCEXES  = $(shell echo $(EXES) | tr '[:upper:]' '[:lower:]')
EXESPO  = $(addsuffix .o,$(LCEXES))
EXESOBJ = $(addprefix $(DOBJ),$(EXESPO))

#auxiliary variables
COTEXT  = "Compiling $(<F)"
LITEXT  = "Assembling $@"

#building rules
$(DEXE)ISSUE116: $(MKDIRS) $(DOBJ)issue116.o
    @rm -f $(filter-out $(DOBJ)issue116.o,$(EXESOBJ))
    @echo $(LITEXT)
    @$(FC) $(OPTSL) $(DOBJ)*.o $(LIBS) -o $@
EXES := $(EXES) ISSUE116

#compiling rules
$(DOBJ)issue116.o: src/issue116.f90
    @echo $(COTEXT)
    @$(FC) $(OPTSC)  $< -o $@

#phony auxiliary rules
.PHONY : $(MKDIRS)
$(MKDIRS):
    @mkdir -p $@
.PHONY : cleanobj
cleanobj:
    @echo deleting objects
    @rm -fr $(DOBJ)
.PHONY : cleanmod
cleanmod:
    @echo deleting mods
    @rm -fr $(DMOD)
.PHONY : cleanexe
cleanexe:
    @echo deleting exes
    @rm -f $(addprefix $(DEXE),$(EXES))
.PHONY : clean
clean: cleanobj cleanmod
.PHONY : cleanall
cleanall: clean cleanexe

As you can see it seems to work, my ambient is now

┌╼ stefano@apollo(01:04 PM Sun Mar 29)
├───╼ ~/fobis-issue-116 4 files, 24Kb
└──────╼ python3 --version
Python 3.7.7

┌╼ stefano@apollo(01:04 PM Sun Mar 29)
├───╼ ~/fobis-issue-116 4 files, 24Kb
└──────╼ FoBiS.py --version
FoBiS.py 3.0.2

┌╼ stefano@apollo(01:05 PM Sun Mar 29)
├───╼ ~/fobis-issue-116 4 files, 24Kb
└──────╼ uname -a
Linux apollo 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

Can you try give me more details in order I can try to replicate the bug?

Cheers

vvshashkin commented 4 years ago

Hi Stefano @szaghi ! Please find copy-paste of my terminal session below:

vova@vova-G3-3590:~/src/test$ uname -a
Linux vova-G3-3590 5.0.0-1043-oem-osp1 #48-Ubuntu SMP Thu Mar 12 09:53:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
vova@vova-G3-3590:~/src/test$ python --version
Python 2.7.17
vova@vova-G3-3590:~/src/test$ python3 --version
Python 3.6.9
vova@vova-G3-3590:~/src/test$ FoBiS.py -v
FoBiS.py 3.0.2
vova@vova-G3-3590:~/src/test$ FoBiS.py build -s ./src  -m Makefile -compiler intel -fc "mpiifort" -lflags " -traceback -init=snan -init=arrays -check all -ftrapuv" -cflags " -c -traceback -init=snan -init=arrays -check all -ftrapuv"
usage: FoBiS.py build [-h] [-compiler {gnu,intel,g95,opencoarrays-gnu,custom}]
                      [-fc FC] [-cflags CFLAGS] [-lflags LFLAGS]
                      [-modsw MODSW] [-mpi] [-openmp] [-coarray] [-coverage]
                      [-profile] [-mklib {static,shared}] [-ch] [-tb]
                      [-s SRC [SRC ...]] [-dbld BUILD_DIR] [-dobj OBJ_DIR]
                      [-dmod MOD_DIR] [-dlib LIB_DIR [LIB_DIR ...]]
                      [-i INCLUDE [INCLUDE ...]]
                      [-ed EXCLUDE_DIRS [EXCLUDE_DIRS ...]] [-drs] [-t TARGET]
                      [-o OUTPUT] [-e EXCLUDE [EXCLUDE ...]]
                      [-libs LIBS [LIBS ...]] [-vlibs VLIBS [VLIBS ...]]
                      [-ext_libs EXT_LIBS [EXT_LIBS ...]]
                      [-ext_vlibs EXT_VLIBS [EXT_VLIBS ...]]
                      [-dependon DEPENDON [DEPENDON ...]] [-inc INC [INC ...]]
                      [-extensions EXTENSIONS [EXTENSIONS ...]] [-build_all]
                      [-f FOBOS] [-fci] [-mode MODE] [-lmodes]
                      [--print_fobos_template] [-preprocessor [PREPROCESSOR]]
                      [-p PREPROC] [-app PREPROCESSOR_ARGS] [-npp]
                      [-dpp PREPROCESSOR_DIR]
                      [-epp PREPROCESSOR_EXT [PREPROCESSOR_EXT ...]]
                      [-force_compile] [-colors] [-l] [-graph] [-q] [-verbose]
                      [-j JOBS] [-m MAKEFILE_name]
FoBiS.py build: error: argument -compiler: invalid lower value: 'intel'
vova@vova-G3-3590:~/src/test$ tree
.
└── src
    └── p.f90

1 directory, 1 file
vova@vova-G3-3590:~/src/test$ 
vvshashkin commented 4 years ago

@szaghi

FoBiS.py is installed via

pip install FoBiS.py

or

sudo pip install FoBiS.py

that doesn't change the result.

I've also tried pip3 istallation, then FoBiS gives other errors (fails to import smth from future)

Currently I'm trying to figure out versions of FoBiS.py dependencies installed ob my system.

Best regards and thank you!

vvshashkin commented 4 years ago

@szaghi It seems that I've solved the problem. The following steps were made: 1) pip3 install future 2) pip3 install FoBiS.py then

vova@vova-G3-3590:~/src/test$ tree
.
└── src
    └── p.f90

1 directory, 1 file
vova@vova-G3-3590:~/src/test$ FoBiS.py -v
FoBiS.py 3.0.2
vova@vova-G3-3590:~/src/test$ FoBiS.py build -s ./src  -m Makefile -compiler intel -fc "mpiifort" -lflags " -traceback -init=snan -init=arrays -check all -ftrapuv" -cflags " -c -traceback -init=snan -init=arrays -check all -ftrapuv"
vova@vova-G3-3590:~/src/test$ tree
.
├── Makefile
├── mod
├── obj
└── src
    └── p.f90

3 directories, 2 files
vova@vova-G3-3590:~/src/test$ 

Am I right that FoBiS should be run in python3 environment? Should then "future" be installed automatically when FoBiS.py is installed (I'm a noob in pip/python packages)?

szaghi commented 4 years ago

@vvshashkin

Vladimir, I am very sorry, you are right, the new version has a setup.py broken, I have to update it.

Yes, the intention is to fully migrate to python3 because python2 support is terminating in 2020.

I have to update setup.py to the new python3 environment for an easy installation, my bad. I keep open this bug-issue until I will fix the setup.py.

Thank you very much for pointing it out.

Cheers

vvshashkin commented 4 years ago

Thank you Stefano! Good luck!

szaghi commented 4 years ago

@vvshashkin

Can you check it the new setup.py is working now? It seems ok for me.

vvshashkin commented 4 years ago

@vvshashkin

Can you check it the new setup.py is working now? It seems ok for me.

@szaghi "future" dependency problem has gone. The following bash sequence $ pip3 uninstall future $ pip3 uninstall FoBiS.py $ pip3 install FoBiS.py $ FoBiS.py build -s ./src -m Makefile -compiler intel -fc "mpiifort" -lflags "$LFLAGS" -cflags "$CFLAGS" provides a correct result for me now. Thank you very much! Schould I close he issue (I'm not used to all this githun stuff)?

szaghi commented 4 years ago

@vvshashkin thank you very much for the feedback. I am closing the issue.

Cheers