gobo-eiffel / gobo

The Gobo Eiffel Project provides the Eiffel community with free and portable Eiffel tools and libraries.
https://sourceforge.net/projects/gobo-eiffel/
Other
59 stars 24 forks source link

/Eiffel_23.09/library/cURL/spec/include/eiffel_curl.h:18:10: fatal error: eif_eiffel.h: No such file or directory #73

Closed mw66 closed 6 months ago

mw66 commented 6 months ago

I'm building:

/Eiffel_23.09/examples/cURL/sftp$ gec ./sftp.ecf
Degree 6: 0/0/0 0:0:0.020
Degree 5: 0/0/0 0:0:0.151
Degree 4: 0/0/0 0:0:0.066
Degree 3: 0/0/0 0:0:0.099
Degree -2: 0/0/0 0:0:0.095
Degree -3: 0/0/0 0:0:0.071
In file included from sftp.h:7043,
                 from sftp1.c:1:
/Eiffel_23.09/library/cURL/spec/include/eiffel_curl.h:18:10: fatal error: eif_eiffel.h: No such file or directory
   18 | #include "eif_eiffel.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Degree -4: 0/0/0 0:0:1
Total Time: 0/0/0 0:0:1.504

Any flag I need to pass in?

ebezault commented 6 months ago

What C compiler are you using? If it's gcc, edit the file gcc.cfg and add -I $GOBO/tool/gec/backend/c/runtime to the cc: line.

Note these files have been moved recently, so you might need to get the latest version of the code from Github.

mw66 commented 6 months ago

on my system, changed to -I$GOBO/tool/gec/runtime/c compile worked, but

/home/eiffel/workspace/PorterPackage/Eiffel_23.09/library/cURL/Clib/eiffel_curl.c:79: undefined reference to `eif_protect'
/home/eiffel/workspace/PorterPackage/Eiffel_23.09/library/cURL/Clib/eiffel_curl.c:88: undefined reference to `eif_wean'

This is strange, because my sys does not have /home/eiffel, so it's hard coded somewhere in Eiffel_23.09.

ebezault commented 6 months ago

eif_protect and eif_wean are coming from the ISE Eiffel runtime. I need to define them as no-op in gec.

ebezault commented 6 months ago

This is strange, because my sys does not have /home/eiffel, so it's hard coded somewhere in Eiffel_23.09.

And you did not try to compile eiffel_curl.c either. This C file is compiled in $ISE_EIFFEL/library/cURL/spec/linux-x86-64/lib/eiffel_curl.o and the C compiler tries to link it to the executable. So /home/eiffel/workspace/PorterPackage/Eiffel_23.09/library/cURL/Clib/eiffel_curl.c was probably the location of the C file when someone compiled eiffel_curl.o at ISE.

ebezault commented 6 months ago

With the new version of gec that I just pushed in the Gobo repository, I was able to compile and run the cURL/sftp example:

ericb@yate:~/ise/Eiffel_23.09/examples/cURL/sftp$ gec sftp.ecf
Degree 6: 0/0/0 0:0:0.076
Degree 5: 0/0/0 0:0:0.453
Degree 4: 0/0/0 0:0:0.084
Degree 3: 0/0/0 0:0:0.137
Degree -2: 0/0/0 0:0:0.247
Degree -3: 0/0/0 0:0:0.197
Degree -4: 0/0/0 0:0:6.225
Total Time: 0/0/0 0:0:7.425
ericb@yate:~/ise/Eiffel_23.09/examples/cURL/sftp$ ./sftp
Eiffel cURL simple sftp.
*   Trying 194.108.117.16:22...
* TCP_NODELAY set
* Connected to test.rebex.net (194.108.117.16) port 22 (#0)
* User: demo
* Authentication using SSH public key file
* completed keyboard interactive authentication
* Authentication complete
* Connection #0 to host test.rebex.net left intact

Let me know if it works for you as well, so that we can close this issue.

Also:

What C compiler are you using? If it's gcc, edit the file gcc.cfg and add -I $GOBO/tool/gec/backend/c/runtime to the cc: line.

This is not needed anymore, gec will now add this include path automatically if needed.

mw66 commented 6 months ago

Confirmed working. Closing.