janverschelde / PHCpack

The primary source code repository for PHCpack, a software package to solve polynomial systems with homotopy continuation methods.
http://www.phcpack.org
GNU General Public License v3.0
59 stars 21 forks source link

Wishlist: Support user build flags #54

Open d-torrance opened 3 years ago

d-torrance commented 3 years ago

There are some standard variables (CPPFLAGS, CFLAGS, CXXFLAGS, and LDFLAGS) that are frequently set by users to pass build flags to compilers. For example, Debian uses them for hardening binaries in its packages.

It would be great if support for these variables be could be added. For gprbuild, the following works for C code:

        for Default_Switches ("C") use External_As_List ("CPPFLAGS", " ") &
            External_As_List ("CFLAGS", " ");
zhangyusi-hub commented 3 years ago

Hello, I want to ask you two problems about the gnat compilers. I used the following method to compile the makefile in /PHCpack/src/MPI: cd /PHCpack/src/MPI make all

But there is a following error with gnatbind: invalid switch: -C gcc -c call_hello.c gnatmake -c hello.adb gnatmake: objects up to date. gnatbind -n -C hello gnatbind: invalid switch: -C

And when I modify it with gnatbind -n -c hello, there is another error with gnatlink: Failed to open binder output: gcc -c call_hello.c gnatmake -c hello.adb gnatmake: objects up to date. gnatbind -n -c hello gnatlink -c hello call_hello.o adatest.o -o adatest --LINK=/BIGDATA1/app/MPI/mpich/3.2.1-gcc-4.8.5-dynamic/bin/mpicc gnatlink: Failed to open binder output Could you tell me how to solve the two problems about the compile commands gnatbind and gnatlink ?