Commit Graph

71 Commits

Author SHA1 Message Date
Dylan Baker 16e04a9bde compilers/fortran: Make ifort (windows) proxy extra args to Compiler 2019-08-14 13:13:23 -07:00
Dylan Baker b5c76a6c02 compilers/fortran: fix ifort (linux, mac) dependency generation
Ifort can generate dependency information (.d files), it just does it
differently than GNU compilers do. This also fixes a bug caused by
adding the dependency generation commands to the GNULike class later in
this series.
2019-08-14 13:13:23 -07:00
Michael Hirsch, Ph.D bc08ace84e
Flang: add links for non-flang main program 2019-07-29 01:18:54 -04:00
Dylan Baker fab47c5680 compilers: split pgi compiler out of compilers module 2019-07-15 10:59:22 -07:00
Dylan Baker 5d685e7a5c compilers: put elbrus in mixins 2019-07-15 10:59:22 -07:00
Dylan Baker bc4438b34f compilers: Put clang mixin in a module 2019-07-15 10:59:22 -07:00
Dylan Baker b8368c1617 compilers: Put Intel compiler classes into the mixins folder 2019-07-15 10:59:22 -07:00
Dylan Baker cd5360821a compilers: split gnu and gnulike compilers out of compilers
I debated a bit whether both classes really belong in the same module,
and decided that they do because the share a number of helpers.
2019-07-15 10:59:22 -07:00
Dylan Baker d483da46a9 compilers: Move clike into a mixins directory
The compilers module is rather large and confusing, with spaghetti
dependencies going every which way. I'm planning to start breaking out
the internal representations into a mixins submodule, for things that
shouldn't be required outside of the compilers module itself.
2019-07-15 10:59:22 -07:00
Michael Hirsch, Ph.D c89aa20941 known Python 3.5 on windows workaround for subprocess(cwd=str(Path)) 2019-06-24 14:06:33 -04:00
Michael Hirsch, Ph.D 1d6ed8cac8 windows ifort can't do shared_library sanely 2019-06-24 14:06:32 -04:00
Michael Hirsch, Ph.D 5b109c9ad2 correct missing argument for IntelClFortranCompiler
ifort passes all tests

cleanup logic
2019-06-24 14:06:32 -04:00
John Ericson 07777e15d4 Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.

As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
2019-06-09 13:13:25 -04:00
Dylan Baker 7f1cecf25b compilers/fortran: Fix all has_argument methods in meson
Apparently we have no tests for this because this is broken pretty
badly. This extends the basic test to actually check for the correct
free-form argument and thus test this.
2019-05-16 22:01:35 +03:00
Dylan Baker fa54f05f09 compilers: Add basic ICL abstractions 2019-05-13 11:22:31 -07:00
Dylan Baker 080f59cf43 compilers: rename IntelCompiler to IntelGnuLikeCompiler
The Intel compiler is strange. On Linux and macOS it's called ICC, and
it tries to mostly behave like gcc/clang. On Windows it's called ICL,
and tries to behave like MSVC. This makes the code that's used to
implement ICC support useless for supporting ICL, because their command
line interfaces are completely different.
2019-05-13 11:22:31 -07:00
Dylan Baker 541523eeba compilers: Split C-Like functionality into a mixin classes
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.
2019-05-03 10:36:50 -07:00
Dylan Baker c0aa89e57f
Merge pull request #4952 from mensinda/cacheCompiles
Cache compilers.compile() in coredata
2019-05-02 14:54:02 -07:00
Michael Hirsch, Ph.D 06bfc2dab6 per-target manual specification of link_language 2019-05-02 23:26:51 +03:00
Daniel Mensinger 8a32fc8dbe
Disable cache for dependencies 2019-04-28 14:33:22 +02:00
Daniel Mensinger 47c06a7875
Add disable_cache to the fortran compiler 2019-04-28 14:33:22 +02:00
Michael Hirsch, Ph.D ee40533b61 better default order for fotran compiler search
correct PGI windows detection

doc

cleanup PGI detect
2019-04-27 23:19:01 -04:00
Tamer Fahmy 0259cc6de2 fortran: fix compile.links() when passing dependencies
With dependencies specifed, mode='compile' causes it to ignore the link
arguments and thereby always fails.
2019-04-22 15:46:43 -07:00
Michael Hirsch, Ph.D d6be7822a0 BUGFIX: don't crash Meson on bad existing exe file for Fortran sanity check 2019-04-05 23:50:22 +03:00
John Ericson f4da210f46 Sanity check with external args
Previously cross, but not native, external args were used. Then in
d451a4bd97 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-27 10:54:56 -04:00
Michael Hirsch, Ph.D df74f8b7a9 more efficient submodule filenaming 2019-03-25 08:28:32 -04:00
Michael Hirsch, Ph.D a4827650fa BUGFIX: match submodule output names by compiler 2019-03-25 08:28:32 -04:00
Dylan Baker ac627bcea7 replace library type strings with an enum
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-20 18:45:56 +02:00
Niklas Claesson dd2c44cdf6 Add static as keyword to find_library 2019-03-11 20:56:52 +02:00
jml1795 a9e63568fe Add warning level zero 2019-02-19 00:06:27 +02:00
John Ericson d451a4bd97 Remove get_cross_extra_flags
This is no longer needed, we just remove conditionals around it.
2019-02-15 09:17:24 -08:00
Michael Hirsch, Ph.D 6b874339cc BUGFIX: Fortran openmp 2019-02-13 21:06:15 +02:00
Michael Hirsch, Ph.D 70e6f4198c Fortran 2008 submodule (#4874) 2019-02-05 22:41:44 +01:00
Michael Hirsch, Ph.D 8821c0aadc better handle variable HDF5 setups, update Fortran compiler def 2019-02-01 07:26:32 +00:00
Michael Hirsch, Ph.D cccffaa29d BUGFIX: allow fc.run(code) to work, pick only Fortran module 2019-01-29 23:25:23 +02:00
Michael Hirsch, Ph.D 8636f31d9c BUGFIX: broken/missing Fortran code/unit tests 2019-01-27 20:57:21 +02:00
Michael Hirsch, Ph.D 72486afd08 Add PGI C and C++ compilers (#4803) 2019-01-21 20:09:36 +02:00
Michael Hirsch, Ph.D 9bb21be59b
FlangFortranCompiler inherit ClangCompiler 2019-01-16 17:06:44 -05:00
Michael Hirsch, Ph.D 9a318d3d5a
better handle link args: PGI and Flang
correct flang, pgi options
2019-01-16 17:06:44 -05:00
Michael Hirsch, Ph.D b40c1af900
Flang Fortran compiler added. 2019-01-16 17:06:43 -05:00
Michael Hirsch, Ph.D fff88b354a restore PGI compile functioning 2019-01-15 20:27:31 +02:00
Daniel Mensinger 9eca2e46a0
Added more compiler option support 2019-01-06 12:19:33 +01:00
Daniel Mensinger 9742927903
Absolute path generation refactoring 2019-01-06 12:19:32 +01:00
Dylan Baker b17ab09eaf compilers/fortran: pass -module ${path} instead of -module${path}
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-15 18:42:25 -08:00
Dylan Baker a7845d91aa ifort: ifort needs to have -lifcore like gfotran needs -lgfortran 2018-11-15 18:42:25 -08:00
Dylan Baker 9f9cfd2139 compilers: Move get_allow_undefined_link_args to Compiler
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-15 18:42:25 -08:00
Dylan Baker 7329ae3ce6 fortran: ifort doesn't have -pipe 2018-11-15 18:42:25 -08:00
Dylan Baker de175aac00 compilers: Use keyword only arguments for compiler interfaces
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-11-13 00:40:13 +02:00
David Seifert 69ec001b06 Use enum instead of `int` for compiler variants
* 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-16 00:47:32 +03:00
Jussi Pakkanen 3d86a24b55 Remove unnecessary -lquadmath from FORTRAN flags. 2018-09-02 18:25:09 +03:00