Hi,
I wrote earlier and got no response. Now I'm trying again.
I installed gpc on a new machine with redhat 9. I can compile and run easy demo programs. But any program the has C-code in it, or uses a unit with C-code, gets rejected.
Under gp, the message is gp: Pascal and C compilers specified seem to be for different platforms gp: ('i686-pc-linux-gnu' and 'i386-redhat-linux')
Using gpc directly, I can compile the unit crt.pas, but when I try to compile a program that uses it, I get a message saying that crt.gpi needs to be recompiled. Recompiling crt.gpi does not change anything.
What do I need to do to get some version of gpc working on this system?
thanks, Toby
Toby Ewing wrote:
I wrote earlier and got no response. Now I'm trying again.
I installed gpc on a new machine with redhat 9. I can compile and run easy demo programs. But any program the has C-code in it, or uses a unit with C-code, gets rejected.
Under gp, the message is gp: Pascal and C compilers specified seem to be for different platforms gp: ('i686-pc-linux-gnu' and 'i386-redhat-linux')
Using gpc directly, I can compile the unit crt.pas, but when I try to compile a program that uses it, I get a message saying that crt.gpi needs to be recompiled. Recompiling crt.gpi does not change anything.
Try `--automake' (not necessary with gp).
What do I need to do to get some version of gpc working on this system?
I did reply on the list (15 Mar). Didn't you get it? Again:
Not the compiler, but the gp utility which you're apparently using. Yes, gp is very strict in this regard.
If you're sure what you're doing, you can disable this check with `--no-check-platform'.
Alternatively you can pass `CC=gpc' to use the gpc as the driver for the C compiler. This should work provided cc1 was installed with gpc. The advantage then is that you definitely have the same backends working. (Though mismatches usually are no problem under Linux and many other systems, indeed.)
Frank
Frank Heckenbach wrote:
Toby Ewing wrote:
I wrote earlier and got no response. Now I'm trying again.
I installed gpc on a new machine with redhat 9. I can compile and run easy demo programs. But any program the has C-code in it, or uses a unit with C-code, gets rejected.
Under gp, the message is gp: Pascal and C compilers specified seem to be for different platforms gp: ('i686-pc-linux-gnu' and 'i386-redhat-linux')
Using gpc directly, I can compile the unit crt.pas, but when I try to compile a program that uses it, I get a message saying that crt.gpi needs to be recompiled. Recompiling crt.gpi does not change anything.
Try `--automake' (not necessary with gp).
What do I need to do to get some version of gpc working on this system?
I did reply on the list (15 Mar). Didn't you get it? Again:
Not the compiler, but the gp utility which you're apparently using. Yes, gp is very strict in this regard.
If you're sure what you're doing, you can disable this check with `--no-check-platform'.
Alternatively you can pass `CC=gpc' to use the gpc as the driver for the C compiler. This should work provided cc1 was installed with gpc. The advantage then is that you definitely have the same backends working. (Though mismatches usually are no problem under Linux and many other systems, indeed.)
I didn't get your 15 Mar reply -- not sure how that happened, as I've been looking for a reply.
--automake does work, and so does gp --no-check-platform. Thank you! I'm particularly pleased that I can use gp, which I really like.
gp.info makes reference to the possibility of using a .gp file to store user-specific options, but I've had no luck with this, either in the gp directory, or in the source directory. I just made a file .gp with --no-check-platform in it. Is there more involved than this?
Thanks to all the others who answered. I will use those approaches when I install the next version, but I needed something fast.
Toby
Toby Ewing wrote:
--automake does work, and so does gp --no-check-platform. Thank you! I'm particularly pleased that I can use gp, which I really like.
Thanks.
gp.info makes reference to the possibility of using a .gp file to store user-specific options, but I've had no luck with this, either in the gp directory, or in the source directory. I just made a file .gp with --no-check-platform in it. Is there more involved than this?
Yes -- I have to implement it. ;-) GP is still work in progress. Parts of the config file support exists, but I have to finish them, I currently I'm busy with GPC.
For now, you could use a small script or shell alias to add the option.
Frank
Frank Heckenbach wrote:
Toby Ewing wrote:
--automake does work, and so does gp --no-check-platform. Thank you! I'm particularly pleased that I can use gp, which I really like.
Thanks.
gp.info makes reference to the possibility of using a .gp file to store user-specific options, but I've had no luck with this, either in the gp directory, or in the source directory. I just made a file .gp with --no-check-platform in it. Is there more involved than this?
Yes -- I have to implement it. ;-) GP is still work in progress. Parts of the config file support exists, but I have to finish them, I currently I'm busy with GPC.
For now, you could use a small script or shell alias to add the option.
Frank
I'm no expert, but here are things I did on SuSE 8.1 (I use Red Hat 9.0 for a gateway server but no development).
(I installed GPC and GCC in a /home/rick subdirectory so it is separate from system directories.)
You need to create some "environment" variables to make the GCC back end compile, link, and run programs(very important) from unusual directories. These variables are; C_INCLUDE_PATH, LIBRARY_PATH, and LD_LIBRARY_PATH. Set these variables in your shell configuration script. For user logins on both SuSE and RH this is /home/rick/.bashrc . For example; C_INCLUDE_PATH=/usr/include:/usr/local/include export C_INCLUDE_PATH
Further, you can create a shell alias like this; gpcc='/home/rick/compiler/bin/gpc --executable-file-name --automake --unit-path=/home/rick/gpc/compiler/lib/gcclib/ ... ' export gpcc
Now you should be able to compile and link by typing $gpcc program.pas . Also, your programs will find their libraries at runtime.
Of course, none of this will work if your name is not rick.
Rick Engebretson wrote:
Further, you can create a shell alias like this; gpcc='/home/rick/compiler/bin/gpc --executable-file-name --automake --unit-path=/home/rick/gpc/compiler/lib/gcclib/ ... ' export gpcc
Now you should be able to compile and link by typing $gpcc program.pas .
That's actually no alias, but a variable. An alias is this:
alias gpcc='blah ...'
gpcc program.pas
Frank
On Mon, 21 Mar 2005, Toby Ewing wrote:
Hi,
I wrote earlier and got no response. Now I'm trying again.
I installed gpc on a new machine with redhat 9. I can compile and run easy demo programs. But any program the has C-code in it, or uses a unit with C-code, gets rejected.
Under gp, the message is gp: Pascal and C compilers specified seem to be for different platforms gp: ('i686-pc-linux-gnu' and 'i386-redhat-linux')
Using gpc directly, I can compile the unit crt.pas, but when I try to compile a program that uses it, I get a message saying that crt.gpi needs to be recompiled. Recompiling crt.gpi does not change anything.
What do I need to do to get some version of gpc working on this system?
While not the only way, a safe way is to get the gpc and gcc sources and compile gpc/gcc so that they will match exactly on your computer. The last beta of gpc and gcc-3.3.5 is fine. When you run configure remember to include --enable-languages=c,pascal
Russ
On 21 Mar 2005 at 16:49, Toby Ewing wrote:
Hi,
I wrote earlier and got no response. Now I'm trying again.
I installed gpc on a new machine with redhat 9. I can compile and run easy demo programs. But any program the has C-code in it, or uses a unit with C-code, gets rejected.
Under gp, the message is gp: Pascal and C compilers specified seem to be for different platforms gp: ('i686-pc-linux-gnu' and 'i386-redhat-linux')
Using gpc directly, I can compile the unit crt.pas, but when I try to compile a program that uses it, I get a message saying that crt.gpi needs to be recompiled. Recompiling crt.gpi does not change anything.
What do I need to do to get some version of gpc working on this system?
If you are building gpc yourself, first run "gcc -dumpmachine". The output of that should be your target when configuring - e.g., if the output is "i686-blah" then you run: "./configure --host=i686-blah --target=i686-blah --build=i686-blah -- prefix=/usr --enable-languages=pascal && make"
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/