summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/fortran.py
Commit message (Collapse)AuthorAgeFilesLines
...
* compilers: Split C-Like functionality into a mixin classesDylan Baker2019-05-031-172/+5
| | | | | | | | | | | | | | | | | Currently C++ inherits C, which can lead to diamond problems. By pulling the code out into a standalone mixin class that the C, C++, ObjC, and Objc++ compilers can inherit and override as necessary we remove one source of diamonding. I've chosen to split this out into it's own file as the CLikeCompiler class is over 1000 lines by itself. This also breaks the VisualStudio derived classes inheriting from each other, to avoid the same C -> CPP inheritance problems. This is all one giant patch because there just isn't a clean way to separate this. I've done the same for Fortran since it effectively inherits the CCompiler (I say effectively because was it actually did was gross beyond explanation), it's probably not correct, but it seems to work for now. There really is a lot of layering violation going on in the Compilers, and a really good scrubbing would do this code a lot of good.
* Merge pull request #4952 from mensinda/cacheCompilesDylan Baker2019-05-021-10/+10
|\ | | | | Cache compilers.compile() in coredata
| * Disable cache for dependenciesDaniel Mensinger2019-04-281-4/+4
| |
| * Add disable_cache to the fortran compilerDaniel Mensinger2019-04-281-6/+6
| |
* | per-target manual specification of link_languageMichael Hirsch, Ph.D2019-05-021-1/+3
| |
* | better default order for fotran compiler searchMichael Hirsch, Ph.D2019-04-271-2/+2
|/ | | | | | | | correct PGI windows detection doc cleanup PGI detect
* fortran: fix compile.links() when passing dependenciesTamer Fahmy2019-04-221-1/+1
| | | | | With dependencies specifed, mode='compile' causes it to ignore the link arguments and thereby always fails.
* BUGFIX: don't crash Meson on bad existing exe file for Fortran sanity checkMichael Hirsch, Ph.D2019-04-051-11/+24
|
* Sanity check with external argsJohn Ericson2019-03-271-2/+13
| | | | | | | | | Previously cross, but not native, external args were used. Then in d451a4bd97f827bb492fd0c0e357cb20b6056ed9 the cross special cases were removed, so external args are never used. This commit switches that so they are always used. Sanity checking works just the same as compiler checks like has header / has library.
* more efficient submodule filenamingMichael Hirsch, Ph.D2019-03-251-3/+4
|
* BUGFIX: match submodule output names by compilerMichael Hirsch, Ph.D2019-03-251-1/+11
|
* replace library type strings with an enumDylan Baker2019-03-201-2/+2
| | | | | | | This patch creates an enum for selecting libtype as static, shared, prefer-static, or prefer-shared. This also renames 'static-shared' with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is just a refactor with no behavioral changes or user facing changes.
* Add static as keyword to find_libraryNiklas Claesson2019-03-111-2/+3
|
* Add warning level zerojml17952019-02-191-6/+12
|
* Remove get_cross_extra_flagsJohn Ericson2019-02-151-2/+1
| | | | This is no longer needed, we just remove conditionals around it.
* BUGFIX: Fortran openmpMichael Hirsch, Ph.D2019-02-131-0/+6
|
* Fortran 2008 submodule (#4874)Michael Hirsch, Ph.D2019-02-051-1/+1
|
* better handle variable HDF5 setups, update Fortran compiler defMichael Hirsch, Ph.D2019-02-011-2/+2
|
* BUGFIX: allow fc.run(code) to work, pick only Fortran moduleMichael Hirsch, Ph.D2019-01-291-4/+1
|
* BUGFIX: broken/missing Fortran code/unit testsMichael Hirsch, Ph.D2019-01-271-2/+11
|
* Add PGI C and C++ compilers (#4803)Michael Hirsch, Ph.D2019-01-211-7/+0
|
* FlangFortranCompiler inherit ClangCompilerMichael Hirsch, Ph.D2019-01-161-3/+8
|
* better handle link args: PGI and FlangMichael Hirsch, Ph.D2019-01-161-2/+2
| | | | correct flang, pgi options
* Flang Fortran compiler added.Michael Hirsch, Ph.D2019-01-161-0/+7
|
* restore PGI compile functioningMichael Hirsch, Ph.D2019-01-151-13/+7
|
* Added more compiler option supportDaniel Mensinger2019-01-061-1/+1
|
* Absolute path generation refactoringDaniel Mensinger2019-01-061-0/+7
|
* compilers/fortran: pass -module ${path} instead of -module${path}Dylan Baker2018-11-151-1/+1
| | | | | ifort doesn't like the latter, and gfortran seems happy with the former. I don't have any of the other supported fortran compilers to test with.
* ifort: ifort needs to have -lifcore like gfotran needs -lgfortranDylan Baker2018-11-151-0/+3
|
* compilers: Move get_allow_undefined_link_args to CompilerDylan Baker2018-11-151-3/+0
| | | | | | | This allows each implementation (gnu-like) and msvc to be implemented in their respective classes rather than through an if tree in the CCompiler class. This is cleaner abstraction and allows us to clean up the Fortran compiler, which was calling CCompiler bound methods without an instance.
* fortran: ifort doesn't have -pipeDylan Baker2018-11-151-0/+6
|
* compilers: Use keyword only arguments for compiler interfacesDylan Baker2018-11-131-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | Because we need to inherit them in some cases, and python's keyword-or-positional arguments make this really painful, especially with inheritance. They do this in two ways: 1) If you want to intercept the arguments you need to check for both a keyword and a positional argument, because you could get either. Then you need to make sure that you only pass one of those down to the next layer. 2) After you do that, if the layer below you decides to do the same thing, but uses the other form (you used keyword by the lower level uses positional or vice versa), then you'll get a TypeError since two layers down got the argument as both a positional and a keyword. All of this is bad. Fortunately python 3.x provides a mechanism to solve this, keyword only arguments. These arguments cannot be based positionally, the interpreter will give us an error in that case. I have made a best effort to do this correctly, and I've verified it with GCC, Clang, ICC, and MSVC, but there are other compilers like Arm and Elbrus that I don't have access to.
* Use enum instead of `int` for compiler variantsDavid Seifert2018-09-161-7/+7
| | | | | | | | * Enums are strongly typed and make the whole `gcc_type`/`clang_type`/`icc_type` distinction redundant. * Enums also allow extending via member functions, which makes the code more generalisable.
* Remove unnecessary -lquadmath from FORTRAN flags.Jussi Pakkanen2018-09-021-1/+1
|
* find_library: Allow undefined symbols while linkingNirbheek Chauhan2018-08-221-0/+3
| | | | | Shared libraries may not always be linkable without the use of other libraries, so don't make it a linker error.
* find_library: Use _build_wrapper to get library dirsBruce Richardson2018-08-221-4/+7
| | | | | | | | | | This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes https://github.com/mesonbuild/meson/issues/3881
* Convert buildtype to optimization and debug options (#3489)Jussi Pakkanen2018-08-181-7/+50
|
* Fix searching of shared libraries on OpenBSD (#3851)Nirbheek Chauhan2018-07-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * get_library_naming: Use templates instead of suffix/prefix pairs This commit does not change functionality, and merely sets the groundwork for a more flexibly naming implementation. * find_library: Fix manual searching on OpenBSD On OpenBSD, shared libraries are called libfoo.so.X.Y where X is the major version and Y is the minor version. We were assuming that it's libfoo.so and not finding shared libraries at all while doing manual searching, which meant we'd link statically instead. See: https://www.openbsd.org/faq/ports/specialtopics.html#SharedLibs Now we use file globbing to do searching, and pick the first one that's a real file. Closes https://github.com/mesonbuild/meson/issues/3844 * find_library: Fix priority of library search in OpenBSD Also add unit tests for the library naming function so that it's absolutely clear what the priority list of naming is. Testing is done with mocking on Linux to ensure that local testing is easy
* macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan2018-06-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | On macOS, we set the install_name for built libraries to @rpath/libfoo.dylib, and when linking to the library, we set the RPATH to its path in the build directory. This allows all built binaries to be run as-is from the build directory (uninstalled). However, on install, we have to strip all the RPATHs because they point to the build directory, and we change the install_name of all built libraries to the absolute path to the library. This causes the install name in binaries to be out of date. We now change that install name to point to the absolute path to each built library after installation. Fixes https://github.com/mesonbuild/meson/issues/3038 Fixes https://github.com/mesonbuild/meson/issues/3077 With this, the default workflow on macOS matches what everyone seems to do, including Autotools and CMake. The next step is providing a way for build files to override the install_name that is used after installation for use with, f.ex., private libraries when combined with the install_rpath: kwarg on targets.
* find_library: Add a cache for library searchingNirbheek Chauhan2018-06-071-1/+9
| | | | | | | | | Otherwise we can end up searching for the same library tens of times, because pkg-config does not de-duplicate -lfoo args before returning them. We use -Wl,--start-group/end-group, so we do not need to worry about ordering issues in static libraries.
* Fix issues found by flake8Xavier Claessens2018-06-061-2/+0
|
* Add support for finding libraries in Fortran projectsMatthew Krupcale2018-05-211-168/+179
| | | | | | | | * mesonbuild/compilers/c.py: Make the `find_library` method more generic by allowing the user to supply the `code` for compiling and linking. * mesonbuild/compilers/fortran.py: Use the methods inherited from `Compiler` base class where appropriate. Also reuse `CComiler` methods where applicable. This should be sufficient to get various compiler/linker arguments as well as to compile and link Fortran programs. This was tested with `gfortran` compiler, and while the other compilers ought to work for simple cases, their methods are primarily inherited from the base `FortranCompiler` class. * test cases/fortran/10 find library/gzip.f90: Fortran module with some basic Fortran wrapper interfaces to `gzopen`, `gzwrite`, and `gzclose` C `zlib` functions. * test cases/fortran/10 find library/main.f90: Fortran program using the `gzip` Fortran interface module to write some data to a gzip file. * test cases/fortran/10 find library/meson.build: Meson build file for this test case. This demonstrates the ability to link the Fortran program against an external library.
* Revert "Add macOS linker versioning information"Nirbheek Chauhan2018-05-091-2/+2
| | | | | | This reverts commit fa6ca160548d7e8df9c4c724e6c96f5e004e5316. Closes https://github.com/mesonbuild/meson/issues/3550
* Can use C++ and FORTRAN in a single target. Closes #2685.dcppJussi Pakkanen2018-05-021-1/+3
|
* Add an OpenMP dependency.Elliott Sales de Andrade2018-04-171-0/+19
| | | | | This works similarly to the thread dependency which stores the various inconsistent flags in each compiler.
* Add macOS linker versioning informationTom Schoonjans2018-04-161-2/+2
| | | | | | This patch exploits the information residing in ltversion to set the -compatibility_version and -current_version flags that are passed to the linker on macOS.
* Added Elbrus lcc compilers support as inheritance from gcc onesmakise-homura2018-03-191-0/+7
|
* Use os.path: basename() and dirname() instead of split()Aleksey Filippov2018-01-301-1/+1
| | | | | | | | | | | | According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
* Merge pull request #2791 from behlec/compiler-versionJussi Pakkanen2017-12-201-18/+18
|\ | | | | Add more version information to compiler
| * More version information for Fortran.Christoph Behle2017-12-161-18/+18
| |