Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need -c flag when compiling #10

Closed
jacobwilliams opened this issue Jul 20, 2014 · 2 comments
Closed

Need -c flag when compiling #10

jacobwilliams opened this issue Jul 20, 2014 · 2 comments

Comments

@jacobwilliams
Copy link

Trying out FoBiS on a simple project:

./FoBiS.py build -s ./src -compiler gnu -o ./bin/test

It fails on the first file because the cmd being called by syswork(cmd) is:

gfortran  -J ././mod/  ./src/blah.f90 -o ././obj/blah.o

It's missing the -c flag.

It works if I add the '-c' to this line in the code:

buildparser.add_argument('-cflags',                required=False,action='store',               default='-c',            help='Compile flags')

I don't know if this is the proper solution, or if I'm just using it wrong.

Also, I can't pass -c to FoBiS using the -cflags command line argument, because it thinks it's a new argument.

I'm using Python 2.7 on a Mac, if that helps.

@szaghi
Copy link
Owner

szaghi commented Jul 20, 2014

Hi jacobwilliams,

thank you very much for trying FoBiS.py. I have just uploaded a patched version. You are right: it was the argparse that set to null string by default: in the very early tests that I have made I did not use argparse and it was the builder class that initialize the builder object with the '-c' flag, but the argparse default overrides the builder default... thank you very much for your test!

On the contrary I do not understand why -cflags '-c' does not work, in my box work. Do you use the ' or " symbols to enclose -c switch?

Note that in the new version that I have just uploaded there is a minor improvement to "rule" execution...

Thank you again for your help.

@jacobwilliams
Copy link
Author

Thanks! I'll try the updates.

On my machine, the following:

./FoBiS.py build -s ./src -compiler gnu -o ./bin/test -cflags -c
./FoBiS.py build -s ./src -compiler gnu -o ./bin/test -cflags '-c'
./FoBiS.py build -s ./src -compiler gnu -o ./bin/test -cflags "-c"

All give the same error:

FoBiS.py build: error: ambiguous option: -c could match -compiler, -colors, -cflags

Not sure why...I'll look into it some more.

@szaghi szaghi closed this as completed Oct 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants