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

Library search path #26

Closed
jacobwilliams opened this issue Feb 5, 2015 · 5 comments
Closed

Library search path #26

jacobwilliams opened this issue Feb 5, 2015 · 5 comments

Comments

@jacobwilliams
Copy link

Might be nice if FoBoS supported the gfortran -L flag for the library search path. I think currently, you have to include the full path to the libraries used with the -libs flag, since gfortran doesn't use the include directory when searching for libraries.

@szaghi
Copy link
Owner

szaghi commented Feb 5, 2015 via email

@szaghi
Copy link
Owner

szaghi commented Feb 6, 2015

Hi Jacob,

I am trying to implement this feature, but I am failing building a working example (I always link libraries with full path). Can you provide examples of commands for liking with -L(-l)? Both GNU gfotran and Intel ifort seem to support the same syntax. For example, let us assume the following setup:

├── build
│   ├── mod
│   └── obj
│       └── cumbersome.o
├── fobos
├── precompiled
│   ├── mod
│   │   └── nested_1.mod
│   └── obj
│       └── first_dep.o
├── README.md
└── src
    └── cumbersome.f90

Which commad I should use to build without the full path precompiled/obj/first_dep.o?

With both gfortran and ifort I have tried:

ifort build/obj/cumbersome.o -Lprecompiled/obj first_dep.o -o build/Cumbersome

but I have failed

ifort: error #10236: File not found:  'first_dep.o'

@jacobwilliams
Copy link
Author

I think it only works for libraries (not .o files). Here's an example (with gfortran...but I think ifort might be the same).

├── build
├── lib
│   └── libblah.a
└── src
    └── cumbersome.f90

To compile, you would use:

gfortran -lblah -L./lib ./src/cumbersome.f90 -o build/Cumbersome

Note that the library is named libblah.a, but you only use -lblah in the call (the compiler puts the lib prefix and .a suffix. This is weird but that's what it does.

@szaghi
Copy link
Owner

szaghi commented Feb 7, 2015

Thanks, I will try it monday.

Have a good weekend.

@szaghi
Copy link
Owner

szaghi commented Feb 9, 2015

Dear Jacob,

your feature should be implemented. I have pushed the new release on both this github repo and PyPi, thus you can install via pip or manually.

I have added some more documentations:

Please, let me know of any bugs you will find.

P.S. Now that FoBiS.py is on PyPi I am testing some nice (IMHO) Travis CI "extensions" for Fortran programs... maybe you will interested on that.

@szaghi szaghi closed this as completed Feb 9, 2015
@szaghi szaghi removed the in progress label Feb 9, 2015
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