aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/fortran.py
AgeCommit message (Collapse)AuthorFilesLines
2019-05-05Revert "Merge pull request #5323 from scivision/pgiflang"revert5323Jussi Pakkanen1-2/+2
This reverts commit 9cd89f55fca0933dd2897ac7470c5827d939e0ac, reversing changes made to 60969d99d33001317c569a9b37d3b9efae08d387.
2019-05-02Merge pull request #4952 from mensinda/cacheCompilesDylan Baker1-10/+10
Cache compilers.compile() in coredata
2019-05-02per-target manual specification of link_languageMichael Hirsch, Ph.D1-1/+3
2019-04-28Disable cache for dependenciesDaniel Mensinger1-4/+4
2019-04-28Add disable_cache to the fortran compilerDaniel Mensinger1-6/+6
2019-04-27better default order for fotran compiler searchMichael Hirsch, Ph.D1-2/+2
correct PGI windows detection doc cleanup PGI detect
2019-04-22fortran: fix compile.links() when passing dependenciesTamer Fahmy1-1/+1
With dependencies specifed, mode='compile' causes it to ignore the link arguments and thereby always fails.
2019-04-05BUGFIX: don't crash Meson on bad existing exe file for Fortran sanity checkMichael Hirsch, Ph.D1-11/+24
2019-03-27Sanity check with external argsJohn Ericson1-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.
2019-03-25more efficient submodule filenamingMichael Hirsch, Ph.D1-3/+4
2019-03-25BUGFIX: match submodule output names by compilerMichael Hirsch, Ph.D1-1/+11
2019-03-20replace library type strings with an enumDylan Baker1-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.
2019-03-11Add static as keyword to find_libraryNiklas Claesson1-2/+3
2019-02-19Add warning level zerojml17951-6/+12
2019-02-15Remove get_cross_extra_flagsJohn Ericson1-2/+1
This is no longer needed, we just remove conditionals around it.
2019-02-13BUGFIX: Fortran openmpMichael Hirsch, Ph.D1-0/+6
2019-02-05Fortran 2008 submodule (#4874)Michael Hirsch, Ph.D1-1/+1
2019-02-01better handle variable HDF5 setups, update Fortran compiler defMichael Hirsch, Ph.D1-2/+2
2019-01-29BUGFIX: allow fc.run(code) to work, pick only Fortran moduleMichael Hirsch, Ph.D1-4/+1
2019-01-27BUGFIX: broken/missing Fortran code/unit testsMichael Hirsch, Ph.D1-2/+11
2019-01-21Add PGI C and C++ compilers (#4803)Michael Hirsch, Ph.D1-7/+0
2019-01-16FlangFortranCompiler inherit ClangCompilerMichael Hirsch, Ph.D1-3/+8
2019-01-16better handle link args: PGI and FlangMichael Hirsch, Ph.D1-2/+2
correct flang, pgi options
2019-01-16Flang Fortran compiler added.Michael Hirsch, Ph.D1-0/+7
2019-01-15restore PGI compile functioningMichael Hirsch, Ph.D1-13/+7
2019-01-06Added more compiler option supportDaniel Mensinger1-1/+1
2019-01-06Absolute path generation refactoringDaniel Mensinger1-0/+7
2018-11-15compilers/fortran: pass -module ${path} instead of -module${path}Dylan Baker1-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.
2018-11-15ifort: ifort needs to have -lifcore like gfotran needs -lgfortranDylan Baker1-0/+3
2018-11-15compilers: Move get_allow_undefined_link_args to CompilerDylan Baker1-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.
2018-11-15fortran: ifort doesn't have -pipeDylan Baker1-0/+6
2018-11-13compilers: Use keyword only arguments for compiler interfacesDylan Baker1-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.
2018-09-16Use enum instead of `int` for compiler variantsDavid Seifert1-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.
2018-09-02Remove unnecessary -lquadmath from FORTRAN flags.Jussi Pakkanen1-1/+1
2018-08-22find_library: Allow undefined symbols while linkingNirbheek Chauhan1-0/+3
Shared libraries may not always be linkable without the use of other libraries, so don't make it a linker error.
2018-08-22find_library: Use _build_wrapper to get library dirsBruce Richardson1-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
2018-08-18Convert buildtype to optimization and debug options (#3489)Jussi Pakkanen1-7/+50
2018-07-09Fix searching of shared libraries on OpenBSD (#3851)Nirbheek Chauhan1-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
2018-06-18macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan1-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.
2018-06-07find_library: Add a cache for library searchingNirbheek Chauhan1-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.
2018-06-06Fix issues found by flake8Xavier Claessens1-2/+0
2018-05-21Add support for finding libraries in Fortran projectsMatthew Krupcale1-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.
2018-05-09Revert "Add macOS linker versioning information"Nirbheek Chauhan1-2/+2
This reverts commit fa6ca160548d7e8df9c4c724e6c96f5e004e5316. Closes https://github.com/mesonbuild/meson/issues/3550
2018-05-02Can use C++ and FORTRAN in a single target. Closes #2685.Jussi Pakkanen1-1/+3
2018-04-17Add an OpenMP dependency.Elliott Sales de Andrade1-0/+19
This works similarly to the thread dependency which stores the various inconsistent flags in each compiler.
2018-04-16Add macOS linker versioning informationTom Schoonjans1-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.
2018-03-19Added Elbrus lcc compilers support as inheritance from gcc onesmakise-homura1-0/+7
2018-01-30Use os.path: basename() and dirname() instead of split()Aleksey Filippov1-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
2017-12-20Merge pull request #2791 from behlec/compiler-versionJussi Pakkanen1-18/+18
Add more version information to compiler
2017-12-18Use -MD instead of -MMD for reliability.Jussi Pakkanen1-1/+1