Commit Graph

484 Commits

Author SHA1 Message Date
Aleksey Gurtovoy 6ac5db50c9 CUDA support on Windows 2019-09-24 14:22:20 -07:00
Jehan 179861ccd1 mesonbuild: fix exception name.
CrossNoRunException is in compilers module, not mesonlib.
2019-09-23 13:25:53 -04:00
Dylan Baker 4030ee4b6f the solaris linker also needs start/end-group for circular linking 2019-09-09 21:22:26 -07:00
Nguyen, Giang (G. Yakiro) 333f77ad3d fix objc freestanding sanitycheck 2019-09-08 16:27:52 +03:00
Jussi Pakkanen d67d5411bb
Merge pull request #5823 from scivision/linker-pgi-linux
PGI compiler fixes
2019-09-05 23:45:54 +03:00
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +03:00
Michael Hirsch, Ph.D b9af8f8b6b
PGI cannot accept -pthread 2019-09-05 11:58:10 -04:00
Michael Hirsch, Ph.D c8d380e4ef
PGI: use ar link wrapper on Windows 2019-09-05 11:50:17 -04:00
Kramer Peace caec875fe1 Create CUDA linker with CUDA compiler
Since they are laways paired there is no need to "search" for the cuda
linker.
2019-09-05 08:38:56 -07:00
Kramer Peace fb9a5ce867 Add a CUDA linker object
Fixes issue #5870
2019-09-05 08:38:56 -07:00
Dylan Baker 0efab591da compilers: Move the compiler argument to proxy linker flags to the compiler class
Instead of the DynamicLinker returning a hardcoded value like
`-Wl,-foo`, it now is passed a value that could be '-Wl,', or could be
something '-Xlinker='

This makes a few things cleaner, and will make it possible to fix using
clang (not clang-cl) on windows, where it invokes either link.exe or
lld-link.exe instead of a gnu-ld compatible linker.
2019-08-30 00:01:32 +03:00
Dylan Baker ba4324ab9d Fix gcc include dot 2019-08-28 22:20:00 +03:00
Jussi Pakkanen 1ea3ddc6ad
Merge pull request #5681 from dcbaker/dynamic-linker-split
split dynamic linker representations from compilers
2019-08-20 23:14:05 +03:00
Phillip Cao 0384487fc5 Fix CCRX linking external dependencies 2019-08-20 21:10:37 +03:00
Jussi Pakkanen 80ef6fd69f Pass optimization flags to rustc properly. Closes: #5788. 2019-08-17 21:14:16 +03:00
Dylan Baker 06dcbd50ee compilers: Dispatch to dynamic linker class
Most of the cuda code is from Olexa Bilaniuk.
Most of the PGI code is from Michael Hirsc
2019-08-14 13:13:23 -07:00
Dylan Baker 38d588bc6e compilers/mixins: Add a module for mixins for compilers that are linkers
This is currently meant to solve problems for D's DMD compiler, however
it may be useful in other cases.
2019-08-14 13:13:23 -07:00
Dylan Baker b0f4ee2f94 compilers/rust: Proxy extra kwargs to Compiler.__init__ 2019-08-14 13:13:23 -07:00
Dylan Baker 18b1bf9292 compilers: Make MSVClike compilers proxy extra keyword arguments 2019-08-14 13:13:23 -07:00
Dylan Baker 16e04a9bde compilers/fortran: Make ifort (windows) proxy extra args to Compiler 2019-08-14 13:13:23 -07:00
Dylan Baker 61255eca16 compilers/cuda: pass through extra kwargs 2019-08-14 13:13:23 -07:00
Dylan Baker 1f66e6708b compilers/swift: Pass extra args to the Compiler constructor 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
Dylan Baker e7db288e19 compilers/objc[pp]: Pass extra keyword arguments to Compiler constructor 2019-08-14 13:13:23 -07:00
Dylan Baker 499c44dc77 compilers/cuda: don't use re for replacement
Even with the check (for extra safety) string.replace is more than twice
as fast.
2019-08-14 13:13:23 -07:00
Michael Hirsch, Ph.D f5f7a7bbb3 compilers/mixins/pgi: simplify pic logic 2019-08-14 13:13:22 -07:00
Dylan Baker 90e43dbdfe re-architect the D compiler abstractions
We support 3 D compilers, DMD, LDC, and GDC. DMD is the reference
compiler, and LDC attempts to largely mirror it's command line usage.
GDC does not, it instead acts like GCC (which makes sense). The current
abstraction puts DMD behavior in the base D compiler and then overrides
then in the GnuDCompiler class.

This is messy, but it becomes more problematic when splitting the linker
and compiler abstractions apart.

I've opted to instead split the DCompiler class into two separate
classes. The DCompiler implements core D functinoality, and
DmdLikeCompilerMixin, which implements the DMD and LDC command line
arguments. I've then mxed that into the DmdDCompiler and LLVMDCompiler
classes, and mixed the GnuCompiler into the GnuDCompiler class to get
Gnu command line behavior.
2019-08-14 13:13:22 -07:00
Jussi Pakkanen f41bdae368 Add basic Webassembly support via Emscripten. 2019-08-05 19:31:32 +03:00
Xavier Claessens 32bd8a3847 Fix cross compilation on OSX
Do not set -Wl,-headerpad_max_install_names when compiling on OSX for
another platform. It causes linker issues.
2019-08-04 21:45:40 +03:00
Jussi Pakkanen 9a62d6932b Make ARM compilers work on Linux. 2019-08-02 19:27:00 +03:00
Michael Hirsch, Ph.D d0e78a2534
default libtype to static to allow windows compilers to not skip
To make Fortran tests useful on Windows, the library_type should default to static,
unless needed to specifically test shared. Shared Fortran libs on Windows for
non-Gfortran compilers is fragile requiring proprietary code syntax.
2019-07-30 15:31:00 -04:00
Michael Hirsch, Ph.D 7eebb6749a
no special shared lib args for PGI 2019-07-30 15:29:51 -04:00
Michael Hirsch, Ph.D 1e08d81476
PGI -shared is for Linux only 2019-07-30 15:29:50 -04:00
Jussi Pakkanen 3e54719ab8
Merge pull request #5740 from scivision/intel-ci_fix
tests: Intel-cl fixes for Fortran
2019-07-30 18:21:30 +03:00
Michael Hirsch, Ph.D 1e53f67187 PGI: cpp_pch precompiled headers functionality
* PGI C++ PCH enable

PGI compilers support precompiled headers for C++ only.
The common/13 pch test passes if run manually with no spaces in the build path.
However, since Meson run_project_tests.py makes temporary build directories
with spaces in each tests, PGI --pch_dir can't handle this and fails.
So we skip the test for PGI despite it working for usual case with no-spaces
in build dir.
Note: it's fine to have spaces in full path for sourcedir, just no spaces in
relative path to builddir.

* doc
2019-07-30 18:07:20 +03:00
Michael Hirsch, Ph.D a7c8a69afb
intel-cl: readd missing import 2019-07-30 00:27:13 -04:00
Michael Hirsch, Ph.D bc08ace84e
Flang: add links for non-flang main program 2019-07-29 01:18:54 -04:00
Dylan Baker c8a6a44850 compilers: pull sanitzier args into compiler classes
This simplifies and cleans things up.
2019-07-23 09:58:24 +00:00
Dylan Baker 5d7395673d compilers: return as-needed args as a list 2019-07-23 09:58:24 +00:00
Dylan Baker 7eb1d89095 compilers: Move lto args into compiler class
There are two problems, one is that it assumes -flto is the argument
to do LTO/WPO, which isn't true of ICC and MSVC (and presumably)
others. It's also incorrect because it assumes that the compiler and
linker will always be the same, which isn't necessarily true. You
could combine GCC with Apple's linker, or clang with link.exe, which
use different arguments.
2019-07-23 09:58:24 +00:00
Nirbheek Chauhan 9c2724bce5 Add optional progress bar when generating build.ninja 2019-07-20 17:02:15 +03:00
Jeremy Philippe c206f3cb1d ValaCompiler: only emit '--debug' in debug build. 2019-07-20 05:48:53 +00:00
Daniel Mensinger bc0f510ef1 fix all flake8 issues 2019-07-18 23:43:29 +03:00
Martin Liska c1870889b1 Fix missing return statements that are seen with -Werror=return-type.
Error example:

Code:

        #include <locale.h>
        int main () {
            /* If it's not defined as a macro, try to use as a symbol */
            #ifndef LC_MESSAGES
                LC_MESSAGES;
            #endif
        }
Compiler stdout:

Compiler stderr:
 In file included from /usr/include/locale.h:25,
                 from /tmp/tmpep_i4iwg/testfile.c:2:
/usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  382 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
/tmp/tmpep_i4iwg/testfile.c: In function 'main':
/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type]
    8 |         }
      |         ^
cc1: some warnings being treated as errors
2019-07-16 09:49:03 +02:00
Dylan Baker 42d34095b4 compilers/mixins/pgi: Finish type annoations 2019-07-15 10:59:22 -07:00
Dylan Baker fab47c5680 compilers: split pgi compiler out of compilers module 2019-07-15 10:59:22 -07:00
Dylan Baker f574beffb4 compilers/mixins/elbrus: add type annotations and fix types
There is a pretty big error in here, trying to return a tuple
comperhension: (a for a in []) is not a tuple, it's a generator. This
has profound type annotations: generators don't support most tuple or
list methods, and they can only be iterated once. Beyond that tuples are
meant for heterogenous types, ie, position matters for types. I've
converted the output to a list in all cases.
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 1b276598ce compilers/mixins/clang: Add type annotations 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